login chnages

merge-requests/140/head
Sultan Khan 4 years ago
parent c65983bfdb
commit 68f7a9ff9c

@ -207,7 +207,6 @@ void setupLocator() {
locator.registerLazySingleton(() => OrderDetailsService()); locator.registerLazySingleton(() => OrderDetailsService());
locator.registerLazySingleton(() => CustomerAddressesService()); locator.registerLazySingleton(() => CustomerAddressesService());
// locator.registerLazySingleton(() => TermsConditionService()); // locator.registerLazySingleton(() => TermsConditionService());
locator.registerLazySingleton(() => PrivilegeService());
locator.registerLazySingleton(() => TermsConditionService()); locator.registerLazySingleton(() => TermsConditionService());
locator.registerLazySingleton(() => CancelOrderService()); locator.registerLazySingleton(() => CancelOrderService());
locator.registerLazySingleton(() => PrivilegeService()); locator.registerLazySingleton(() => PrivilegeService());

@ -27,7 +27,7 @@ class AddFamilyMemberType extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Image.asset( Image.asset(
'assets/images/DQ/dq_logo_icon.png', 'assets/images/habib-logo.png',
height: 80, height: 80,
width: 80, width: 80,
), ),

@ -109,7 +109,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Image.asset( Image.asset(
'assets/images/DQ/dq_logo_icon.png', 'assets/images/habib-logo.png',
height: 90, height: 90,
width: 90, width: 90,
), ),
@ -173,7 +173,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Image.asset( Image.asset(
'assets/images/DQ/dq_logo_icon.png', 'assets/images/habib-logo.png',
height: 90, height: 90,
width: 90, width: 90,
), ),
@ -510,8 +510,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
.then((result) => { .then((result) => {
if (result is Map) if (result is Map)
{ {
projectViewModel.setPrivilege(privilegeList: result), result = CheckActivationCode.fromJson(result),
result = CheckActivationCode.fromJson(result),
if (this.registerd_data != null && if (this.registerd_data != null &&
this.registerd_data.isRegister == true) this.registerd_data.isRegister == true)
{ {
@ -582,8 +581,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
}); });
} }
goToHome() async { goToHome() {
await authenticatedUserObject.getUser(getUser: true);
authenticatedUserObject.isLogin = true; authenticatedUserObject.isLogin = true;
appointmentRateViewModel.isLogin = true; appointmentRateViewModel.isLogin = true;
projectViewModel.isLogin = true; projectViewModel.isLogin = true;
@ -634,11 +632,10 @@ class _ConfirmLogin extends State<ConfirmLogin> {
return InkWell( return InkWell(
onTap: () => {authenticateUser(4, true)}, onTap: () => {authenticateUser(4, true)},
child: RoundedContainer( child: RoundedContainer(
height: 140,
borderColor: Colors.grey, borderColor: Colors.grey,
showBorder: true, showBorder: true,
child: Padding( child: Padding(
padding: EdgeInsets.fromLTRB(5, 15, 5, 15), padding: EdgeInsets.fromLTRB(30, 15, 30, 15),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Image.asset( Image.asset(
@ -661,11 +658,10 @@ class _ConfirmLogin extends State<ConfirmLogin> {
return InkWell( return InkWell(
onTap: () => {authenticateUser(1, true)}, onTap: () => {authenticateUser(1, true)},
child: RoundedContainer( child: RoundedContainer(
height: 140,
borderColor: Colors.grey, borderColor: Colors.grey,
showBorder: true, showBorder: true,
child: Padding( child: Padding(
padding: EdgeInsets.fromLTRB(5, 15, 5, 15), padding: EdgeInsets.fromLTRB(30, 15, 30, 15),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
@ -676,16 +672,14 @@ class _ConfirmLogin extends State<ConfirmLogin> {
), ),
projectViewModel.isArabic projectViewModel.isArabic
? SizedBox( ? SizedBox(
height: 20, height: 0,
) )
: SizedBox( : SizedBox(
height: 20, height: 20,
), ),
AppText( AppText(
TranslationBase.of(context).verifySMS, TranslationBase.of(context).verifySMS,
fontSize: projectViewModel.isArabic fontSize: SizeConfig.textMultiplier * 2,
? SizeConfig.textMultiplier * 1.8
: SizeConfig.textMultiplier * 2,
textAlign: TextAlign.center, textAlign: TextAlign.center,
) )
], ],
@ -696,14 +690,13 @@ class _ConfirmLogin extends State<ConfirmLogin> {
return InkWell( return InkWell(
onTap: () => {authenticateUser(2, BiometricType.fingerprint.index)}, onTap: () => {authenticateUser(2, BiometricType.fingerprint.index)},
child: RoundedContainer( child: RoundedContainer(
height: 140,
backgroundColor: BiometricType.fingerprint.index == 1 backgroundColor: BiometricType.fingerprint.index == 1
? Colors.white ? Colors.white
: Colors.white.withOpacity(.7), : Colors.white.withOpacity(.7),
borderColor: Colors.grey, borderColor: Colors.grey,
showBorder: true, showBorder: true,
child: Padding( child: Padding(
padding: EdgeInsets.fromLTRB(5, 15, 5, 15), padding: EdgeInsets.fromLTRB(30, 15, 30, 15),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Image.asset( Image.asset(
@ -726,14 +719,13 @@ class _ConfirmLogin extends State<ConfirmLogin> {
return InkWell( return InkWell(
onTap: () => {authenticateUser(3, BiometricType.face.index)}, onTap: () => {authenticateUser(3, BiometricType.face.index)},
child: RoundedContainer( child: RoundedContainer(
height: 140,
backgroundColor: checkIfBiometricAvailable(BiometricType.face) backgroundColor: checkIfBiometricAvailable(BiometricType.face)
? Colors.white ? Colors.white
: Colors.white.withOpacity(.7), : Colors.white.withOpacity(.7),
borderColor: Colors.grey, borderColor: Colors.grey,
showBorder: true, showBorder: true,
child: Padding( child: Padding(
padding: EdgeInsets.fromLTRB(5, 15, 5, 15), padding: EdgeInsets.fromLTRB(30, 15, 30, 15),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
@ -762,14 +754,13 @@ class _ConfirmLogin extends State<ConfirmLogin> {
}) })
}, },
child: RoundedContainer( child: RoundedContainer(
height: 140,
backgroundColor: BiometricType.fingerprint.index == 1 backgroundColor: BiometricType.fingerprint.index == 1
? Colors.white ? Colors.white
: Colors.white.withOpacity(.7), : Colors.white.withOpacity(.7),
borderColor: Colors.grey, borderColor: Colors.grey,
showBorder: true, showBorder: true,
child: Padding( child: Padding(
padding: EdgeInsets.fromLTRB(5, 15, 5, 15), padding: EdgeInsets.fromLTRB(0, 0, 0, 5),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Image.asset( Image.asset(
@ -782,7 +773,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
height: 15, height: 15,
) )
: SizedBox( : SizedBox(
height: 10, height: 20,
), ),
AppText( AppText(
TranslationBase.of(context).moreVerification, TranslationBase.of(context).moreVerification,

@ -8,8 +8,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart'; import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_loader_widget.dart'; import 'package:diplomaticquarterapp/widgets/progress_indicator/app_loader_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:diplomaticquarterapp/widgets/robo-search/robosearch.dart';
import 'package:diplomaticquarterapp/widgets/robo-search/search.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
@ -38,22 +37,22 @@ class PharmacyAppScaffold extends StatelessWidget {
final Color backgroundColor; final Color backgroundColor;
AuthenticatedUserObject authenticatedUserObject = AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>(); locator<AuthenticatedUserObject>();
PharmacyAppScaffold( PharmacyAppScaffold(
{@required this.body, {@required this.body,
this.appBarTitle = '', this.appBarTitle = '',
this.isLoading = false, this.isLoading = false,
this.isShowAppBar = false, this.isShowAppBar = false,
this.hasAppBarParam, this.hasAppBarParam,
this.bottomSheet, this.bottomSheet,
this.baseViewModel, this.baseViewModel,
this.floatingActionButton, this.floatingActionButton,
this.title, this.title,
this.description, this.description,
this.isShowDecPage = true, this.isShowDecPage = true,
this.isBottomBar, this.isBottomBar,
this.backgroundColor}); this.backgroundColor});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -61,38 +60,38 @@ class PharmacyAppScaffold extends StatelessWidget {
return Scaffold( return Scaffold(
backgroundColor: backgroundColor:
backgroundColor ?? Theme.of(context).scaffoldBackgroundColor, backgroundColor ?? Theme.of(context).scaffoldBackgroundColor,
appBar: isShowAppBar appBar: isShowAppBar
? AppBar( ? AppBar(
elevation: 0, elevation: 0,
backgroundColor: Color(0xff5AB145), backgroundColor: Color(0xff5AB145),
textTheme: TextTheme( textTheme: TextTheme(
headline6: headline6:
TextStyle(color: Colors.white, fontWeight: FontWeight.bold), TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
), ),
title: Text(authenticatedUserObject.isLogin title: Text(authenticatedUserObject.isLogin
? appBarTitle.toUpperCase() ? appBarTitle.toUpperCase()
: TranslationBase.of(context).serviceInformationTitle), : TranslationBase.of(context).serviceInformationTitle),
leading: Builder( leading: Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
return ArrowBack(); return ArrowBack();
}, },
), ),
centerTitle: true, centerTitle: true,
actions: <Widget>[], actions: <Widget>[],
) )
: null, : null,
body: (!authenticatedUserObject.isLogin && isShowDecPage) body: (!authenticatedUserObject.isLogin && isShowDecPage)
? NotAutPage( ? NotAutPage(
title: appBarTitle, title: appBarTitle,
description: description, description: description,
) )
: baseViewModel != null : baseViewModel != null
? NetworkBaseView( ? NetworkBaseView(
child: buildBodyWidget(), child: buildBodyWidget(),
baseViewModel: baseViewModel, baseViewModel: baseViewModel,
) )
: buildBodyWidget(), : buildBodyWidget(),
bottomSheet: bottomSheet, bottomSheet: bottomSheet,
floatingActionButton: floatingActionButton ?? floatingActionButton, floatingActionButton: floatingActionButton ?? floatingActionButton,
// bottomNavigationBar: // bottomNavigationBar:

@ -12,8 +12,6 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart'; import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_loader_widget.dart'; import 'package:diplomaticquarterapp/widgets/progress_indicator/app_loader_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:diplomaticquarterapp/widgets/robo-search/robosearch.dart';
import 'package:diplomaticquarterapp/widgets/robo-search/search.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
@ -49,27 +47,26 @@ class DetailPageScafold extends StatefulWidget {
final List<Widget> appBarIcons; final List<Widget> appBarIcons;
final PreferredSizeWidget appBarWidget; final PreferredSizeWidget appBarWidget;
DetailPageScafold( DetailPageScafold(
{@required this.body, {@required this.body,
this.appBarTitle = '', this.appBarTitle = '',
this.isLoading = false, this.isLoading = false,
this.isShowAppBar = false, this.isShowAppBar = false,
this.hasAppBarParam, this.hasAppBarParam,
this.bottomSheet, this.bottomSheet,
this.baseViewModel, this.baseViewModel,
this.floatingActionButton, this.floatingActionButton,
this.isPharmacy = false, this.isPharmacy = false,
this.title, this.title,
this.description, this.description,
this.isShowDecPage = true, this.isShowDecPage = true,
this.isBottomBar, this.isBottomBar,
this.backgroundColor, this.backgroundColor,
this.preferredSize = 0.0, this.preferredSize = 0.0,
this.appBarIcons, this.appBarIcons,
this.appBarWidget, this.appBarWidget,
this.image, this.image,
this.infoList}); this.infoList});
@override @override
_DetailPageScafoldState createState() => _DetailPageScafoldState(); _DetailPageScafoldState createState() => _DetailPageScafoldState();
@ -77,7 +74,7 @@ class DetailPageScafold extends StatefulWidget {
class _DetailPageScafoldState extends State<DetailPageScafold> { class _DetailPageScafoldState extends State<DetailPageScafold> {
AuthenticatedUserObject authenticatedUserObject = AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>(); locator<AuthenticatedUserObject>();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -96,29 +93,29 @@ class _DetailPageScafoldState extends State<DetailPageScafold> {
appBar = widget.preferredSize == 0 appBar = widget.preferredSize == 0
? appBarWidget ? appBarWidget
: PreferredSize( : PreferredSize(
child: appBarWidget, child: appBarWidget,
preferredSize: Size.fromHeight(widget.preferredSize)); preferredSize: Size.fromHeight(widget.preferredSize));
} else { } else {
appBar = this.widget.appBarWidget; appBar = this.widget.appBarWidget;
} }
return Scaffold( return Scaffold(
backgroundColor: backgroundColor:
widget.backgroundColor ?? Theme.of(context).scaffoldBackgroundColor, widget.backgroundColor ?? Theme.of(context).scaffoldBackgroundColor,
appBar: appBar, appBar: appBar,
body: (!Provider.of<ProjectViewModel>(context, listen: false).isLogin && body: (!Provider.of<ProjectViewModel>(context, listen: false).isLogin &&
widget.isShowDecPage) widget.isShowDecPage)
? NotAutPage( ? NotAutPage(
title: widget.appBarTitle, title: widget.appBarTitle,
description: widget.description, description: widget.description,
infoList: widget.infoList, infoList: widget.infoList,
) )
: widget.baseViewModel != null : widget.baseViewModel != null
? NetworkBaseView( ? NetworkBaseView(
child: buildBodyWidget(), child: buildBodyWidget(),
baseViewModel: widget.baseViewModel, baseViewModel: widget.baseViewModel,
) )
: buildBodyWidget(), : buildBodyWidget(),
bottomSheet: widget.bottomSheet, bottomSheet: widget.bottomSheet,
//floatingActionButton: floatingActionButton ?? floatingActionButton, //floatingActionButton: floatingActionButton ?? floatingActionButton,
// bottomNavigationBar: // bottomNavigationBar:
@ -141,7 +138,7 @@ class _DetailPageScafoldState extends State<DetailPageScafold> {
class AppBarWidget extends StatelessWidget with PreferredSizeWidget { class AppBarWidget extends StatelessWidget with PreferredSizeWidget {
final AuthenticatedUserObject authenticatedUserObject = final AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>(); locator<AuthenticatedUserObject>();
final String appBarTitle; final String appBarTitle;
final List<Widget> appBarIcons; final List<Widget> appBarIcons;
@ -161,81 +158,79 @@ class AppBarWidget extends StatelessWidget with PreferredSizeWidget {
Widget buildAppBar(BuildContext context) { Widget buildAppBar(BuildContext context) {
return isShowAppBar return isShowAppBar
? AppBar( ? AppBar(
elevation: 0, elevation: 0,
backgroundColor:Colors.white, backgroundColor: Colors.white,
// isPharmacy ? Colors.green : Theme.of(context).appBarTheme.color, // isPharmacy ? Colors.green : Theme.of(context).appBarTheme.color,
textTheme: TextTheme( textTheme: TextTheme(
headline6: headline6:
TextStyle(color: Colors.white, fontWeight: FontWeight.bold), TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
), ),
title: Texts( title: Texts(
authenticatedUserObject.isLogin || !isShowDecPage authenticatedUserObject.isLogin || !isShowDecPage
? appBarTitle.toUpperCase() ? appBarTitle.toUpperCase()
: TranslationBase.of(context).serviceInformationTitle, : TranslationBase.of(context).serviceInformationTitle,
color: Colors.white, color: Colors.white,
bold: true, bold: true,
),
leading: Builder(
builder: (BuildContext context) {
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap:()=> Navigator.pop(context),
child: Icon(Icons.arrow_back_ios, color: Colors.grey),
);
},
),
centerTitle: true,
actions: <Widget>[
isPharmacy
? IconButton(
icon: Icon(Icons.shopping_cart),
color: Colors.grey,
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => CartOrderPage()),
);
// Navigator.of(context)
// .popUntil(ModalRoute.withName('/'));
})
: Container(),
image != null
? InkWell(
onTap: () => Navigator.push(
context,
FadePage(
page: InsuranceUpdate(),
), ),
), leading: Builder(
child: Padding( builder: (BuildContext context) {
padding: const EdgeInsets.all(8.0), return GestureDetector(
child: Image.asset( behavior: HitTestBehavior.opaque,
image, onTap: () => Navigator.pop(context),
height: SizeConfig.heightMultiplier * 5, child: Icon(Icons.arrow_back_ios, color: Colors.grey),
width: SizeConfig.heightMultiplier * 5, );
color: Colors.grey, },
), ),
), centerTitle: true,
) actions: <Widget>[
: IconButton( isPharmacy
icon: Icon(FontAwesomeIcons.ellipsisV), ? IconButton(
color: Colors.grey, icon: Icon(Icons.shopping_cart),
onPressed: () { color: Colors.grey,
settingModalBottomSheet(context); onPressed: () {
}, Navigator.push(
), context,
if (appBarIcons != null) ...appBarIcons MaterialPageRoute(
], builder: (context) => CartOrderPage()),
) );
// Navigator.of(context)
// .popUntil(ModalRoute.withName('/'));
})
: Container(),
image != null
? InkWell(
onTap: () => Navigator.push(
context,
FadePage(
page: InsuranceUpdate(),
),
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset(
image,
height: SizeConfig.heightMultiplier * 5,
width: SizeConfig.heightMultiplier * 5,
color: Colors.grey,
),
),
)
: IconButton(
icon: Icon(FontAwesomeIcons.ellipsisV),
color: Colors.grey,
onPressed: () {
settingModalBottomSheet(context);
},
),
if (appBarIcons != null) ...appBarIcons
],
)
: Container( : Container(
height: 0, height: 0,
width: 0, width: 0,
); );
} }
@override @override
Size get preferredSize => Size(double.maxFinite, 60); Size get preferredSize => Size(double.maxFinite, 60);
} }

Loading…
Cancel
Save