Skip to content

Commit

Permalink
improve example
Browse files Browse the repository at this point in the history
  • Loading branch information
ulusoyca committed Dec 16, 2024
1 parent e149bc9 commit aab7869
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
12 changes: 10 additions & 2 deletions examples/playground/lib/home/pages/root_sheet_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,16 @@ class RootSheetPage {
destinationPage = SheetPageWithNonScrollingLayout.build();
break;
case ModalPageName.inAppNavigation:
destinationPage = SheetPageWithInAppNavigation.build();
break;
WoltModalSheet.of(context).addOrReplacePages(
[
SheetPageWithInAppNavigation.build(),
ProductWithSkuPage(1),
ProductWithSkuPage(2),
ProductWithSkuPage(3),
]
);
isButtonEnabledNotifier.value = selectedItemData.isSelected;
return;
case null:
WoltModalSheet.of(context).addOrReplacePages(
_constructAllPagesAfterRootPage(context),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,14 @@ class _ButtonForShowProductWithSku extends StatelessWidget {
Expanded(
child: WoltElevatedButton(
onPressed: () {
WoltModalSheet.of(context).showPage<ProductWithSkuPage>(where: (page) => page.sku == sku,);
_showMessage(context, 'Moved to product page with sku: $sku');
final didShowFilteredPage =
WoltModalSheet.of(context).showPage<ProductWithSkuPage>(
where: (page) => page.sku == sku,
);
String message = didShowFilteredPage
? 'Moved to product page with sku: $sku'
: 'Cannot navigate: No product page with sku $sku found.';
_showMessage(context, message);
},
child: Text('SKU $sku'),
),
Expand Down

0 comments on commit aab7869

Please sign in to comment.