Files
rog_app/lib/main.dart

112 lines
3.2 KiB
Dart
Raw Permalink Normal View History

2023-03-17 11:54:12 +05:30
import 'dart:io';
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';
2023-03-17 11:54:12 +05:30
import 'package:flutter_map_tile_caching/flutter_map_tile_caching.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';
2023-06-09 15:55:59 +05:30
import 'package:rogapp/common/state/game/game_binding.dart';
2022-05-12 02:17:08 +05:30
import 'package:rogapp/pages/index/index_binding.dart';
2022-03-14 12:28:57 +05:30
import 'package:rogapp/routes/app_pages.dart';
2023-06-02 10:50:56 +05:30
import 'package:rogapp/theme/theme.dart';
2022-03-14 12:28:57 +05:30
import 'package:rogapp/utils/string_values.dart';
2023-03-17 11:54:12 +05:30
import 'package:shared_preferences/shared_preferences.dart';
import 'package:path/path.dart' as p;
void main() async {
WidgetsFlutterBinding.ensureInitialized();
FlutterMapTileCaching.initialise(await RootDirectory.normalCache);
final StoreDirectory instanceA = FMTC.instance('OpenStreetMap (A)');
await instanceA.manage.createAsync();
await instanceA.metadata.addAsync(
key: 'sourceURL',
value: 'https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png',
);
await instanceA.metadata.addAsync(
key: 'validDuration',
value: '14',
);
await instanceA.metadata.addAsync(
key: 'behaviour',
value: 'cacheFirst',
);
2022-03-14 12:28:57 +05:30
2022-07-20 15:57:40 +05:30
runApp(MyApp());
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'),
2022-10-30 21:43:29 +05:30
//locale: const Locale('en', 'US'),
2022-03-14 12:28:57 +05:30
fallbackLocale: const Locale('en', 'US'),
title: 'ROGAINING',
2023-06-02 10:50:56 +05:30
theme: AppTheme.theme,
2022-03-14 12:28:57 +05:30
debugShowCheckedModeBanner: false,
defaultTransition: Transition.cupertino,
opaqueRoute: Get.isOpaqueRouteDefault,
popGesture: Get.isPopGestureEnable,
2022-04-17 11:45:21 +05:30
transitionDuration: const Duration(milliseconds: 230),
2023-06-09 15:55:59 +05:30
initialBinding: GameBinding(),
2023-06-02 10:50:56 +05:30
initialRoute: AppPages.S_LOGIN,
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",
// ),
// ),
// ),
// );
// }
// }