@@ -18,25 +18,29 @@ import 'theme.dart';
18
18
/// They are persistent and non-modal, allowing the user to either ignore them or
19
19
/// interact with them at any time.
20
20
///
21
- /// {@tool dartpad --template=stateless_widget_scaffold_no_null_safety}
22
- ///
21
+ /// {@tool dartpad --template=stateless_widget_material}
23
22
/// ```dart
24
23
/// 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
+ /// ),
40
44
/// );
41
45
/// }
42
46
/// ```
0 commit comments