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,14 +602,13 @@ 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: () { changeCurrentTab(2);
changeCurrentTab(2); })
}) : null);
: null);
} }
triggerRobot() { triggerRobot() {

@ -117,110 +117,145 @@ class _ConfirmLogin extends State<ConfirmLogin> {
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
children: [ children: [
SizedBox(height: 12), SizedBox(height: 12),
Text( if (user != null)
TranslationBase.of(context).welcomeBack, Column(
style: TextStyle(fontSize: 12, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64),
),
Text(
user.name.toLowerCase().capitalizeFirstofEach,
style: TextStyle(fontSize: 24, fontFamily: "Poppins", fontWeight: FontWeight.w700, color: Color(0xff2B353E), height: 1, letterSpacing: -1.44),
),
SizedBox(height: 10),
Text(
TranslationBase.of(context).accountInfo,
style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 25 / 16),
),
Container(
height: 72,
margin: 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, mainAxisSize: MainAxisSize.min,
children: [ children: [
Row( Text(
mainAxisAlignment: MainAxisAlignment.spaceBetween, TranslationBase.of(context).welcomeBack,
crossAxisAlignment: CrossAxisAlignment.center, style: TextStyle(fontSize: 12, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64),
children: [
Text(
TranslationBase.of(context).lastLoginAt.toCamelCase,
style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64),
),
Text(
user.editedOn != null
? formatDateToDate(DateUtil.convertStringToDate(user.editedOn))
: user.createdOn != null
? formatDateToDate(DateUtil.convertStringToDate(user.createdOn))
: '--',
style: TextStyle(fontSize: 12, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48),
),
],
), ),
Row( Text(
mainAxisAlignment: MainAxisAlignment.spaceBetween, user.name.toLowerCase().capitalizeFirstofEach,
crossAxisAlignment: CrossAxisAlignment.center, style: TextStyle(fontSize: 24, fontFamily: "Poppins", fontWeight: FontWeight.w700, color: Color(0xff2B353E), height: 1, letterSpacing: -1.44),
children: [ ),
Text( SizedBox(height: 10),
TranslationBase.of(context).lastLoginWith.toCamelCase, Text(
style: TextStyle( TranslationBase.of(context).accountInfo,
fontSize: 10, style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 25 / 16),
fontFamily: "Poppins", ),
fontWeight: FontWeight.w600, Container(
color: Color(0xff575757), height: 72,
), margin: 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,
), ),
Text( ),
" " + getType(user.logInType, context), child: Column(
style: TextStyle( mainAxisSize: MainAxisSize.min,
fontSize: 12, children: [
fontFamily: "Poppins", Row(
fontWeight: FontWeight.w600, mainAxisAlignment: MainAxisAlignment.spaceBetween,
color: Color(0xff2B353E), crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
TranslationBase.of(context).lastLoginAt.toCamelCase,
style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64),
),
Text(
user.editedOn != null
? formatDateToDate(DateUtil.convertStringToDate(user.editedOn))
: user.createdOn != null
? formatDateToDate(DateUtil.convertStringToDate(user.createdOn))
: '--',
style: TextStyle(fontSize: 12, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48),
),
],
), ),
), Row(
Expanded(child: SizedBox()), mainAxisAlignment: MainAxisAlignment.spaceBetween,
Text( crossAxisAlignment: CrossAxisAlignment.center,
user.editedOn != null children: [
? formatDateToTime(DateUtil.convertStringToDate(user.editedOn)) Text(
: user.createdOn != null TranslationBase.of(context).lastLoginWith.toCamelCase,
? formatDateToTime(DateUtil.convertStringToDate(user.createdOn)) style: TextStyle(
: '--', fontSize: 10,
style: TextStyle(fontSize: 12, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.48), fontFamily: "Poppins",
), fontWeight: FontWeight.w600,
color: Color(0xff575757),
),
),
Text(
" " + getType(user.logInType, context),
style: TextStyle(
fontSize: 12,
fontFamily: "Poppins",
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
),
),
Expanded(child: SizedBox()),
Text(
user.editedOn != null
? formatDateToTime(DateUtil.convertStringToDate(user.editedOn))
: user.createdOn != null
? formatDateToTime(DateUtil.convertStringToDate(user.createdOn))
: '--',
style: TextStyle(fontSize: 12, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.48),
),
],
)
],
),
),
Text(
TranslationBase.of(context).pleaseVerify,
style: TextStyle(fontSize: 16, fontFamily: "Poppins", 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: [
getButton(3),
getButton(2),
getButton(1),
getButton(4),
], ],
) )
], ],
), )
), else
Text( Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
TranslationBase.of(context).pleaseVerify, Image.asset(
style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64), 'assets/images/habib-logo.png',
), height: 90,
GridView( width: 90,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9), ),
physics: NeverScrollableScrollPhysics(), this.onlySMSBox == false
padding: EdgeInsets.only(top: 9), ? Texts(
shrinkWrap: true, TranslationBase.of(context).verifyLoginWith,
children: [ fontSize: SizeConfig.textMultiplier * 3.5,
getButton(3), textAlign: TextAlign.left,
getButton(2), )
getButton(1), : Texts(
getButton(4), 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,37 +30,35 @@ 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, AppText(
children: <Widget>[ TranslationBase.of(context).welcome,
Image.asset('assets/images/DQ/logo.png', fontSize: 30,
height: 90, width: 90), fontWeight: FontWeight.bold,
AppText( ),
TranslationBase.of(context).welcome, AppText(
fontSize: 30, TranslationBase.of(context).welcomeText,
fontWeight: FontWeight.bold, fontSize: 24,
), textAlign: TextAlign.start,
AppText( ),
TranslationBase.of(context).welcomeText, AppText(
fontSize: 24, TranslationBase.of(context).welcomeText2,
textAlign: TextAlign.start, fontSize: 24,
), textAlign: TextAlign.start,
AppText( ),
TranslationBase.of(context).welcomeText2, SizedBox(
fontSize: 24, height: SizeConfig.realScreenHeight * .15,
textAlign: TextAlign.start, )
), ]),
SizedBox(
height: SizeConfig.realScreenHeight * .15,
)
]),
), ),
Expanded( Expanded(
flex: 2, flex: 2,
@ -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,18 +102,23 @@ 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
? appBar = AppBarWidget( ? NewAppBarWidget(
appBarTitle: appBarTitle, title: appBarTitle,
appBarIcons: appBarIcons, showTitle: showNewAppBarTitle,
showHomeAppBarIcon: showHomeAppBarIcon,
isPharmacy: isPharmacy,
showPharmacyCart: showPharmacyCart,
isOfferPackages: isOfferPackages,
showOfferPackagesCart: showOfferPackagesCart,
isShowDecPage: isShowDecPage,
) )
: null, : (isShowAppBar
? appBar = AppBarWidget(
appBarTitle: appBarTitle,
appBarIcons: appBarIcons,
showHomeAppBarIcon: showHomeAppBarIcon,
isPharmacy: isPharmacy,
showPharmacyCart: showPharmacyCart,
isOfferPackages: isOfferPackages,
showOfferPackagesCart: showOfferPackagesCart,
isShowDecPage: isShowDecPage,
)
: 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