12345678910111213141516171819202122232425262728293031323334353637383940 |
- import 'package:flutter/material.dart';
- import 'package:flutter_screenutil/flutter_screenutil.dart';
- import 'package:flutter_tracker/pages/welcome_page.dart';
- import 'package:flutter_tracker/routes/routes.dart';
- import 'package:flutter_tracker/utils/sp_util.dart';
- import 'index_page.dart';
- /// Description:
- /// Time : 2021年12月03日 Friday
- /// Author : liuyuqi.gov@msncn
- void main() async {
- WidgetsFlutterBinding.ensureInitialized();
- bool isLogin = await SpUtil.get("isLogin", false);
- runApp(MyApp(
- isLogin: isLogin,
- ));
- }
- class MyApp extends StatelessWidget {
- bool isLogin = false;
- MyApp({Key? key, required this.isLogin}) : super(key: key);
- // This widget is the root of your application.
- @override
- Widget build(BuildContext context) {
- return ScreenUtilInit(
- designSize: const Size(750, 1344),
- builder: () => MaterialApp(
- title: '追踪者',
- theme: ThemeData(
- primarySwatch: Colors.blue,
- ),
- debugShowCheckedModeBanner: false,
- home: isLogin ? IndexPage() : WelComePage(),
- onGenerateRoute: Routes.generateRoute,
- ),
- );
- }
- }
|