title: how to Create and Use SnackBar for ReUse(Globally) in Flutter
body: <p>i want create <code>SnackBar</code> for reusable(globally)</p>
  
  <p>i already created but its only for 1 page , i don't know how to create <strong>reusable</strong>.</p>
  
  <p><strong>below code:</strong></p>
  
  <pre><code>import 'package:flutter/material.dart';
  
  class SnackBarMain extends StatefulWidget {
    @override
    _SnackBarMainState createState() =&gt; _SnackBarMainState();
  }
  
  class _SnackBarMainState extends State&lt;SnackBarMain&gt; {
    final globalKey = GlobalKey&lt;ScaffoldState&gt;();
    String title = 'SnackBar';
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        key: globalKey,
        resizeToAvoidBottomPadding: false,
        appBar: AppBar(
          centerTitle: true,
          title: Text(title),
        ),
        body: Center(
          child: RaisedButton(
            shape: new RoundedRectangleBorder(
                borderRadius: new BorderRadius.circular(18.0),
                side: BorderSide(color: Colors.purple)),
            onPressed: () =&gt; snackBarMsg(context),
            color: Colors.purple,
            textColor: Colors.white,
            child: Text("SnackBar",
                style: TextStyle(fontSize: 18)),
          ),
        ),
      );
    }
  
  snackBarMsg(BuildContext context) {
      final sb = SnackBar(
        elevation: 0.0,
        //behavior: SnackBarBehavior.floating,
        content: Text('SnackBar Bottom Message'),
        duration: new Duration(seconds: 5000000),
        shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.only(
              topLeft: Radius.circular(16.0), topRight: Radius.circular(16.0)),
        ),
        //backgroundColor: Colors.redAccent,
        action: SnackBarAction(
          textColor: Color(0xFFFAF2FB),
          label: 'OK',
          onPressed: () {},
        ),
      );
      globalKey.currentState.showSnackBar(sb);
    }
  }
  </code></pre>
  
  <p>so any one please give me example for this</p>