|
|
@ -13,8 +13,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';
|
|
|
@ -67,7 +65,8 @@ class AppScaffold extends StatelessWidget {
|
|
|
|
this.backgroundColor,
|
|
|
|
this.backgroundColor,
|
|
|
|
this.preferredSize = 0.0,
|
|
|
|
this.preferredSize = 0.0,
|
|
|
|
this.appBarIcons,
|
|
|
|
this.appBarIcons,
|
|
|
|
this.infoList, this.imagesInfo});
|
|
|
|
this.infoList,
|
|
|
|
|
|
|
|
this.imagesInfo});
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
@ -75,12 +74,14 @@ class AppScaffold extends StatelessWidget {
|
|
|
|
return Scaffold(
|
|
|
|
return Scaffold(
|
|
|
|
backgroundColor:
|
|
|
|
backgroundColor:
|
|
|
|
backgroundColor ?? Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
backgroundColor ?? Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
appBar: isShowAppBar? AppBarWidget(
|
|
|
|
appBar: isShowAppBar
|
|
|
|
appBarTitle:appBarTitle,
|
|
|
|
? AppBarWidget(
|
|
|
|
appBarIcons:appBarIcons,
|
|
|
|
appBarTitle: appBarTitle,
|
|
|
|
|
|
|
|
appBarIcons: appBarIcons,
|
|
|
|
isPharmacy: isPharmacy,
|
|
|
|
isPharmacy: isPharmacy,
|
|
|
|
isShowDecPage: isShowDecPage,
|
|
|
|
isShowDecPage: isShowDecPage,
|
|
|
|
):null,
|
|
|
|
)
|
|
|
|
|
|
|
|
: null,
|
|
|
|
bottomSheet: bottomSheet,
|
|
|
|
bottomSheet: bottomSheet,
|
|
|
|
body: (!Provider.of<ProjectViewModel>(context, listen: false).isLogin &&
|
|
|
|
body: (!Provider.of<ProjectViewModel>(context, listen: false).isLogin &&
|
|
|
|
isShowDecPage)
|
|
|
|
isShowDecPage)
|
|
|
@ -102,7 +103,6 @@ class AppScaffold extends StatelessWidget {
|
|
|
|
buildAppLoaderWidget(bool isLoading) {
|
|
|
|
buildAppLoaderWidget(bool isLoading) {
|
|
|
|
return isLoading ? AppLoaderWidget() : Container();
|
|
|
|
return isLoading ? AppLoaderWidget() : Container();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class AppBarWidget extends StatelessWidget with PreferredSizeWidget {
|
|
|
|
class AppBarWidget extends StatelessWidget with PreferredSizeWidget {
|
|
|
@ -114,8 +114,11 @@ class AppBarWidget extends StatelessWidget with PreferredSizeWidget {
|
|
|
|
final bool isPharmacy;
|
|
|
|
final bool isPharmacy;
|
|
|
|
final bool isShowDecPage;
|
|
|
|
final bool isShowDecPage;
|
|
|
|
|
|
|
|
|
|
|
|
AppBarWidget({this.appBarTitle, this.appBarIcons,
|
|
|
|
AppBarWidget(
|
|
|
|
this.isPharmacy = true, this.isShowDecPage = true});
|
|
|
|
{this.appBarTitle,
|
|
|
|
|
|
|
|
this.appBarIcons,
|
|
|
|
|
|
|
|
this.isPharmacy = true,
|
|
|
|
|
|
|
|
this.isShowDecPage = true});
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
@ -129,8 +132,7 @@ class AppBarWidget extends StatelessWidget with PreferredSizeWidget {
|
|
|
|
backgroundColor:
|
|
|
|
backgroundColor:
|
|
|
|
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: Text(
|
|
|
|
title: Text(
|
|
|
|
authenticatedUserObject.isLogin || !isShowDecPage
|
|
|
|
authenticatedUserObject.isLogin || !isShowDecPage
|
|
|
@ -139,8 +141,7 @@ class AppBarWidget extends StatelessWidget with PreferredSizeWidget {
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
fontFamily:
|
|
|
|
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans')),
|
|
|
|
projectViewModel.isArabic ? 'Cairo' : 'WorkSans')),
|
|
|
|
|
|
|
|
leading: Builder(
|
|
|
|
leading: Builder(
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
return ArrowBack();
|
|
|
|
return ArrowBack();
|
|
|
@ -153,8 +154,7 @@ class AppBarWidget extends StatelessWidget with PreferredSizeWidget {
|
|
|
|
icon: Icon(Icons.shopping_cart),
|
|
|
|
icon: Icon(Icons.shopping_cart),
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
Navigator.of(context)
|
|
|
|
Navigator.of(context).popUntil(ModalRoute.withName('/'));
|
|
|
|
.popUntil(ModalRoute.withName('/'));
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
: Container(),
|
|
|
|
: Container(),
|
|
|
|
IconButton(
|
|
|
|
IconButton(
|
|
|
@ -163,14 +163,12 @@ class AppBarWidget extends StatelessWidget with PreferredSizeWidget {
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
Navigator.pushAndRemoveUntil(
|
|
|
|
Navigator.pushAndRemoveUntil(
|
|
|
|
context,
|
|
|
|
context,
|
|
|
|
MaterialPageRoute(
|
|
|
|
MaterialPageRoute(builder: (context) => LandingPage()),
|
|
|
|
builder: (context) => LandingPage()),
|
|
|
|
|
|
|
|
(Route<dynamic> r) => false);
|
|
|
|
(Route<dynamic> r) => false);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
if (appBarIcons != null) ...appBarIcons
|
|
|
|
if (appBarIcons != null) ...appBarIcons
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|