Merge branch 'master' into development_aamir

# Conflicts:
#	lib/classes/notifications.dart
merge-requests/154/head
Aamir Muhammad 3 years ago
commit a78b5b0a19

@ -14,7 +14,6 @@ import flutter_local_notifications
FlutterLocalNotificationsPlugin.setPluginRegistrantCallback { (registry) in FlutterLocalNotificationsPlugin.setPluginRegistrantCallback { (registry) in
GeneratedPluginRegistrant.register(with: registry) GeneratedPluginRegistrant.register(with: registry)
} }
if #available(iOS 10.0, *) { if #available(iOS 10.0, *) {
UNUserNotificationCenter.current().delegate = self as UNUserNotificationCenterDelegate UNUserNotificationCenter.current().delegate = self as UNUserNotificationCenterDelegate
} }

@ -87,13 +87,12 @@ class ApiClient {
if (!kReleaseMode) { if (!kReleaseMode) {
logger.i("res: " + response.body); logger.i("res: " + response.body);
} }
var jsonData = jsonDecode(response.body); var jsonData = jsonDecode(response.body);
if (jsonData["MessageStatus"] == 2) { if (jsonData["IsAuthenticated"] != null) {
AppState().setIsAuthenticated = false; AppState().setIsAuthenticated = jsonData["IsAuthenticated"];
} }
if (jsonData["ErrorMessage"] == null) {
if (jsonData["ErrorMessage"] == null && jsonData["MessageStatus"] == 1) {
return factoryConstructor(jsonData); return factoryConstructor(jsonData);
} else { } else {
APIError? apiError; APIError? apiError;

@ -60,7 +60,7 @@ class AppNotifications {
} }
void _handleMessage(RemoteMessage message) { void _handleMessage(RemoteMessage message) {
Utils.saveStringFromPrefs("isAppOpendByChat", "true"); Utils.saveStringFromPrefs("isAppOpendByChat", "false");
} }
void _handleOpenApp(RemoteMessage message) { void _handleOpenApp(RemoteMessage message) {
@ -77,6 +77,6 @@ AndroidNotificationChannel channel = const AndroidNotificationChannel(
Future<dynamic> backgroundMessageHandler(RemoteMessage message) async { Future<dynamic> backgroundMessageHandler(RemoteMessage message) async {
await Firebase.initializeApp(); await Firebase.initializeApp();
Utils.saveStringFromPrefs("isAppOpendByChat", "true"); Utils.saveStringFromPrefs("isAppOpendByChat", "false");
Utils.saveStringFromPrefs("notificationData", message.data["user_chat_history_response"].toString()); Utils.saveStringFromPrefs("notificationData", message.data["user_chat_history_response"].toString());
} }

@ -115,12 +115,14 @@ class Utils {
} else { } else {
if (!AppState().isAuthenticated) { if (!AppState().isAuthenticated) {
showDialog( showDialog(
barrierDismissible: false,
context: cxt, context: cxt,
builder: (cxt) => ConfirmDialog( builder: (cxt) => ConfirmDialog(
message: errorMessage, message: errorMessage,
onTap: () { onTap: () {
Navigator.pushNamedAndRemoveUntil(cxt, AppRoutes.login, (Route<dynamic> route) => false); Navigator.pushNamedAndRemoveUntil(cxt, AppRoutes.login, (Route<dynamic> route) => false);
}, },
onCloseTap: () {},
), ),
); );
} else { } else {

@ -158,13 +158,15 @@ extension EmailValidator on String {
style: TextStyle(height: 1, color: color ?? MyColors.darkTextColor, fontSize: 22, letterSpacing: -1.44, fontWeight: isBold ? FontWeight.bold : FontWeight.w600), style: TextStyle(height: 1, color: color ?? MyColors.darkTextColor, fontSize: 22, letterSpacing: -1.44, fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
); );
Widget toText24({Color? color, bool isBold = false}) => Text( Widget toText24({Color? color, bool isBold = false, bool isCentered = false}) => Text(
this, this,
textAlign: isCentered ? TextAlign.center : null,
style: TextStyle(height: 23 / 24, color: color ?? MyColors.darkTextColor, fontSize: 24, letterSpacing: -1.44, fontWeight: isBold ? FontWeight.bold : FontWeight.w600), style: TextStyle(height: 23 / 24, color: color ?? MyColors.darkTextColor, fontSize: 24, letterSpacing: -1.44, fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
); );
Widget toText30({Color? color, bool isBold = false}) => Text( Widget toText30({Color? color, bool isBold = false, bool isCentered = false}) => Text(
this, this,
textAlign: isCentered ? TextAlign.center : null,
style: TextStyle(height: 20 / 32, color: color ?? MyColors.darkTextColor, fontSize: 32, letterSpacing: -1.2, fontWeight: isBold ? FontWeight.bold : FontWeight.w600), style: TextStyle(height: 20 / 32, color: color ?? MyColors.darkTextColor, fontSize: 32, letterSpacing: -1.2, fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
); );

@ -533,6 +533,9 @@ class CodegenLoader extends AssetLoader{
"startingIn": "يبدأ في", "startingIn": "يبدأ في",
"youAreOutOfContest": "أنت خارج المسابقة.", "youAreOutOfContest": "أنت خارج المسابقة.",
"winners": "الفائزين!!!", "winners": "الفائزين!!!",
"expireAfter": "تنتهي بعد",
"oneWeek": "أسبوع 1",
"twoWeek": "2 أسبوع",
"noUpcoming": "لا يوجد قادم", "noUpcoming": "لا يوجد قادم",
"fakeLocation": ".لقد تتبعنا أنك تحاول استخدام موقع مزيف! يعتبر هذا مخالفة وقد تم إخطار الموارد البشرية", "fakeLocation": ".لقد تتبعنا أنك تحاول استخدام موقع مزيف! يعتبر هذا مخالفة وقد تم إخطار الموارد البشرية",
"noWinner": "حزين! لم يفز أحد اليوم.", "noWinner": "حزين! لم يفز أحد اليوم.",
@ -1058,6 +1061,9 @@ static const Map<String,dynamic> en_US = {
"startingIn": "Starting in", "startingIn": "Starting in",
"youAreOutOfContest": "You are out of the contest.", "youAreOutOfContest": "You are out of the contest.",
"winners": "WINNERS!!!", "winners": "WINNERS!!!",
"expireAfter": "Expires After",
"oneWeek": "1 Week",
"twoWeek": "2 Week",
"noUpcoming": "There is no upcoming", "noUpcoming": "There is no upcoming",
"fakeLocation": "We traced out that you try to use a fake location! This is considered a violation, and HR has been notified.", "fakeLocation": "We traced out that you try to use a fake location! This is considered a violation, and HR has been notified.",
"noWinner": "Sad! No one won today.", "noWinner": "Sad! No one won today.",

@ -1,6 +1,6 @@
// DO NOT EDIT. This is code generated via package:easy_localization/generate.dart // DO NOT EDIT. This is code generated via package:easy_localization/generate.dart
abstract class LocaleKeys { abstract class LocaleKeys {
static const mohemm = 'mohemm'; static const mohemm = 'mohemm';
static const english = 'english'; static const english = 'english';
static const arabic = 'arabic'; static const arabic = 'arabic';
@ -250,7 +250,7 @@ abstract class LocaleKeys {
static const Payroll = 'Payroll'; static const Payroll = 'Payroll';
static const civilIdentityNumber = 'civilIdentityNumber'; static const civilIdentityNumber = 'civilIdentityNumber';
static const dateOfBirth = 'dateOfBirth'; static const dateOfBirth = 'dateOfBirth';
static const maritalStatus = 'maritalStatus '; static const maritalStatus = 'maritalStatus ';
static const fullName = 'fullName'; static const fullName = 'fullName';
static const remove = 'remove'; static const remove = 'remove';
static const submit = 'submit'; static const submit = 'submit';
@ -280,7 +280,7 @@ abstract class LocaleKeys {
static const enterNewInfo = 'enterNewInfo'; static const enterNewInfo = 'enterNewInfo';
static const endDate = 'endDate'; static const endDate = 'endDate';
static const removeThisMember = 'removeThisMember'; static const removeThisMember = 'removeThisMember';
static const wantUpdateThisMember = 'wantUpdateThisMember '; static const wantUpdateThisMember = 'wantUpdateThisMember ';
static const addNewFamilyMember = 'addNewFamilyMember'; static const addNewFamilyMember = 'addNewFamilyMember';
static const addRow = 'addRow'; static const addRow = 'addRow';
static const pleaseSelect = 'pleaseSelect'; static const pleaseSelect = 'pleaseSelect';
@ -503,12 +503,13 @@ abstract class LocaleKeys {
static const startingIn = 'startingIn'; static const startingIn = 'startingIn';
static const youAreOutOfContest = 'youAreOutOfContest'; static const youAreOutOfContest = 'youAreOutOfContest';
static const winners = 'winners'; static const winners = 'winners';
static const noUpcoming = 'noUpcoming';
static const fakeLocation = 'fakeLocation';
static const expireAfter = 'expireAfter'; static const expireAfter = 'expireAfter';
static const oneWeek = 'oneWeek'; static const oneWeek = 'oneWeek';
static const twoWeek = 'twoWeek'; static const twoWeek = 'twoWeek';
static const noUpcoming = 'noUpcoming';
static const fakeLocation = 'fakeLocation';
static const noWinner = 'noWinner'; static const noWinner = 'noWinner';
static const myTeam = 'myTeam'; static const myTeam = 'myTeam';
static const youCanPlayDemo = 'youCanPlayDemo'; static const youCanPlayDemo = 'youCanPlayDemo';
} }

@ -1451,12 +1451,11 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
} }
void openChatByNoti(BuildContext context) async { void openChatByNoti(BuildContext context) async {
SingleUserChatModel nUser = SingleUserChatModel.fromJson(
jsonDecode(await Utils.getStringFromPrefs("notificationData")),
);
Utils.saveStringFromPrefs("isAppOpendByChat", "false"); Utils.saveStringFromPrefs("isAppOpendByChat", "false");
SingleUserChatModel nUser = SingleUserChatModel.fromJson(jsonDecode(await Utils.getStringFromPrefs("notificationData")));
Utils.saveStringFromPrefs("notificationData", "null"); Utils.saveStringFromPrefs("notificationData", "null");
Future.delayed(const Duration(seconds: 1)); logger.w(jsonEncode(nUser));
Future.delayed(const Duration(seconds: 2));
for (ChatUser user in searchedChats!) { for (ChatUser user in searchedChats!) {
if (user.id == nUser.targetUserId) { if (user.id == nUser.targetUserId) {
Navigator.pushNamed(context, AppRoutes.chatDetailed, arguments: ChatDetailedScreenParams(user, false)); Navigator.pushNamed(context, AppRoutes.chatDetailed, arguments: ChatDetailedScreenParams(user, false));

@ -190,7 +190,7 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
accrualList = await DashboardApiClient().getAccrualBalances(DateFormat("MM/dd/yyyy").format(date)); accrualList = await DashboardApiClient().getAccrualBalances(DateFormat("MM/dd/yyyy").format(date));
isLeaveTicketBalanceLoading = false; isLeaveTicketBalanceLoading = false;
leaveBalanceAccrual = accrualList![0]; leaveBalanceAccrual = accrualList![0];
ticketBalance = (accrualList![1].accrualNetEntitlement ?? 0.0) + (accrualList![2].accrualNetEntitlement ?? 0.0); ticketBalance = (accrualList![1].accrualNetEntitlement ?? 0.0) + (accrualList![2].accrualNetEntitlement ?? 0.0) + (accrualList![3].accrualNetEntitlement ?? 0.0);
notifyListeners(); notifyListeners();
} catch (ex) { } catch (ex) {
isLeaveTicketBalanceLoading = false; isLeaveTicketBalanceLoading = false;

@ -76,11 +76,8 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
void checkSession() async { void checkSession() async {
try { try {
Utils.showLoading(context);
await DashboardApiClient().getOpenMissingSwipes(); await DashboardApiClient().getOpenMissingSwipes();
Utils.hideLoading(context);
} catch (ex) { } catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null); Utils.handleException(ex, context, null);
} }
} }

@ -96,7 +96,7 @@ class MenusWidget extends StatelessWidget {
Row( Row(
children: [ children: [
Expanded( Expanded(
child: data.leaveBalance.toString().toText16(color: Colors.white, isBold: true, maxlines: 1), child: data.leaveBalance.toStringAsFixed(2).toText16(color: Colors.white, isBold: true, maxlines: 1),
), ),
RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)), RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)),
], ],
@ -123,7 +123,7 @@ class MenusWidget extends StatelessWidget {
Row( Row(
children: [ children: [
Expanded( Expanded(
child: data.ticketBalance.toString().toText16(color: Colors.white, isBold: true, maxlines: 1), child: data.ticketBalance.toStringAsFixed(2).toText16(color: Colors.white, isBold: true, maxlines: 1),
), ),
RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)), RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white)),
], ],

@ -190,6 +190,7 @@ class MarathonProvider extends ChangeNotifier {
oneSec, oneSec,
(Timer timer) async { (Timer timer) async {
if (totalSecondsToWaitForMarathon == 0) { if (totalSecondsToWaitForMarathon == 0) {
timer.cancel();
if (isUserWaiting) { if (isUserWaiting) {
MarathonApiClient().joinMarathonAsParticipant().whenComplete(() async { MarathonApiClient().joinMarathonAsParticipant().whenComplete(() async {
await callNextQuestionApi(); await callNextQuestionApi();
@ -197,7 +198,6 @@ class MarathonProvider extends ChangeNotifier {
} else { } else {
isButtonEnabled = false; isButtonEnabled = false;
} }
timer.cancel();
return; return;
} else { } else {
totalSecondsToWaitForMarathon--; totalSecondsToWaitForMarathon--;
@ -210,20 +210,24 @@ class MarathonProvider extends ChangeNotifier {
int totalCurrentQuestionTime = 0; int totalCurrentQuestionTime = 0;
int currentGapTime = 0; int currentGapTime = 0;
Timer timerForQuestion = Timer.periodic(const Duration(seconds: 1), (Timer timer) {}); Timer timerForQuestion = Timer.periodic(const Duration(seconds: 1), (Timer timer) {});
int callCountThreshold = 0;
void startTimerForQuestion() { void startTimerForQuestion() {
const Duration oneSec = Duration(seconds: 1); const Duration oneSec = Duration(seconds: 1);
timerForQuestion = Timer.periodic( timerForQuestion = Timer.periodic(
oneSec, oneSec,
(Timer timer) async { (Timer timer) async {
// This 2 is just to show the color of answer tile for 1 and then update card status // This 1 is just to show the color of answer tile for 1 and then update card status
if (totalCurrentQuestionTime - currentGapTime == 1) { if (totalCurrentQuestionTime - currentGapTime == 1) {
getCorrectAnswerAndUpdateAnswerColor(); if (callCountThreshold == 0) {
getCorrectAnswerAndUpdateAnswerColor();
}
} }
if (totalCurrentQuestionTime - currentGapTime == -2) { if (totalCurrentQuestionTime - currentGapTime == -2) {
updateCardStatusToAnswer(); if (callCountThreshold == 0) {
updateCardStatusToAnswer();
}
// scheduleMicrotask(() async { // scheduleMicrotask(() async {
// if (AppState().getIsDemoMarathon || isUserOutOfGame) { // if (AppState().getIsDemoMarathon || isUserOutOfGame) {
// await callNextQuestionApi(); // await callNextQuestionApi();
@ -243,6 +247,7 @@ class MarathonProvider extends ChangeNotifier {
notifyListeners(); notifyListeners();
} }
totalCurrentQuestionTime--; totalCurrentQuestionTime--;
callCountThreshold = 0;
} }
if (totalCurrentQuestionTime == 0) { if (totalCurrentQuestionTime == 0) {
@ -255,6 +260,7 @@ class MarathonProvider extends ChangeNotifier {
} else { } else {
if (totalCurrentQuestionTime - currentGapTime != -2) { if (totalCurrentQuestionTime - currentGapTime != -2) {
totalCurrentQuestionTime--; totalCurrentQuestionTime--;
callCountThreshold = 0;
} }
} }
@ -413,6 +419,7 @@ class MarathonProvider extends ChangeNotifier {
} }
void getCorrectAnswerAndUpdateAnswerColor() { void getCorrectAnswerAndUpdateAnswerColor() {
callCountThreshold = 1;
if (selectedOptionIndex != null) { if (selectedOptionIndex != null) {
scheduleMicrotask(() async { scheduleMicrotask(() async {
if (AppState().getIsDemoMarathon) { if (AppState().getIsDemoMarathon) {
@ -447,7 +454,7 @@ class MarathonProvider extends ChangeNotifier {
if (currentQuestionNumber == 0) { if (currentQuestionNumber == 0) {
return; return;
} }
callCountThreshold = 1;
scheduleMicrotask(() async { scheduleMicrotask(() async {
await callNextQuestionApi(); await callNextQuestionApi();
}); });
@ -478,6 +485,7 @@ class MarathonProvider extends ChangeNotifier {
void resetValues() async { void resetValues() async {
_currentQuestionNumber = 0; _currentQuestionNumber = 0;
iAmWinner = false;
cardContentList.clear(); cardContentList.clear();
itsMarathonTime = false; itsMarathonTime = false;
timerForWinnerSelection.cancel(); timerForWinnerSelection.cancel();

@ -169,26 +169,37 @@ class MarathonScreen extends StatelessWidget {
], ],
) )
: const SizedBox(), : const SizedBox(),
36.height, 34.height,
if (provider.selectedWinners != null) ...<Widget>[ if (provider.selectedWinners != null) ...<Widget>[
ListView.separated( provider.selectedWinners!.length == 1
shrinkWrap: true, ? Column(
itemCount: provider.selectedWinners!.length, children: <Widget>[
separatorBuilder: (BuildContext context, int index) { (AppState().isArabic(context) ? provider.selectedWinners![0].nameEn : provider.selectedWinners![0].nameEn)!.toText24(
return const Divider(); color: MyColors.grey3AColor,
}, isCentered: true,
itemBuilder: (BuildContext context, int index) { ),
return Column( 8.height,
crossAxisAlignment: CrossAxisAlignment.start, AppState().memberInformationList!.eMPLOYEENUMBER!.toText22(color: MyColors.grey57Color),
children: <Widget>[ ],
(AppState().isArabic(context) ? provider.selectedWinners![index].nameEn : provider.selectedWinners![index].nameEn)!.toText16( )
color: MyColors.grey3AColor, : ListView.separated(
), shrinkWrap: true,
provider.selectedWinners!.first.employeeId!.toText16(color: MyColors.grey57Color), itemCount: provider.selectedWinners!.length,
], separatorBuilder: (BuildContext context, int index) {
); return const Divider();
}, },
), itemBuilder: (BuildContext context, int index) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
(AppState().isArabic(context) ? provider.selectedWinners![index].nameEn : provider.selectedWinners![index].nameEn)!.toText16(
color: MyColors.grey3AColor,
),
provider.selectedWinners!.first.employeeId!.toText16(color: MyColors.grey57Color),
],
);
},
),
], ],
60.height, 60.height,
if (provider.marathonDetailModel.sponsors != null && provider.marathonDetailModel.sponsors!.isNotEmpty) ...<Widget>[ if (provider.marathonDetailModel.sponsors != null && provider.marathonDetailModel.sponsors!.isNotEmpty) ...<Widget>[

@ -431,7 +431,7 @@ class MarathonBanner extends StatelessWidget {
), ),
Flexible( Flexible(
child: Text( child: Text(
(AppState().isArabic(context) ? provider.marathonDetailModel.titleAr ?? "" : provider.marathonDetailModel.titleEn ?? "").trimString(15), (AppState().isArabic(context) ? provider.marathonDetailModel.titleAr ?? "" : provider.marathonDetailModel.titleEn ?? "").trimString(isTablet ? 25 : 15),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontStyle: FontStyle.italic, fontStyle: FontStyle.italic,

@ -12,8 +12,9 @@ class ConfirmDialog extends StatelessWidget {
final String message; final String message;
final String? okTitle; final String? okTitle;
final VoidCallback? onTap; final VoidCallback? onTap;
final VoidCallback? onCloseTap;
const ConfirmDialog({Key? key, this.title, required this.message, this.okTitle, this.onTap}) : super(key: key); const ConfirmDialog({Key? key, this.title, required this.message, this.okTitle, this.onTap, this.onCloseTap}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -41,9 +42,8 @@ class ConfirmDialog extends StatelessWidget {
icon: const Icon(Icons.close), icon: const Icon(Icons.close),
color: MyColors.darkTextColor, color: MyColors.darkTextColor,
constraints: const BoxConstraints(), constraints: const BoxConstraints(),
onPressed: () { onPressed: () => onCloseTap ?? Navigator.pop(context),
Navigator.pop(context); // onPressed: () => Navigator.pop(context),
},
) )
], ],
), ),

@ -145,7 +145,6 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
Future<void> performNfcAttendance(DashboardProviderModel model, {String lat = "0", String lng = "0"}) async { Future<void> performNfcAttendance(DashboardProviderModel model, {String lat = "0", String lng = "0"}) async {
if (Platform.isIOS) { if (Platform.isIOS) {
Utils.readNFc(onRead: (String nfcId) async { Utils.readNFc(onRead: (String nfcId) async {
Utils.showLoading(context); Utils.showLoading(context);
try { try {
@ -214,7 +213,25 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
} }
} }
Future<bool> checkSession() async {
try {
Utils.showLoading(context);
await DashboardApiClient().getOpenMissingSwipes();
Utils.hideLoading(context);
return true;
} catch (ex) {
Utils.hideLoading(context);
Utils.handleException(ex, context, null);
return false;
}
}
Future<void> performWifiAttendance(DashboardProviderModel model, {String lat = "0", String lng = "0"}) async { Future<void> performWifiAttendance(DashboardProviderModel model, {String lat = "0", String lng = "0"}) async {
if (Platform.isAndroid) {
if (!(await checkSession())) {
return;
}
}
Utils.showLoading(context); Utils.showLoading(context);
bool isConnected = await WiFiForIoTPlugin.connect(AppState().getMohemmWifiSSID ?? "", bool isConnected = await WiFiForIoTPlugin.connect(AppState().getMohemmWifiSSID ?? "",
password: AppState().getMohemmWifiPassword ?? "", joinOnce: Platform.isIOS ? false : true, security: NetworkSecurity.WPA, withInternet: false); password: AppState().getMohemmWifiPassword ?? "", joinOnce: Platform.isIOS ? false : true, security: NetworkSecurity.WPA, withInternet: false);
@ -227,23 +244,13 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
} }
} }
if (isConnected) { if (isConnected && AppState().isAuthenticated) {
// if (Platform.isIOS) {
// await closeWifiRequest();
// await Future.delayed(Duration(seconds: 6));
// } else {
// await WiFiForIoTPlugin.forceWifiUsage(true);
// }
await WiFiForIoTPlugin.forceWifiUsage(true); await WiFiForIoTPlugin.forceWifiUsage(true);
await Future.delayed(const Duration(seconds: 6)); await Future.delayed(const Duration(seconds: 6));
try { try {
GenericResponseModel? g = await DashboardApiClient().markAttendance(pointType: 3, nfcValue: "", isGpsRequired: isWifiLocationEnabled, lat: lat, long: lng); GenericResponseModel? g = await DashboardApiClient().markAttendance(pointType: 3, nfcValue: "", isGpsRequired: isWifiLocationEnabled, lat: lat, long: lng);
bool status = await model.fetchAttendanceTracking(context); bool status = await model.fetchAttendanceTracking(context);
Utils.hideLoading(context); Utils.hideLoading(context);
// if (Platform.isAndroid) {
// await closeWifiRequest();
// }
await closeWifiRequest(); await closeWifiRequest();
showMDialog( showMDialog(
context, context,
@ -257,8 +264,12 @@ class _MarkAttendanceWidgetState extends State<MarkAttendanceWidget> {
Utils.handleException(ex, context, null); Utils.handleException(ex, context, null);
} }
} else { } else {
Utils.hideLoading(context); if (AppState().isAuthenticated) {
Utils.confirmDialog(context, LocaleKeys.comeNearHMGWifi.tr()); Utils.hideLoading(context);
Utils.confirmDialog(context, LocaleKeys.comeNearHMGWifi.tr());
} else {
await closeWifiRequest();
}
} }
} }

Loading…
Cancel
Save