@ -58,8 +58,7 @@ class AppScaffold extends StatelessWidget {
final List < Widget > appBarIcons ;
final List < Widget > appBarIcons ;
final List < ImagesInfo > imagesInfo ;
final List < ImagesInfo > imagesInfo ;
final bool isHelp ;
final bool isHelp ;
AuthenticatedUserObject authenticatedUserObject =
AuthenticatedUserObject authenticatedUserObject = locator < AuthenticatedUserObject > ( ) ;
locator < AuthenticatedUserObject > ( ) ;
AppBarWidget appBar ;
AppBarWidget appBar ;
AppScaffold (
AppScaffold (
@ -96,8 +95,7 @@ class AppScaffold extends StatelessWidget {
Widget build ( BuildContext context ) {
Widget build ( BuildContext context ) {
AppGlobal . context = context ;
AppGlobal . context = context ;
return Scaffold (
return Scaffold (
backgroundColor:
backgroundColor: backgroundColor ? ? Theme . of ( context ) . scaffoldBackgroundColor ,
backgroundColor ? ? Theme . of ( context ) . scaffoldBackgroundColor ,
appBar: isShowAppBar
appBar: isShowAppBar
? appBar = AppBarWidget (
? appBar = AppBarWidget (
appBarTitle: appBarTitle ,
appBarTitle: appBarTitle ,
@ -114,9 +112,7 @@ class AppScaffold extends StatelessWidget {
body: SafeArea (
body: SafeArea (
top: true ,
top: true ,
bottom: true ,
bottom: true ,
child:
child: ( ! Provider . of < ProjectViewModel > ( context , listen: false ) . isLogin & & isShowDecPage )
( ! Provider . of < ProjectViewModel > ( context , listen: false ) . isLogin & &
isShowDecPage )
? NotAutPage (
? NotAutPage (
title: title ? ? appBarTitle ,
title: title ? ? appBarTitle ,
description: description ,
description: description ,
@ -130,6 +126,7 @@ class AppScaffold extends StatelessWidget {
)
)
: buildBodyWidget ( context ) ,
: buildBodyWidget ( context ) ,
) ,
) ,
floatingActionButton: floatingActionButton ,
) ;
) ;
}
}
@ -138,14 +135,12 @@ class AppScaffold extends StatelessWidget {
}
}
buildBodyWidget ( context ) {
buildBodyWidget ( context ) {
return Stack (
return Stack ( children: < Widget > [ body , isHelp = = true ? RobotIcon ( ) : Container ( ) ] ) ;
children: < Widget > [ body , isHelp = = true ? RobotIcon ( ) : Container ( ) ] ) ;
}
}
}
}
class AppBarWidget extends StatefulWidget with PreferredSizeWidget {
class AppBarWidget extends StatefulWidget with PreferredSizeWidget {
final AuthenticatedUserObject authenticatedUserObject =
final AuthenticatedUserObject authenticatedUserObject = locator < AuthenticatedUserObject > ( ) ;
locator < AuthenticatedUserObject > ( ) ;
final String appBarTitle ;
final String appBarTitle ;
final bool showHomeAppBarIcon ;
final bool showHomeAppBarIcon ;
@ -193,22 +188,12 @@ class AppBarWidgetState extends State<AppBarWidget> {
ProjectViewModel projectViewModel = Provider . of ( context ) ;
ProjectViewModel projectViewModel = Provider . of ( context ) ;
return AppBar (
return AppBar (
elevation: 0 ,
elevation: 0 ,
backgroundColor: widget . isPharmacy
backgroundColor: widget . isPharmacy ? Colors . green : Theme . of ( context ) . appBarTheme . color ,
? Colors . green
: Theme . of ( context ) . appBarTheme . color ,
textTheme: TextTheme (
textTheme: TextTheme (
headline6: TextStyle (
headline6: TextStyle ( color: Theme . of ( context ) . textTheme . headline1 . color , fontWeight: FontWeight . bold ) ,
color: Theme . of ( context ) . textTheme . headline1 . color ,
fontWeight: FontWeight . bold ) ,
) ,
) ,
title: Text (
title: Text ( widget . authenticatedUserObject . isLogin | | ! widget . isShowDecPage ? widget . appBarTitle . toUpperCase ( ) : TranslationBase . of ( context ) . serviceInformationTitle ,
widget . authenticatedUserObject . isLogin | | ! widget . isShowDecPage
style: TextStyle ( fontWeight: FontWeight . bold , color: Theme . of ( context ) . textTheme . headline1 . color , fontFamily: projectViewModel . isArabic ? ' Cairo ' : ' WorkSans ' ) ) ,
? widget . appBarTitle . toUpperCase ( )
: TranslationBase . of ( context ) . serviceInformationTitle ,
style: TextStyle (
fontWeight: FontWeight . bold ,
color: Theme . of ( context ) . textTheme . headline1 . color ,
fontFamily: projectViewModel . isArabic ? ' Cairo ' : ' WorkSans ' ) ) ,
leading: Builder (
leading: Builder (
builder: ( BuildContext context ) {
builder: ( BuildContext context ) {
return ArrowBack ( ) ;
return ArrowBack ( ) ;
@ -218,9 +203,7 @@ class AppBarWidgetState extends State<AppBarWidget> {
actions: < Widget > [
actions: < Widget > [
( widget . isPharmacy & & widget . showPharmacyCart )
( widget . isPharmacy & & widget . showPharmacyCart )
? IconButton (
? IconButton (
icon: Badge (
icon: Badge ( badgeContent: Text ( badgeText ) , child: Icon ( Icons . shopping_cart ) ) ,
badgeContent: Text ( badgeText ) ,
child: Icon ( Icons . shopping_cart ) ) ,
color: Colors . white ,
color: Colors . white ,
onPressed: ( ) {
onPressed: ( ) {
Navigator . of ( context ) . popUntil ( ModalRoute . withName ( ' / ' ) ) ;
Navigator . of ( context ) . popUntil ( ModalRoute . withName ( ' / ' ) ) ;
@ -232,10 +215,7 @@ class AppBarWidgetState extends State<AppBarWidget> {
position: BadgePosition . topStart ( top: - 15 , start: - 10 ) ,
position: BadgePosition . topStart ( top: - 15 , start: - 10 ) ,
badgeContent: Text (
badgeContent: Text (
badgeText ,
badgeText ,
style: TextStyle (
style: TextStyle ( fontSize: 9 , color: Colors . white , fontWeight: FontWeight . normal ) ,
fontSize: 9 ,
color: Colors . white ,
fontWeight: FontWeight . normal ) ,
) ,
) ,
child: Icon ( Icons . shopping_cart ) ) ,
child: Icon ( Icons . shopping_cart ) ) ,
color: Colors . white ,
color: Colors . white ,
@ -249,10 +229,7 @@ class AppBarWidgetState extends State<AppBarWidget> {
icon: Icon ( FontAwesomeIcons . home ) ,
icon: Icon ( FontAwesomeIcons . home ) ,
color: Colors . white ,
color: Colors . white ,
onPressed: ( ) {
onPressed: ( ) {
Navigator . pushAndRemoveUntil (
Navigator . pushAndRemoveUntil ( context , MaterialPageRoute ( builder: ( context ) = > LandingPage ( ) ) , ( Route < dynamic > r ) = > false ) ;
context ,
MaterialPageRoute ( builder: ( context ) = > LandingPage ( ) ) ,
( Route < dynamic > r ) = > false ) ;
/ / Cart Click Event
/ / Cart Click Event
if ( _onCartClick ! = null ) _onCartClick ( ) ;
if ( _onCartClick ! = null ) _onCartClick ( ) ;
@ -316,18 +293,11 @@ class _RobotIcon extends State<RobotIcon> {
] ,
] ,
) ,
) ,
child: TyperAnimatedTextKit (
child: TyperAnimatedTextKit (
text: Provider . of < ProjectViewModel > ( context ,
text: Provider . of < ProjectViewModel > ( context , listen: false ) . isArabic = = true
listen: false )
. isArabic = =
true
? " هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي. "
? " هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي. "
: " Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file. " ,
: " Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file. " ,
textLength: Provider . of < ProjectViewModel > ( context ,
textLength: Provider . of < ProjectViewModel > ( context , listen: false ) . isArabic = = true
listen: false )
? " هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي. " . length
. isArabic = =
true
? " هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي. "
. length
: " Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file. "
: " Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file. "
. length ) )
. length ) )
: Container ( ) ,
: Container ( ) ,