diff --git a/lib/src/core/resources/themes.dart b/lib/src/core/resources/themes.dart index 289f4dc8..4fcbf4ae 100644 --- a/lib/src/core/resources/themes.dart +++ b/lib/src/core/resources/themes.dart @@ -130,7 +130,10 @@ class Themes { ), listTileTheme: const ListTileThemeData( textColor: Colors.white, - ), + ), + checkboxTheme: CheckboxThemeData( + checkColor: WidgetStateProperty.all(Colors.deepPurple[600]), + ), ); final ThemeData lightTheme = ThemeData.light().copyWith( @@ -262,6 +265,9 @@ class Themes { ), listTileTheme: const ListTileThemeData( textColor: Colors.black, - ), + ), + checkboxTheme: CheckboxThemeData( + checkColor: WidgetStateProperty.all(Colors.deepPurple[600]), + ), ); } diff --git a/lib/src/core/utils/determine_position.dart b/lib/src/core/utils/determine_position.dart index 98e9799c..9d23de61 100644 --- a/lib/src/core/utils/determine_position.dart +++ b/lib/src/core/utils/determine_position.dart @@ -33,6 +33,8 @@ Future> determinePosition() async { if (permission == LocationPermission.deniedForever) { // Permissions are denied forever, handle appropriately. + + // TODO: await Geolocator.openLocationSettings(); return DataFailed( 'Location permissions are permanently denied, we cannot request permissions.', ); diff --git a/lib/src/presentation/controllers/realtime_irl_view_controller.dart b/lib/src/presentation/controllers/realtime_irl_view_controller.dart index 3052ba0d..9135d85a 100644 --- a/lib/src/presentation/controllers/realtime_irl_view_controller.dart +++ b/lib/src/presentation/controllers/realtime_irl_view_controller.dart @@ -1,5 +1,7 @@ import 'dart:async'; +import 'dart:io'; +import 'package:flutter/material.dart'; import 'package:geolocator/geolocator.dart'; import 'package:get/get.dart'; import 'package:irllink/src/core/resources/data_state.dart'; @@ -29,9 +31,42 @@ class RealtimeIrlViewController extends GetxController { } Future start() async { - realtimeIrl.status.value = RtIrlStatus.updating; + if (Platform.isAndroid) { + if (await Geolocator.checkPermission() == LocationPermission.denied) { + await Get.dialog( + barrierDismissible: false, + AlertDialog( + title: const Text('RealtimeIRL'), + content: const Text( + 'This application will ask the permission to access your location to share it with RealtimeIRL service.', + ), + actions: [ + TextButton( + onPressed: () { + Get.back(result: true); + }, + child: const Text('OK'), + ), + ], + ), + ); + } + } DataState p = await determinePosition(); + if (p.error != null) { + Get.snackbar( + "Error", + p.error!, + snackPosition: SnackPosition.BOTTOM, + icon: const Icon(Icons.error_outline, color: Colors.red), + borderWidth: 1, + borderColor: Colors.red, + ); + return; + } + realtimeIrl.status.value = RtIrlStatus.updating; + timerRtIrl = Timer.periodic(const Duration(seconds: 4), (Timer t) async { if (p is DataSuccess && realtimeIrl.status.value == RtIrlStatus.updating) { diff --git a/lib/src/presentation/widgets/stream_elements/se_activities_list.dart b/lib/src/presentation/widgets/stream_elements/se_activities_list.dart index ae8d8106..0e52367c 100644 --- a/lib/src/presentation/widgets/stream_elements/se_activities_list.dart +++ b/lib/src/presentation/widgets/stream_elements/se_activities_list.dart @@ -78,7 +78,6 @@ class SeActivitiesList extends GetView { PopupMenuItem( child: Obx( () => CheckboxListTile( - activeColor: Colors.deepPurple[600], controlAffinity: ListTileControlAffinity.leading, title: const Text( "Followers", @@ -102,7 +101,6 @@ class SeActivitiesList extends GetView { PopupMenuItem( child: Obx( () => CheckboxListTile( - activeColor: Colors.deepPurple[600], controlAffinity: ListTileControlAffinity.leading, title: const Text( "Subscriptions", @@ -126,7 +124,6 @@ class SeActivitiesList extends GetView { PopupMenuItem( child: Obx( () => CheckboxListTile( - activeColor: Colors.deepPurple[600], controlAffinity: ListTileControlAffinity.leading, title: const Text( "Bits", @@ -150,7 +147,6 @@ class SeActivitiesList extends GetView { PopupMenuItem( child: Obx( () => CheckboxListTile( - activeColor: Colors.deepPurple[600], controlAffinity: ListTileControlAffinity.leading, title: const Text( "Donations", @@ -174,7 +170,6 @@ class SeActivitiesList extends GetView { PopupMenuItem( child: Obx( () => CheckboxListTile( - activeColor: Colors.deepPurple[600], controlAffinity: ListTileControlAffinity.leading, title: const Text( "Raids", @@ -198,7 +193,6 @@ class SeActivitiesList extends GetView { PopupMenuItem( child: Obx( () => CheckboxListTile( - activeColor: Colors.deepPurple[600], controlAffinity: ListTileControlAffinity.leading, title: const Text( "Hosts", diff --git a/lib/src/presentation/widgets/tabs/realtime_irl_tab_view.dart b/lib/src/presentation/widgets/tabs/realtime_irl_tab_view.dart index 5d2d8fdd..b537b7b4 100644 --- a/lib/src/presentation/widgets/tabs/realtime_irl_tab_view.dart +++ b/lib/src/presentation/widgets/tabs/realtime_irl_tab_view.dart @@ -40,6 +40,11 @@ class RealtimeIrlTabView extends GetView { }, child: const Text('Start'), ), + const SizedBox(height: 10), + const Text( + 'By clicking the button above, you will start sharing your current GPS location with RealtimeIRL.', + textAlign: TextAlign.center, + ), ], ); } @@ -64,6 +69,11 @@ class RealtimeIrlTabView extends GetView { }, child: const Text('Stop'), ), + const SizedBox(height: 10), + const Text( + 'Your GPS location is currently shared with RealtimeIRL...', + textAlign: TextAlign.center, + ), ], ); } diff --git a/pubspec.yaml b/pubspec.yaml index 16bc4c5e..d27631ac 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 2.4.5+63 +version: 2.4.5+64 environment: sdk: '>=2.19.0-0 <4.0.0'