From 7205e7083a7375fecfb9c0b91dc330eeba581b53 Mon Sep 17 00:00:00 2001 From: Matthias Ngeo <matthiasngeo@gmail.com> Date: Sun, 24 Nov 2024 17:10:53 +0800 Subject: [PATCH] Fix PR issues --- docs/pages/docs/overlay/popover-menu.mdx | 1 - docs/pages/docs/tile/select-menu-tile.mdx | 20 ++++++++++++-------- docs/pages/docs/tile/select-tile-group.mdx | 6 +++--- docs/pages/docs/tile/tile-group.mdx | 6 +++--- forui/lib/src/widgets/select_menu_tile.dart | 14 +++----------- forui/lib/src/widgets/tile/tile_group.dart | 1 - samples/lib/widgets/popover_menu.dart | 1 - samples/lib/widgets/select_menu_tile.dart | 8 ++++++-- 8 files changed, 27 insertions(+), 30 deletions(-) diff --git a/docs/pages/docs/overlay/popover-menu.mdx b/docs/pages/docs/overlay/popover-menu.mdx index 26be0352c..603719bb3 100644 --- a/docs/pages/docs/overlay/popover-menu.mdx +++ b/docs/pages/docs/overlay/popover-menu.mdx @@ -40,7 +40,6 @@ A popover menu displays a menu in a portal aligned to a child. popoverController: controller, menuAnchor: Alignment.topRight, childAnchor: Alignment.bottomRight, - maxHeight: 200, menu: [ FTileGroup( children: [ diff --git a/docs/pages/docs/tile/select-menu-tile.mdx b/docs/pages/docs/tile/select-menu-tile.mdx index 6fb432bae..81870355e 100644 --- a/docs/pages/docs/tile/select-menu-tile.mdx +++ b/docs/pages/docs/tile/select-menu-tile.mdx @@ -198,11 +198,11 @@ FSelectMenuTile<Value>.builder( <Tabs items={['Preview', 'Code']}> <Tabs.Tab> - <Widget name='select-menu-tile' variant='scrollable' query={{}} height={400}/> + <Widget name='select-menu-tile' variant='scrollable' query={{}} height={500}/> </Tabs.Tab> <Tabs.Tab> - ```dart - enum Notification { all, direct, limitedTime, nothing } + ```dart {33} + enum Notification { all, direct, limitedTime, timeSensitive, selectedApps, nothing } class _ScrollableSelectMenuTile extends StatefulWidget { const _ScrollableSelectMenuTile({super.key}); @@ -228,15 +228,19 @@ FSelectMenuTile<Value>.builder( Notification.all => 'All', Notification.direct => 'Direct Messages', Notification.limitedTime => 'Limited Time', + Notification.SelectedApps => 'Selected Apps', + Notification.timeSensitive => 'Time Sensitive', null || Notification.nothing => 'None', }, ), ), - maxHeight: 150, + maxHeight: 200, menu: [ FSelectTile(title: const Text('All'), value: Notification.all), FSelectTile(title: const Text('Direct Messages'), value: Notification.direct), FSelectTile(title: const Text('Limited Time'), value: Notification.limitedTime), + FSelectTile(title: const Text('Selected Apps'), value: Notification.SelectedApps), + FSelectTile(title: const Text('Time Sensitive'), value: Notification.timeSensitive), FSelectTile(title: const Text('None'), value: Notification.nothing), ], ); @@ -252,14 +256,14 @@ FSelectMenuTile<Value>.builder( </Tabs> -### Lazy +### Lazy Scrollable <Tabs items={['Preview', 'Code']}> <Tabs.Tab> - <Widget name='select-menu-tile' variant='lazy' query={{}} height={400}/> + <Widget name='select-menu-tile' variant='lazy' query={{}} height={500}/> </Tabs.Tab> <Tabs.Tab> - ```dart {12, 19-22} + ```dart {12, 18-22} class _LazySelectMenuTile extends StatefulWidget { const _SelectMenuTileForm({super.key}); @@ -277,7 +281,7 @@ FSelectMenuTile<Value>.builder( validator: (value) => value == null ? 'Select an item' : null, prefixIcon: FIcon(FAssets.icons.variable), title: const Text('Applicable values'), - maxHeight: 150, + maxHeight: 200, menuTileBuilder: (context, index) => FSelectTile( title: Text('Tile $index'), value: index, diff --git a/docs/pages/docs/tile/select-tile-group.mdx b/docs/pages/docs/tile/select-tile-group.mdx index 522caeb0a..deaac3d26 100644 --- a/docs/pages/docs/tile/select-tile-group.mdx +++ b/docs/pages/docs/tile/select-tile-group.mdx @@ -105,7 +105,7 @@ FSelectTileGroup<Value>.builder( <Widget name='select-tile-group' variant='scrollable' query={{}} height={300}/> </Tabs.Tab> <Tabs.Tab> - ```dart + ```dart {5} FSelectTileGroup( groupController: FMultiSelectGroupController(values: {Sidebar.recents}), label: const Text('Settings'), @@ -133,14 +133,14 @@ FSelectTileGroup<Value>.builder( </Tabs.Tab> </Tabs> -#### Lazy +#### Lazy Scrollable <Tabs items={['Preview', 'Code']}> <Tabs.Tab> <Widget name='select-tile-group' variant='lazy' query={{}} height={300}/> </Tabs.Tab> <Tabs.Tab> - ```dart {1, 7-11} + ```dart {1, 5-11} FSelectTileGroup.builder( groupController: FMultiSelectGroupController(values: {1}), label: const Text('Settings'), diff --git a/docs/pages/docs/tile/tile-group.mdx b/docs/pages/docs/tile/tile-group.mdx index c084f6e09..b5290a19c 100644 --- a/docs/pages/docs/tile/tile-group.mdx +++ b/docs/pages/docs/tile/tile-group.mdx @@ -102,7 +102,7 @@ controller: ScrollController(), <Widget name='tile-group' variant='scrollable' query={{}} height={300}/> </Tabs.Tab> <Tabs.Tab> - ```dart + ```dart {4} FTileGroup( label: const Text('Settings'), description: const Text('Personalize your experience'), @@ -145,14 +145,14 @@ controller: ScrollController(), </Tabs.Tab> </Tabs> -#### Lazy +#### Lazy Scrollable <Tabs items={['Preview', 'Code']}> <Tabs.Tab> <Widget name='tile-group' variant='lazy' query={{}} height={300}/> </Tabs.Tab> <Tabs.Tab> - ```dart {1, 6-10} + ```dart {1, 4-10} FTileGroup.builder( label: const Text('Settings'), description: const Text('Personalize your experience'), diff --git a/forui/lib/src/widgets/select_menu_tile.dart b/forui/lib/src/widgets/select_menu_tile.dart index e76251af2..dc86a4133 100644 --- a/forui/lib/src/widgets/select_menu_tile.dart +++ b/forui/lib/src/widgets/select_menu_tile.dart @@ -33,29 +33,21 @@ class FSelectMenuTile<T> extends FormField<Set<T>> with FTileMixin { /// The scroll controller used to control the position to which this menu is scrolled. /// /// Scrolling past the end of the group using the controller will result in undefined behaviour. - /// - /// It is ignored if the group is part of a merged [FTileGroup]. final ScrollController? scrollController; - /// The cache extent in logical pixels. + /// The menu's cache extent in logical pixels. /// /// Items that fall in this cache area are laid out even though they are not (yet) visible on screen. It describes /// how many pixels the cache area extends before the leading edge and after the trailing edge of the viewport. - /// - /// It is ignored if the group is part of a merged [FTileGroup]. final double? cacheExtent; - /// The max height, in logical pixels. Defaults to infinity. - /// - /// It is ignored if the group is part of a merged [FTileGroup]. + /// The menu's max height, in logical pixels. Defaults to infinity. /// /// ## Contract /// Throws [AssertionError] if [maxHeight] is not positive. final double maxHeight; - /// Determines the way that drag start behavior is handled. Defaults to [DragStartBehavior.start]. - /// - /// It is ignored if the group is part of a merged [FTileGroup]. + /// Determines the way that the menu's drag start behavior is handled. Defaults to [DragStartBehavior.start]. final DragStartBehavior dragStartBehavior; /// The style. diff --git a/forui/lib/src/widgets/tile/tile_group.dart b/forui/lib/src/widgets/tile/tile_group.dart index ad671b1db..981c0254c 100644 --- a/forui/lib/src/widgets/tile/tile_group.dart +++ b/forui/lib/src/widgets/tile/tile_group.dart @@ -1,6 +1,5 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/gestures.dart'; -import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:meta/meta.dart'; diff --git a/samples/lib/widgets/popover_menu.dart b/samples/lib/widgets/popover_menu.dart index 18a6ca799..ef301c017 100644 --- a/samples/lib/widgets/popover_menu.dart +++ b/samples/lib/widgets/popover_menu.dart @@ -34,7 +34,6 @@ class _State extends StatefulSampleState<PopoverMenuPage> with SingleTickerProvi popoverController: controller, menuAnchor: Alignment.topRight, childAnchor: Alignment.bottomRight, - maxHeight: 200, menu: [ FTileGroup( children: [ diff --git a/samples/lib/widgets/select_menu_tile.dart b/samples/lib/widgets/select_menu_tile.dart index 18ac020f3..9c436e66d 100644 --- a/samples/lib/widgets/select_menu_tile.dart +++ b/samples/lib/widgets/select_menu_tile.dart @@ -5,7 +5,7 @@ import 'package:forui/forui.dart'; import 'package:forui_samples/sample.dart'; -enum Notification { all, direct, nothing, limitedTime } +enum Notification { all, direct, nothing, limitedTime, timeSensitive, selectedApps } @RoutePage() class SelectMenuTilePage extends StatefulSample { @@ -84,6 +84,8 @@ class _ScrollableSelectMenuTilePageState extends StatefulSampleState<ScrollableS Notification.all => 'All', Notification.direct => 'Direct Messages', Notification.limitedTime => 'Limited Time', + Notification.selectedApps => 'Selected Apps', + Notification.timeSensitive => 'Time Sensitive', null || Notification.nothing => 'None', }, ), @@ -93,6 +95,8 @@ class _ScrollableSelectMenuTilePageState extends StatefulSampleState<ScrollableS FSelectTile(title: const Text('All'), value: Notification.all), FSelectTile(title: const Text('Direct Messages'), value: Notification.direct), FSelectTile(title: const Text('Limited Time'), value: Notification.limitedTime), + FSelectTile(title: const Text('Selected Apps'), value: Notification.selectedApps), + FSelectTile(title: const Text('Time Sensitive'), value: Notification.timeSensitive), FSelectTile(title: const Text('None'), value: Notification.nothing), ], ); @@ -127,7 +131,7 @@ class _LazySelectMenuTilePageState extends StatefulSampleState<LazySelectMenuTil groupController: controller, prefixIcon: FIcon(FAssets.icons.variable), title: const Text('Applicable values'), - maxHeight: 150, + maxHeight: 200, menuTileBuilder: (context, index) => FSelectTile(title: Text('Tile $index'), value: index), ), ),