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