Skip to content

Commit

Permalink
Fix PR issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Pante committed Dec 8, 2024
1 parent 1c11cf5 commit c2ff069
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 19 deletions.
4 changes: 2 additions & 2 deletions docs/pages/docs/overlay/_meta.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export default {
dialog: 'Dialog',
sheet: 'Sheet',
'persistent-sheet': 'Persistent Sheet',
popover: 'Popover',
'popover-menu': 'Popover Menu',
'modal-sheet': 'Modal Sheet',
'persistent-sheet': 'Persistent Sheet',
tooltip: 'Tooltip',
};
16 changes: 9 additions & 7 deletions docs/pages/docs/overlay/persistent-sheet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,19 @@ import LinkBadgeGroup from "../../../components/link-badge/link-badge-group.tsx"

# Persistent Sheet

A persistent sheet that are displayed above another widget. It is part of [FScaffold](/docs/layout/scaffold), which
should be preferred in most cases.

A closely related widget is a [modal sheet](/docs/overlay/modal-sheet) which prevents the user from interacting with the
rest of the app.
A persistent sheet is displayed above another widget while still allowing users to interact with the widget below.
It is part of [FScaffold](/docs/layout/scaffold), which should be preferred in most cases.

<LinkBadgeGroup>
<LinkBadge label="API Reference" href="https://pub.dev/documentation/forui/latest/forui.widgets.sheet/forui.widgets.sheet-library.html"/>
</LinkBadgeGroup>

<Callout type="info">
A closely related widget is a [modal sheet](/docs/overlay/sheet) which prevents the user from interacting with the
rest of the app.
</Callout>

<Callout type="warning">
All calls to `showFPersistentSheet(...)` should be made inside widgets that have either `FScaffold` or `FSheets` as
their ancestor.
</Callout>
Expand Down Expand Up @@ -189,7 +191,7 @@ showFPersistentSheet(
<Widget name='persistent-sheet' query={{keepAliveOffstage: true}} height={500}/>
</Tabs.Tab>
<Tabs.Tab>
```dart {17}
```dart {23}
class Sheets extends StatefulWidget {
@override
State<Sheets> createState() => _State();
Expand Down Expand Up @@ -334,7 +336,7 @@ showFPersistentSheet(
<Widget name='persistent-sheet' query={{}} height={400} variant='draggable'/>
</Tabs.Tab>
<Tabs.Tab>
```dart
```dart {23-41}
class DraggableSheets extends StatefulWidget {
@override
State<DraggableSheets> createState() => _State();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
import { Tabs } from 'nextra/components';
import { Callout, Tabs } from 'nextra/components';
import { Widget } from "../../../components/widget.tsx";
import LinkBadge from "../../../components/link-badge/link-badge.tsx";
import LinkBadgeGroup from "../../../components/link-badge/link-badge-group.tsx";

# Modal Sheet
# Sheet

A modal sheet is an alternative to a menu or a dialog and prevents the user from interacting with the rest of the app.

A closely related widget is a [persistent sheet](/docs/overlay/persistent-sheet), which shows information that
supplements the primary content of the app without preventing the user from interacting with the app.
It navigates to a new page each time.

<LinkBadgeGroup>
<LinkBadge label="API Reference" href="https://pub.dev/documentation/forui/latest/forui.widgets.sheet/forui.widgets.sheet-library.html"/>
</LinkBadgeGroup>

<Callout type="info">
A closely related widget is a [persistent sheet](/docs/overlay/persistent-sheet), which shows information that
supplements the primary content of the app without preventing the user from interacting with the app.
</Callout>

<Tabs items={['Preview', 'Code']}>
<Tabs.Tab>
<Widget name='modal-sheet' query={{}} height={500}/>
Expand Down Expand Up @@ -160,7 +163,7 @@ showFSheet(
<Widget name='modal-sheet' query={{}} height={400} variant='draggable'/>
</Tabs.Tab>
<Tabs.Tab>
```dart
```dart {9-22}
FButton(
label: const Text('Click me'),
onPress: () => showFModalSheet(
Expand Down
4 changes: 2 additions & 2 deletions forui/lib/src/widgets/sheet/modal_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import 'package:forui/src/widgets/sheet/sheet.dart';
/// closed.
///
/// See:
/// * https://forui.dev/docs/overlay/modal-sheet for working examples.
/// * https://forui.dev/docs/overlay/sheet for working examples.
/// * [showFPersistentSheet] for displaying a sheet above the current widget.
/// * [FModalSheetRoute] for more information about the various arguments.
/// * [FSheetStyle] for customizing a switch's appearance.
Expand Down Expand Up @@ -96,7 +96,7 @@ Future<T?> showFSheet<T>({
/// app without preventing the user from interacting with the app.
///
/// See:
/// * https://forui.dev/docs/overlay/modal-sheet for working examples.
/// * https://forui.dev/docs/overlay/sheet for working examples.
/// * [FSheetStyle] for customizing a switch's appearance.
/// * [showFSheet] for displaying a FModalSheetRoute.
/// * [showFPersistentSheet] for displaying a sheet above the current widget.
Expand Down
2 changes: 1 addition & 1 deletion forui/lib/src/widgets/sheet/persistent_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ FPersistentSheetController showFPersistentSheet({
]);
}

key ??= ValueKey(Random.secure().nextInt(2147483647));
key ??= ValueKey(Random().nextInt(2147483647));
style ??= context.theme.sheetStyle;

final controller = FPersistentSheetController._(
Expand Down
2 changes: 1 addition & 1 deletion forui/lib/widgets/sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/// A sheet is a panel that slides in from the edge of a screen.
///
/// See:
/// * https://forui.dev/docs/overlay/modal-sheet for working examples of a modal sheet.
/// * https://forui.dev/docs/overlay/sheet for working examples of a modal sheet.
library forui.widgets.sheet;

export '../src/widgets/sheet/modal_sheet.dart';
Expand Down

0 comments on commit c2ff069

Please sign in to comment.