From 22af6fa2f90be4e15c47a7eaf56264e407aeadf0 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 13 Feb 2024 17:33:36 +0300 Subject: [PATCH] Huawei location fix --- lib/provider/chat_provider_model.dart | 2 +- lib/widgets/mark_attendance_widget.dart | 4 +++- pubspec.yaml | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/provider/chat_provider_model.dart b/lib/provider/chat_provider_model.dart index 0c73a4b..380278d 100644 --- a/lib/provider/chat_provider_model.dart +++ b/lib/provider/chat_provider_model.dart @@ -1260,7 +1260,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin { } bool checkFileSize(String path) { - int fileSizeLimit = 1024; + int fileSizeLimit = 5120; File f = File(path); double fileSizeInKB = f.lengthSync() / 5000; double fileSizeInMB = fileSizeInKB / 5000; diff --git a/lib/widgets/mark_attendance_widget.dart b/lib/widgets/mark_attendance_widget.dart index 982e316..75a5ef5 100644 --- a/lib/widgets/mark_attendance_widget.dart +++ b/lib/widgets/mark_attendance_widget.dart @@ -313,7 +313,7 @@ class _MarkAttendanceWidgetState extends State { void getHuaweiCurrentLocation(String attendanceType) async { try { Utils.showLoading(context); - FusedLocationProviderClient locationService = FusedLocationProviderClient(); + FusedLocationProviderClient locationService = FusedLocationProviderClient()..initFusedLocationService(); LocationRequest locationRequest = LocationRequest(); locationRequest.priority = LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY; locationRequest.interval = 500; @@ -377,6 +377,8 @@ class _MarkAttendanceWidgetState extends State { } catch (error) { print("HUAWEI LOCATION ERROR!!!!!"); print(error); + Utils.hideLoading(context); + Utils.handleException(error, context, null); } } diff --git a/pubspec.yaml b/pubspec.yaml index f7264a4..0db0731 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html #version: 3.3.01+300040 -version: 3.3.5+300045 +version: 3.4.1+300051 environment: sdk: ">=2.16.0 <3.0.0"