From a371fbcc1b72da7d3660f306ef24b2dcb1c159ca Mon Sep 17 00:00:00 2001 From: Tadas Petra <60107328+tadaspetra@users.noreply.github.com> Date: Mon, 2 Nov 2020 01:43:06 -0600 Subject: [PATCH] AdoptAWidget: MaterialBanner (#69530) --- packages/flutter/lib/src/material/banner.dart | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/packages/flutter/lib/src/material/banner.dart b/packages/flutter/lib/src/material/banner.dart index 9d6b73af1db..e50009a2130 100644 --- a/packages/flutter/lib/src/material/banner.dart +++ b/packages/flutter/lib/src/material/banner.dart @@ -18,6 +18,30 @@ import 'theme.dart'; /// They are persistent and non-modal, allowing the user to either ignore them or /// interact with them at any time. /// +/// {@tool dartpad --template=stateless_widget_scaffold} +/// +/// ```dart +/// Widget build(BuildContext context) { +/// return MaterialBanner( +/// padding: const EdgeInsets.all(20), +/// content: Text("Hey, I am an Material Banner"), +/// leading: Icon(Icons.agriculture_outlined), +/// backgroundColor: Colors.grey[300], +/// actions: [ +/// FlatButton( +/// child: Text("OPEN"), +/// onPressed: () {}, +/// ), +/// FlatButton( +/// child: Text("DISMISS"), +/// onPressed: () {}, +/// ), +/// ], +/// ); +/// } +/// ``` +/// {@end-tool} +/// /// The [actions] will be placed beside the [content] if there is only one. /// Otherwise, the [actions] will be placed below the [content]. Use /// [forceActionsBelow] to override this behavior.