|
|
|
|
@ -52,9 +52,18 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
int orderId;
|
|
|
|
|
return BaseView<OrdersViewModel>(
|
|
|
|
|
onModelReady: (model) => model.getPendingOrders(),
|
|
|
|
|
onModelReady: (model) async {
|
|
|
|
|
if (!model.isGetPendingOrdersServices) {
|
|
|
|
|
await model.getPendingOrders();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!model.isGetDeliveredOrdersServices) {
|
|
|
|
|
await model.getDeliveredOrders();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
builder: (BuildContext context, OrdersViewModel model, Widget child) =>
|
|
|
|
|
AppScaffold(
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
|
child: Container(
|
|
|
|
|
height: MediaQuery.of(context).orientation == Orientation.landscape
|
|
|
|
|
@ -149,6 +158,12 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
|
borderRadius: BorderRadius.circular(15.0),
|
|
|
|
|
gradient: LINEAR_GRADIENT,
|
|
|
|
|
),
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () => Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (context) =>
|
|
|
|
|
OrdersListScreen())),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
|
@ -161,24 +176,27 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
|
MainAxisAlignment.spaceEvenly,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context).youHave,
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.youHave,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize: MediaQuery.of(context)
|
|
|
|
|
.orientation ==
|
|
|
|
|
Orientation.landscape
|
|
|
|
|
? SizeConfig.textMultiplier *
|
|
|
|
|
? SizeConfig
|
|
|
|
|
.textMultiplier *
|
|
|
|
|
2.2
|
|
|
|
|
: SizeConfig.textMultiplier *
|
|
|
|
|
: SizeConfig
|
|
|
|
|
.textMultiplier *
|
|
|
|
|
1.3,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
'5',
|
|
|
|
|
model.orders.length.toString(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize:
|
|
|
|
|
SizeConfig.textMultiplier *
|
|
|
|
|
fontSize: SizeConfig
|
|
|
|
|
.textMultiplier *
|
|
|
|
|
3.0),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
@ -189,9 +207,11 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
|
fontSize: MediaQuery.of(context)
|
|
|
|
|
.orientation ==
|
|
|
|
|
Orientation.landscape
|
|
|
|
|
? SizeConfig.textMultiplier *
|
|
|
|
|
? SizeConfig
|
|
|
|
|
.textMultiplier *
|
|
|
|
|
2.2
|
|
|
|
|
: SizeConfig.textMultiplier *
|
|
|
|
|
: SizeConfig
|
|
|
|
|
.textMultiplier *
|
|
|
|
|
1.3,
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
@ -238,6 +258,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
@ -291,7 +312,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
'3',
|
|
|
|
|
model.deliverdOrders.length
|
|
|
|
|
.toString(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize: SizeConfig
|
|
|
|
|
@ -511,7 +533,9 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
|
itemCount: model.orders == null
|
|
|
|
|
? 0
|
|
|
|
|
: model.orders.length < 3 ? model.orders.length : 3,
|
|
|
|
|
: model.orders.length < 3
|
|
|
|
|
? model.orders.length
|
|
|
|
|
: 3,
|
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
|
return Padding(
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 0.2),
|
|
|
|
|
|