diff --git a/lib/codeviewer/code_segments.dart b/lib/codeviewer/code_segments.dart index f7dd1a864a..65d753d3ee 100644 --- a/lib/codeviewer/code_segments.dart +++ b/lib/codeviewer/code_segments.dart @@ -37180,20 +37180,6 @@ class CodeSegments { TextSpan(style: codeStyle.baseStyle, text: ' '), TextSpan(style: codeStyle.punctuationStyle, text: '{'), TextSpan(style: codeStyle.baseStyle, text: '\u000a '), - TextSpan(style: codeStyle.keywordStyle, text: 'final'), - TextSpan(style: codeStyle.baseStyle, text: ' '), - TextSpan(style: codeStyle.classStyle, text: 'GlobalKey'), - TextSpan(style: codeStyle.punctuationStyle, text: '<'), - TextSpan(style: codeStyle.classStyle, text: 'ScaffoldState'), - TextSpan(style: codeStyle.punctuationStyle, text: '>'), - TextSpan(style: codeStyle.baseStyle, text: ' _scaffoldKey '), - TextSpan(style: codeStyle.punctuationStyle, text: '='), - TextSpan(style: codeStyle.baseStyle, text: ' '), - TextSpan(style: codeStyle.classStyle, text: 'GlobalKey'), - TextSpan(style: codeStyle.punctuationStyle, text: '<'), - TextSpan(style: codeStyle.classStyle, text: 'ScaffoldState'), - TextSpan(style: codeStyle.punctuationStyle, text: '>();'), - TextSpan(style: codeStyle.baseStyle, text: '\u000a\u000a '), TextSpan(style: codeStyle.classStyle, text: 'PersonData'), TextSpan(style: codeStyle.baseStyle, text: ' person '), TextSpan(style: codeStyle.punctuationStyle, text: '='), @@ -37619,10 +37605,6 @@ class CodeSegments { TextSpan(style: codeStyle.baseStyle, text: ' '), TextSpan(style: codeStyle.classStyle, text: 'Scaffold'), TextSpan(style: codeStyle.punctuationStyle, text: '('), - TextSpan(style: codeStyle.baseStyle, text: '\u000a key'), - TextSpan(style: codeStyle.punctuationStyle, text: ':'), - TextSpan(style: codeStyle.baseStyle, text: ' _scaffoldKey'), - TextSpan(style: codeStyle.punctuationStyle, text: ','), TextSpan(style: codeStyle.baseStyle, text: '\u000a body'), TextSpan(style: codeStyle.punctuationStyle, text: ':'), TextSpan(style: codeStyle.baseStyle, text: ' '), diff --git a/lib/demos/material/menu_demo.dart b/lib/demos/material/menu_demo.dart index b1fc285d7f..cb4a151682 100644 --- a/lib/demos/material/menu_demo.dart +++ b/lib/demos/material/menu_demo.dart @@ -36,8 +36,6 @@ class MenuDemo extends StatefulWidget { } class _MenuDemoState extends State { - final GlobalKey _scaffoldKey = GlobalKey(); - void showInSnackBar(String value) { ScaffoldMessenger.of(context).hideCurrentSnackBar(); ScaffoldMessenger.of(context).showSnackBar(SnackBar( @@ -64,7 +62,6 @@ class _MenuDemoState extends State { } return Scaffold( - key: _scaffoldKey, appBar: AppBar( title: Text(GalleryLocalizations.of(context).demoMenuTitle), automaticallyImplyLeading: false, diff --git a/lib/demos/material/text_field_demo.dart b/lib/demos/material/text_field_demo.dart index 26116171c0..a5c454a928 100644 --- a/lib/demos/material/text_field_demo.dart +++ b/lib/demos/material/text_field_demo.dart @@ -102,8 +102,6 @@ class _PasswordFieldState extends State { } class TextFormFieldDemoState extends State { - final GlobalKey _scaffoldKey = GlobalKey(); - PersonData person = PersonData(); void showInSnackBar(String value) { @@ -172,7 +170,6 @@ class TextFormFieldDemoState extends State { const sizedBoxSpace = SizedBox(height: 24); return Scaffold( - key: _scaffoldKey, body: Form( key: _formKey, autovalidateMode: _autoValidateMode, diff --git a/lib/pages/demo.dart b/lib/pages/demo.dart index d0f7da5bc6..3b21614230 100644 --- a/lib/pages/demo.dart +++ b/lib/pages/demo.dart @@ -63,10 +63,11 @@ class _DemoPageState extends State { // Return to root if invalid slug. Navigator.of(context).pop(); } - return GalleryDemoPage( + return ScaffoldMessenger( + child: GalleryDemoPage( restorationId: widget.slug, demo: slugToDemoMap[widget.slug], - ); + )); } } @@ -382,9 +383,11 @@ class _GalleryDemoPageState extends State } Widget body; - Widget demoContent = DemoContent( - height: contentHeight, - buildRoute: _currentConfig.buildRoute, + Widget demoContent = ScaffoldMessenger( + child: DemoContent( + height: contentHeight, + buildRoute: _currentConfig.buildRoute, + ), ); if (isDesktop) { final isFullScreen = currentDemoState == _DemoState.fullscreen; diff --git a/pubspec.lock b/pubspec.lock index 1119f72872..38862b5a01 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -658,7 +658,7 @@ packages: name: vm_service url: "https://pub.dartlang.org" source: hosted - version: "5.2.0" + version: "5.5.0" watcher: dependency: transitive description: