1.2.6+13 uat released.

main_design2.1
Sikander Saleem 1 year ago
parent d386f0152f
commit dc9e6c6ff3

@ -54,6 +54,8 @@ post_install do |installer|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0' config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [ config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
'$(inherited)', '$(inherited)',
## dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse]
'PERMISSION_LOCATION=1',
## dart: PermissionGroup.microphone ## dart: PermissionGroup.microphone
'PERMISSION_MICROPHONE=1', 'PERMISSION_MICROPHONE=1',
] ]

@ -1,4 +1,6 @@
PODS: PODS:
- audio_session (0.0.1):
- Flutter
- audioplayers_darwin (0.0.1): - audioplayers_darwin (0.0.1):
- Flutter - Flutter
- DKImagePickerController/Core (4.3.4): - DKImagePickerController/Core (4.3.4):
@ -32,6 +34,7 @@ PODS:
- DKPhotoGallery/Resource (0.0.17): - DKPhotoGallery/Resource (0.0.17):
- SDWebImage - SDWebImage
- SwiftyGif - SwiftyGif
- DTTJailbreakDetection (0.4.0)
- file_picker (0.0.1): - file_picker (0.0.1):
- DKImagePickerController/PhotoGallery - DKImagePickerController/PhotoGallery
- Flutter - Flutter
@ -82,6 +85,8 @@ PODS:
- FMDB (2.7.5): - FMDB (2.7.5):
- FMDB/standard (= 2.7.5) - FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5) - FMDB/standard (2.7.5)
- geolocator_apple (1.2.0):
- Flutter
- GoogleDataTransport (9.3.0): - GoogleDataTransport (9.3.0):
- GoogleUtilities/Environment (~> 7.7) - GoogleUtilities/Environment (~> 7.7)
- nanopb (< 2.30910.0, >= 2.30908.0) - nanopb (< 2.30910.0, >= 2.30908.0)
@ -108,6 +113,8 @@ PODS:
- TOCropViewController (~> 2.6.1) - TOCropViewController (~> 2.6.1)
- image_picker_ios (0.0.1): - image_picker_ios (0.0.1):
- Flutter - Flutter
- just_audio (0.0.1):
- Flutter
- local_auth_ios (0.0.1): - local_auth_ios (0.0.1):
- Flutter - Flutter
- MTBBarcodeScanner (5.0.11) - MTBBarcodeScanner (5.0.11)
@ -116,6 +123,8 @@ PODS:
- nanopb/encode (= 2.30909.1) - nanopb/encode (= 2.30909.1)
- nanopb/decode (2.30909.1) - nanopb/decode (2.30909.1)
- nanopb/encode (2.30909.1) - nanopb/encode (2.30909.1)
- nfc_manager (0.0.1):
- Flutter
- open_file (0.0.1): - open_file (0.0.1):
- Flutter - Flutter
- package_info (0.0.1): - package_info (0.0.1):
@ -131,6 +140,9 @@ PODS:
- MTBBarcodeScanner - MTBBarcodeScanner
- record_mp3 (0.0.1): - record_mp3 (0.0.1):
- Flutter - Flutter
- safe_device (1.0.0):
- DTTJailbreakDetection
- Flutter
- SDWebImage (5.18.7): - SDWebImage (5.18.7):
- SDWebImage/Core (= 5.18.7) - SDWebImage/Core (= 5.18.7)
- SDWebImage/Core (5.18.7) - SDWebImage/Core (5.18.7)
@ -151,8 +163,11 @@ PODS:
- Try (2.1.1) - Try (2.1.1)
- url_launcher_ios (0.0.1): - url_launcher_ios (0.0.1):
- Flutter - Flutter
- wifi_iot (0.0.1):
- Flutter
DEPENDENCIES: DEPENDENCIES:
- audio_session (from `.symlinks/plugins/audio_session/ios`)
- audioplayers_darwin (from `.symlinks/plugins/audioplayers_darwin/ios`) - audioplayers_darwin (from `.symlinks/plugins/audioplayers_darwin/ios`)
- file_picker (from `.symlinks/plugins/file_picker/ios`) - file_picker (from `.symlinks/plugins/file_picker/ios`)
- firebase_core (from `.symlinks/plugins/firebase_core/ios`) - firebase_core (from `.symlinks/plugins/firebase_core/ios`)
@ -162,25 +177,31 @@ DEPENDENCIES:
- flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`) - flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`)
- flutter_sound (from `.symlinks/plugins/flutter_sound/ios`) - flutter_sound (from `.symlinks/plugins/flutter_sound/ios`)
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`) - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
- geolocator_apple (from `.symlinks/plugins/geolocator_apple/ios`)
- image_cropper (from `.symlinks/plugins/image_cropper/ios`) - image_cropper (from `.symlinks/plugins/image_cropper/ios`)
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
- just_audio (from `.symlinks/plugins/just_audio/ios`)
- local_auth_ios (from `.symlinks/plugins/local_auth_ios/ios`) - local_auth_ios (from `.symlinks/plugins/local_auth_ios/ios`)
- nfc_manager (from `.symlinks/plugins/nfc_manager/ios`)
- open_file (from `.symlinks/plugins/open_file/ios`) - open_file (from `.symlinks/plugins/open_file/ios`)
- package_info (from `.symlinks/plugins/package_info/ios`) - package_info (from `.symlinks/plugins/package_info/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/ios`) - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/ios`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`) - permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- qr_code_scanner (from `.symlinks/plugins/qr_code_scanner/ios`) - qr_code_scanner (from `.symlinks/plugins/qr_code_scanner/ios`)
- record_mp3 (from `.symlinks/plugins/record_mp3/ios`) - record_mp3 (from `.symlinks/plugins/record_mp3/ios`)
- safe_device (from `.symlinks/plugins/safe_device/ios`)
- share (from `.symlinks/plugins/share/ios`) - share (from `.symlinks/plugins/share/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/ios`) - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/ios`)
- speech_to_text (from `.symlinks/plugins/speech_to_text/ios`) - speech_to_text (from `.symlinks/plugins/speech_to_text/ios`)
- sqflite (from `.symlinks/plugins/sqflite/ios`) - sqflite (from `.symlinks/plugins/sqflite/ios`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
- wifi_iot (from `.symlinks/plugins/wifi_iot/ios`)
SPEC REPOS: SPEC REPOS:
trunk: trunk:
- DKImagePickerController - DKImagePickerController
- DKPhotoGallery - DKPhotoGallery
- DTTJailbreakDetection
- Firebase - Firebase
- FirebaseCore - FirebaseCore
- FirebaseCoreInternal - FirebaseCoreInternal
@ -200,6 +221,8 @@ SPEC REPOS:
- Try - Try
EXTERNAL SOURCES: EXTERNAL SOURCES:
audio_session:
:path: ".symlinks/plugins/audio_session/ios"
audioplayers_darwin: audioplayers_darwin:
:path: ".symlinks/plugins/audioplayers_darwin/ios" :path: ".symlinks/plugins/audioplayers_darwin/ios"
file_picker: file_picker:
@ -218,12 +241,18 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/flutter_sound/ios" :path: ".symlinks/plugins/flutter_sound/ios"
fluttertoast: fluttertoast:
:path: ".symlinks/plugins/fluttertoast/ios" :path: ".symlinks/plugins/fluttertoast/ios"
geolocator_apple:
:path: ".symlinks/plugins/geolocator_apple/ios"
image_cropper: image_cropper:
:path: ".symlinks/plugins/image_cropper/ios" :path: ".symlinks/plugins/image_cropper/ios"
image_picker_ios: image_picker_ios:
:path: ".symlinks/plugins/image_picker_ios/ios" :path: ".symlinks/plugins/image_picker_ios/ios"
just_audio:
:path: ".symlinks/plugins/just_audio/ios"
local_auth_ios: local_auth_ios:
:path: ".symlinks/plugins/local_auth_ios/ios" :path: ".symlinks/plugins/local_auth_ios/ios"
nfc_manager:
:path: ".symlinks/plugins/nfc_manager/ios"
open_file: open_file:
:path: ".symlinks/plugins/open_file/ios" :path: ".symlinks/plugins/open_file/ios"
package_info: package_info:
@ -236,6 +265,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/qr_code_scanner/ios" :path: ".symlinks/plugins/qr_code_scanner/ios"
record_mp3: record_mp3:
:path: ".symlinks/plugins/record_mp3/ios" :path: ".symlinks/plugins/record_mp3/ios"
safe_device:
:path: ".symlinks/plugins/safe_device/ios"
share: share:
:path: ".symlinks/plugins/share/ios" :path: ".symlinks/plugins/share/ios"
shared_preferences_foundation: shared_preferences_foundation:
@ -246,11 +277,15 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/sqflite/ios" :path: ".symlinks/plugins/sqflite/ios"
url_launcher_ios: url_launcher_ios:
:path: ".symlinks/plugins/url_launcher_ios/ios" :path: ".symlinks/plugins/url_launcher_ios/ios"
wifi_iot:
:path: ".symlinks/plugins/wifi_iot/ios"
SPEC CHECKSUMS: SPEC CHECKSUMS:
audio_session: 088d2483ebd1dc43f51d253d4a1c517d9a2e7207
audioplayers_darwin: 877d9a4d06331c5c374595e46e16453ac7eafa40 audioplayers_darwin: 877d9a4d06331c5c374595e46e16453ac7eafa40
DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179 DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
DTTJailbreakDetection: 5e356c5badc17995f65a83ed9483f787a0057b71
file_picker: ce3938a0df3cc1ef404671531facef740d03f920 file_picker: ce3938a0df3cc1ef404671531facef740d03f920
Firebase: 25899099b77d255a636e3579c3d9dce10ec150d5 Firebase: 25899099b77d255a636e3579c3d9dce10ec150d5
firebase_core: 2e0e89436a00b664a23bebb08859e5fede7215e9 firebase_core: 2e0e89436a00b664a23bebb08859e5fede7215e9
@ -266,13 +301,16 @@ SPEC CHECKSUMS:
flutter_sound_core: 26c10e5832e76aaacfae252d8925232281c486ae flutter_sound_core: 26c10e5832e76aaacfae252d8925232281c486ae
fluttertoast: fafc4fa4d01a6a9e4f772ecd190ffa525e9e2d9c fluttertoast: fafc4fa4d01a6a9e4f772ecd190ffa525e9e2d9c
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
geolocator_apple: 9bcea1918ff7f0062d98345d238ae12718acfbc1
GoogleDataTransport: 57c22343ab29bc686febbf7cbb13bad167c2d8fe GoogleDataTransport: 57c22343ab29bc686febbf7cbb13bad167c2d8fe
GoogleUtilities: 0759d1a57ebb953965c2dfe0ba4c82e95ccc2e34 GoogleUtilities: 0759d1a57ebb953965c2dfe0ba4c82e95ccc2e34
image_cropper: a3291c624a953049bc6a02e1f8c8ceb162a24b25 image_cropper: a3291c624a953049bc6a02e1f8c8ceb162a24b25
image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5 image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5
just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa
local_auth_ios: c6cf091ded637a88f24f86a8875d8b0f526e2605 local_auth_ios: c6cf091ded637a88f24f86a8875d8b0f526e2605
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
nanopb: d4d75c12cd1316f4a64e3c6963f879ecd4b5e0d5 nanopb: d4d75c12cd1316f4a64e3c6963f879ecd4b5e0d5
nfc_manager: d7da7cb781f7744b94df5fe9dbca904ac4a0939e
open_file: 02eb5cb6b21264bd3a696876f5afbfb7ca4f4b7d open_file: 02eb5cb6b21264bd3a696876f5afbfb7ca4f4b7d
package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62 package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943 path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
@ -280,6 +318,7 @@ SPEC CHECKSUMS:
PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4 PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4
qr_code_scanner: bb67d64904c3b9658ada8c402e8b4d406d5d796e qr_code_scanner: bb67d64904c3b9658ada8c402e8b4d406d5d796e
record_mp3: b842d3900f65a0707e4064d9bcfac6323dea0b4f record_mp3: b842d3900f65a0707e4064d9bcfac6323dea0b4f
safe_device: 4539eb6bdbeb4b61a763a51c4e73e6b37dea4e3d
SDWebImage: f9258c58221ed854cfa0e2b80ee4033710b1c6d3 SDWebImage: f9258c58221ed854cfa0e2b80ee4033710b1c6d3
share: 0b2c3e82132f5888bccca3351c504d0003b3b410 share: 0b2c3e82132f5888bccca3351c504d0003b3b410
shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126 shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126
@ -290,7 +329,8 @@ SPEC CHECKSUMS:
TOCropViewController: edfd4f25713d56905ad1e0b9f5be3fbe0f59c863 TOCropViewController: edfd4f25713d56905ad1e0b9f5be3fbe0f59c863
Try: 5ef669ae832617b3cee58cb2c6f99fb767a4ff96 Try: 5ef669ae832617b3cee58cb2c6f99fb767a4ff96
url_launcher_ios: 68d46cc9766d0c41dbdc884310529557e3cd7a86 url_launcher_ios: 68d46cc9766d0c41dbdc884310529557e3cd7a86
wifi_iot: b5aafd6f9b52f8a357383a1deabab45f31cd602d
PODFILE CHECKSUM: 0e9d20dce82ccc5d44ed3f83729982dc68625efb PODFILE CHECKSUM: ca3feaeeb16aa3354407ddd8e4ea66e3744da220
COCOAPODS: 1.12.0 COCOAPODS: 1.12.0

@ -82,5 +82,21 @@
<array> <array>
<dict/> <dict/>
</array> </array>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>This App requires access to your location to mark your attendance.</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>This App requires access to your location to mark your attendance.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>This App requires access to your location to mark your attendance.</string>
<key>NFCReaderUsageDescription</key>
<string>This App requires access to NFC to mark your attendance.</string>
<key>com.apple.developer.nfc.readersession.felica.systemcodes</key>
<array>
<string>0000</string>
</array>
<key>com.apple.developer.nfc.readersession.formats</key>
<array>
<string>TAG</string>
</array>
</dict> </dict>
</plist> </plist>

@ -4,6 +4,14 @@
<dict> <dict>
<key>aps-environment</key> <key>aps-environment</key>
<string>development</string> <string>development</string>
<key>com.apple.developer.networking.HotspotConfiguration</key>
<true/>
<key>com.apple.developer.networking.wifi-info</key>
<true/>
<key>com.apple.developer.nfc.readersession.formats</key>
<array>
<string>TAG</string>
</array>
<key>inter-app-audio</key> <key>inter-app-audio</key>
<true/> <true/>
</dict> </dict>

@ -95,7 +95,7 @@ class ApiManager {
return response; return response;
} }
Future<http.Response> postWithOutBody(String url, {Map<String, String> headers}) async { Future<http.Response> postWithOutBody(String url, {Map<String, String> headers,showLoading = true}) async {
headers ??= {}; headers ??= {};
headers.addAll(_headers); headers.addAll(_headers);
@ -117,7 +117,7 @@ class ApiManager {
} else { } else {
if (jsonDecode(response.body) is Map<String, dynamic>) { if (jsonDecode(response.body) is Map<String, dynamic>) {
final message = jsonDecode(response.body)["message"]; final message = jsonDecode(response.body)["message"];
if (message != null && message.toString().isNotEmpty) { if (message != null && message.toString().isNotEmpty && showLoading) {
Fluttertoast.showToast(msg: message ?? "", toastLength: Toast.LENGTH_LONG); Fluttertoast.showToast(msg: message ?? "", toastLength: Toast.LENGTH_LONG);
} }
} }

@ -7,7 +7,6 @@ import 'package:google_api_availability/google_api_availability.dart';
// import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; // import 'package:huawei_hmsavailability/huawei_hmsavailability.dart';
import 'package:huawei_push/huawei_push.dart' as h_push; import 'package:huawei_push/huawei_push.dart' as h_push;
import 'package:test_sa/controllers/notification/notification_manger.dart'; import 'package:test_sa/controllers/notification/notification_manger.dart';
import 'package:test_sa/extensions/string_extensions.dart';
import 'package:test_sa/models/all_requests_and_count_model.dart'; import 'package:test_sa/models/all_requests_and_count_model.dart';
import 'package:test_sa/models/device/asset_transfer.dart'; import 'package:test_sa/models/device/asset_transfer.dart';
import 'package:test_sa/models/new_models/gas_refill_model.dart'; import 'package:test_sa/models/new_models/gas_refill_model.dart';
@ -44,7 +43,7 @@ class FirebaseNotificationManger {
h_push.Push.getTokenStream.listen((hToken) { h_push.Push.getTokenStream.listen((hToken) {
// onToken(token); // onToken(token);
// print("Huawei Token: ${hToken}"); // print("Huawei Token: ${hToken}");
token = hToken; token = hToken;
}, onError: (e) { }, onError: (e) {
print(e.toString()); print(e.toString());
@ -67,7 +66,7 @@ class FirebaseNotificationManger {
} catch (ex) {} } catch (ex) {}
} }
} }
// print("pushToken:$token"); // print("pushToken:$token");
// return token; // return token;
} }
@ -120,7 +119,7 @@ class FirebaseNotificationManger {
} }
static initialized(BuildContext context) async { static initialized(BuildContext context) async {
if (!(await isGoogleServicesAvailable())) { if (Platform.isAndroid && !(await isGoogleServicesAvailable())) {
var initialNotification = await h_push.Push.getInitialNotification(); var initialNotification = await h_push.Push.getInitialNotification();
if (initialNotification != null) { if (initialNotification != null) {
Map<String, dynamic> remoteData = Map<String, dynamic>.from(initialNotification["extras"] as Map); Map<String, dynamic> remoteData = Map<String, dynamic>.from(initialNotification["extras"] as Map);

@ -254,9 +254,7 @@ class UserProvider extends ChangeNotifier {
Response response; Response response;
try { try {
showDialog(context: context, barrierDismissible: false, builder: (context) => const AppLazyLoading()); showDialog(context: context, barrierDismissible: false, builder: (context) => const AppLazyLoading());
response = await ApiManager.instance.postWithOutBody( response = await ApiManager.instance.postWithOutBody(URLs.sendForgetPasswordOtp + '?employeeId=$employeeId', showLoading: false);
URLs.sendForgetPasswordOtp + '?employeeId=$employeeId',
);
generalResponseModel = GeneralResponseModel.fromJson(json.decode(response.body)); generalResponseModel = GeneralResponseModel.fromJson(json.decode(response.body));
_loading = false; _loading = false;
if (response.statusCode >= 200 && response.statusCode < 300) { if (response.statusCode >= 200 && response.statusCode < 300) {

@ -2,16 +2,18 @@ import 'dart:io';
import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_core/firebase_core.dart';
import 'package:flare_flutter/flare_actor.dart'; import 'package:flare_flutter/flare_actor.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:local_auth/local_auth.dart'; import 'package:local_auth/local_auth.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:safe_device/safe_device.dart';
import 'package:test_sa/controllers/providers/api/user_provider.dart'; import 'package:test_sa/controllers/providers/api/user_provider.dart';
import 'package:test_sa/controllers/providers/settings/setting_provider.dart'; import 'package:test_sa/controllers/providers/settings/setting_provider.dart';
import 'package:test_sa/extensions/widget_extensions.dart'; import 'package:test_sa/extensions/widget_extensions.dart';
import 'package:test_sa/new_views/pages/land_page/land_page.dart'; import 'package:test_sa/new_views/pages/land_page/land_page.dart';
import 'package:test_sa/new_views/pages/login_page.dart'; import 'package:test_sa/new_views/pages/login_page.dart';
import 'package:safe_device/safe_device.dart';
import 'package:test_sa/new_views/pages/usSafeDevice_view.dart'; import 'package:test_sa/new_views/pages/usSafeDevice_view.dart';
import '../../models/size_config.dart'; import '../../models/size_config.dart';
class SplashPage extends StatefulWidget { class SplashPage extends StatefulWidget {
@ -108,15 +110,14 @@ class _SplashPageState extends State<SplashPage> {
callback: (animation) async { callback: (animation) async {
bool isSafe = await checkDeviceSafety(); bool isSafe = await checkDeviceSafety();
print('is safe is ${isSafe}'); print('is safe is ${isSafe}');
if(!isSafe){ if (!isSafe) {
Navigator.pushNamedAndRemoveUntil(context,UnsafeDeviceScreen.routeName, (_) => false); Navigator.pushNamedAndRemoveUntil(context, UnsafeDeviceScreen.routeName, (_) => false);
}else{ } else {
if (_settingProvider.isLoaded && (_settingProvider.user != null)) { if (_settingProvider.isLoaded && (_settingProvider.user != null)) {
checkTokenValidity(_settingProvider.user.token); checkTokenValidity(_settingProvider.user.token);
} else { } else {
Navigator.of(context).pushNamedAndRemoveUntil(LoginPage.routeName, (routes) => true); Navigator.of(context).pushNamedAndRemoveUntil(LoginPage.routeName, (routes) => true);
} }
} }
// if (_settingProvider.isLoaded && (_settingProvider.user?.isLiveToken ?? false)) { // if (_settingProvider.isLoaded && (_settingProvider.user?.isLiveToken ?? false)) {
@ -137,28 +138,30 @@ class _SplashPageState extends State<SplashPage> {
), ),
); );
} }
Future<bool> checkDeviceSafety() async {
bool isOnExternalStorage=false; Future<bool> checkDeviceSafety() async {
bool isDevelopmentModeEnable=false; if (!kReleaseMode) return true;
bool isJailBroken=false; bool isOnExternalStorage = false;
bool isRealDevice=false; bool isDevelopmentModeEnable = false;
bool isJailBroken = false;
bool isRealDevice = false;
try { try {
isJailBroken = await SafeDevice.isJailBroken; isJailBroken = await SafeDevice.isJailBroken;
isRealDevice = await SafeDevice.isRealDevice; isRealDevice = await SafeDevice.isRealDevice;
if (Platform.isAndroid) { if (Platform.isAndroid) {
isOnExternalStorage = await SafeDevice.isOnExternalStorage; isOnExternalStorage = await SafeDevice.isOnExternalStorage;
isDevelopmentModeEnable = await SafeDevice.isDevelopmentModeEnable; isDevelopmentModeEnable = await SafeDevice.isDevelopmentModeEnable;
} }
//TODO correct isDevelopmentModeEnable when publish to prod... //TODO correct isDevelopmentModeEnable when publish to prod...
if (isJailBroken || !isRealDevice || isOnExternalStorage || !isDevelopmentModeEnable) { if (isJailBroken || !isRealDevice || isOnExternalStorage || isDevelopmentModeEnable) {
return false; return false;
}else{ } else {
return true; return true;
} }
} catch (error) { } catch (error) {
print(error); print(error);
return false; return false;
} }
} }
} }

@ -1,7 +1,9 @@
import 'dart:async'; import 'dart:async';
import 'dart:convert';
import 'dart:developer'; import 'dart:developer';
import 'dart:io'; import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart'; import 'package:geolocator/geolocator.dart';
import 'package:google_api_availability/google_api_availability.dart'; import 'package:google_api_availability/google_api_availability.dart';
@ -22,11 +24,11 @@ import 'package:test_sa/new_views/app_style/app_color.dart';
import 'package:test_sa/new_views/common_widgets/app_lazy_loading.dart'; import 'package:test_sa/new_views/common_widgets/app_lazy_loading.dart';
import 'package:test_sa/new_views/pages/land_page/nfc/nfc_reader_sheet.dart'; import 'package:test_sa/new_views/pages/land_page/nfc/nfc_reader_sheet.dart';
import 'package:test_sa/new_views/swipe_module/dialoge/confirm_dialog.dart'; import 'package:test_sa/new_views/swipe_module/dialoge/confirm_dialog.dart';
import 'package:test_sa/new_views/swipe_module/dialoge/qr_scanner_dialog.dart';
import 'package:test_sa/new_views/swipe_module/enums/swipe_type.dart'; import 'package:test_sa/new_views/swipe_module/enums/swipe_type.dart';
import 'package:test_sa/new_views/swipe_module/models/swipe_model.dart'; import 'package:test_sa/new_views/swipe_module/models/swipe_model.dart';
import 'package:test_sa/new_views/swipe_module/swipe_success_view.dart'; import 'package:test_sa/new_views/swipe_module/swipe_success_view.dart';
import 'package:test_sa/new_views/swipe_module/utils/location_utils.dart'; import 'package:test_sa/new_views/swipe_module/utils/location_utils.dart';
import 'package:test_sa/views/widgets/qr/scan_qr.dart';
import 'package:wifi_iot/wifi_iot.dart'; import 'package:wifi_iot/wifi_iot.dart';
class SwipeGeneralUtils { class SwipeGeneralUtils {
@ -147,13 +149,13 @@ class SwipeGeneralUtils {
StreamSubscription<Location> _streamSubscription; StreamSubscription<Location> _streamSubscription;
int requestCode = (await (locationService.requestLocationUpdates(locationRequest))); int requestCode = (await (locationService.requestLocationUpdates(locationRequest)));
_streamSubscription = locationService.onLocationData.listen( _streamSubscription = locationService.onLocationData.listen(
(Location location) async { (Location location) async {
hideLoading(context); hideLoading(context);
await locationService.removeLocationUpdates(requestCode); // todo #test on release mode. await locationService.removeLocationUpdates(requestCode);
handleSwipeOperation(swipeType: attendanceType, context: context, lat: location.latitude, long: location.longitude); handleSwipeOperation(swipeType: attendanceType, context: context, lat: location.latitude, long: location.longitude);
requestCode = 0; requestCode = 0;
_streamSubscription.cancel();
}, },
); );
} catch (error) { } catch (error) {
@ -250,11 +252,10 @@ class SwipeGeneralUtils {
Future<void> performQrCodeAttendance({double latitude, double longitude, BuildContext context}) async { Future<void> performQrCodeAttendance({double latitude, double longitude, BuildContext context}) async {
UserProvider userProvider = Provider.of<UserProvider>(context, listen: false); UserProvider userProvider = Provider.of<UserProvider>(context, listen: false);
var qrCodeValue = await Navigator.of(context).push( String qrCodeValue = await Navigator.of(context).push(
MaterialPageRoute( MaterialPageRoute(builder: (_) => ScanQr()),
builder: (BuildContext context) => QrScannerDialog(), ) as String;
),
);
if (qrCodeValue != null) { if (qrCodeValue != null) {
showLoading(context); showLoading(context);
try { try {
@ -333,7 +334,7 @@ class SwipeGeneralUtils {
} }
void handleSwipe({SwipeTypeEnum swipeType, @required bool isEnable, @required BuildContext context}) async { void handleSwipe({SwipeTypeEnum swipeType, @required bool isEnable, @required BuildContext context}) async {
if (!(await isGoogleServicesAvailable())) { if (Platform.isAndroid && !(await isGoogleServicesAvailable())) {
checkHuaweiLocationPermission(attendanceType: swipeType, context: context); checkHuaweiLocationPermission(attendanceType: swipeType, context: context);
} else { } else {
LocationUtilities.isEnabled((bool isEnabled) { LocationUtilities.isEnabled((bool isEnabled) {
@ -403,7 +404,10 @@ class SwipeGeneralUtils {
handleSwipe(swipeType: SwipeTypeEnum.QR, isEnable: userProvider.user.enableQR, context: navigatorKey.currentState.overlay.context); handleSwipe(swipeType: SwipeTypeEnum.QR, isEnable: userProvider.user.enableQR, context: navigatorKey.currentState.overlay.context);
}, context)); }, context));
} }
userProvider.user.enableWifi= true; if (kDebugMode) {
userProvider.user.enableWifi = true;
}
if (userProvider.user.enableWifi) { if (userProvider.user.enableWifi) {
availableMethods.add(attendanceTypeCard(SwipeTypeEnum.Wifi.name, 'wifi_icon', userProvider.user.enableWifi, () { availableMethods.add(attendanceTypeCard(SwipeTypeEnum.Wifi.name, 'wifi_icon', userProvider.user.enableWifi, () {
Navigator.pop(context); Navigator.pop(context);
@ -470,17 +474,11 @@ class SwipeGeneralUtils {
return false; return false;
} }
Future<void> performWifiAttendance({@required double latitude, @required double long,@required BuildContext context}) async { Future<void> performWifiAttendance({@required double latitude, @required double long, @required BuildContext context}) async {
String ssId ='HMG-MOHEMM'; String ssId = String.fromCharCodes(base64Decode("SE1HLU1PSEVNTQ=="));
String password ='M0hemm@1212'; String password = String.fromCharCodes(base64Decode("TTBoZW1tQDEyMTI="));
// if (Platform.isAndroid) { showLoading(context);
// if (!(await checkSession())) { bool isConnected = await WiFiForIoTPlugin.connect(ssId, password: password, joinOnce: Platform.isIOS ? false : true, security: NetworkSecurity.WPA, withInternet: false);
// return;
// }
// }
showLoading(context);
bool isConnected = await WiFiForIoTPlugin.connect( ssId,
password: password, joinOnce: Platform.isIOS ? false : true, security: NetworkSecurity.WPA, withInternet: false);
if (Platform.isIOS) { if (Platform.isIOS) {
if (await WiFiForIoTPlugin.getSSID() == ssId) { if (await WiFiForIoTPlugin.getSSID() == ssId) {
@ -489,7 +487,7 @@ class SwipeGeneralUtils {
isConnected = false; isConnected = false;
} }
} }
UserProvider userProvider = Provider.of<UserProvider>(context, listen: false); UserProvider userProvider = Provider.of<UserProvider>(context, listen: false);
if (isConnected) { if (isConnected) {
await WiFiForIoTPlugin.forceWifiUsage(true); await WiFiForIoTPlugin.forceWifiUsage(true);
@ -504,6 +502,7 @@ class SwipeGeneralUtils {
Navigator.pushNamed(context, SwipeSuccessView.routeName); Navigator.pushNamed(context, SwipeSuccessView.routeName);
} else { } else {
hideLoading(context); hideLoading(context);
await Future.delayed(const Duration(milliseconds: 250));
showErrorDialog(message: swipeResponse.message ?? "Unexpected error occurred", context: context); showErrorDialog(message: swipeResponse.message ?? "Unexpected error occurred", context: context);
} }
} catch (errSwipeGeneralUtilsor) { } catch (errSwipeGeneralUtilsor) {
@ -512,8 +511,8 @@ class SwipeGeneralUtils {
} }
} else { } else {
// if (userProvider.) { // if (userProvider.) {
hideLoading(context); hideLoading(context);
confirmDialog(context, "Come Near HMG Wifi"); confirmDialog(context, "Come Near HMG Wifi");
// } else { // } else {
// await closeWifiRequest(); // await closeWifiRequest();
// } // }
@ -521,7 +520,6 @@ class SwipeGeneralUtils {
} }
} }
Future<bool> closeWifiRequest() async { Future<bool> closeWifiRequest() async {
if (Platform.isAndroid) { if (Platform.isAndroid) {
await WiFiForIoTPlugin.forceWifiUsage(false); await WiFiForIoTPlugin.forceWifiUsage(false);

@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at # Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.2.5+12 version: 1.2.6+13
environment: environment:
sdk: ">=2.7.0 <3.0.0" sdk: ">=2.7.0 <3.0.0"

Loading…
Cancel
Save