|
|
|
|
@ -76,18 +76,12 @@ class AppScaffold extends StatelessWidget {
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
AppGlobal.context = context;
|
|
|
|
|
ProjectViewModel projectViewModel = Provider.of<ProjectViewModel>(context);
|
|
|
|
|
AppGlobal.context = context;
|
|
|
|
|
PreferredSizeWidget appBar;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return Scaffold(
|
|
|
|
|
backgroundColor:
|
|
|
|
|
backgroundColor ?? Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
|
appBar: isShowAppBar? AppBarWidget(
|
|
|
|
|
appBarTitle,
|
|
|
|
|
appBarIcons,
|
|
|
|
|
isShowAppBar,
|
|
|
|
|
appBarTitle:appBarTitle,
|
|
|
|
|
appBarIcons:appBarIcons,
|
|
|
|
|
isPharmacy: isPharmacy,
|
|
|
|
|
isShowDecPage: isShowDecPage,
|
|
|
|
|
image: image,
|
|
|
|
|
@ -95,22 +89,17 @@ class AppScaffold extends StatelessWidget {
|
|
|
|
|
body: (!Provider.of<ProjectViewModel>(context, listen: false).isLogin &&
|
|
|
|
|
isShowDecPage)
|
|
|
|
|
? NotAutPage(
|
|
|
|
|
title: appBarTitle,
|
|
|
|
|
title: title ?? appBarTitle,
|
|
|
|
|
description: description,
|
|
|
|
|
infoList: infoList,
|
|
|
|
|
imagesInfo: imagesInfo,
|
|
|
|
|
)
|
|
|
|
|
: baseViewModel != null
|
|
|
|
|
? NetworkBaseView(
|
|
|
|
|
child: buildBodyWidget(),
|
|
|
|
|
child: body,
|
|
|
|
|
baseViewModel: baseViewModel,
|
|
|
|
|
)
|
|
|
|
|
: buildBodyWidget(),
|
|
|
|
|
bottomSheet: bottomSheet,
|
|
|
|
|
//floatingActionButton: floatingActionButton ?? floatingActionButton,
|
|
|
|
|
// bottomNavigationBar:
|
|
|
|
|
// this.isBottomBar == true ? BottomBarSearch() : SizedBox()
|
|
|
|
|
// floatingActionButton: FloatingSearchButton(),
|
|
|
|
|
: body,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -118,12 +107,6 @@ class AppScaffold extends StatelessWidget {
|
|
|
|
|
return isLoading ? AppLoaderWidget() : Container();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
buildBodyWidget() {
|
|
|
|
|
// return body; //Stack(children: <Widget>[body, buildAppLoaderWidget(isLoading)]);
|
|
|
|
|
return Stack(children: <Widget>[
|
|
|
|
|
body, /*FloatingSearchButton()*/
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class AppBarWidget extends StatelessWidget with PreferredSizeWidget {
|
|
|
|
|
@ -132,13 +115,12 @@ class AppBarWidget extends StatelessWidget with PreferredSizeWidget {
|
|
|
|
|
|
|
|
|
|
final String appBarTitle;
|
|
|
|
|
final List<Widget> appBarIcons;
|
|
|
|
|
final bool isShowAppBar;
|
|
|
|
|
final bool isPharmacy;
|
|
|
|
|
final bool isShowDecPage;
|
|
|
|
|
final String image;
|
|
|
|
|
|
|
|
|
|
AppBarWidget(this.appBarTitle, this.appBarIcons, this.isShowAppBar,
|
|
|
|
|
{this.isPharmacy = true, this.isShowDecPage = true, this.image});
|
|
|
|
|
AppBarWidget({this.appBarTitle, this.appBarIcons,
|
|
|
|
|
this.isPharmacy = true, this.isShowDecPage = true, this.image});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
@ -147,8 +129,7 @@ class AppBarWidget extends StatelessWidget with PreferredSizeWidget {
|
|
|
|
|
|
|
|
|
|
Widget buildAppBar(BuildContext context) {
|
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
|
return isShowAppBar
|
|
|
|
|
? AppBar(
|
|
|
|
|
return AppBar(
|
|
|
|
|
elevation: 0,
|
|
|
|
|
backgroundColor:
|
|
|
|
|
isPharmacy ? Colors.green : Theme.of(context).appBarTheme.color,
|
|
|
|
|
@ -194,10 +175,7 @@ class AppBarWidget extends StatelessWidget with PreferredSizeWidget {
|
|
|
|
|
),
|
|
|
|
|
if (appBarIcons != null) ...appBarIcons
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: Container(
|
|
|
|
|
height: 0,
|
|
|
|
|
width: 0,
|
|
|
|
|
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|