Skip to content

Commit

Permalink
Merge pull request #220 from LezdCS/develop
Browse files Browse the repository at this point in the history
Getting conform to Google policies
  • Loading branch information
LezdCS authored Jul 27, 2024
2 parents 6520e0e + 91988e8 commit 79f7a72
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 10 deletions.
10 changes: 8 additions & 2 deletions lib/src/core/resources/themes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -262,6 +265,9 @@ class Themes {
),
listTileTheme: const ListTileThemeData(
textColor: Colors.black,
),
),
checkboxTheme: CheckboxThemeData(
checkColor: WidgetStateProperty.all(Colors.deepPurple[600]),
),
);
}
2 changes: 2 additions & 0 deletions lib/src/core/utils/determine_position.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ Future<DataState<Position>> 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.',
);
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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<Position> 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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ class SeActivitiesList extends GetView {
PopupMenuItem(
child: Obx(
() => CheckboxListTile(
activeColor: Colors.deepPurple[600],
controlAffinity: ListTileControlAffinity.leading,
title: const Text(
"Followers",
Expand All @@ -102,7 +101,6 @@ class SeActivitiesList extends GetView {
PopupMenuItem(
child: Obx(
() => CheckboxListTile(
activeColor: Colors.deepPurple[600],
controlAffinity: ListTileControlAffinity.leading,
title: const Text(
"Subscriptions",
Expand All @@ -126,7 +124,6 @@ class SeActivitiesList extends GetView {
PopupMenuItem(
child: Obx(
() => CheckboxListTile(
activeColor: Colors.deepPurple[600],
controlAffinity: ListTileControlAffinity.leading,
title: const Text(
"Bits",
Expand All @@ -150,7 +147,6 @@ class SeActivitiesList extends GetView {
PopupMenuItem(
child: Obx(
() => CheckboxListTile(
activeColor: Colors.deepPurple[600],
controlAffinity: ListTileControlAffinity.leading,
title: const Text(
"Donations",
Expand All @@ -174,7 +170,6 @@ class SeActivitiesList extends GetView {
PopupMenuItem(
child: Obx(
() => CheckboxListTile(
activeColor: Colors.deepPurple[600],
controlAffinity: ListTileControlAffinity.leading,
title: const Text(
"Raids",
Expand All @@ -198,7 +193,6 @@ class SeActivitiesList extends GetView {
PopupMenuItem(
child: Obx(
() => CheckboxListTile(
activeColor: Colors.deepPurple[600],
controlAffinity: ListTileControlAffinity.leading,
title: const Text(
"Hosts",
Expand Down
10 changes: 10 additions & 0 deletions lib/src/presentation/widgets/tabs/realtime_irl_tab_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ class RealtimeIrlTabView extends GetView<RealtimeIrlViewController> {
},
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,
),
],
);
}
Expand All @@ -64,6 +69,11 @@ class RealtimeIrlTabView extends GetView<RealtimeIrlViewController> {
},
child: const Text('Stop'),
),
const SizedBox(height: 10),
const Text(
'Your GPS location is currently shared with RealtimeIRL...',
textAlign: TextAlign.center,
),
],
);
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 79f7a72

Please sign in to comment.