Skip to content

Commit 8960baa

Browse files
authored
Updated the MaterialBanner example, NNBD, etc (flutter#72477)
1 parent 9ff4326 commit 8960baa

File tree

1 file changed

+21
-17
lines changed

1 file changed

+21
-17
lines changed

packages/flutter/lib/src/material/banner.dart

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,29 @@ import 'theme.dart';
1818
/// They are persistent and non-modal, allowing the user to either ignore them or
1919
/// interact with them at any time.
2020
///
21-
/// {@tool dartpad --template=stateless_widget_scaffold_no_null_safety}
22-
///
21+
/// {@tool dartpad --template=stateless_widget_material}
2322
/// ```dart
2423
/// Widget build(BuildContext context) {
25-
/// return MaterialBanner(
26-
/// padding: const EdgeInsets.all(20),
27-
/// content: Text("Hey, I am a Material Banner"),
28-
/// leading: Icon(Icons.agriculture_outlined),
29-
/// backgroundColor: Colors.grey[300],
30-
/// actions: <Widget>[
31-
/// FlatButton(
32-
/// child: Text("OPEN"),
33-
/// onPressed: () {},
34-
/// ),
35-
/// FlatButton(
36-
/// child: Text("DISMISS"),
37-
/// onPressed: () {},
38-
/// ),
39-
/// ],
24+
/// return Scaffold(
25+
/// appBar: AppBar(
26+
/// title: const Text('The MaterialBanner is below'),
27+
/// ),
28+
/// body: const MaterialBanner(
29+
/// padding: EdgeInsets.all(20),
30+
/// content: Text('Hello, I am a Material Banner'),
31+
/// leading: Icon(Icons.agriculture_outlined),
32+
/// backgroundColor: Color(0xFFE0E0E0),
33+
/// actions: <Widget>[
34+
/// TextButton(
35+
/// child: Text('OPEN'),
36+
/// onPressed: null,
37+
/// ),
38+
/// TextButton(
39+
/// child: Text('DISMISS'),
40+
/// onPressed: null,
41+
/// ),
42+
/// ],
43+
/// ),
4044
/// );
4145
/// }
4246
/// ```

0 commit comments

Comments
 (0)