|
|
|
@ -13,14 +13,12 @@ import 'package:mohem_flutter_app/classes/consts.dart';
|
|
|
|
import 'package:mohem_flutter_app/classes/utils.dart';
|
|
|
|
import 'package:mohem_flutter_app/classes/utils.dart';
|
|
|
|
import 'package:mohem_flutter_app/config/routes.dart';
|
|
|
|
import 'package:mohem_flutter_app/config/routes.dart';
|
|
|
|
import 'package:mohem_flutter_app/dialogs/otp_dialog.dart';
|
|
|
|
import 'package:mohem_flutter_app/dialogs/otp_dialog.dart';
|
|
|
|
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
|
|
|
|
|
|
|
|
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
|
|
|
|
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
|
|
|
|
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
|
|
|
|
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
|
|
|
|
import 'package:mohem_flutter_app/models/basic_member_information_model.dart';
|
|
|
|
import 'package:mohem_flutter_app/models/basic_member_information_model.dart';
|
|
|
|
import 'package:mohem_flutter_app/models/generic_response_model.dart';
|
|
|
|
import 'package:mohem_flutter_app/models/generic_response_model.dart';
|
|
|
|
import 'package:mohem_flutter_app/models/member_information_list_model.dart';
|
|
|
|
import 'package:mohem_flutter_app/models/member_information_list_model.dart';
|
|
|
|
import 'package:mohem_flutter_app/models/privilege_list_model.dart';
|
|
|
|
import 'package:mohem_flutter_app/models/privilege_list_model.dart';
|
|
|
|
import 'package:mohem_flutter_app/widgets/button/default_button.dart';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VerifyLoginScreen extends StatefulWidget {
|
|
|
|
class VerifyLoginScreen extends StatefulWidget {
|
|
|
|
VerifyLoginScreen({Key? key}) : super(key: key);
|
|
|
|
VerifyLoginScreen({Key? key}) : super(key: key);
|
|
|
|
@ -56,142 +54,23 @@ class _VerifyLoginScreenState extends State<VerifyLoginScreen> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
// actions: [Center(child: "Employee Digital ID".toText12(color: MyColors.textMixColor, isUnderLine: true).onPress(() {})), 21.width],
|
|
|
|
// actions: [Center(child: "Employee Digital ID".toText12(color: MyColors.textMixColor, isUnderLine: true).onPress(() {})), 21.width],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
body: Column(
|
|
|
|
body: ListView(
|
|
|
|
|
|
|
|
padding: const EdgeInsets.all(21),
|
|
|
|
|
|
|
|
physics: const BouncingScrollPhysics(),
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
LocaleKeys.pleaseVerify.tr().toText16(),
|
|
|
|
child: ListView(
|
|
|
|
GridView(
|
|
|
|
padding: const EdgeInsets.all(21),
|
|
|
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9),
|
|
|
|
physics: const BouncingScrollPhysics(),
|
|
|
|
physics: const NeverScrollableScrollPhysics(),
|
|
|
|
children: [
|
|
|
|
padding: const EdgeInsets.only(top: 9),
|
|
|
|
//12.height,
|
|
|
|
shrinkWrap: true,
|
|
|
|
if (true)
|
|
|
|
children: [
|
|
|
|
Column(
|
|
|
|
getButton(3),
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
getButton(4),
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
getButton(2),
|
|
|
|
children: [
|
|
|
|
getButton(1),
|
|
|
|
// LocaleKeys.welcomeBack.tr().toText12(),
|
|
|
|
],
|
|
|
|
// "Mohammad Hussain".toText24(isBold: true),
|
|
|
|
)
|
|
|
|
// 10.height,
|
|
|
|
|
|
|
|
// LocaleKeys.wouldYouLikeToLoginWithCurrentUsername.tr().toText16(),
|
|
|
|
|
|
|
|
// Container(
|
|
|
|
|
|
|
|
// height: 72,
|
|
|
|
|
|
|
|
// margin: const EdgeInsets.only(top: 23, bottom: 23),
|
|
|
|
|
|
|
|
// alignment: Alignment.center,
|
|
|
|
|
|
|
|
// padding: EdgeInsets.only(left: 17, right: 12),
|
|
|
|
|
|
|
|
// decoration: BoxDecoration(
|
|
|
|
|
|
|
|
// borderRadius: BorderRadius.circular(10),
|
|
|
|
|
|
|
|
// color: Colors.white,
|
|
|
|
|
|
|
|
// border: Border.all(
|
|
|
|
|
|
|
|
// color: Color(0xffefefef),
|
|
|
|
|
|
|
|
// width: 1,
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// child: Column(
|
|
|
|
|
|
|
|
// mainAxisSize: MainAxisSize.min,
|
|
|
|
|
|
|
|
// children: [
|
|
|
|
|
|
|
|
// Row(
|
|
|
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
|
|
|
// children: [
|
|
|
|
|
|
|
|
// LocaleKeys.lastLoginDetails.tr().toText16(),
|
|
|
|
|
|
|
|
// // Text(
|
|
|
|
|
|
|
|
// // user.editedOn != null
|
|
|
|
|
|
|
|
// // ? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(user.editedOn))
|
|
|
|
|
|
|
|
// // : user.createdOn != null
|
|
|
|
|
|
|
|
// // ? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(user.createdOn))
|
|
|
|
|
|
|
|
// // : '--',
|
|
|
|
|
|
|
|
// // style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48),
|
|
|
|
|
|
|
|
// // ),
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// Row(
|
|
|
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
|
|
|
// children: [
|
|
|
|
|
|
|
|
// LocaleKeys.verificationType.tr().toText10(color: MyColors.grey57Color),
|
|
|
|
|
|
|
|
// Text(
|
|
|
|
|
|
|
|
// "SMS",
|
|
|
|
|
|
|
|
// // " " + getType(user.logInType, context),
|
|
|
|
|
|
|
|
// style: TextStyle(
|
|
|
|
|
|
|
|
// fontSize: 12,
|
|
|
|
|
|
|
|
// fontWeight: FontWeight.w600,
|
|
|
|
|
|
|
|
// color: Color(0xff2B353E),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// Expanded(child: SizedBox()),
|
|
|
|
|
|
|
|
// // Text(
|
|
|
|
|
|
|
|
// // user.editedOn != null
|
|
|
|
|
|
|
|
// // ? DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(user.editedOn), false)
|
|
|
|
|
|
|
|
// // : user.createdOn != null
|
|
|
|
|
|
|
|
// // ? DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(user.createdOn), false)
|
|
|
|
|
|
|
|
// // : '--',
|
|
|
|
|
|
|
|
// // style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.48),
|
|
|
|
|
|
|
|
// // ),
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
// )
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
LocaleKeys.pleaseVerify.tr().toText16(),
|
|
|
|
|
|
|
|
GridView(
|
|
|
|
|
|
|
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9),
|
|
|
|
|
|
|
|
physics: const NeverScrollableScrollPhysics(),
|
|
|
|
|
|
|
|
padding: const EdgeInsets.only(top: 9),
|
|
|
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
getButton(3),
|
|
|
|
|
|
|
|
getButton(4),
|
|
|
|
|
|
|
|
getButton(2),
|
|
|
|
|
|
|
|
getButton(1),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
// else
|
|
|
|
|
|
|
|
// Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
|
|
|
|
|
|
|
|
// Image.asset(
|
|
|
|
|
|
|
|
// 'assets/images/habib-logo.png',
|
|
|
|
|
|
|
|
// height: 90,
|
|
|
|
|
|
|
|
// width: 90,
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// SizedBox(height: 23),
|
|
|
|
|
|
|
|
// this.onlySMSBox == false
|
|
|
|
|
|
|
|
// ? Text(
|
|
|
|
|
|
|
|
// TranslationBase.of(context).verifyLoginWith,
|
|
|
|
|
|
|
|
// style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 25 / 16),
|
|
|
|
|
|
|
|
// )
|
|
|
|
|
|
|
|
// : Text(
|
|
|
|
|
|
|
|
// TranslationBase.of(context).verifyFingerprint2,
|
|
|
|
|
|
|
|
// style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 25 / 16),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// SizedBox(height: 23),
|
|
|
|
|
|
|
|
// Text(
|
|
|
|
|
|
|
|
// TranslationBase.of(context).pleaseVerify,
|
|
|
|
|
|
|
|
// style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// GridView(
|
|
|
|
|
|
|
|
// gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9),
|
|
|
|
|
|
|
|
// physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
|
|
|
// padding: EdgeInsets.only(top: 9),
|
|
|
|
|
|
|
|
// shrinkWrap: true,
|
|
|
|
|
|
|
|
// children: [
|
|
|
|
|
|
|
|
// if (onlySMSBox == false) getButton(3),
|
|
|
|
|
|
|
|
// if (onlySMSBox == false) getButton(2),
|
|
|
|
|
|
|
|
// getButton(1),
|
|
|
|
|
|
|
|
// getButton(4),
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ]),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
12.height,
|
|
|
|
|
|
|
|
DefaultButton(
|
|
|
|
|
|
|
|
LocaleKeys.useAnotherAccount.tr(),
|
|
|
|
|
|
|
|
() => {
|
|
|
|
|
|
|
|
//Navigator.of(context).pushNamed(LOGIN_TYPE)
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
).insideContainer,
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
@ -686,8 +565,8 @@ class _VerifyLoginScreenState extends State<VerifyLoginScreen> {
|
|
|
|
print(element.serviceName.toString() + " " + element.previlege.toString()); // Check availability
|
|
|
|
print(element.serviceName.toString() + " " + element.previlege.toString()); // Check availability
|
|
|
|
});
|
|
|
|
});
|
|
|
|
PrivilegeListModel.saveToPrefs(genericResponseModel.privilegeList ?? []);
|
|
|
|
PrivilegeListModel.saveToPrefs(genericResponseModel.privilegeList ?? []);
|
|
|
|
AppState().mohemmWifiSSID = genericResponseModel.mohemmWifiSSID;
|
|
|
|
AppState().setMohemmWifiSSID = genericResponseModel.mohemmWifiSSID;
|
|
|
|
AppState().mohemmWifiPassword = genericResponseModel.mohemmWifiPassword;
|
|
|
|
AppState().setMohemmWifiPassword = genericResponseModel.mohemmWifiPassword;
|
|
|
|
Utils.saveStringFromPrefs(SharedPrefsConsts.username, AppState().getUserName!);
|
|
|
|
Utils.saveStringFromPrefs(SharedPrefsConsts.username, AppState().getUserName!);
|
|
|
|
Utils.saveStringFromPrefs(SharedPrefsConsts.password, AppState().password!);
|
|
|
|
Utils.saveStringFromPrefs(SharedPrefsConsts.password, AppState().password!);
|
|
|
|
Utils.saveStringFromPrefs(SharedPrefsConsts.mohemmWifiSSID, genericResponseModel.mohemmWifiSSID!);
|
|
|
|
Utils.saveStringFromPrefs(SharedPrefsConsts.mohemmWifiSSID, genericResponseModel.mohemmWifiSSID!);
|
|
|
|
@ -707,7 +586,6 @@ class _VerifyLoginScreenState extends State<VerifyLoginScreen> {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
).displayDialog(context);
|
|
|
|
).displayDialog(context);
|
|
|
|
} catch (ex) {
|
|
|
|
} catch (ex) {
|
|
|
|
print(ex);
|
|
|
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
Utils.handleException(ex, context, null);
|
|
|
|
Utils.handleException(ex, context, null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|