From 0388cf0b92fc2a2bb85ef3bb62483296e39d7d80 Mon Sep 17 00:00:00 2001 From: LezdCS Date: Wed, 24 Jul 2024 09:50:39 +0900 Subject: [PATCH 1/6] improve themes --- lib/src/core/resources/themes.dart | 10 ++++++++-- .../widgets/stream_elements/se_activities_list.dart | 6 ------ 2 files changed, 8 insertions(+), 8 deletions(-) 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/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", From 97ac463de0d51f3c7232ee98516c8f907e1564fe Mon Sep 17 00:00:00 2001 From: LezdCS Date: Wed, 24 Jul 2024 18:53:41 +0900 Subject: [PATCH 2/6] realtime IRL snackbar on errors --- lib/src/core/utils/determine_position.dart | 2 ++ .../controllers/realtime_irl_view_controller.dart | 14 ++++++++++++++ 2 files changed, 16 insertions(+) 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..2203e30f 100644 --- a/lib/src/presentation/controllers/realtime_irl_view_controller.dart +++ b/lib/src/presentation/controllers/realtime_irl_view_controller.dart @@ -1,5 +1,6 @@ import 'dart:async'; +import 'package:flutter/material.dart'; import 'package:geolocator/geolocator.dart'; import 'package:get/get.dart'; import 'package:irllink/src/core/resources/data_state.dart'; @@ -32,6 +33,19 @@ class RealtimeIrlViewController extends GetxController { realtimeIrl.status.value = RtIrlStatus.updating; DataState p = await determinePosition(); + if (p.error != null) { + realtimeIrl.status.value = RtIrlStatus.stopped; + Get.snackbar( + "Error", + p.error!, + snackPosition: SnackPosition.BOTTOM, + icon: const Icon(Icons.error_outline, color: Colors.red), + borderWidth: 1, + borderColor: Colors.red, + ); + return; + } + timerRtIrl = Timer.periodic(const Duration(seconds: 4), (Timer t) async { if (p is DataSuccess && realtimeIrl.status.value == RtIrlStatus.updating) { From bf61095fcbbc9916de9ccc82f82de91312ec2e42 Mon Sep 17 00:00:00 2001 From: LezdCS Date: Sat, 27 Jul 2024 20:48:39 +0900 Subject: [PATCH 3/6] add text indication RealtimeIRL --- .../widgets/tabs/realtime_irl_tab_view.dart | 10 ++++++++++ 1 file changed, 10 insertions(+) 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, + ), ], ); } From 24311741146f21612bcbe717ebefbfdb06c5ba16 Mon Sep 17 00:00:00 2001 From: LezdCS Date: Sat, 27 Jul 2024 21:06:18 +0900 Subject: [PATCH 4/6] Conform to Google policies --- .../realtime_irl_view_controller.dart | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/lib/src/presentation/controllers/realtime_irl_view_controller.dart b/lib/src/presentation/controllers/realtime_irl_view_controller.dart index 2203e30f..fbe761fd 100644 --- a/lib/src/presentation/controllers/realtime_irl_view_controller.dart +++ b/lib/src/presentation/controllers/realtime_irl_view_controller.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:io'; import 'package:flutter/material.dart'; import 'package:geolocator/geolocator.dart'; @@ -30,11 +31,27 @@ class RealtimeIrlViewController extends GetxController { } Future start() async { - realtimeIrl.status.value = RtIrlStatus.updating; + if (Platform.isAndroid) { + dynamic result = await Get.dialog( + 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) { - realtimeIrl.status.value = RtIrlStatus.stopped; Get.snackbar( "Error", p.error!, @@ -45,6 +62,7 @@ class RealtimeIrlViewController extends GetxController { ); return; } + realtimeIrl.status.value = RtIrlStatus.updating; timerRtIrl = Timer.periodic(const Duration(seconds: 4), (Timer t) async { if (p is DataSuccess && From e68f584d67f709e201e0c0775f99edc85dbeae7e Mon Sep 17 00:00:00 2001 From: LezdCS Date: Sat, 27 Jul 2024 21:10:24 +0900 Subject: [PATCH 5/6] fix --- .../realtime_irl_view_controller.dart | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/lib/src/presentation/controllers/realtime_irl_view_controller.dart b/lib/src/presentation/controllers/realtime_irl_view_controller.dart index fbe761fd..9135d85a 100644 --- a/lib/src/presentation/controllers/realtime_irl_view_controller.dart +++ b/lib/src/presentation/controllers/realtime_irl_view_controller.dart @@ -32,22 +32,25 @@ class RealtimeIrlViewController extends GetxController { Future start() async { if (Platform.isAndroid) { - dynamic result = await Get.dialog( - 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'), + 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(); From 91988e85d473eb1da07986aad3bbcb0f5450cfac Mon Sep 17 00:00:00 2001 From: LezdCS Date: Sat, 27 Jul 2024 21:10:43 +0900 Subject: [PATCH 6/6] build number --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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'