Files
rog_app/lib/main.dart

99 lines
2.8 KiB
Dart
Raw Normal View History

2022-03-14 12:28:57 +05:30
import 'package:flutter/material.dart';
2022-07-20 15:57:40 +05:30
import 'package:flutter/services.dart';
2022-03-14 12:28:57 +05:30
import 'package:get/get.dart';
import 'package:google_fonts/google_fonts.dart';
2022-07-20 15:57:40 +05:30
import 'package:permission_handler/permission_handler.dart';
2022-12-13 18:19:16 +05:30
import 'package:rogapp/pages/rog/rog_binding.dart';
2022-03-14 12:28:57 +05:30
import 'package:rogapp/routes/app_pages.dart';
2022-07-30 20:42:44 +05:30
import 'package:rogapp/services/location_service.dart';
2022-12-13 18:19:16 +05:30
import 'package:rogapp/utils/app_binding.dart';
2022-03-14 12:28:57 +05:30
import 'package:rogapp/utils/string_values.dart';
void main() {
2022-03-15 18:19:34 +05:30
//WidgetsFlutterBinding.ensureInitialized();
2022-07-30 20:42:44 +05:30
initServices();
2022-07-20 15:57:40 +05:30
runApp(MyApp());
2022-03-14 12:28:57 +05:30
}
2022-07-30 20:42:44 +05:30
void initServices() async {
print('starting services ...');
await Get.putAsync(() => LocationService().init());
print('All services started...');
}
2022-03-14 12:28:57 +05:30
class MyApp extends StatelessWidget {
2022-07-20 15:57:40 +05:30
const MyApp({Key? key}) : super(key: key);
2022-03-14 12:28:57 +05:30
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return GetMaterialApp(
translations: StringValues(),
locale: const Locale('ja', 'JP'),
fallbackLocale: const Locale('en', 'US'),
title: 'ROGAINING',
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
textTheme: GoogleFonts.muliTextTheme(),
),
debugShowCheckedModeBanner: false,
defaultTransition: Transition.cupertino,
opaqueRoute: Get.isOpaqueRouteDefault,
popGesture: Get.isPopGestureEnable,
2022-04-17 11:45:21 +05:30
transitionDuration: const Duration(milliseconds: 230),
2022-12-13 18:19:16 +05:30
initialBinding: RogBinding(), //HomeBinding(),
initialRoute: AppPages.ROG,
2022-03-14 12:28:57 +05:30
getPages: AppPages.routes,
2022-07-09 22:51:34 +05:30
enableLog: true,
2022-03-14 12:28:57 +05:30
);
}
}
2022-07-20 15:57:40 +05:30
// class MyApp extends StatelessWidget {
// MyApp({Key? key}) : super(key: key);
// // This widget is the root of your application.
// @override
// Widget build(BuildContext context) {
// return MaterialApp(
// title: 'Flutter Demo',
// theme: ThemeData(
// primaryColor: Color(0xfff00B074),
// textTheme: const TextTheme(
// bodyText1: TextStyle(
// fontSize: 18.0,
// fontFamily: 'Barlow-Medium',
// color: Color(0xff464255)),
// ),
// ),
// home: PermissionHandlerScreen(),
// );
// }
// }
// class SplashScreen extends StatelessWidget {
// const SplashScreen({Key? key}) : super(key: key);
// @override
// Widget build(BuildContext context) {
// return WillPopScope(
// onWillPop: () async {
// SystemNavigator.pop();
// return true;
// },
// child: Scaffold(
// body: Center(
// child: Text(
// "Splash Screen",
// ),
// ),
// ),
// );
// }
// }