diff --git a/examples/cookbook/design/cupertino_sheets/lib/main.dart b/examples/cookbook/design/cupertino_sheets/lib/main.dart index 5a6e681191e..535d500d736 100644 --- a/examples/cookbook/design/cupertino_sheets/lib/main.dart +++ b/examples/cookbook/design/cupertino_sheets/lib/main.dart @@ -31,8 +31,9 @@ class CupertinoSheetPage extends StatelessWidget { // #docregion ShowCupertinoSheet showCupertinoSheet( context: context, - builder: (context) { + scrollableBuilder: (context, scrollController) { return SingleChildScrollView( + controller: scrollController, child: Center( child: Column( mainAxisSize: MainAxisSize.min, diff --git a/sites/docs/src/content/cookbook/design/cupertino-sheets.md b/sites/docs/src/content/cookbook/design/cupertino-sheets.md index e0ae83e13ae..0b00b9d8db3 100644 --- a/sites/docs/src/content/cookbook/design/cupertino-sheets.md +++ b/sites/docs/src/content/cookbook/design/cupertino-sheets.md @@ -42,15 +42,16 @@ class CupertinoSheetDemo extends StatelessWidget { ## 2. Display the sheet content With the basic app structure in place, display the sheet. -To show it, call `showCupertinoSheet` and provide a `builder` +To show it, call `showCupertinoSheet` and provide a `scrollableBuilder` that returns the content for the sheet, such as a `SingleChildScrollView`. ```dart showCupertinoSheet( context: context, - builder: (context) { + scrollableBuilder: (context, scrollController) { return SingleChildScrollView( + controller: scrollController, child: Center( child: Column( mainAxisSize: MainAxisSize.min, @@ -107,8 +108,9 @@ class CupertinoSheetPage extends StatelessWidget { onPressed: () { showCupertinoSheet( context: context, - builder: (context) { + scrollableBuilder: (context, scrollController) { return SingleChildScrollView( + controller: scrollController, child: Center( child: Column( mainAxisSize: MainAxisSize.min,