1.2.6+13 uat released.

main_design2.1
Sikander Saleem 11 months ago
parent d386f0152f
commit dc9e6c6ff3

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

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

@ -82,5 +82,21 @@
<array>
<dict/>
</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>
</plist>

@ -4,6 +4,14 @@
<dict>
<key>aps-environment</key>
<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>
<true/>
</dict>

@ -95,7 +95,7 @@ class ApiManager {
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.addAll(_headers);
@ -117,7 +117,7 @@ class ApiManager {
} else {
if (jsonDecode(response.body) is Map<String, dynamic>) {
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);
}
}

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

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

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

@ -1,7 +1,9 @@
import 'dart:async';
import 'dart:convert';
import 'dart:developer';
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.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/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/qr_scanner_dialog.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/swipe_success_view.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';
class SwipeGeneralUtils {
@ -147,13 +149,13 @@ class SwipeGeneralUtils {
StreamSubscription<Location> _streamSubscription;
int requestCode = (await (locationService.requestLocationUpdates(locationRequest)));
_streamSubscription = locationService.onLocationData.listen(
(Location location) async {
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);
requestCode = 0;
_streamSubscription.cancel();
},
);
} catch (error) {
@ -250,11 +252,10 @@ class SwipeGeneralUtils {
Future<void> performQrCodeAttendance({double latitude, double longitude, BuildContext context}) async {
UserProvider userProvider = Provider.of<UserProvider>(context, listen: false);
var qrCodeValue = await Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context) => QrScannerDialog(),
),
);
String qrCodeValue = await Navigator.of(context).push(
MaterialPageRoute(builder: (_) => ScanQr()),
) as String;
if (qrCodeValue != null) {
showLoading(context);
try {
@ -333,7 +334,7 @@ class SwipeGeneralUtils {
}
void handleSwipe({SwipeTypeEnum swipeType, @required bool isEnable, @required BuildContext context}) async {
if (!(await isGoogleServicesAvailable())) {
if (Platform.isAndroid && !(await isGoogleServicesAvailable())) {
checkHuaweiLocationPermission(attendanceType: swipeType, context: context);
} else {
LocationUtilities.isEnabled((bool isEnabled) {
@ -403,7 +404,10 @@ class SwipeGeneralUtils {
handleSwipe(swipeType: SwipeTypeEnum.QR, isEnable: userProvider.user.enableQR, context: navigatorKey.currentState.overlay.context);
}, context));
}
userProvider.user.enableWifi= true;
if (kDebugMode) {
userProvider.user.enableWifi = true;
}
if (userProvider.user.enableWifi) {
availableMethods.add(attendanceTypeCard(SwipeTypeEnum.Wifi.name, 'wifi_icon', userProvider.user.enableWifi, () {
Navigator.pop(context);
@ -470,17 +474,11 @@ class SwipeGeneralUtils {
return false;
}
Future<void> performWifiAttendance({@required double latitude, @required double long,@required BuildContext context}) async {
String ssId ='HMG-MOHEMM';
String password ='M0hemm@1212';
// if (Platform.isAndroid) {
// if (!(await checkSession())) {
// return;
// }
// }
showLoading(context);
bool isConnected = await WiFiForIoTPlugin.connect( ssId,
password: password, joinOnce: Platform.isIOS ? false : true, security: NetworkSecurity.WPA, withInternet: false);
Future<void> performWifiAttendance({@required double latitude, @required double long, @required BuildContext context}) async {
String ssId = String.fromCharCodes(base64Decode("SE1HLU1PSEVNTQ=="));
String password = String.fromCharCodes(base64Decode("TTBoZW1tQDEyMTI="));
showLoading(context);
bool isConnected = await WiFiForIoTPlugin.connect(ssId, password: password, joinOnce: Platform.isIOS ? false : true, security: NetworkSecurity.WPA, withInternet: false);
if (Platform.isIOS) {
if (await WiFiForIoTPlugin.getSSID() == ssId) {
@ -489,7 +487,7 @@ class SwipeGeneralUtils {
isConnected = false;
}
}
UserProvider userProvider = Provider.of<UserProvider>(context, listen: false);
UserProvider userProvider = Provider.of<UserProvider>(context, listen: false);
if (isConnected) {
await WiFiForIoTPlugin.forceWifiUsage(true);
@ -504,6 +502,7 @@ class SwipeGeneralUtils {
Navigator.pushNamed(context, SwipeSuccessView.routeName);
} else {
hideLoading(context);
await Future.delayed(const Duration(milliseconds: 250));
showErrorDialog(message: swipeResponse.message ?? "Unexpected error occurred", context: context);
}
} catch (errSwipeGeneralUtilsor) {
@ -512,8 +511,8 @@ class SwipeGeneralUtils {
}
} else {
// if (userProvider.) {
hideLoading(context);
confirmDialog(context, "Come Near HMG Wifi");
hideLoading(context);
confirmDialog(context, "Come Near HMG Wifi");
// } else {
// await closeWifiRequest();
// }
@ -521,7 +520,6 @@ class SwipeGeneralUtils {
}
}
Future<bool> closeWifiRequest() async {
if (Platform.isAndroid) {
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.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.2.5+12
version: 1.2.6+13
environment:
sdk: ">=2.7.0 <3.0.0"

Loading…
Cancel
Save