global_snack_bar_with_duration 0.0.13 copy "global_snack_bar_with_duration: ^0.0.13" to clipboard
global_snack_bar_with_duration: ^0.0.13 copied to clipboard

Provides a convenient way to summon a SnackBar Widget on any open page, without much extra code. (E9 added duration)

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:global_snack_bar/global_snack_bar.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Global Snack Bar Example',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: HomePage(title: 'Global Snack Bar Example'),
    );
  }
}

class HomePage extends StatefulWidget {
  HomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: GlobalMsgWrapper(
        Center(
          child: Text("Hello, World"),
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: () {
          GlobalSnackBarBloc.showMessage(
            GlobalMsg("hello", bgColor: Colors.cyanAccent),
          );
        },
        child: Icon(Icons.ac_unit),
      ),
    );
  }
}
1
likes
120
pub points
42%
popularity

Publisher

verified publishere9hq.com

Provides a convenient way to summon a SnackBar Widget on any open page, without much extra code. (E9 added duration)

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on global_snack_bar_with_duration