Skip to content

Commit

Permalink
Merged in RahmanDev (pull request #48)
Browse files Browse the repository at this point in the history
fix errors zian
  • Loading branch information
R Razaee committed May 6, 2021
2 parents d65a49e + 86ba478 commit 057748f
Show file tree
Hide file tree
Showing 13 changed files with 1,002 additions and 807 deletions.
2 changes: 2 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import 'package:admin/modules/drawer/drawer.dart';
import 'package:admin/modules/notifications/notification_page.dart';
import 'package:admin/modules/orders/orders_page_notification.dart';
import 'package:admin/routes.dart';
import 'package:admin/testPage.dart';
import 'package:admin/themes/style.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
Expand Down Expand Up @@ -137,6 +138,7 @@ class _MyAppState extends State<MyApp> {
title: 'Admin App',
theme: restaurantTheme,
routes: routes,

home: ConnectivityWidgetWrapper(
stacked: true,
height: 30,
Expand Down
116 changes: 87 additions & 29 deletions lib/modules/Resturant/Screen/formResturant.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class _ResturantFormState extends State<ResturantForm> {
));
});

if (picked_s != null) return "${picked_s.hour}:${picked_s.minute}";
return (picked_s != null) ? "${picked_s.hour}:${picked_s.minute}" : null;
}

AuthProvider auth;
Expand Down Expand Up @@ -617,9 +617,13 @@ class _ResturantFormState extends State<ResturantForm> {
IconButton(
icon: Image.asset("assets/images/edit.png"),
onPressed: () {
_selectTime(context).then((value) => setState(() {
_selectTime(context).then((value) {
if (value != null) {
setState(() {
resturantModel.sunday.startTime = value;
}));
});
}
});
},
),
],
Expand All @@ -633,9 +637,13 @@ class _ResturantFormState extends State<ResturantForm> {
IconButton(
icon: Image.asset("assets/images/edit.png"),
onPressed: () {
_selectTime(context).then((value) => setState(() {
_selectTime(context).then((value) {
if (value != null) {
setState(() {
resturantModel.sunday.endTime = value;
}));
});
}
});
},
),
],
Expand All @@ -654,9 +662,13 @@ class _ResturantFormState extends State<ResturantForm> {
IconButton(
icon: Image.asset("assets/images/edit.png"),
onPressed: () {
_selectTime(context).then((value) => setState(() {
_selectTime(context).then((value) {
if (value != null) {
setState(() {
resturantModel.monday.startTime = value;
}));
});
}
});
},
),
],
Expand All @@ -670,9 +682,13 @@ class _ResturantFormState extends State<ResturantForm> {
IconButton(
icon: Image.asset("assets/images/edit.png"),
onPressed: () {
_selectTime(context).then((value) => setState(() {
_selectTime(context).then((value) {
if (value != null) {
setState(() {
resturantModel.monday.endTime = value;
}));
});
}
});
},
),
],
Expand All @@ -691,9 +707,13 @@ class _ResturantFormState extends State<ResturantForm> {
IconButton(
icon: Image.asset("assets/images/edit.png"),
onPressed: () {
_selectTime(context).then((value) => setState(() {
_selectTime(context).then((value) {
if (value != null) {
setState(() {
resturantModel.tuesday.startTime = value;
}));
});
}
});
},
),
],
Expand All @@ -707,9 +727,13 @@ class _ResturantFormState extends State<ResturantForm> {
IconButton(
icon: Image.asset("assets/images/edit.png"),
onPressed: () {
_selectTime(context).then((value) => setState(() {
_selectTime(context).then((value) {
if (value != null) {
setState(() {
resturantModel.tuesday.endTime = value;
}));
});
}
});
},
),
],
Expand All @@ -728,9 +752,13 @@ class _ResturantFormState extends State<ResturantForm> {
IconButton(
icon: Image.asset("assets/images/edit.png"),
onPressed: () {
_selectTime(context).then((value) => setState(() {
_selectTime(context).then((value) {
if (value != null) {
setState(() {
resturantModel.wednesday.startTime = value;
}));
});
}
});
},
),
],
Expand All @@ -744,9 +772,13 @@ class _ResturantFormState extends State<ResturantForm> {
IconButton(
icon: Image.asset("assets/images/edit.png"),
onPressed: () {
_selectTime(context).then((value) => setState(() {
_selectTime(context).then((value) {
if (value != null) {
setState(() {
resturantModel.wednesday.endTime = value;
}));
});
}
});
},
),
],
Expand All @@ -765,9 +797,13 @@ class _ResturantFormState extends State<ResturantForm> {
IconButton(
icon: Image.asset("assets/images/edit.png"),
onPressed: () {
_selectTime(context).then((value) => setState(() {
_selectTime(context).then((value) {
if (value != null) {
setState(() {
resturantModel.thursday.startTime = value;
}));
});
}
});
},
),
],
Expand All @@ -781,9 +817,13 @@ class _ResturantFormState extends State<ResturantForm> {
IconButton(
icon: Image.asset("assets/images/edit.png"),
onPressed: () {
_selectTime(context).then((value) => setState(() {
_selectTime(context).then((value) {
if (value != null) {
setState(() {
resturantModel.thursday.endTime = value;
}));
});
}
});
},
),
],
Expand All @@ -802,9 +842,13 @@ class _ResturantFormState extends State<ResturantForm> {
IconButton(
icon: Image.asset("assets/images/edit.png"),
onPressed: () {
_selectTime(context).then((value) => setState(() {
_selectTime(context).then((value) {
if (value != null) {
setState(() {
resturantModel.friday.startTime = value;
}));
});
}
});
},
),
],
Expand All @@ -818,9 +862,13 @@ class _ResturantFormState extends State<ResturantForm> {
IconButton(
icon: Image.asset("assets/images/edit.png"),
onPressed: () {
_selectTime(context).then((value) => setState(() {
_selectTime(context).then((value) {
if (value != null) {
setState(() {
resturantModel.friday.endTime = value;
}));
});
}
});
},
),
],
Expand All @@ -839,9 +887,13 @@ class _ResturantFormState extends State<ResturantForm> {
IconButton(
icon: Image.asset("assets/images/edit.png"),
onPressed: () {
_selectTime(context).then((value) => setState(() {
_selectTime(context).then((value) {
if (value != null) {
setState(() {
resturantModel.saturday.startTime = value;
}));
});
}
});
},
),
],
Expand All @@ -855,9 +907,13 @@ class _ResturantFormState extends State<ResturantForm> {
IconButton(
icon: Image.asset("assets/images/edit.png"),
onPressed: () {
_selectTime(context).then((value) => setState(() {
_selectTime(context).then((value) {
if (value != null) {
setState(() {
resturantModel.saturday.endTime = value;
}));
});
}
});
},
),
],
Expand All @@ -869,4 +925,6 @@ class _ResturantFormState extends State<ResturantForm> {
),
);
}


}
86 changes: 49 additions & 37 deletions lib/modules/customers/screen/Customers_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,43 +108,55 @@ class _CustomersPageState extends State<CustomersPage> {
builder: (context, snapshot) {
return Center(child: CircularProgressIndicator());
})
: IncrementallyLoadingListView(
shrinkWrap: true,
// physics: NeverScrollableScrollPhysics(),
hasMore: () => value.hasMoreItems,
itemCount: () => value.getCustomers.length,
loadMore: () async {
await value.fetchCustomers();
},
onLoadMore: () {
value.showLoadingBottom(true);
},
onLoadMoreFinished: () {
value.showLoadingBottom(false);
},
loadMoreOffsetFromBottom: 0,
itemBuilder: (context, index) {
if ((value.loadingMore ?? false) &&
index == value.getCustomers.length - 1) {
log(value.getCustomers[index].username);
return Column(
children: <Widget>[
_customerItemBuilder(
context,
value.getCustomers[index],
customersProvider,
: value.getCustomers.isEmpty
? ListView(
children: [
Container(
height:
MediaQuery.of(context).size.height - 100,
child: Center(
child: Text("No Customers"),
),
PlaceholderItemCard()
],
);
}
return _customerItemBuilder(
context,
value.getCustomers[index],
customersProvider,
);
},
),
)
],
)
: IncrementallyLoadingListView(
shrinkWrap: true,
// physics: NeverScrollableScrollPhysics(),
hasMore: () => value.hasMoreItems,
itemCount: () => value.getCustomers.length,
loadMore: () async {
await value.fetchCustomers();
},
onLoadMore: () {
value.showLoadingBottom(true);
},
onLoadMoreFinished: () {
value.showLoadingBottom(false);
},
loadMoreOffsetFromBottom: 0,
itemBuilder: (context, index) {
if ((value.loadingMore ?? false) &&
index == value.getCustomers.length - 1) {
log(value.getCustomers[index].username);
return Column(
children: <Widget>[
_customerItemBuilder(
context,
value.getCustomers[index],
customersProvider,
),
PlaceholderItemCard()
],
);
}
return _customerItemBuilder(
context,
value.getCustomers[index],
customersProvider,
);
},
),
);
})),
],
Expand All @@ -169,7 +181,7 @@ class _CustomersPageState extends State<CustomersPage> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
width: getDeviceWidthSize(context)/2,
width: getDeviceWidthSize(context) / 2,
child: Text(
"${customer.username}",
style: Theme.of(context).textTheme.headline4,
Expand Down
6 changes: 3 additions & 3 deletions lib/modules/dashboard/Screen/dashboard_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class _DashboardPageState extends State<DashboardPage> {
child: LabelDashBoard(
color: Colors.white,
title:
"Total earning Today: \$${dashProvider.getDashData['totalEarning'] ?? 0}",
"Total earning Today: \$${dashProvider.getDashData['totalEarningToday'] ?? 0}",
),
),
),
Expand All @@ -110,7 +110,7 @@ class _DashboardPageState extends State<DashboardPage> {
child: LabelDashBoard(
color: Colors.white,
title:
"Total Restaurants : \$${dashProvider.getDashData['totalRestaurants']}",
"Total Restaurants : ${dashProvider.getDashData['totalRestaurants']}",
),
),
),
Expand All @@ -122,7 +122,7 @@ class _DashboardPageState extends State<DashboardPage> {
child: LabelDashBoard(
color: Colors.white,
title:
"Total Customers : \$${dashProvider.getDashData['totalCustomers']}",
"Total Customers : ${dashProvider.getDashData['totalCustomers']}",
),
),
),
Expand Down
Loading

0 comments on commit 057748f

Please sign in to comment.