Skip to content

Commit e9ad327

Browse files
committed
remove snackbar as it gets in the way
1 parent 46099ca commit e9ad327

File tree

5 files changed

+41
-372
lines changed

5 files changed

+41
-372
lines changed

lib/Frontend/Widgets/back_button_to_close.dart

Lines changed: 0 additions & 81 deletions
This file was deleted.

lib/Frontend/Widgets/snack_bar_overlay.dart

Lines changed: 0 additions & 121 deletions
This file was deleted.

lib/Frontend/pages/shell.dart

Lines changed: 41 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,16 @@ import 'package:tail_app/Frontend/Widgets/wear_helper.dart';
99
import 'package:tail_app/Frontend/go_router_config.dart';
1010
import 'package:upgrader/upgrader.dart';
1111

12-
import '../Widgets/back_button_to_close.dart';
1312
import '../Widgets/known_gear.dart';
1413
import '../Widgets/known_gear_scan_controller.dart';
15-
import '../Widgets/snack_bar_overlay.dart';
1614
import '../translation_string_definitions.dart';
1715
import '../utils.dart';
1816

1917
part 'shell.freezed.dart';
2018

2119
@freezed
2220
abstract class NavDestination with _$NavDestination {
23-
const factory NavDestination({
24-
required String label,
25-
required Widget icon,
26-
required Widget selectedIcon,
27-
required String path,
28-
}) = _NavDestination;
21+
const factory NavDestination({required String label, required Widget icon, required Widget selectedIcon, required String path}) = _NavDestination;
2922
}
3023

3124
List<NavDestination> destinations = <NavDestination>[
@@ -53,68 +46,45 @@ class _NavigationDrawerExampleState extends ConsumerState<NavigationDrawerExampl
5346
Widget build(BuildContext context) {
5447
setupSystemColor(context);
5548
ref.watch(initLocaleProvider);
56-
return BackButtonToClose(
57-
child: WearHelper(
58-
child: UpgradeAlert(
59-
dialogStyle: UpgradeDialogStyle.material,
60-
navigatorKey: rootNavigatorKey,
61-
child: AdaptiveScaffold(
62-
// An option to override the default breakpoints used for small, medium,
63-
// and large.
64-
smallBreakpoint: const Breakpoint(endWidth: 700),
65-
mediumBreakpoint: const Breakpoint(beginWidth: 700, endWidth: 1000),
66-
largeBreakpoint: const Breakpoint(beginWidth: 1000),
67-
useDrawer: false,
68-
internalAnimations: false,
69-
transitionDuration: Duration.zero,
70-
appBarBreakpoint: const Breakpoint(beginWidth: 0),
71-
selectedIndex: screenIndex,
72-
onSelectedIndexChange: (int index) {
73-
setState(
74-
() {
75-
screenIndex = index;
76-
return GoRouter.of(context).go(destinations[index].path);
77-
},
78-
);
79-
},
80-
destinations: destinations.map(
81-
(NavDestination destination) {
82-
return NavigationDestination(
83-
label: destination.label,
84-
icon: destination.icon,
85-
selectedIcon: destination.selectedIcon,
86-
tooltip: destination.label,
87-
);
88-
},
89-
).toList(),
90-
body: (_) => SafeArea(
91-
bottom: false,
92-
top: false,
93-
child: SnackBarOverlay(
94-
child: widget.child,
95-
),
96-
),
97-
// smallBody: (_) => SafeArea(
98-
// bottom: false,
99-
// top: false,
100-
// child: SnackBarOverlay(
101-
// child: widget.child,
102-
// ),
103-
// ),
104-
// Define a default secondaryBody.
105-
//secondaryBody: AdaptiveScaffold.emptyBuilder,
106-
// Override the default secondaryBody during the smallBreakpoint to be
107-
// empty. Must use AdaptiveScaffold.emptyBuilder to ensure it is properly
108-
// overridden.
109-
smallSecondaryBody: AdaptiveScaffold.emptyBuilder,
110-
appBar: AppBar(
111-
title: const DeviceStatusWidget(),
112-
centerTitle: true,
113-
leadingWidth: 0,
114-
titleSpacing: 0,
115-
toolbarHeight: 100 * MediaQuery.textScalerOf(context).scale(1),
116-
),
117-
),
49+
return WearHelper(
50+
child: UpgradeAlert(
51+
dialogStyle: UpgradeDialogStyle.material,
52+
navigatorKey: rootNavigatorKey,
53+
child: AdaptiveScaffold(
54+
// An option to override the default breakpoints used for small, medium,
55+
// and large.
56+
smallBreakpoint: const Breakpoint(endWidth: 700),
57+
mediumBreakpoint: const Breakpoint(beginWidth: 700, endWidth: 1000),
58+
largeBreakpoint: const Breakpoint(beginWidth: 1000),
59+
useDrawer: false,
60+
internalAnimations: false,
61+
transitionDuration: Duration.zero,
62+
appBarBreakpoint: const Breakpoint(beginWidth: 0),
63+
selectedIndex: screenIndex,
64+
onSelectedIndexChange: (int index) {
65+
setState(() {
66+
screenIndex = index;
67+
return GoRouter.of(context).go(destinations[index].path);
68+
});
69+
},
70+
destinations: destinations.map((NavDestination destination) {
71+
return NavigationDestination(label: destination.label, icon: destination.icon, selectedIcon: destination.selectedIcon, tooltip: destination.label);
72+
}).toList(),
73+
body: (_) => SafeArea(bottom: false, top: false, child: widget.child),
74+
// smallBody: (_) => SafeArea(
75+
// bottom: false,
76+
// top: false,
77+
// child: SnackBarOverlay(
78+
// child: widget.child,
79+
// ),
80+
// ),
81+
// Define a default secondaryBody.
82+
//secondaryBody: AdaptiveScaffold.emptyBuilder,
83+
// Override the default secondaryBody during the smallBreakpoint to be
84+
// empty. Must use AdaptiveScaffold.emptyBuilder to ensure it is properly
85+
// overridden.
86+
smallSecondaryBody: AdaptiveScaffold.emptyBuilder,
87+
appBar: AppBar(title: const DeviceStatusWidget(), centerTitle: true, leadingWidth: 0, titleSpacing: 0, toolbarHeight: 100 * MediaQuery.textScalerOf(context).scale(1)),
11888
),
11989
),
12090
);
@@ -145,10 +115,7 @@ class _DeviceStatusWidgetState extends ConsumerState<DeviceStatusWidget> {
145115
controller: _scrollController,
146116
physics: const AlwaysScrollableScrollPhysics(),
147117
scrollDirection: Axis.horizontal,
148-
child: const Padding(
149-
padding: EdgeInsets.symmetric(horizontal: 8),
150-
child: KnownGear(),
151-
),
118+
child: const Padding(padding: EdgeInsets.symmetric(horizontal: 8), child: KnownGear()),
152119
),
153120
),
154121
);

0 commit comments

Comments
 (0)