From 078183c1fbfbd8db8c996511b848474bb88109f8 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 1 Dec 2020 16:23:40 +0300 Subject: [PATCH] not authenticated page updated --- lib/widgets/others/not_auh_page.dart | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/lib/widgets/others/not_auh_page.dart b/lib/widgets/others/not_auh_page.dart index a1a2f00c..d1684125 100644 --- a/lib/widgets/others/not_auh_page.dart +++ b/lib/widgets/others/not_auh_page.dart @@ -1,5 +1,7 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/login/login-type.dart'; +import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -8,6 +10,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../../splashPage.dart'; + class NotAutPage extends StatelessWidget { final String title; final String description; @@ -99,8 +103,9 @@ class NotAutPage extends StatelessWidget { Container( width: MediaQuery.of(context).size.width * 0.9, child: SecondaryButton( - onTap: () => Navigator.pushReplacement( - context, FadePage(page: LoginType())), + onTap: (){ + loginCheck(context); + }, label: TranslationBase.of(context).serviceInformationButton, textColor: Theme.of(context).backgroundColor), ), @@ -109,4 +114,16 @@ class NotAutPage extends StatelessWidget { ), ); } + + loginCheck(context) async{ + var data = await sharedPref.getObject(IMEI_USER_DATA); + sharedPref.remove(REGISTER_DATA_FOR_LOGIIN); + if (data != null) { + Navigator.of(context).pushNamed(CONFIRM_LOGIN); + } else { + Navigator.of(context).pushNamed( + WELCOME_LOGIN, + ); + } + } }