Skip to content

Commit

Permalink
Fix order ui save button
Browse files Browse the repository at this point in the history
  • Loading branch information
mllrr96 committed Jan 21, 2024
1 parent 144a457 commit 60ba160
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 24 deletions.
35 changes: 16 additions & 19 deletions lib/presentation/modules/dashboard/views/dashboard_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,34 +28,31 @@ class _DashboardViewState extends State<DashboardView>

@override
void didChangeAppLifecycleState(AppLifecycleState state) {
if (state == AppLifecycleState.paused) {
}
if (state == AppLifecycleState.paused) {}

if (state == AppLifecycleState.resumed) {
}
if (state == AppLifecycleState.resumed) {}
}

@override
Widget build(BuildContext context) {
const routes = [
OrdersRoute(),
DraftOrdersRoute(),
ProductsRoute(),
CollectionsRoute(),
CategoriesRoute(),
CustomersRoute(),
GroupsRoute(),
DiscountsRoute(),
GiftCardsRoute(),
PricingRoute(),
StoreSettingsRoute(),
AppSettingsRoute(),
];
return AnnotatedRegion<SystemUiOverlayStyle>(
value: context.systemUiOverlayNoAppBarStyle,
child: AutoTabsRouter(
homeIndex: 0,
routes: routes,
routes: const [
OrdersRoute(),
DraftOrdersRoute(),
ProductsRoute(),
CollectionsRoute(),
CategoriesRoute(),
CustomersRoute(),
GroupsRoute(),
DiscountsRoute(),
GiftCardsRoute(),
PricingRoute(),
StoreSettingsRoute(),
AppSettingsRoute(),
],
transitionBuilder: (context, child, animation) => child,
builder: (context, child) => child,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ class AppDevSettingsView extends StatelessWidget {
return Scaffold(
body: NestedScrollView(
headerSliverBuilder: (context, innerBoxIsScrolled) => [
MedusaSliverAppBar(
title: const Text('App Dev Settings'),
actions: const [
const MedusaSliverAppBar(
title: Text('App Dev Settings'),
actions: [
Padding(
padding: EdgeInsets.all(16.0),
child: Icon(Icons.settings, size: 28.0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ class OrderSettingsView extends StatelessWidget {
title: const Text('Order Settings'),
actions: [
TextButton(
onPressed: () {
onPressed: mapEquals(controller.orderPreference.toJson(),
PreferenceService.orderPreference.toJson()) ? null : () {
PreferenceService.instance
.updateOrderSettings(controller.orderPreference);
OrdersController.instance.update();
context.popRoute();
context.router.popForced();
},
child: const Text('Save'))
],
Expand Down

0 comments on commit 60ba160

Please sign in to comment.