fix set mapbox token
This commit is contained in:
@@ -105,6 +105,11 @@ class _MapboxPagesState extends State<MapboxPages> with ShowAlertDialog {
|
||||
}
|
||||
|
||||
Future<void> _getUserLocation() async {
|
||||
await dotenv.load(fileName: ".env");
|
||||
|
||||
// Set the access token globally
|
||||
mapbox.MapboxOptions.setAccessToken(
|
||||
dotenv.env['MAPBOX_ACCESS_TOKEN'] ?? '');
|
||||
try {
|
||||
bool serviceEnabled = await geo.Geolocator.isLocationServiceEnabled();
|
||||
if (!serviceEnabled) return;
|
||||
|
Reference in New Issue
Block a user