MaterialBanner In Flutter

MaterialBanner In Flutter :

This flutter tutorial post is MaterialBanner widget in flutter.
A banner displays very important, message, and other provides actions. Actions using MaterialBanner widget dismissed or other action.

const MaterialBanner({
   Key key,
   @required this.content,
   @required this.actions,
   this.forceActionsBelow = false,

Screenshot :

MaterialBanner In Flutter

Material Banner.dart

class HomePage extends StatefulWidget {
  _HomePageState createState() => _HomePageState();

class _HomePageState extends State<HomePage> {
  final TextStyle whiteText = TextStyle(
    color: Colors.white,

  bool shouldShowBanner = true;

  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text("Material Banner"),
        body: Column(children: <Widget>[
          if (shouldShowBanner)
                padding: const EdgeInsets.all(20),
                contentTextStyle: whiteText,
                content: Text(
                  "Flutter Tutorial",
                leading: Icon(Icons.credit_card, color: Colors.white),
                backgroundColor: Colors.indigo,
                actions: <Widget>[
                      child: Text("UPDATE", style: whiteText),
                      onPressed: _hideBanner),
                      child: Text("DISMISS", style: whiteText),
                      onPressed: _hideBanner)

  void _hideBanner() {
    setState(() => shouldShowBanner = false);

The flutter tutorial  is a website that bring you the latest and amazing resources of code. All the languages codes are included in this website. The languages like flutter, android, java,kotlin etc.with the help of this languages any user can develop the beautiful application

For more information about Flutter. visit