47 lines
1.3 KiB
Dart
47 lines
1.3 KiB
Dart
import 'package:device_info_plus/device_info_plus.dart';
|
|
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/scheduler.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:mmkv/mmkv.dart';
|
|
|
|
import 'page/home_page.dart';
|
|
import 'page/login_page.dart';
|
|
import 'page/register_page.dart';
|
|
import 'page/splash_page.dart';
|
|
|
|
|
|
void main() async{
|
|
// must wait for MMKV to finish initialization
|
|
final rootDir = await MMKV.initialize();
|
|
print('MMKV for flutter with rootDir = $rootDir');
|
|
|
|
final deviceInfoPlugin = DeviceInfoPlugin();
|
|
final deviceInfo = await deviceInfoPlugin.deviceInfo;
|
|
final allInfo = deviceInfo.data;
|
|
print('Device info: $allInfo');
|
|
|
|
runApp(const MyApp());
|
|
}
|
|
|
|
class MyApp extends StatelessWidget {
|
|
const MyApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return GetCupertinoApp(
|
|
title: 'Family Care',
|
|
theme: CupertinoThemeData(
|
|
primaryColor: CupertinoColors.systemBlue,
|
|
scaffoldBackgroundColor: CupertinoColors.systemGroupedBackground,
|
|
),
|
|
home: const SplashScreen(),
|
|
getPages: [
|
|
GetPage(name: '/splash', page: () => const SplashScreen()),
|
|
GetPage(name: '/login', page: () => const LoginPage()),
|
|
GetPage(name: '/home', page: () => const MyHomePage()),
|
|
GetPage(name: '/register', page: () => const RegisterPage()),
|
|
],
|
|
);
|
|
}
|
|
}
|