Skip to content

Commit 1a0b8f1

Browse files
committed
chore: don't ask location permission in demo app for web platform
1 parent 8e04fc1 commit 1a0b8f1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

example/lib/main.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import 'dart:async';
22
import 'dart:convert';
33

44
import 'package:env_flutter/env_flutter.dart';
5+
import 'package:flutter/foundation.dart';
56
import 'package:flutter/material.dart';
67
import 'package:fpjs_pro_plugin/error.dart';
78
import 'package:fpjs_pro_plugin/fpjs_pro_plugin.dart';
@@ -82,6 +83,9 @@ class _MyAppState extends State<MyApp> {
8283
}
8384

8485
Future<void> requestLocationPermission() async {
86+
if (kIsWeb) {
87+
return;
88+
}
8589
LocationPermission permission = await Geolocator.checkPermission();
8690
if (permission == LocationPermission.denied) {
8791
permission = await Geolocator.requestPermission();

0 commit comments

Comments
 (0)