Skip to content

Commit

Permalink
added go to settings prompt for location
Browse files Browse the repository at this point in the history
  • Loading branch information
ninest committed Apr 10, 2020
1 parent 7b3465b commit 09fe718
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
4 changes: 1 addition & 3 deletions lib/providers/search.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ class SearchProvider extends ChangeNotifier {
bool getNoStopsFoundValue() => _noStopsFound;

getNearestBusStopSearchResults() async {
// bool canGetPermission = await LocationPermissionsProvider().getBoolPermissionStatus;
// TODO: fix
bool canGetPermission = false;
bool canGetPermission = await LocationPermsProvider.getPermStatus();
if (canGetPermission) {
_searchResults = await BusService.getNearestStops();
notifyListeners();
Expand Down
7 changes: 0 additions & 7 deletions lib/routes/search.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,6 @@ class SearchPage extends StatelessWidget {
Spacing(height: Values.marginBelowTitle).sliver(),

SearchResultsList().sliverToBoxAdapter()
// SliverList(
// delegate: SliverChildListDelegate(
// [
// SearchResultsList(),
// ],
// ),
// )
],
).scaffold();
}
Expand Down
3 changes: 3 additions & 0 deletions lib/services/location.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
import 'package:nextbussg/providers/location_perms.dart';

Expand All @@ -10,6 +12,7 @@ class LocationServices {
} catch (e) {
// request location
await LocationPermsProvider.requestPerm();
BotToast.showText(text: "Please go to settings to enable location access.", contentColor: Colors.red);
return LocationServices.getLocation();
}
}
Expand Down

0 comments on commit 09fe718

Please sign in to comment.