Skip to content

Commit

Permalink
Fix PR issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Pante committed Nov 24, 2024
1 parent bc3bac4 commit 7205e70
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 30 deletions.
1 change: 0 additions & 1 deletion docs/pages/docs/overlay/popover-menu.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down
20 changes: 12 additions & 8 deletions docs/pages/docs/tile/select-menu-tile.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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});
Expand All @@ -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),
],
);
Expand All @@ -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});
Expand All @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions docs/pages/docs/tile/select-tile-group.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down Expand Up @@ -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'),
Expand Down
6 changes: 3 additions & 3 deletions docs/pages/docs/tile/tile-group.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down Expand Up @@ -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'),
Expand Down
14 changes: 3 additions & 11 deletions forui/lib/src/widgets/select_menu_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion forui/lib/src/widgets/tile/tile_group.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
1 change: 0 additions & 1 deletion samples/lib/widgets/popover_menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class _State extends StatefulSampleState<PopoverMenuPage> with SingleTickerProvi
popoverController: controller,
menuAnchor: Alignment.topRight,
childAnchor: Alignment.bottomRight,
maxHeight: 200,
menu: [
FTileGroup(
children: [
Expand Down
8 changes: 6 additions & 2 deletions samples/lib/widgets/select_menu_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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',
},
),
Expand All @@ -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),
],
);
Expand Down Expand Up @@ -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),
),
),
Expand Down

0 comments on commit 7205e70

Please sign in to comment.