2023-06-21 17:44:28 +08:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
import 'package:together_mobile/common/theme.dart';
|
2023-08-11 23:02:31 +08:00
|
|
|
import 'package:together_mobile/database/hive_database.dart';
|
2023-06-21 17:44:28 +08:00
|
|
|
import 'package:together_mobile/router/router.dart';
|
2023-07-17 01:00:16 +08:00
|
|
|
import 'package:together_mobile/models/init_get_it.dart';
|
2023-09-09 16:48:47 +08:00
|
|
|
import 'notification_api.dart';
|
2023-06-21 17:44:28 +08:00
|
|
|
|
2023-09-09 16:48:47 +08:00
|
|
|
|
|
|
|
void main() async {
|
2023-07-11 23:39:36 +08:00
|
|
|
initGetIt();
|
2023-09-09 16:48:47 +08:00
|
|
|
await initNotification();
|
2023-08-10 19:08:46 +08:00
|
|
|
registerAdapter();
|
2023-06-21 17:44:28 +08:00
|
|
|
runApp(const Together());
|
|
|
|
}
|
|
|
|
|
|
|
|
class Together extends StatelessWidget {
|
|
|
|
const Together({super.key});
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return MaterialApp.router(
|
|
|
|
debugShowCheckedModeBanner: false,
|
|
|
|
title: "Together",
|
|
|
|
theme: lightThemeData(context),
|
|
|
|
darkTheme: darkThemeData(context),
|
|
|
|
routerConfig: router,
|
|
|
|
// This builder is used to dismiss keyboard while tap anywhere of the
|
|
|
|
// screen excluding the input widgets.
|
|
|
|
builder: (context, child) {
|
|
|
|
return GestureDetector(
|
|
|
|
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
|
|
|
child: child,
|
|
|
|
);
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|