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