cleanup code
This commit is contained in:
@@ -564,8 +564,6 @@ class _SheetContainer extends HookConsumerWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
final colorScheme = Theme.of(context).colorScheme;
|
final colorScheme = Theme.of(context).colorScheme;
|
||||||
// Memoize maxChildSize to prevent keyboard from affecting sheet size
|
|
||||||
final stableMaxChildSize = useMemoized(() => relativeSafeArea, []);
|
|
||||||
|
|
||||||
bool dismissOnThreshold(DraggableScrollableNotification notification) {
|
bool dismissOnThreshold(DraggableScrollableNotification notification) {
|
||||||
if (notification.extent <= 0.1) {
|
if (notification.extent <= 0.1) {
|
||||||
@@ -591,14 +589,14 @@ class _SheetContainer extends HookConsumerWidget {
|
|||||||
ViewTabsSheet() =>
|
ViewTabsSheet() =>
|
||||||
NotificationListener<DraggableScrollableNotification>(
|
NotificationListener<DraggableScrollableNotification>(
|
||||||
onNotification: dismissOnThreshold,
|
onNotification: dismissOnThreshold,
|
||||||
child: _ViewTabsSheet(maxChildSize: stableMaxChildSize),
|
child: _ViewTabsSheet(maxChildSize: relativeSafeArea),
|
||||||
),
|
),
|
||||||
final SiteSettingsSheet parameter =>
|
final SiteSettingsSheet parameter =>
|
||||||
NotificationListener<DraggableScrollableNotification>(
|
NotificationListener<DraggableScrollableNotification>(
|
||||||
onNotification: dismissOnThreshold,
|
onNotification: dismissOnThreshold,
|
||||||
child: _SiteSettingsSheet(
|
child: _SiteSettingsSheet(
|
||||||
initialTabState: parameter.tabState,
|
initialTabState: parameter.tabState,
|
||||||
maxChildSize: stableMaxChildSize,
|
maxChildSize: relativeSafeArea,
|
||||||
bottomAppBarHeight: bottomAppBarHeight,
|
bottomAppBarHeight: bottomAppBarHeight,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user