fixed merging issues

merge-update-with-lab-changes
enadhilal 5 years ago
parent 9c55571072
commit 727940c5c6

@ -37,7 +37,6 @@ class AppScaffold extends StatelessWidget {
final bool isBottomBar; final bool isBottomBar;
final Widget floatingActionButton; final Widget floatingActionButton;
final bool isPharmacy; final bool isPharmacy;
final bool showCart;
final String title; final String title;
final String description; final String description;
final String image; final String image;
@ -49,29 +48,28 @@ class AppScaffold extends StatelessWidget {
final PreferredSizeWidget appBarWidget; final PreferredSizeWidget appBarWidget;
AuthenticatedUserObject authenticatedUserObject = AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>(); locator<AuthenticatedUserObject>();
AppScaffold( AppScaffold(
{@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.showCart = 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
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -90,58 +88,29 @@ class AppScaffold extends StatelessWidget {
appBar = preferredSize == 0 appBar = preferredSize == 0
? appBarWidget ? appBarWidget
: PreferredSize( : PreferredSize(
child: appBarWidget, child: appBarWidget,
preferredSize: Size.fromHeight(preferredSize)); preferredSize: Size.fromHeight(preferredSize));
} else { } else {
appBar = this.appBarWidget; appBar = this.appBarWidget;
} }
return Scaffold( return Scaffold(
backgroundColor: backgroundColor ?? Theme.of(context).scaffoldBackgroundColor, backgroundColor:
appBar: isShowAppBar backgroundColor ?? Theme.of(context).scaffoldBackgroundColor,
? AppBar( appBar: appBar,
elevation: 0, body: (!Provider.of<ProjectViewModel>(context, listen: false).isLogin &&
backgroundColor: isPharmacy isShowDecPage)
? Colors.green ? NotAutPage(
: Theme.of(context).appBarTheme.color, title: appBarTitle,
textTheme: TextTheme( description: description,
headline6: infoList: infoList,
TextStyle(color: Colors.white, fontWeight: FontWeight.bold), )
),
title: Text(authenticatedUserObject.isLogin
? appBarTitle.toUpperCase()
: TranslationBase.of(context).serviceInformationTitle),leading: Builder(
builder: (BuildContext context) {
return ArrowBack();
},
),
centerTitle: true,
actions: <Widget>[
isPharmacy && showCart
? IconButton(
icon: Icon(Icons.shopping_cart),
color: Colors.white,
onPressed: () {
Navigator.of(context)
.popUntil(ModalRoute.withName('/'));
},
)
: isPharmacy && !showCart ? Container() :IconButton(
icon: Icon(FontAwesomeIcons.home),
color: Colors.white,
onPressed: () {
Navigator.of(context)
.popUntil(ModalRoute.withName('/'));
},
),
],
)
: 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:
@ -164,7 +133,7 @@ class AppScaffold extends StatelessWidget {
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;
@ -184,72 +153,72 @@ 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: 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: Texts(
authenticatedUserObject.isLogin || !isShowDecPage
? appBarTitle.toUpperCase()
: TranslationBase.of(context).serviceInformationTitle,
color: Colors.white,
bold: true,
),
leading: Builder(
builder: (BuildContext context) {
return ArrowBack();
},
),
centerTitle: true,
actions: <Widget>[
isPharmacy
? IconButton(
icon: Icon(Icons.shopping_cart),
color: Colors.white,
onPressed: () {
Navigator.of(context)
.popUntil(ModalRoute.withName('/'));
})
: Container(),
image != null
? InkWell(
onTap: () => Navigator.push(
context,
FadePage(
page: InsuranceUpdate(),
), ),
title: Texts( ),
authenticatedUserObject.isLogin || !isShowDecPage child: Padding(
? appBarTitle.toUpperCase() padding: const EdgeInsets.all(8.0),
: TranslationBase.of(context).serviceInformationTitle, child: Image.asset(
image,
height: SizeConfig.heightMultiplier * 5,
width: SizeConfig.heightMultiplier * 5,
color: Colors.white, color: Colors.white,
bold: true,
), ),
leading: Builder( ),
builder: (BuildContext context) { )
return ArrowBack(); : IconButton(
}, icon: Icon(FontAwesomeIcons.home),
), color: Colors.white,
centerTitle: true, onPressed: () {
actions: <Widget>[ Navigator.pushAndRemoveUntil(
isPharmacy context,
? IconButton( MaterialPageRoute(
icon: Icon(Icons.shopping_cart), builder: (context) => LandingPage()),
color: Colors.white, (Route<dynamic> r) => false);
onPressed: () { },
Navigator.of(context) ),
.popUntil(ModalRoute.withName('/')); if (appBarIcons != null) ...appBarIcons
}) ],
: 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.white,
),
),
)
: IconButton(
icon: Icon(FontAwesomeIcons.home),
color: Colors.white,
onPressed: () {
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(
builder: (context) => LandingPage()),
(Route<dynamic> r) => false);
},
),
if (appBarIcons != null) ...appBarIcons
],
)
: Container( : Container(
height: 0, height: 0,
width: 0, width: 0,
); );
} }
@override @override

@ -6,9 +6,6 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
class productTile extends StatelessWidget { class productTile extends StatelessWidget {
final String productName; final String productName;
final String productPrice; final String productPrice;
@ -16,14 +13,20 @@ class productTile extends StatelessWidget {
final int productReviews; final int productReviews;
final String qyt; final String qyt;
final String totalPrice; final String totalPrice;
final bool isOrderDetails; final bool isOrderDetails;
final String productImage; final String productImage;
final bool showLine; final bool showLine;
productTile({this.productName, this.productPrice, this.productRate, productTile(
this.qyt, this.totalPrice, this.productReviews, {this.productName,
this.isOrderDetails=true, this.productImage ,this.showLine = true}); this.productPrice,
this.productRate,
this.qyt,
this.totalPrice,
this.productReviews,
this.isOrderDetails = true,
this.productImage,
this.showLine = true});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -63,8 +66,7 @@ class productTile extends StatelessWidget {
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: text: productName,
productName,
style: TextStyle( style: TextStyle(
color: Colors.black54, color: Colors.black54,
fontSize: 15, fontSize: 15,
@ -88,251 +90,267 @@ class productTile extends StatelessWidget {
), ),
), ),
), ),
this.isOrderDetails == false ? Container( this.isOrderDetails == false
margin: EdgeInsets.all(5), ? Container(
child: Align( margin: EdgeInsets.all(5),
alignment: Alignment.topLeft, child: Align(
child: RatingBar.readOnly( alignment: Alignment.topLeft,
initialRating: productRate, child: RatingBar.readOnly(
size: 15.0, initialRating: productRate,
filledColor: Colors.yellow[700], size: 15.0,
emptyColor: Colors.grey[500], filledColor: Colors.yellow[700],
isHalfAllowed: true, emptyColor: Colors.grey[500],
halfFilledIcon: Icons.star_half, isHalfAllowed: true,
filledIcon: Icons.star, halfFilledIcon: Icons.star_half,
emptyIcon: Icons.star, filledIcon: Icons.star,
), emptyIcon: Icons.star,
), ),
): Container(), ),
)
: Container(),
], ],
), ),
), ),
this.isOrderDetails == false ? Expanded( this.isOrderDetails == false
flex: 1, ? Expanded(
child: Column ( flex: 1,
children: [ child: Column(
Icon(FontAwesomeIcons.trashAlt, size: 15), children: [
SizedBox(height: 50,), Icon(FontAwesomeIcons.trashAlt, size: 15),
Icon(FontAwesomeIcons.shoppingCart, size: 15), SizedBox(
], height: 50,
), ),
) : Container(), Icon(FontAwesomeIcons.shoppingCart, size: 15),
],
),
)
: Container(),
], ],
), ),
this.isOrderDetails == true ?Expanded( this.isOrderDetails == true
child: Row( ? Expanded(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, child: Row(
children: [ mainAxisAlignment: MainAxisAlignment.spaceEvenly,
Container( children: [
margin: EdgeInsets.only(bottom: 5.0), Container(
child: RichText( margin: EdgeInsets.only(bottom: 5.0),
text: TextSpan( child: RichText(
text: 'QYT: $qyt',
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.grey,
fontSize: 13),
),
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Text(
TranslationBase.of(context).total,
style: TextStyle(
color: Colors.grey,
fontSize: 13.0,
fontWeight: FontWeight.bold,
),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
RichText(
text: TextSpan( text: TextSpan(
text: ' $totalPrice SAR', text: 'QYT: $qyt',
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, color: Colors.grey,
fontSize: 15), fontSize: 13),
), ),
), ),
],
),
],
),
],
),
): Container(),
// this.isOrderDetails == true && model.order[0].orderStatusId == 30?
this.isOrderDetails == true?
Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Container(
// margin: EdgeInsets.all(5.0),
child: Align(
alignment: Alignment.topLeft,
child: RatingBar.readOnly(
initialRating: productRate,
size: 15.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
),
),
),
Container(
// margin: EdgeInsets.all(5),
child: Align(
// alignment: Alignment.topLeft,
child: RichText(
text: TextSpan(
text: '($productReviews reviews)',
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.grey,
fontSize: 13),
),
),
),
),
InkWell(
onTap: () {
Navigator.push(context,
MaterialPageRoute(builder: (context) => ProductReviewPage()));
},
child: Container(
padding: EdgeInsets.only(left: 13.0, right: 13.0, top: 5.0),
height: 30.0,
decoration: BoxDecoration(
border: Border.all(
color: Colors.orange,
style: BorderStyle.solid,
width: 1.0
), ),
color: Colors.transparent, Column(
borderRadius: BorderRadius.circular(5.0) crossAxisAlignment: CrossAxisAlignment.center,
),
child: Text(
TranslationBase.of(context).writeReview,
style: TextStyle(
fontSize:12,
color: Colors.orange,
),
),
),
),
],
),
) : Container(),
],
),
):
Container(
child: Padding(
padding: EdgeInsets.all(8.0),
child: Row(
children: [
Padding(
padding: EdgeInsets.only(left:15),
child: Container(
width: 160,
height: 200,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
border: Border(
top: BorderSide(width: 0.5, color: Colors.grey),
left: BorderSide(width: 0.5, color: Colors.grey),
right: BorderSide(width: 0.5, color: Colors.grey),
bottom: BorderSide(width: 0.5, color: Colors.grey),
),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(height: 2,),
Container(
child: Image.network(
productImage.trim(),
fit: BoxFit.cover,
width: 80,
height: 70,
),
),
SizedBox(height: 10,),
// Container(width: 150,height: 20,color: Colors.green,),
Container(
alignment: Alignment.centerLeft,
child:Column(
children: [ children: [
Container( Row(
margin: EdgeInsets.all(5), mainAxisAlignment: MainAxisAlignment.end,
child: Align( children: [
alignment: Alignment.topLeft, Text(
child: RichText( TranslationBase.of(context).total,
text: TextSpan( style: TextStyle(
text: color: Colors.grey,
productName, fontSize: 13.0,
style: TextStyle( fontWeight: FontWeight.bold,
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
), ),
), ),
), ],
), ),
Container( Row(
margin: EdgeInsets.all(5), mainAxisAlignment: MainAxisAlignment.end,
child: Align( children: [
alignment: Alignment.topLeft, RichText(
child: RichText(
text: TextSpan( text: TextSpan(
text: 'SAR $productPrice', text: ' $totalPrice SAR',
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, color: Colors.black,
fontSize: 13), fontSize: 15),
), ),
), ),
],
),
],
),
],
),
)
: Container(),
// this.isOrderDetails == true && model.order[0].orderStatusId == 30?
this.isOrderDetails == true
? Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Container(
// margin: EdgeInsets.all(5.0),
child: Align(
alignment: Alignment.topLeft,
child: RatingBar.readOnly(
initialRating: productRate,
size: 15.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
),
),
),
Container(
// margin: EdgeInsets.all(5),
child: Align(
// alignment: Alignment.topLeft,
child: RichText(
text: TextSpan(
text: '($productReviews reviews)',
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.grey,
fontSize: 13),
), ),
), ),
Container( ),
alignment: Alignment.topLeft, ),
margin: EdgeInsets.all(5), InkWell(
child: Align( onTap: () {
child: RatingBar.readOnly( Navigator.push(
initialRating: productRate, context,
size: 15.0, MaterialPageRoute(
filledColor: Colors.yellow[700], builder: (context) => ProductReviewPage()));
emptyColor: Colors.grey[500], },
isHalfAllowed: true, child: Container(
halfFilledIcon: Icons.star_half, padding: EdgeInsets.only(
filledIcon: Icons.star, left: 13.0, right: 13.0, top: 5.0),
emptyIcon: Icons.star, height: 30.0,
), decoration: BoxDecoration(
border: Border.all(
color: Colors.orange,
style: BorderStyle.solid,
width: 1.0),
color: Colors.transparent,
borderRadius: BorderRadius.circular(5.0)),
child: Text(
TranslationBase.of(context).writeReview,
style: TextStyle(
fontSize: 12,
color: Colors.orange,
), ),
), ),
], ),
), ),
],
),
)
: Container(
child: Padding(
padding: EdgeInsets.all(8.0),
child: Row(
children: [
Padding(
padding: EdgeInsets.only(left: 15),
child: Container(
width: 160,
height: 200,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
border: Border(
top: BorderSide(
width: 0.5, color: Colors.grey),
left: BorderSide(
width: 0.5, color: Colors.grey),
right: BorderSide(
width: 0.5, color: Colors.grey),
bottom: BorderSide(
width: 0.5, color: Colors.grey),
),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(
height: 2,
),
Container(
child: Image.network(
productImage.trim(),
fit: BoxFit.cover,
width: 80,
height: 70,
),
),
SizedBox(
height: 10,
),
// Container(width: 150,height: 20,color: Colors.green,),
Container(
alignment: Alignment.centerLeft,
child: Column(
children: [
Container(
margin: EdgeInsets.all(5),
child: Align(
alignment: Alignment.topLeft,
child: RichText(
text: TextSpan(
text: productName,
style: TextStyle(
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
),
),
),
),
Container(
margin: EdgeInsets.all(5),
child: Align(
alignment: Alignment.topLeft,
child: RichText(
text: TextSpan(
text: 'SAR $productPrice',
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
),
),
),
),
Container(
alignment: Alignment.topLeft,
margin: EdgeInsets.all(5),
child: Align(
child: RatingBar.readOnly(
initialRating: productRate,
size: 15.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
),
),
),
],
),
),
],
),
),
),
],
), ),
], ),
), ),
), ],
),
],
),
), ),
); );
} }

Loading…
Cancel
Save