|
|
|
@ -55,9 +55,10 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
onModelReady: (model) => model.getPendingOrders(),
|
|
|
|
onModelReady: (model) => model.getPendingOrders(),
|
|
|
|
builder: (BuildContext context, OrdersViewModel model, Widget child) =>
|
|
|
|
builder: (BuildContext context, OrdersViewModel model, Widget child) =>
|
|
|
|
AppScaffold(
|
|
|
|
AppScaffold(
|
|
|
|
body: Container(
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
|
|
|
|
child: Container(
|
|
|
|
|
|
|
|
height: MediaQuery.of(context).size.height * 1.6,
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
@ -147,7 +148,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
gradient: LINEAR_GRADIENT,
|
|
|
|
gradient: LINEAR_GRADIENT,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
child: Padding(
|
|
|
|
child: Padding(
|
|
|
|
@ -271,15 +273,18 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
MainAxisAlignment.spaceEvenly,
|
|
|
|
MainAxisAlignment.spaceEvenly,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
TranslationBase.of(context).youHave,
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.youHave,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
fontSize: MediaQuery.of(context)
|
|
|
|
fontSize: MediaQuery.of(context)
|
|
|
|
.orientation ==
|
|
|
|
.orientation ==
|
|
|
|
Orientation.landscape
|
|
|
|
Orientation.landscape
|
|
|
|
? SizeConfig.textMultiplier *
|
|
|
|
? SizeConfig
|
|
|
|
|
|
|
|
.textMultiplier *
|
|
|
|
2.2
|
|
|
|
2.2
|
|
|
|
: SizeConfig.textMultiplier *
|
|
|
|
: SizeConfig
|
|
|
|
|
|
|
|
.textMultiplier *
|
|
|
|
1.3,
|
|
|
|
1.3,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -287,8 +292,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
'3',
|
|
|
|
'3',
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
fontSize:
|
|
|
|
fontSize: SizeConfig
|
|
|
|
SizeConfig.textMultiplier *
|
|
|
|
.textMultiplier *
|
|
|
|
3.0),
|
|
|
|
3.0),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
@ -299,9 +304,11 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
fontSize: MediaQuery.of(context)
|
|
|
|
fontSize: MediaQuery.of(context)
|
|
|
|
.orientation ==
|
|
|
|
.orientation ==
|
|
|
|
Orientation.landscape
|
|
|
|
Orientation.landscape
|
|
|
|
? SizeConfig.textMultiplier *
|
|
|
|
? SizeConfig
|
|
|
|
|
|
|
|
.textMultiplier *
|
|
|
|
2.2
|
|
|
|
2.2
|
|
|
|
: SizeConfig.textMultiplier *
|
|
|
|
: SizeConfig
|
|
|
|
|
|
|
|
.textMultiplier *
|
|
|
|
1.3,
|
|
|
|
1.3,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
@ -357,7 +364,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 16.0, horizontal: 15.0),
|
|
|
|
padding:
|
|
|
|
|
|
|
|
EdgeInsets.symmetric(vertical: 16.0, horizontal: 15.0),
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
@ -444,7 +452,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 1.0),
|
|
|
|
padding:
|
|
|
|
|
|
|
|
EdgeInsets.symmetric(horizontal: 20.0, vertical: 1.0),
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
@ -467,7 +476,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
TranslationBase.of(context).seeAll,
|
|
|
|
TranslationBase.of(context).seeAll,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 14.5, color: Color(0xff42B6AD)),
|
|
|
|
fontSize: 14.5,
|
|
|
|
|
|
|
|
color: Color(0xff42B6AD)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Icon(
|
|
|
|
Icon(
|
|
|
|
Icons.arrow_forward_ios,
|
|
|
|
Icons.arrow_forward_ios,
|
|
|
|
@ -487,15 +497,21 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
if (model.state == ViewState.Idle)
|
|
|
|
|
|
|
|
model.orders.length == 0
|
|
|
|
|
|
|
|
? Text("There's No Orders To deliver")
|
|
|
|
|
|
|
|
: Text(""),
|
|
|
|
NetworkBaseView(
|
|
|
|
NetworkBaseView(
|
|
|
|
baseViewModel: model,
|
|
|
|
baseViewModel: model,
|
|
|
|
child: Column(
|
|
|
|
child: Expanded(
|
|
|
|
children: <Widget>[
|
|
|
|
child: ListView.builder(
|
|
|
|
...List.generate(
|
|
|
|
shrinkWrap: true,
|
|
|
|
model.orders == null
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
|
|
|
|
itemCount: model.orders == null
|
|
|
|
? 0
|
|
|
|
? 0
|
|
|
|
: model.orders.length < 3 ? model.orders.length : 3,
|
|
|
|
: model.orders.length < 3 ? model.orders.length : 3,
|
|
|
|
(index) => Padding(
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
|
|
|
|
return Padding(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 0.2),
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 0.2),
|
|
|
|
child: OrderInfoCard(
|
|
|
|
child: OrderInfoCard(
|
|
|
|
order: model.orders[index],
|
|
|
|
order: model.orders[index],
|
|
|
|
@ -503,19 +519,21 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
Navigator.push(
|
|
|
|
Navigator.push(
|
|
|
|
context,
|
|
|
|
context,
|
|
|
|
MaterialPageRoute(
|
|
|
|
MaterialPageRoute(
|
|
|
|
builder: (context) =>
|
|
|
|
builder: (context) => InformationPage(
|
|
|
|
InformationPage(
|
|
|
|
|
|
|
|
item: model.orders[index],
|
|
|
|
item: model.orders[index],
|
|
|
|
)));
|
|
|
|
)));
|
|
|
|
}),
|
|
|
|
},
|
|
|
|
))
|
|
|
|
),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -537,5 +555,3 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|