step 7 : presensi selfie get address and coordinate fix
This commit is contained in:
45
lib/repository/googleapis_repository.dart
Normal file
45
lib/repository/googleapis_repository.dart
Normal file
@@ -0,0 +1,45 @@
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
import 'base_repository.dart';
|
||||
|
||||
class GoogleApisRepository extends BaseRepository {
|
||||
GoogleApisRepository({required super.graphql, required super.dio});
|
||||
|
||||
Future<String?> getAddressFromCoordinates(
|
||||
double latitude, double longitude) async {
|
||||
final dio = Dio();
|
||||
const apiKey = "AIzaSyAVUr4Ku4O1HlSkK8n9KGnUyqvsXBL-yfs";
|
||||
final latitudeString = latitude.toString();
|
||||
final longitudeString = longitude.toString();
|
||||
const url =
|
||||
'https://maps.googleapis.com/maps/api/geocode/json';
|
||||
|
||||
try {
|
||||
final response = await dio.get(
|
||||
url,
|
||||
queryParameters: {
|
||||
'latlng': '$latitudeString,$longitudeString',
|
||||
'key': apiKey,
|
||||
},
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
final data = response.data;
|
||||
// Mengambil compound_code dari hasil JSON
|
||||
final plusCode = data['plus_code'];
|
||||
if (plusCode != null && plusCode['compound_code'] != null) {
|
||||
return plusCode['compound_code'];
|
||||
} else {
|
||||
print('Alamat Tidak Ditemukan');
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
print('Failed to load data');
|
||||
return null;
|
||||
}
|
||||
} catch (e) {
|
||||
print('Error: $e');
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,15 @@
|
||||
import 'package:absensi_sas/app/constant.dart';
|
||||
import 'package:absensi_sas/provider/current_rekap_kehadiran_home_provider.dart';
|
||||
import 'package:dart_nominatim/dart_nominatim.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||
import 'package:geocoding/geocoding.dart';
|
||||
import 'package:geolocator/geolocator.dart';
|
||||
// import 'package:geocoding/geocoding.dart';
|
||||
// import 'package:geolocator/geolocator.dart';
|
||||
import 'package:google_sign_in/google_sign_in.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:latlong2/latlong.dart';
|
||||
import 'package:location/location.dart';
|
||||
// import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
|
||||
|
||||
import '../../app/route.dart';
|
||||
@@ -42,6 +45,8 @@ class HomeScreen extends HookConsumerWidget {
|
||||
// ref.watch(currentUserGoogleProvider);
|
||||
|
||||
final googleSignIn = ref.watch(googleSignInProvider);
|
||||
Location location = new Location();
|
||||
LocationData _locationData;
|
||||
|
||||
useEffect(() {
|
||||
WidgetsBinding.instance.addPostFrameCallback((timeStamp) async {
|
||||
@@ -95,9 +100,10 @@ class HomeScreen extends HookConsumerWidget {
|
||||
try {
|
||||
isLoadingProsesCheckDistance.value = true;
|
||||
// Mendapatkan posisi pengguna
|
||||
LocationPermission permission = await Geolocator.requestPermission();
|
||||
// LocationPermission permission = await Geolocator.requestPermission();
|
||||
final permission = await location.hasPermission();
|
||||
|
||||
if (permission == LocationPermission.denied) {
|
||||
if (permission == PermissionStatus.denied) {
|
||||
isLoadingProsesCheckDistance.value = false;
|
||||
SanckbarWidget(context, 'Izin lokasi ditolak', snackbarType.error);
|
||||
// Handle jika pengguna menolak izin lokasi
|
||||
@@ -105,25 +111,29 @@ class HomeScreen extends HookConsumerWidget {
|
||||
return;
|
||||
}
|
||||
|
||||
Position position = await Geolocator.getCurrentPosition(
|
||||
desiredAccuracy: LocationAccuracy.high);
|
||||
// Position position = await Geolocator.getCurrentPosition(
|
||||
// desiredAccuracy: LocationAccuracy.high);
|
||||
|
||||
location.changeSettings(
|
||||
accuracy: LocationAccuracy.high,
|
||||
interval: 1000,
|
||||
distanceFilter: 5,
|
||||
);
|
||||
_locationData = await location.getLocation();
|
||||
|
||||
// positionLatitude.value = position.latitude.toString();
|
||||
// positionLongitude.value = position.longitude.toString();
|
||||
|
||||
positionLatitude.value = _locationData.latitude.toString();
|
||||
positionLongitude.value = _locationData.longitude.toString();
|
||||
|
||||
// Mendapatkan alamat dari posisi
|
||||
List<Placemark> placemarks = await placemarkFromCoordinates(
|
||||
position.latitude, position.longitude);
|
||||
final address = await positionToAddress(
|
||||
LatLng(_locationData.latitude!, _locationData.longitude!));
|
||||
|
||||
if (placemarks.isNotEmpty) {
|
||||
isLoadingProsesCheckDistance.value = false;
|
||||
Placemark placemark = placemarks.first;
|
||||
// String address =
|
||||
// "${placemark.thoroughfare}, ${placemark.locality}, ${placemark.administrativeArea}, ${placemark.country},";
|
||||
|
||||
String address =
|
||||
"${placemark.street}, ${placemark.subLocality}, ${placemark.subAdministrativeArea}, ${placemark.postalCode}";
|
||||
print("Alamat: $address");
|
||||
|
||||
positionLatitude.value = position.latitude.toString();
|
||||
positionLongitude.value = position.longitude.toString();
|
||||
if (address.city != "") {
|
||||
positionLatitude.value = _locationData.latitude.toString();
|
||||
positionLongitude.value = _locationData.longitude.toString();
|
||||
|
||||
// panggil check distance provider
|
||||
ref.read(checkDistanceProvider.notifier).checkDistance(
|
||||
@@ -146,10 +156,12 @@ class HomeScreen extends HookConsumerWidget {
|
||||
}
|
||||
|
||||
Future<void> requestLocationPermission() async {
|
||||
var status = await Permission.location.request();
|
||||
// var status = await Permission.location.request();
|
||||
final status = await location.serviceEnabled();
|
||||
isLoadingProsesCheckDistance.value = true;
|
||||
if (status.isGranted) {
|
||||
if (status) {
|
||||
// Izin diberikan, lanjutkan dengan mendapatkan lokasi
|
||||
// print('izin diberikan');
|
||||
getAddressFromLocation();
|
||||
} else {
|
||||
isLoadingProsesCheckDistance.value = false;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:absensi_sas/app/constant.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||
import 'package:geocoding/geocoding.dart';
|
||||
// import 'package:geocoding/geocoding.dart';
|
||||
import 'package:geolocator/geolocator.dart';
|
||||
import 'package:google_sign_in/google_sign_in.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
@@ -89,39 +89,39 @@ class HomeScreenV1 extends HookConsumerWidget {
|
||||
return;
|
||||
}
|
||||
|
||||
Position position = await Geolocator.getCurrentPosition(
|
||||
desiredAccuracy: LocationAccuracy.high);
|
||||
// Position position = await Geolocator.getCurrentPosition(
|
||||
// desiredAccuracy: LocationAccuracy.high);
|
||||
|
||||
// Mendapatkan alamat dari posisi
|
||||
List<Placemark> placemarks = await placemarkFromCoordinates(
|
||||
position.latitude, position.longitude);
|
||||
// // Mendapatkan alamat dari posisi
|
||||
// List<Placemark> placemarks = await placemarkFromCoordinates(
|
||||
// position.latitude, position.longitude);
|
||||
|
||||
if (placemarks.isNotEmpty) {
|
||||
isLoadingProsesCheckDistance.value = false;
|
||||
Placemark placemark = placemarks.first;
|
||||
// String address =
|
||||
// "${placemark.thoroughfare}, ${placemark.locality}, ${placemark.administrativeArea}, ${placemark.country},";
|
||||
// if (placemarks.isNotEmpty) {
|
||||
// isLoadingProsesCheckDistance.value = false;
|
||||
// Placemark placemark = placemarks.first;
|
||||
// // String address =
|
||||
// // "${placemark.thoroughfare}, ${placemark.locality}, ${placemark.administrativeArea}, ${placemark.country},";
|
||||
|
||||
String address =
|
||||
"${placemark.street}, ${placemark.subLocality}, ${placemark.subAdministrativeArea}, ${placemark.postalCode}";
|
||||
print("Alamat: $address");
|
||||
// String address =
|
||||
// "${placemark.street}, ${placemark.subLocality}, ${placemark.subAdministrativeArea}, ${placemark.postalCode}";
|
||||
// print("Alamat: $address");
|
||||
|
||||
positionLatitude.value = position.latitude.toString();
|
||||
positionLongitude.value = position.longitude.toString();
|
||||
// positionLatitude.value = position.latitude.toString();
|
||||
// positionLongitude.value = position.longitude.toString();
|
||||
|
||||
// panggil check distance provider
|
||||
ref.read(checkDistanceProvider.notifier).checkDistance(
|
||||
selectedUser?.model.staffId ?? "",
|
||||
selectedUser?.model.companyId ?? "",
|
||||
positionLatitude.value,
|
||||
positionLongitude.value,
|
||||
);
|
||||
} else {
|
||||
isLoadingProsesCheckDistance.value = false;
|
||||
SanckbarWidget(
|
||||
context, 'Tidak dapat menemukan alamat.', snackbarType.error);
|
||||
print("Tidak dapat menemukan alamat.");
|
||||
}
|
||||
// // panggil check distance provider
|
||||
// ref.read(checkDistanceProvider.notifier).checkDistance(
|
||||
// selectedUser?.model.staffId ?? "",
|
||||
// selectedUser?.model.companyId ?? "",
|
||||
// positionLatitude.value,
|
||||
// positionLongitude.value,
|
||||
// );
|
||||
// } else {
|
||||
// isLoadingProsesCheckDistance.value = false;
|
||||
// SanckbarWidget(
|
||||
// context, 'Tidak dapat menemukan alamat.', snackbarType.error);
|
||||
// print("Tidak dapat menemukan alamat.");
|
||||
// }
|
||||
} catch (e) {
|
||||
print("Error: $e");
|
||||
isLoadingProsesCheckDistance.value = false;
|
||||
|
||||
69
lib/screen/presensi/googleapis_provider.dart
Normal file
69
lib/screen/presensi/googleapis_provider.dart
Normal file
@@ -0,0 +1,69 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import '../../provider/dio_provider.dart';
|
||||
import '../../provider/graphql_provider.dart';
|
||||
import '../../repository/base_repository.dart';
|
||||
import '../../repository/googleapis_repository.dart';
|
||||
|
||||
// 3. state provider
|
||||
final googleApisProvider =
|
||||
StateNotifierProvider<GoogleApisNotifier, GoogleApisState>(
|
||||
(ref) => GoogleApisNotifier(ref: ref));
|
||||
|
||||
// 2. notifier
|
||||
class GoogleApisNotifier extends StateNotifier<GoogleApisState> {
|
||||
final Ref ref;
|
||||
GoogleApisNotifier({required this.ref}) : super(GoogleApisStateInit());
|
||||
|
||||
void getAddressGoogleApis(
|
||||
{required double latitude, required double longitude}) async {
|
||||
try {
|
||||
state = GoogleApisStateLoading();
|
||||
final graphql = ref.read(graphqlProvider(''));
|
||||
final dio = ref.read(dioProvider);
|
||||
final resp = await GoogleApisRepository(graphql: graphql, dio: dio).getAddressFromCoordinates(
|
||||
latitude,
|
||||
longitude,
|
||||
);
|
||||
|
||||
// print(resp);
|
||||
state = GoogleApisStateDone(model: resp);
|
||||
} catch (e) {
|
||||
if (e is BaseRepositoryException) {
|
||||
state = GoogleApisStateError(message: e.message ?? "");
|
||||
} else {
|
||||
state = GoogleApisStateError(message: e.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 1. state
|
||||
abstract class GoogleApisState extends Equatable {
|
||||
final DateTime date;
|
||||
const GoogleApisState(this.date);
|
||||
@override
|
||||
List<Object?> get props => [date];
|
||||
}
|
||||
|
||||
class GoogleApisStateInit extends GoogleApisState {
|
||||
GoogleApisStateInit() : super(DateTime.now());
|
||||
}
|
||||
|
||||
class GoogleApisStateLoading extends GoogleApisState {
|
||||
GoogleApisStateLoading() : super(DateTime.now());
|
||||
}
|
||||
|
||||
class GoogleApisStateError extends GoogleApisState {
|
||||
final String message;
|
||||
GoogleApisStateError({
|
||||
required this.message,
|
||||
}) : super(DateTime.now());
|
||||
}
|
||||
|
||||
class GoogleApisStateDone extends GoogleApisState {
|
||||
final String? model;
|
||||
GoogleApisStateDone({
|
||||
required this.model,
|
||||
}) : super(DateTime.now());
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import 'package:absensi_sas/widget/real_date.dart';
|
||||
import 'package:absensi_sas/widget/sankbar_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||
import 'package:geocoding/geocoding.dart';
|
||||
// import 'package:geocoding/geocoding.dart';
|
||||
import 'package:geolocator/geolocator.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
@@ -55,48 +55,48 @@ class PresensiScreen extends HookConsumerWidget {
|
||||
Position position = await Geolocator.getCurrentPosition(
|
||||
desiredAccuracy: LocationAccuracy.high);
|
||||
|
||||
// Mendapatkan alamat dari posisi
|
||||
List<Placemark> placemarks = await placemarkFromCoordinates(
|
||||
position.latitude, position.longitude);
|
||||
// // Mendapatkan alamat dari posisi
|
||||
// List<Placemark> placemarks = await placemarkFromCoordinates(
|
||||
// position.latitude, position.longitude);
|
||||
|
||||
if (positionLongitude.value.isEmpty && positionLatitude.value.isEmpty) {
|
||||
if (placemarks.isNotEmpty) {
|
||||
isLoadingAddressUserLocation.value = false;
|
||||
Placemark placemark = placemarks.first;
|
||||
// String address =
|
||||
// "${placemark.thoroughfare}, ${placemark.locality}, ${placemark.administrativeArea}, ${placemark.country},";
|
||||
// if (positionLongitude.value.isEmpty && positionLatitude.value.isEmpty) {
|
||||
// if (placemarks.isNotEmpty) {
|
||||
// isLoadingAddressUserLocation.value = false;
|
||||
// Placemark placemark = placemarks.first;
|
||||
// // String address =
|
||||
// // "${placemark.thoroughfare}, ${placemark.locality}, ${placemark.administrativeArea}, ${placemark.country},";
|
||||
|
||||
String address =
|
||||
"${placemark.street}, ${placemark.subLocality}, ${placemark.subAdministrativeArea}, ${placemark.postalCode}";
|
||||
print("Alamat: $address");
|
||||
// String address =
|
||||
// "${placemark.street}, ${placemark.subLocality}, ${placemark.subAdministrativeArea}, ${placemark.postalCode}";
|
||||
// print("Alamat: $address");
|
||||
|
||||
positionLatitude.value = position.latitude.toString();
|
||||
positionLongitude.value = position.longitude.toString();
|
||||
// positionLatitude.value = position.latitude.toString();
|
||||
// positionLongitude.value = position.longitude.toString();
|
||||
|
||||
if (address != "") {
|
||||
currentAddressUserLocation.value = address;
|
||||
}
|
||||
} else {
|
||||
isLoadingAddressUserLocation.value = false;
|
||||
SanckbarWidget(
|
||||
context, 'Tidak dapat menemukan alamat.', snackbarType.error);
|
||||
print("Tidak dapat menemukan alamat.");
|
||||
}
|
||||
} else {
|
||||
// jika sudah dapat latitude dan logitude baru panggil check distance provider
|
||||
if (positionLatitude.value.isNotEmpty &&
|
||||
positionLongitude.value.isNotEmpty) {
|
||||
print('check distance provider');
|
||||
// if (address != "") {
|
||||
// currentAddressUserLocation.value = address;
|
||||
// }
|
||||
// } else {
|
||||
// isLoadingAddressUserLocation.value = false;
|
||||
// SanckbarWidget(
|
||||
// context, 'Tidak dapat menemukan alamat.', snackbarType.error);
|
||||
// print("Tidak dapat menemukan alamat.");
|
||||
// }
|
||||
// } else {
|
||||
// // jika sudah dapat latitude dan logitude baru panggil check distance provider
|
||||
// if (positionLatitude.value.isNotEmpty &&
|
||||
// positionLongitude.value.isNotEmpty) {
|
||||
// print('check distance provider');
|
||||
|
||||
// panggil check distance provider
|
||||
ref.read(checkDistanceProvider.notifier).checkDistance(
|
||||
selectedUser?.model.staffId ?? "",
|
||||
selectedUser?.model.companyId ?? "",
|
||||
positionLatitude.value,
|
||||
positionLongitude.value,
|
||||
);
|
||||
}
|
||||
}
|
||||
// // panggil check distance provider
|
||||
// ref.read(checkDistanceProvider.notifier).checkDistance(
|
||||
// selectedUser?.model.staffId ?? "",
|
||||
// selectedUser?.model.companyId ?? "",
|
||||
// positionLatitude.value,
|
||||
// positionLongitude.value,
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
} catch (e) {
|
||||
print("Error: $e");
|
||||
isLoadingAddressUserLocation.value = false;
|
||||
|
||||
@@ -1,18 +1,22 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:absensi_sas/repository/googleapis_repository.dart';
|
||||
import 'package:absensi_sas/screen/presensi/presensi_clock_in_provider.dart';
|
||||
import 'package:absensi_sas/screen/presensi/presensi_clock_out_provider.dart';
|
||||
import 'package:absensi_sas/widget/custom_drawer.dart';
|
||||
import 'package:dart_nominatim/dart_nominatim.dart';
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||
import 'package:geocoding/geocoding.dart';
|
||||
import 'package:geolocator/geolocator.dart';
|
||||
// import 'package:geocoding/geocoding.dart';
|
||||
// import 'package:geolocator/geolocator.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:latlong2/latlong.dart';
|
||||
import 'package:location/location.dart';
|
||||
import 'package:mobkit_dashed_border/mobkit_dashed_border.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
// import 'package:permission_handler/permission_handler.dart';
|
||||
|
||||
import '../../app/constant.dart';
|
||||
import '../../app/route.dart';
|
||||
@@ -25,6 +29,7 @@ import '../../widget/real_time.dart';
|
||||
import '../../widget/sankbar_widget.dart';
|
||||
import 'check_distance_provider.dart';
|
||||
import 'check_presensi_jam_provider.dart';
|
||||
import 'googleapis_provider.dart';
|
||||
import 'presensi_selfie_upload_area.dart';
|
||||
import 'dart:io' as io;
|
||||
|
||||
@@ -52,6 +57,9 @@ class PresensiSelfieScreen extends HookConsumerWidget {
|
||||
final fileSize = useState(0);
|
||||
final fileName = useState("");
|
||||
|
||||
Location location = new Location();
|
||||
LocationData _locationData;
|
||||
|
||||
getBase64() async {
|
||||
// List<int> imageBytes = await fileData.value?.readAsBytes();
|
||||
if (fileData.value != null) {
|
||||
@@ -163,9 +171,10 @@ class PresensiSelfieScreen extends HookConsumerWidget {
|
||||
try {
|
||||
isLoadingAddressUserLocation.value = true;
|
||||
// Mendapatkan posisi pengguna
|
||||
LocationPermission permission = await Geolocator.requestPermission();
|
||||
// LocationPermission permission = await Geolocator.requestPermission();
|
||||
final permission = await location.hasPermission();
|
||||
|
||||
if (permission == LocationPermission.denied) {
|
||||
if (permission == PermissionStatus.denied) {
|
||||
isLoadingAddressUserLocation.value = false;
|
||||
SanckbarWidget(context, 'Izin lokasi ditolak', snackbarType.error);
|
||||
// Handle jika pengguna menolak izin lokasi
|
||||
@@ -173,30 +182,42 @@ class PresensiSelfieScreen extends HookConsumerWidget {
|
||||
return;
|
||||
}
|
||||
|
||||
Position position = await Geolocator.getCurrentPosition(
|
||||
desiredAccuracy: LocationAccuracy.high);
|
||||
// Position position = await Geolocator.getCurrentPosition(
|
||||
// locationSettings: LocationSettings(
|
||||
// accuracy: LocationAccuracy.high,
|
||||
// ),
|
||||
// );
|
||||
|
||||
location.changeSettings(
|
||||
accuracy: LocationAccuracy.high,
|
||||
interval: 1000,
|
||||
distanceFilter: 5,
|
||||
);
|
||||
_locationData = await location.getLocation();
|
||||
|
||||
// Mendapatkan alamat dari posisi
|
||||
List<Placemark> placemarks = await placemarkFromCoordinates(
|
||||
position.latitude, position.longitude);
|
||||
final address = await positionToAddress(
|
||||
LatLng(_locationData.latitude!, _locationData.longitude!));
|
||||
|
||||
// final address = await positionToAddress(
|
||||
// LatLng(-7.5666203, 110.8083376),
|
||||
// );
|
||||
|
||||
// Mendapatkan alamat dari posisi
|
||||
if (positionLongitude.value.isEmpty && positionLatitude.value.isEmpty) {
|
||||
if (placemarks.isNotEmpty) {
|
||||
if (address.city != "") {
|
||||
isLoadingAddressUserLocation.value = false;
|
||||
Placemark placemark = placemarks.first;
|
||||
|
||||
ref.read(googleApisProvider.notifier).getAddressGoogleApis(
|
||||
latitude: _locationData.latitude!,
|
||||
longitude: _locationData.longitude!,
|
||||
);
|
||||
|
||||
// String address =
|
||||
// "${placemark.thoroughfare}, ${placemark.locality}, ${placemark.administrativeArea}, ${placemark.country},";
|
||||
|
||||
String address =
|
||||
"${placemark.street}, ${placemark.subLocality}, ${placemark.subAdministrativeArea}, ${placemark.postalCode}";
|
||||
print("Alamat: $address");
|
||||
|
||||
positionLatitude.value = position.latitude.toString();
|
||||
positionLongitude.value = position.longitude.toString();
|
||||
|
||||
if (address != "") {
|
||||
currentAddressUserLocation.value = address;
|
||||
}
|
||||
positionLatitude.value = _locationData.latitude.toString();
|
||||
positionLongitude.value = _locationData.longitude.toString();
|
||||
} else {
|
||||
isLoadingAddressUserLocation.value = false;
|
||||
SanckbarWidget(
|
||||
@@ -226,9 +247,10 @@ class PresensiSelfieScreen extends HookConsumerWidget {
|
||||
}
|
||||
|
||||
Future<void> requestLocationPermission() async {
|
||||
var status = await Permission.location.request();
|
||||
// var status = await PermissionStatus.location.request();
|
||||
final status = await location.serviceEnabled();
|
||||
isLoadingAddressUserLocation.value = true;
|
||||
if (status.isGranted) {
|
||||
if (status) {
|
||||
// Izin diberikan, lanjutkan dengan mendapatkan lokasi
|
||||
getAddressFromLocation();
|
||||
} else {
|
||||
@@ -261,6 +283,19 @@ class PresensiSelfieScreen extends HookConsumerWidget {
|
||||
}
|
||||
});
|
||||
|
||||
// googleApis address
|
||||
ref.listen(googleApisProvider, (prev, next) {
|
||||
if (next is GoogleApisStateLoading) {
|
||||
isLoadingProsesCheckDistance.value = true;
|
||||
} else if (next is GoogleApisStateError) {
|
||||
isLoadingProsesCheckDistance.value = false;
|
||||
SanckbarWidget(context, next.message, snackbarType.warning);
|
||||
} else if (next is GoogleApisStateDone) {
|
||||
isLoadingProsesCheckDistance.value = false;
|
||||
currentAddressUserLocation.value = next.model ?? "0";
|
||||
}
|
||||
});
|
||||
|
||||
// check jam presensi
|
||||
ref.listen(checkPresensiJamProvider, (prev, next) {
|
||||
if (next is CheckPresensiJamStateLoading) {
|
||||
@@ -508,7 +543,7 @@ class PresensiSelfieScreen extends HookConsumerWidget {
|
||||
appBar: AppBar(
|
||||
title: Text(
|
||||
// 'Home Screen',
|
||||
'Presensi Selfie',
|
||||
'Presensi Selfie ${positionLatitude.value} , ${positionLongitude.value}',
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
color: Constant.textBlack,
|
||||
@@ -628,18 +663,18 @@ class PresensiSelfieScreen extends HookConsumerWidget {
|
||||
onTap: () async {
|
||||
getAddressFromLocation();
|
||||
// jika sudah dapat latitude dan logitude baru panggil check distance provider
|
||||
if (positionLatitude.value.isNotEmpty &&
|
||||
positionLongitude.value.isNotEmpty) {
|
||||
// panggil check distance provider
|
||||
ref
|
||||
.read(checkDistanceProvider.notifier)
|
||||
.checkDistance(
|
||||
selectedUser?.model.staffId ?? "",
|
||||
selectedUser?.model.companyId ?? "",
|
||||
positionLatitude.value,
|
||||
positionLongitude.value,
|
||||
);
|
||||
}
|
||||
// if (positionLatitude.value.isNotEmpty &&
|
||||
// positionLongitude.value.isNotEmpty) {
|
||||
// // panggil check distance provider
|
||||
// ref
|
||||
// .read(checkDistanceProvider.notifier)
|
||||
// .checkDistance(
|
||||
// selectedUser?.model.staffId ?? "",
|
||||
// selectedUser?.model.companyId ?? "",
|
||||
// positionLatitude.value,
|
||||
// positionLongitude.value,
|
||||
// );
|
||||
// }
|
||||
},
|
||||
child: Container(
|
||||
width: Constant.getActualXPhone(
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:geolocator/geolocator.dart';
|
||||
import 'package:geocoding/geocoding.dart';
|
||||
|
||||
class TestMap extends StatefulWidget {
|
||||
const TestMap({super.key});
|
||||
@@ -104,37 +103,37 @@ class _TestMapState extends State<TestMap> {
|
||||
Map<String, dynamic> posx = await determinePosition();
|
||||
print('${posx}');
|
||||
|
||||
if (posx['error'] == false) {
|
||||
Position position = posx['position'];
|
||||
List<Placemark> placemarks = await placemarkFromCoordinates(
|
||||
position.latitude, position.longitude);
|
||||
print('placemark : ${placemarks}');
|
||||
// if (posx['error'] == false) {
|
||||
// Position position = posx['position'];
|
||||
// List<Placemark> placemarks = await placemarkFromCoordinates(
|
||||
// position.latitude, position.longitude);
|
||||
// print('placemark : ${placemarks}');
|
||||
|
||||
double jarakx = await Geolocator.distanceBetween(-7.5350973,
|
||||
110.7921524, position.latitude, position.longitude);
|
||||
// double jarakx = await Geolocator.distanceBetween(-7.5350973,
|
||||
// 110.7921524, position.latitude, position.longitude);
|
||||
|
||||
setState(() {
|
||||
jarak = jarakx.toString() + " meter";
|
||||
longitude = position.longitude.toString();
|
||||
latitude = position.latitude.toString();
|
||||
addressFromCoordinat = placemarks[0].street.toString() +
|
||||
" , " +
|
||||
placemarks[0].subLocality.toString() +
|
||||
" , " +
|
||||
placemarks[0].locality.toString() +
|
||||
" , " +
|
||||
placemarks[0].postalCode.toString() +
|
||||
" , " +
|
||||
placemarks[0].country.toString();
|
||||
});
|
||||
} else {
|
||||
setState(() {
|
||||
longitude = "";
|
||||
addressFromCoordinat = "";
|
||||
jarak = "";
|
||||
latitude = posx['message'].toString();
|
||||
});
|
||||
}
|
||||
// setState(() {
|
||||
// jarak = jarakx.toString() + " meter";
|
||||
// longitude = position.longitude.toString();
|
||||
// latitude = position.latitude.toString();
|
||||
// addressFromCoordinat = placemarks[0].street.toString() +
|
||||
// " , " +
|
||||
// placemarks[0].subLocality.toString() +
|
||||
// " , " +
|
||||
// placemarks[0].locality.toString() +
|
||||
// " , " +
|
||||
// placemarks[0].postalCode.toString() +
|
||||
// " , " +
|
||||
// placemarks[0].country.toString();
|
||||
// });
|
||||
// } else {
|
||||
// setState(() {
|
||||
// longitude = "";
|
||||
// addressFromCoordinat = "";
|
||||
// jarak = "";
|
||||
// latitude = posx['message'].toString();
|
||||
// });
|
||||
// }
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
|
||||
@@ -8,6 +8,7 @@ import Foundation
|
||||
import file_selector_macos
|
||||
import geolocator_apple
|
||||
import google_sign_in_ios
|
||||
import location
|
||||
import path_provider_foundation
|
||||
import shared_preferences_foundation
|
||||
|
||||
@@ -15,6 +16,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
|
||||
GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin"))
|
||||
FLTGoogleSignInPlugin.register(with: registry.registrar(forPlugin: "FLTGoogleSignInPlugin"))
|
||||
LocationPlugin.register(with: registry.registrar(forPlugin: "LocationPlugin"))
|
||||
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
||||
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
||||
}
|
||||
|
||||
174
pubspec.lock
174
pubspec.lock
@@ -137,6 +137,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.6"
|
||||
dart_nominatim:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: dart_nominatim
|
||||
sha256: "5f1d72733f5dd6cf4d32bae707fda4bc6ef1a61ddbd3b24e373d66b52a2ae5a9"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
dio:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -225,6 +233,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.9.3+1"
|
||||
fixnum:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: fixnum
|
||||
sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
fluentui_system_icons:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -266,10 +282,10 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_map
|
||||
sha256: cda8d72135b697f519287258b5294a57ce2f2a5ebf234f0e406aad4dc14c9399
|
||||
sha256: "87cc8349b8fa5dccda5af50018c7374b6645334a0d680931c1fe11bce88fa5bb"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.1.0"
|
||||
version: "6.2.1"
|
||||
flutter_plugin_android_lifecycle:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -304,86 +320,54 @@ packages:
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
geocoding:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: geocoding
|
||||
sha256: e1dc0ac56666d9ed1d5a9ae5543ce9eb5986db6209cc7600103487d09192059c
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
geocoding_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: geocoding_android
|
||||
sha256: "609db1d71bc364dd9d0616f72a41c01e0c74f3a3807efb85e0d5a67e57baf50f"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.2"
|
||||
geocoding_ios:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: geocoding_ios
|
||||
sha256: "8f79e380abb640ef4d88baee8bb65390058c802601158d0813dc990b36b189d2"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
geocoding_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: geocoding_platform_interface
|
||||
sha256: "8848605d307d844d89937cdb4b8ad7dfa880552078f310fa24d8a460f6dddab4"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
geolocator:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: geolocator
|
||||
sha256: e946395fc608842bb2f6c914807e9183f86f3cb787f6b8f832753e5251036f02
|
||||
sha256: "0ec58b731776bc43097fcf751f79681b6a8f6d3bc737c94779fe9f1ad73c1a81"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "10.1.0"
|
||||
version: "13.0.1"
|
||||
geolocator_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: geolocator_android
|
||||
sha256: "741579fa6c9e412984d2bdb2fbaa54e3c3f7587c60aeacfe6e058358a11f40f8"
|
||||
sha256: "7aefc530db47d90d0580b552df3242440a10fe60814496a979aa67aa98b1fd47"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.4.0"
|
||||
version: "4.6.1"
|
||||
geolocator_apple:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: geolocator_apple
|
||||
sha256: "16cdb6b8d3685d3e07a7e54e88e97106f4fae9e496191f33e8bb389cce14f198"
|
||||
sha256: bc2aca02423ad429cb0556121f56e60360a2b7d694c8570301d06ea0c00732fd
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.3.4"
|
||||
version: "2.3.7"
|
||||
geolocator_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: geolocator_platform_interface
|
||||
sha256: "6c8d494d6948757c56720b778af742f6973f31fca1f702a7539b8917e4a2468a"
|
||||
sha256: "386ce3d9cce47838355000070b1d0b13efb5bc430f8ecda7e9238c8409ace012"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.2.0"
|
||||
version: "4.2.4"
|
||||
geolocator_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: geolocator_web
|
||||
sha256: "59083f7e0871b78299918d92bf930a14377f711d2d1156c558cd5ebae6c20d58"
|
||||
sha256: "2ed69328e05cd94e7eb48bb0535f5fc0c0c44d1c4fa1e9737267484d05c29b5e"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.0"
|
||||
version: "4.1.1"
|
||||
geolocator_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: geolocator_windows
|
||||
sha256: a92fae29779d5c6dc60e8411302f5221ade464968fe80a36d330e80a71f087af
|
||||
sha256: "53da08937d07c24b0d9952eb57a3b474e29aae2abf9dd717f7e1230995f13f0e"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.2.2"
|
||||
version: "0.2.3"
|
||||
google_identity_services_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -436,18 +420,18 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: gql
|
||||
sha256: "0bdd22c3a9464970ae590559e4f0568769b219dda9e94cb10c4cf999a3e263f7"
|
||||
sha256: "8ecd3585bb9e40d671aa58f52575d950670f99e5ffab18e2b34a757e071a6693"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.1-alpha+1705114622973"
|
||||
version: "1.0.1-alpha+1717789143880"
|
||||
gql_dedupe_link:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: gql_dedupe_link
|
||||
sha256: e5359dd0c7a38f95e2b12f6ab305989a4e30028e4032825c8e9f610150999c69
|
||||
sha256: "10bee0564d67c24e0c8bd08bd56e0682b64a135e58afabbeed30d85d5e9fea96"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.4-alpha+1705114623057"
|
||||
version: "2.0.4-alpha+1715521079596"
|
||||
gql_error_link:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -468,18 +452,18 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: gql_http_link
|
||||
sha256: "1f922eed1b7078fdbfd602187663026f9f659fe9a9499e2207b5d5e01617f658"
|
||||
sha256: ef6ad24d31beb5a30113e9b919eec20876903cc4b0ee0d31550047aaaba7d5dd
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.1+1"
|
||||
version: "1.1.0"
|
||||
gql_link:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: gql_link
|
||||
sha256: "63941513a688d856546f0c3218e7ad94d47fc6e04662dcdb06de92a4cde2d7db"
|
||||
sha256: "70fd5b5cbcc50601679f4b9fea3bcc994e583f59cfec7e1fec11113074b1a565"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.1-alpha+1705114622987"
|
||||
version: "1.0.1-alpha+1717789143896"
|
||||
gql_transform_link:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -492,10 +476,10 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: graphql
|
||||
sha256: d066e53446166c12537458386b507f7426f2b8801ebafc184576aab3cbc64d56
|
||||
sha256: "62f31433ba194eda7b81a812a83c3d9560766cec5ac0210ea4a3e677c91b8df4"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.2.0-beta.7"
|
||||
version: "5.2.0-beta.8"
|
||||
hive:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -524,10 +508,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: http
|
||||
sha256: "759d1a329847dd0f39226c688d3e06a6b8679668e350e2891a6474f8b4bb8525"
|
||||
sha256: b9c29a161230ee03d3ccf545097fccd9b87a5264228c5d348202e0f0c28f9010
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
version: "1.2.2"
|
||||
http_parser:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -652,10 +636,10 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: latlong2
|
||||
sha256: "18712164760cee655bc790122b0fd8f3d5b3c36da2cb7bf94b68a197fbb0811b"
|
||||
sha256: "98227922caf49e6056f91b6c56945ea1c7b166f28ffcd5fb8e72fc0b453cc8fe"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.9.0"
|
||||
version: "0.9.1"
|
||||
leak_tracker:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -696,14 +680,38 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
location:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: location
|
||||
sha256: "06be54f682c9073cbfec3899eb9bc8ed90faa0e17735c9d9fa7fe426f5be1dd1"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.0.3"
|
||||
location_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: location_platform_interface
|
||||
sha256: "8aa1d34eeecc979d7c9fe372931d84f6d2ebbd52226a54fe1620de6fdc0753b1"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.2"
|
||||
location_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: location_web
|
||||
sha256: ec484c66e8a4ff1ee5d044c203f4b6b71e3a0556a97b739a5bc9616de672412b
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.2.0"
|
||||
logger:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: logger
|
||||
sha256: "6bbb9d6f7056729537a4309bda2e74e18e5d9f14302489cc1e93f33b3fe32cac"
|
||||
sha256: "697d067c60c20999686a0add96cf6aba723b3aa1f83ecf806a8097231529ec32"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.2+1"
|
||||
version: "2.4.0"
|
||||
matcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -844,42 +852,50 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: permission_handler
|
||||
sha256: "284a66179cabdf942f838543e10413246f06424d960c92ba95c84439154fcac8"
|
||||
sha256: "18bf33f7fefbd812f37e72091a15575e72d5318854877e0e4035a24ac1113ecb"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "11.0.1"
|
||||
version: "11.3.1"
|
||||
permission_handler_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: permission_handler_android
|
||||
sha256: f9fddd3b46109bd69ff3f9efa5006d2d309b7aec0f3c1c5637a60a2d5659e76e
|
||||
sha256: "76e4ab092c1b240d31177bb64d2b0bea43f43d0e23541ec866151b9f7b2490fa"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "11.1.0"
|
||||
version: "12.0.12"
|
||||
permission_handler_apple:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: permission_handler_apple
|
||||
sha256: "99e220bce3f8877c78e4ace901082fb29fa1b4ebde529ad0932d8d664b34f3f5"
|
||||
sha256: e6f6d73b12438ef13e648c4ae56bd106ec60d17e90a59c4545db6781229082a0
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "9.1.4"
|
||||
version: "9.4.5"
|
||||
permission_handler_html:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: permission_handler_html
|
||||
sha256: af26edbbb1f2674af65a8f4b56e1a6f526156bc273d0e65dd8075fab51c78851
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.1.3+2"
|
||||
permission_handler_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: permission_handler_platform_interface
|
||||
sha256: "6760eb5ef34589224771010805bea6054ad28453906936f843a8cc4d3a55c4a4"
|
||||
sha256: fe0ffe274d665be8e34f9c59705441a7d248edebbe5d9e3ec2665f88b79358ea
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.12.0"
|
||||
version: "4.2.2"
|
||||
permission_handler_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: permission_handler_windows
|
||||
sha256: cc074aace208760f1eee6aa4fae766b45d947df85bc831cde77009cdb4720098
|
||||
sha256: "1a790728016f79a41216d88672dbc5df30e686e811ad4e698bfc51f76ad91f1e"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.1.3"
|
||||
version: "0.2.1"
|
||||
petitparser:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -1105,10 +1121,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: uuid
|
||||
sha256: "22c94e5ad1e75f9934b766b53c742572ee2677c56bc871d850a57dad0f82127f"
|
||||
sha256: "83d37c7ad7aaf9aa8e275490669535c8080377cfa7a7004c24dfac53afffaa90"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.2.2"
|
||||
version: "4.4.2"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -1165,6 +1181,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "14.2.5"
|
||||
web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: web
|
||||
sha256: d43c1d6b787bf0afad444700ae7f4db8827f701bc61c255ac8d328c6f4d52062
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
web_socket_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -1214,5 +1238,5 @@ packages:
|
||||
source: hosted
|
||||
version: "3.1.2"
|
||||
sdks:
|
||||
dart: ">=3.3.0 <4.0.0"
|
||||
dart: ">=3.4.0 <4.0.0"
|
||||
flutter: ">=3.19.0"
|
||||
|
||||
10
pubspec.yaml
10
pubspec.yaml
@@ -36,8 +36,9 @@ dependencies:
|
||||
# The following adds the Cupertino Icons font to your application.
|
||||
# Use with the CupertinoIcons class for iOS style icons.
|
||||
cupertino_icons: ^1.0.2
|
||||
geolocator: ^10.1.0
|
||||
geocoding: ^2.1.1
|
||||
# geolocator: ^10.1.0
|
||||
geolocator: ^13.0.1
|
||||
# geocoding: ^2.1.1
|
||||
dio: ^4.0.6
|
||||
flutter_riverpod: ^1.0.4
|
||||
flutter_hooks: ^0.18.5+1
|
||||
@@ -53,7 +54,8 @@ dependencies:
|
||||
intl: ^0.17.0
|
||||
graphql: ^5.1.3
|
||||
top_snackbar_flutter: ^3.1.0
|
||||
permission_handler: ^11.0.0
|
||||
# permission_handler: ^11.0.0
|
||||
permission_handler: ^11.3.1
|
||||
mobkit_dashed_border: ^0.0.5
|
||||
file_picker: ^6.1.1
|
||||
open_file: ^3.3.2
|
||||
@@ -67,6 +69,8 @@ dependencies:
|
||||
fluentui_system_icons: ^1.1.226
|
||||
eva_icons_flutter: ^3.1.0
|
||||
image_picker_web: ^4.0.0
|
||||
dart_nominatim: ^1.0.1
|
||||
location: ^5.0.0
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
||||
@@ -39,5 +39,11 @@
|
||||
</head>
|
||||
<body>
|
||||
<script src="flutter_bootstrap.js" async></script>
|
||||
<!-- <script>
|
||||
var API_KEY = "AIzaSyCiN7EeJsUpXVLQKFfrj3sE5OTKebjpzek";
|
||||
var script = document.createElement('script');
|
||||
script.src = "https://maps.googleapis.com/maps/api/js?key=" + API_KEY;
|
||||
document.head.appendChild(script);
|
||||
</script> -->
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user