re factor rog
This commit is contained in:
146
lib/main_mapsix.dart
Normal file
146
lib/main_mapsix.dart
Normal file
@ -0,0 +1,146 @@
|
||||
// import 'package:flutter/material.dart';
|
||||
// import 'package:flutter_map_tile_caching/flutter_map_tile_caching.dart';
|
||||
// import 'package:get/get.dart';
|
||||
// import 'package:rogapp/pages/destination/destination_controller.dart';
|
||||
// import 'package:rogapp/pages/index/index_binding.dart';
|
||||
// import 'package:rogapp/routes/app_pages.dart';
|
||||
// import 'package:rogapp/utils/location_controller.dart';
|
||||
// import 'package:rogapp/utils/string_values.dart';
|
||||
// import 'package:shared_preferences/shared_preferences.dart';
|
||||
// // import 'package:is_lock_screen/is_lock_screen.dart';
|
||||
|
||||
// void saveGameState() async {
|
||||
// DestinationController destinationController =
|
||||
// Get.find<DestinationController>();
|
||||
// SharedPreferences pref = await SharedPreferences.getInstance();
|
||||
// pref.setBool("is_in_rog", destinationController.isInRog.value);
|
||||
// pref.setBool(
|
||||
// "rogaining_counted", destinationController.rogainingCounted.value);
|
||||
// pref.setBool("ready_for_goal", DestinationController.ready_for_goal);
|
||||
// }
|
||||
|
||||
// void restoreGame() async {
|
||||
// SharedPreferences pref = await SharedPreferences.getInstance();
|
||||
// DestinationController destinationController =
|
||||
// Get.find<DestinationController>();
|
||||
// destinationController.skipGps = false;
|
||||
// destinationController.isInRog.value = pref.getBool("is_in_rog") ?? false;
|
||||
// destinationController.rogainingCounted.value =
|
||||
// pref.getBool("rogaining_counted") ?? false;
|
||||
// DestinationController.ready_for_goal =
|
||||
// pref.getBool("ready_for_goal") ?? false;
|
||||
// //print(
|
||||
// // "--restored -- destinationController.isInRog.value ${pref.getBool("is_in_rog")} -- ${pref.getBool("rogaining_counted")}");
|
||||
// }
|
||||
|
||||
// void main() async {
|
||||
// WidgetsFlutterBinding.ensureInitialized();
|
||||
// await FlutterMapTileCaching.initialise();
|
||||
// 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',
|
||||
// );
|
||||
// runApp(const MyApp());
|
||||
// }
|
||||
|
||||
// class MyApp extends StatefulWidget {
|
||||
// const MyApp({Key? key}) : super(key: key);
|
||||
|
||||
// @override
|
||||
// State<MyApp> createState() => _MyAppState();
|
||||
// }
|
||||
|
||||
// class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
||||
// // This widget is the root of your application.
|
||||
|
||||
// @override
|
||||
// void initState() {
|
||||
// super.initState();
|
||||
// if (context.mounted) {
|
||||
// restoreGame();
|
||||
// }
|
||||
// WidgetsBinding.instance.addObserver(this);
|
||||
// }
|
||||
|
||||
// @override
|
||||
// void dispose() {
|
||||
// WidgetsBinding.instance.removeObserver(this);
|
||||
// super.dispose();
|
||||
// }
|
||||
|
||||
// // void saveGameState() async {
|
||||
// // DestinationController destinationController = Get.find<DestinationController>();
|
||||
// // SharedPreferences pref = await SharedPreferences.getInstance();
|
||||
// // pref.setBool("is_in_rog", destinationController.is_in_rog.value);
|
||||
// // pref.setBool("rogaining_counted", destinationController.rogaining_counted.value);
|
||||
// // }
|
||||
|
||||
// @override
|
||||
// void didChangeAppLifecycleState(AppLifecycleState state) {
|
||||
// LocationController locationController = Get.find<LocationController>();
|
||||
|
||||
// DestinationController destinationController =
|
||||
// Get.find<DestinationController>();
|
||||
// switch (state) {
|
||||
// case AppLifecycleState.resumed:
|
||||
// locationController.resumePositionStream();
|
||||
// //print("RESUMED");
|
||||
// restoreGame();
|
||||
// break;
|
||||
// case AppLifecycleState.inactive:
|
||||
// locationController.resumePositionStream();
|
||||
// //print("INACTIVE");
|
||||
// break;
|
||||
// case AppLifecycleState.paused:
|
||||
// locationController.resumePositionStream();
|
||||
// //print("PAUSED");
|
||||
// saveGameState();
|
||||
// break;
|
||||
// case AppLifecycleState.detached:
|
||||
// locationController.resumePositionStream();
|
||||
// //print("DETACHED");
|
||||
// saveGameState();
|
||||
// break;
|
||||
// case AppLifecycleState.hidden:
|
||||
// locationController.resumePositionStream();
|
||||
// //print("DETACHED");
|
||||
// saveGameState();
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// return GetMaterialApp(
|
||||
// translations: StringValues(),
|
||||
// locale: const Locale('ja', 'JP'),
|
||||
// //locale: const Locale('en', 'US'),
|
||||
// fallbackLocale: const Locale('en', 'US'),
|
||||
// title: 'ROGAINING',
|
||||
// theme: ThemeData(
|
||||
// colorScheme: ColorScheme.fromSeed(
|
||||
// seedColor: const Color.fromARGB(255, 36, 135, 221)),
|
||||
// useMaterial3: true,
|
||||
// ),
|
||||
// debugShowCheckedModeBanner: false,
|
||||
// defaultTransition: Transition.cupertino,
|
||||
// opaqueRoute: Get.isOpaqueRouteDefault,
|
||||
// popGesture: Get.isPopGestureEnable,
|
||||
// transitionDuration: const Duration(milliseconds: 230),
|
||||
// initialBinding: IndexBinding(), //HomeBinding(),
|
||||
// initialRoute: AppPages.PERMISSION,
|
||||
// getPages: AppPages.routes,
|
||||
// enableLog: true,
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
Reference in New Issue
Block a user