diff --git a/packages/material_ui/example/lib/app/app.snippet.0.dart b/packages/material_ui/example/lib/app/app.snippet.0.dart new file mode 100644 index 000000000000..9c330c415ffc --- /dev/null +++ b/packages/material_ui/example/lib/app/app.snippet.0.dart @@ -0,0 +1,31 @@ +// Copyright 2013 The Flutter Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:material_ui/material_ui.dart'; + +/// Flutter code sample for [MaterialApp]. + +void main() { + runApp(const MaterialAppExample()); +} + +class MaterialAppExample extends StatelessWidget { + const MaterialAppExample({super.key}); + + @override + Widget build(BuildContext context) { + return + // #region content + MaterialApp( + home: Scaffold( + appBar: AppBar( + title: const Text('Home'), + ), + ), + debugShowCheckedModeBanner: false, + ) + // #endregion content + ; + } +} diff --git a/packages/material_ui/example/test/app/app.snippet.0_test.dart b/packages/material_ui/example/test/app/app.snippet.0_test.dart new file mode 100644 index 000000000000..02d59cde1eb6 --- /dev/null +++ b/packages/material_ui/example/test/app/app.snippet.0_test.dart @@ -0,0 +1,17 @@ +// Copyright 2013 The Flutter Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:flutter_test/flutter_test.dart'; +import 'package:material_ui/material_ui.dart'; +import 'package:material_ui_examples/app/app.snippet.0.dart' as example; + +void main() { + testWidgets('The app is mounted without a checked mode banner', ( + WidgetTester tester, + ) async { + await tester.pumpWidget(const example.MaterialAppExample()); + expect(find.byType(MaterialApp), findsOne); + expect(find.byType(CheckedModeBanner), findsNothing); + }); +} diff --git a/packages/material_ui/lib/src/app.dart b/packages/material_ui/lib/src/app.dart index fdfef4617901..75a330724ae4 100644 --- a/packages/material_ui/lib/src/app.dart +++ b/packages/material_ui/lib/src/app.dart @@ -128,16 +128,7 @@ enum ThemeMode { /// /// ![The MaterialApp displays a Scaffold ](https://flutter.github.io/assets-for-api-docs/assets/material/basic_material_app.png) /// -/// ```dart -/// MaterialApp( -/// home: Scaffold( -/// appBar: AppBar( -/// title: const Text('Home'), -/// ), -/// ), -/// debugShowCheckedModeBanner: false, -/// ) -/// ``` +/// {@example /example/lib/app/app.snippet.0.dart#content indent=strip} /// // TODO(framework): End of the blue example container. ///