60 lines
1.7 KiB
Dart
60 lines
1.7 KiB
Dart
import 'package:chat/configs/themes.dart';
|
|
import 'package:chat/controllers/group_controller.dart';
|
|
import 'package:chat/controllers/moment_controller.dart';
|
|
import 'package:chat/controllers/private_controller.dart';
|
|
import 'package:chat/routes/app_router.dart';
|
|
import 'package:chat/routes/app_routes.dart';
|
|
import 'package:chat/services/auth_service.dart';
|
|
import 'package:chat/services/tabbar_service.dart';
|
|
import 'package:chat/services/tim_service.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:get_storage/get_storage.dart';
|
|
|
|
Future<void> main() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
|
|
await GetStorage.init();
|
|
|
|
runApp(const MyApp());
|
|
}
|
|
|
|
class MyApp extends StatelessWidget {
|
|
const MyApp({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return GetMaterialApp(
|
|
title: 'ZH-CHAT',
|
|
debugShowCheckedModeBanner: false,
|
|
theme: Themes.light,
|
|
darkTheme: Themes.dark,
|
|
initialRoute: AppRoutes.transit,
|
|
defaultTransition: Transition.cupertino,
|
|
getPages: AppRouter.getPages,
|
|
builder: EasyLoading.init(),
|
|
initialBinding: BindingsBuilder(
|
|
() {
|
|
Get.put(AuthService());
|
|
Get.put(TabbarService());
|
|
Get.put(TimService());
|
|
|
|
Get.lazyPut(
|
|
() => GroupController(),
|
|
fenix: true,
|
|
);
|
|
Get.lazyPut(
|
|
() => PrivateController(),
|
|
fenix: true,
|
|
);
|
|
Get.lazyPut(
|
|
() => MomentController(),
|
|
fenix: true,
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
}
|