banners 0.3.1 copy "banners: ^0.3.1" to clipboard
banners: ^0.3.1 copied to clipboard

Package for dynamically displaying global banners at the top of the screen.

Often, you want to be able to dynamically display banners at the top of the screen. This package offers this functionality.

How to use #

Create banners #

Create some banner Widgets. Use the BannerScaffold for automatically setting a color and respecting the status bar padding.

/// Indicates the user is using a demo account.
class DemoBanner extends StatelessWidget {
  Key get key => ValueKey('demo');

  @override
  Widget build(BuildContext context) {
    return BannerScaffold(
      backgroundColor: Colors.yellow,
      body: Padding(
        padding: EdgeInsets.all(8),
        child: Text('This is a demo account.'),
      ),
    );
  }
}

Use banners #

Wrap a widget with Bannered and provide the banner widgets. The MediaQuery's padding will be adjusted correctly.

return Bannered(
  banners: [
    // Some banner widgets.
  ],
  child: Scaffold(...),
);
10
likes
150
pub points
78%
popularity

Publisher

unverified uploader

Package for dynamically displaying global banners at the top of the screen.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

collection, flutter

More

Packages that depend on banners