NFC Attendance implement 1.0

merge-requests/1/merge
devmirza121 4 years ago
parent 68729ddbb9
commit 35d683a8ae

@ -69,12 +69,12 @@ class _LoginScreenState extends State<LoginScreen> {
} }
String? firebaseToken; String? firebaseToken;
GetMobileLoginInfoListModel? loginInfo;
Future<void> checkFirebaseToken() async { Future<void> checkFirebaseToken() async {
try { try {
Utils.showLoading(context); Utils.showLoading(context);
firebaseToken = await _firebaseMessaging.getToken(); firebaseToken = await _firebaseMessaging.getToken();
GetMobileLoginInfoListModel? loginInfo = await LoginApiClient().getMobileLoginInfoNEW(firebaseToken ?? "", Platform.isAndroid ? "android" : "ios"); loginInfo = await LoginApiClient().getMobileLoginInfoNEW(firebaseToken ?? "", Platform.isAndroid ? "android" : "ios");
if (loginInfo == null) { if (loginInfo == null) {
Utils.hideLoading(context); Utils.hideLoading(context);
print("Device token not found"); print("Device token not found");
@ -112,7 +112,7 @@ class _LoginScreenState extends State<LoginScreen> {
} }
Utils.hideLoading(context); Utils.hideLoading(context);
if (_autoLogin) { if (_autoLogin) {
Navigator.pushNamed(context, AppRoutes.verifyLastLogin); Navigator.pushNamed(context, AppRoutes.verifyLastLogin, arguments: loginInfo);
} else { } else {
Navigator.pushNamed(context, AppRoutes.verifyLogin, arguments: "$firebaseToken"); Navigator.pushNamed(context, AppRoutes.verifyLogin, arguments: "$firebaseToken");
} }
@ -125,10 +125,11 @@ class _LoginScreenState extends State<LoginScreen> {
} }
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
username.text="15153"; username.text = "15153";
password.text="Xy12345@"; password.text = "Xy12345@";
return Scaffold( return Scaffold(
body: Column( body: Column(
children: [ children: [

Loading…
Cancel
Save