Merge branch 'login_design_sikander' into development_new_design_2.0

merge-update-with-lab-changes
Sikander Saleem 5 years ago
commit 2d64426cd4

@ -132,6 +132,7 @@ const Map localizedValues = {
"verify-with-faceid": {"en": "Face ID", "ar": "معرف الوجه"}, "verify-with-faceid": {"en": "Face ID", "ar": "معرف الوجه"},
"verify-with-sms": {"en": "SMS", "ar": "الرسائل القصيرة"}, "verify-with-sms": {"en": "SMS", "ar": "الرسائل القصيرة"},
"verify-with-whatsapp": {"en": "Whatsapp", "ar": " الواتس اب"}, "verify-with-whatsapp": {"en": "Whatsapp", "ar": " الواتس اب"},
"verify-through": {"en": "Verify Through", "ar": " تحقق من خلال"},
"last-login": {"en": "LAST LOGIN AT:", "ar": "آخر تسجيل دخول"}, "last-login": {"en": "LAST LOGIN AT:", "ar": "آخر تسجيل دخول"},
"last-login-with": {"en": "VERIFICATION TYPE:", "ar": "نوع التحقق:"}, "last-login-with": {"en": "VERIFICATION TYPE:", "ar": "نوع التحقق:"},
"verify-fingerprint": { "verify-fingerprint": {

@ -98,7 +98,6 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
LocationUtils locationUtils; LocationUtils locationUtils;
changeCurrentTab(int tab) { changeCurrentTab(int tab) {
if (!projectViewModel.isLogin) { if (!projectViewModel.isLogin) {
if (tab == 3) { if (tab == 3) {
List<ImagesInfo> imagesInfo = []; List<ImagesInfo> imagesInfo = [];
@ -234,8 +233,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
if (token != null && DEVICE_TOKEN == "") { if (token != null && DEVICE_TOKEN == "") {
DEVICE_TOKEN = token; DEVICE_TOKEN = token;
checkUserStatus(token); checkUserStatus(token);
if (projectViewModel.isLogin) if (projectViewModel.isLogin) this.getNotificationCount(DEVICE_TOKEN);
this.getNotificationCount(DEVICE_TOKEN);
} }
}); });
if (results[Permission.location].isGranted) ; if (results[Permission.location].isGranted) ;
@ -451,9 +449,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
Navigator.of(context).pushNamed(CONFIRM_LOGIN); Navigator.of(context).pushNamed(CONFIRM_LOGIN);
} else { } else {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
authService authService.selectDeviceImei(DEVICE_TOKEN).then((SelectDeviceIMEIRES value) {
.selectDeviceImei(DEVICE_TOKEN)
.then((SelectDeviceIMEIRES value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (value != null) { if (value != null) {
setUserValues(value); setUserValues(value);
@ -483,13 +479,8 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
if (value != null) if (value != null)
{ {
setState(() { setState(() {
notificationCount = value['List_PatientDashboard'][0] notificationCount =
['UnreadPatientNotificationCount'] > value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString();
99
? '99+'
: value['List_PatientDashboard'][0]
['UnreadPatientNotificationCount']
.toString();
sharedPref.setString(NOTIFICATION_COUNT, notificationCount); sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
}) })
@ -611,8 +602,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
index: currentTab, index: currentTab,
), ),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
floatingActionButton: floatingActionButton: (projectViewModel.havePrivilege(34) && currentTab == 0)
(projectViewModel.havePrivilege(34) && currentTab == 0)
? FloatingButton( ? FloatingButton(
elevation: true, elevation: true,
onTap: () { onTap: () {

@ -117,6 +117,10 @@ class _ConfirmLogin extends State<ConfirmLogin> {
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
children: [ children: [
SizedBox(height: 12), SizedBox(height: 12),
if (user != null)
Column(
mainAxisSize: MainAxisSize.min,
children: [
Text( Text(
TranslationBase.of(context).welcomeBack, TranslationBase.of(context).welcomeBack,
style: TextStyle(fontSize: 12, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64), style: TextStyle(fontSize: 12, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64),
@ -217,10 +221,41 @@ class _ConfirmLogin extends State<ConfirmLogin> {
], ],
) )
], ],
)
else
Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
Image.asset(
'assets/images/habib-logo.png',
height: 90,
width: 90,
),
this.onlySMSBox == false
? Texts(
TranslationBase.of(context).verifyLoginWith,
fontSize: SizeConfig.textMultiplier * 3.5,
textAlign: TextAlign.left,
)
: Texts(
TranslationBase.of(context).verifyFingerprint2,
fontSize: SizeConfig.textMultiplier * 2.5,
textAlign: TextAlign.start,
),
onlySMSBox == false
? Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[Expanded(child: getButton(3)), Expanded(child: getButton(2))],
)
: SizedBox(),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[Expanded(child: getButton(1)), Expanded(child: getButton(4))],
),
]),
],
), ),
), ),
SizedBox( SizedBox(
height: 12, // todo discuss height: 12,
), ),
SizedBox( SizedBox(
height: 43, height: 43,

@ -30,18 +30,16 @@ class _WelcomeLogin extends State<WelcomeLogin> {
appBarTitle: TranslationBase.of(context).welcome, appBarTitle: TranslationBase.of(context).welcome,
isShowDecPage: false, isShowDecPage: false,
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: false,
body: Padding( body: Padding(
padding: EdgeInsets.all(20), padding: EdgeInsets.all(20),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
flex: 6, flex: 6,
child: Column( child: Column(mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
mainAxisAlignment: MainAxisAlignment.spaceEvenly, Image.asset('assets/images/DQ/logo.png', height: 90, width: 90),
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Image.asset('assets/images/DQ/logo.png',
height: 90, width: 90),
AppText( AppText(
TranslationBase.of(context).welcome, TranslationBase.of(context).welcome,
fontSize: 30, fontSize: 30,
@ -74,8 +72,7 @@ class _WelcomeLogin extends State<WelcomeLogin> {
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).yes, TranslationBase.of(context).yes,
() => { () => {
Navigator.of(context) Navigator.of(context).push(FadePage(page: LoginType())),
.push(FadePage(page: LoginType())),
}, },
color: Color(0xFFc5272c), color: Color(0xFFc5272c),
textColor: Colors.white, textColor: Colors.white,
@ -88,8 +85,7 @@ class _WelcomeLogin extends State<WelcomeLogin> {
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).no, TranslationBase.of(context).no,
() => { () => {
Navigator.of(context) Navigator.of(context).push(FadePage(page: Register())),
.push(FadePage(page: Register())),
}, },
)) ))
], ],

@ -40,6 +40,8 @@ class AppScaffold extends StatelessWidget {
final Widget bottomSheet; final Widget bottomSheet;
final bool isLoading; final bool isLoading;
final bool isShowAppBar; final bool isShowAppBar;
final bool showNewAppBar;
final bool showNewAppBarTitle;
final bool hasAppBarParam; final bool hasAppBarParam;
final BaseViewModel baseViewModel; final BaseViewModel baseViewModel;
final bool isBottomBar; final bool isBottomBar;
@ -67,6 +69,8 @@ class AppScaffold extends StatelessWidget {
this.appBarTitle = '', this.appBarTitle = '',
this.isLoading = false, this.isLoading = false,
this.isShowAppBar = false, this.isShowAppBar = false,
this.showNewAppBar = false,
this.showNewAppBarTitle = false,
this.hasAppBarParam, this.hasAppBarParam,
this.bottomSheet, this.bottomSheet,
this.baseViewModel, this.baseViewModel,
@ -98,7 +102,12 @@ class AppScaffold extends StatelessWidget {
AppGlobal.context = context; AppGlobal.context = context;
return Scaffold( return Scaffold(
backgroundColor: backgroundColor ?? Theme.of(context).scaffoldBackgroundColor, backgroundColor: backgroundColor ?? Theme.of(context).scaffoldBackgroundColor,
appBar: isShowAppBar appBar: showNewAppBar
? NewAppBarWidget(
title: appBarTitle,
showTitle: showNewAppBarTitle,
)
: (isShowAppBar
? appBar = AppBarWidget( ? appBar = AppBarWidget(
appBarTitle: appBarTitle, appBarTitle: appBarTitle,
appBarIcons: appBarIcons, appBarIcons: appBarIcons,
@ -109,7 +118,7 @@ class AppScaffold extends StatelessWidget {
showOfferPackagesCart: showOfferPackagesCart, showOfferPackagesCart: showOfferPackagesCart,
isShowDecPage: isShowDecPage, isShowDecPage: isShowDecPage,
) )
: null, : null),
bottomSheet: bottomSheet, bottomSheet: bottomSheet,
body: SafeArea( body: SafeArea(
top: true, top: true,
@ -142,6 +151,39 @@ class AppScaffold extends StatelessWidget {
} }
} }
class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget {
final bool showTitle;
final String title;
NewAppBarWidget({Key key, this.showTitle = false, this.title = ""}) : super(key: key);
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppBar(
elevation: 0,
backgroundColor: Colors.transparent,
automaticallyImplyLeading: false,
title: Row(
children: [
ArrowBack(),
if (showTitle)
Expanded(
child: Text(
title,
maxLines: 1,
style: TextStyle(
fontSize: 24, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
),
)
],
),
);
}
@override
Size get preferredSize => Size(double.maxFinite, 60);
}
class AppBarWidget extends StatefulWidget with PreferredSizeWidget { class AppBarWidget extends StatefulWidget with PreferredSizeWidget {
final AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); final AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();

@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -33,7 +34,93 @@ class _NotAutPageState extends State<NotAutPage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return Scaffold( return AppScaffold(
appBarTitle: widget.title,
isShowDecPage: false,
isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: false,
body: Padding(
padding: EdgeInsets.only(bottom: 20, left: 21, right: 21),
child: Column(children: [
Expanded(
child: ListView(
padding: EdgeInsets.zero,
physics: BouncingScrollPhysics(),
children: [
SizedBox(height: 12),
if (widget.icon != null)
Align(
alignment: Alignment.centerLeft,
child: SvgPicture.asset(
widget.icon,
height: 35,
width: 35,
),
),
SizedBox(height: 16),
Text(
widget.title,
style: TextStyle(fontSize: 24, fontFamily: "Poppins", fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 23 / 24),
),
Text(
widget.description,
style: TextStyle(fontSize: 14, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56, height: 21 / 14),
),
SizedBox(
height: 14,
),
if (!projectViewModel.isInternetConnection)
Center(
child: SizedBox(
height: MediaQuery.of(context).size.height * 0.55,
width: MediaQuery.of(context).size.width * 0.50,
child: Image.asset(projectViewModel.isArabic ? 'assets/images/Wifi-AR.png' : 'assets/images/wifi-EN.png'),
),
),
if (projectViewModel.isInternetConnection && widget.imagesInfo != null)
CarouselSlider(
items: widget.imagesInfo.map((image) {
return Builder(
builder: (BuildContext context) {
return SizedBox(
width: MediaQuery.of(context).size.width * 0.50,
child: image.isAsset ? Image.asset(projectViewModel.isArabic ? image.imageAr : image.imageEn) : Image.network(projectViewModel.isArabic ? image.imageAr : image.imageEn));
},
);
}).toList(),
options: CarouselOptions(
height: MediaQuery.of(context).size.height * 0.55,
autoPlay: widget.imagesInfo.length > 1,
viewportFraction: 1.0,
),
),
],
),
),
SizedBox(
height: 43,
width: double.infinity,
child: FlatButton(
onPressed: () {
loginCheck(context);
},
child: Text(
TranslationBase.of(context).loginregister,
style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.48),
),
// color: Color(0xffD02127),
color: Color(0xffD02127),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(6),
),
),
),
]),
),
);
Scaffold(
backgroundColor: Color(0xfff8f8f8), backgroundColor: Color(0xfff8f8f8),
resizeToAvoidBottomPadding: false, resizeToAvoidBottomPadding: false,
appBar: AppBar( appBar: AppBar(

Loading…
Cancel
Save