Skip to content

Commit

Permalink
Update example for the page type
Browse files Browse the repository at this point in the history
  • Loading branch information
ulusoyca committed Jan 29, 2024
1 parent c48c897 commit 07cf17b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
7 changes: 3 additions & 4 deletions lib/src/modal_page/non_scrolling_wolt_modal_sheet_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import 'package:wolt_modal_sheet/wolt_modal_sheet.dart';
/// provide scrolling capabilities to handle larger content effectively using slivers.
class NonScrollingWoltModalSheetPage extends SliverWoltModalSheetPage {
/// A [Widget] that represents the main content displayed in the page.
/// This is a shortcut for providing a list of Sliver widgets with only one Sliver widget.
/// This is a shortcut for providing a list of Sliver widgets with only one Sliver widget which
/// is [SliverFillViewport].
final Widget child;

/// Creates a page to be built within [WoltScrollableModalSheet].
Expand All @@ -35,9 +36,7 @@ class NonScrollingWoltModalSheetPage extends SliverWoltModalSheetPage {
}) : super(
isTopBarLayerAlwaysVisible: hasTopBarLayer,
mainContentSlivers: [
SliverFillViewport(
delegate: SliverChildListDelegate([child]),
),
SliverFillViewport(delegate: SliverChildListDelegate([child])),
],
);
}
2 changes: 1 addition & 1 deletion playground/lib/home/pages/root_sheet_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class RootSheetPage {
isSelected: false,
),
WoltSelectionListItemData(
title: 'WoltFlexibleSheetPage example',
title: 'NonScrollingWoltModalSheetPage example',
value: MultiPagePathName.flexibleLayout,
isSelected: false,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,18 @@ class SheetPageWithNonScrollingLayout {
}) {
const textStyle = TextStyle(fontSize: 24, fontWeight: FontWeight.bold);
return NonScrollingWoltModalSheetPage(
leadingNavBarWidget:
WoltModalSheetBackButton(onBackPressed: onBackPressed),
leadingNavBarWidget: WoltModalSheetBackButton(onBackPressed: onBackPressed),
trailingNavBarWidget: WoltModalSheetCloseButton(onClosed: onClosed),
hasTopBarLayer: true,
navBarHeight: 72.0,
topBarTitle: const Text('Non-scrolling page'),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
const Flexible(
flex: 2,
child: ColoredBox(
color: Colors.blue,
child: Center(
child: Text('Flex: 2', style: textStyle),
),
child: Center(
child: Text('Flex: 2', style: textStyle),
),
),
const Flexible(
Expand Down

0 comments on commit 07cf17b

Please sign in to comment.