You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
1.5 KiB
60 lines
1.5 KiB
import 'package:dating_touchme_app/pages/home_page.dart';
|
|
import 'package:dating_touchme_app/pages/index_page.dart';
|
|
import 'package:dating_touchme_app/provide/user_info.dart';
|
|
import 'package:dating_touchme_app/utils/global_modal.dart';
|
|
import 'package:fluro/fluro.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'router/router.dart';
|
|
import 'router/application.dart';
|
|
import 'package:provider/provider.dart';
|
|
|
|
void main() {
|
|
|
|
runApp(const MyApp());
|
|
}
|
|
|
|
class MyApp extends StatefulWidget {
|
|
const MyApp({super.key});
|
|
|
|
@override
|
|
State<MyApp> createState() => _MyAppState();
|
|
}
|
|
|
|
class _MyAppState extends State<MyApp> {
|
|
|
|
@override
|
|
void initState(){
|
|
super.initState();
|
|
final router = FluroRouter();
|
|
Routes.configureRoutes(router);
|
|
Application.router = router;
|
|
registerGlobalModals();
|
|
}
|
|
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
//全局挂载provide
|
|
return MultiProvider(
|
|
providers: [
|
|
ChangeNotifierProvider(create: (_) => UserInfo()),
|
|
],
|
|
//全局设定ui尺寸
|
|
child: ScreenUtilInit(
|
|
designSize: const Size(375, 667),
|
|
builder: (context, child){
|
|
return MaterialApp(
|
|
theme: ThemeData(
|
|
scaffoldBackgroundColor: Colors.white,
|
|
),
|
|
builder: (context, child) => GlobalModalHost(child: child ?? const SizedBox()),
|
|
home: const HomePage(),
|
|
onGenerateRoute: Application.router.generator,
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|