dropdown_banner 1.4.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 82


dropdown_banner #

DropdownBanner manages the creation and animation of banner ui elements that are useful for displaying warnings and updates to users. It is simple to use and effective at event communication.

Getting Started #

Using the dropdown banner is quite intuitive and simple. Below is a quick example of how to use it!

In your main.dart when creating the app #

import 'packages:dropdown_banner/dropdown_banner.dart';
class MainApp extends StatelessWidget {
  Widget build(BuildContext context) {
    final navigatorKey = GlobalKey<NavigatorState>();
    return MaterialApp(
        home: DropdownBanner(
          child: Scaffold(...),
          navigatorKey: navigatorKey,

Generate a banner event #

import 'packages:dropdown_banner/dropdown_banner.dart';
class SomeClass {
  void doSomethingThenFail() {
      text: 'Failed to complete network request',
      color: SKColors.warning_red,
      textStyle: TextStyle(color: Colors.white),

Planned improvements #

If this package gets any traction, I plan to add support for images, custom widgets, animation duration.. etc. If you have any ideas for making this package more applicable, just open an issue!

Other info #

This package uses another of my packages, dart_notification_center, for implementing the observer pattern. This is what makes using the banner so simple! Check it out if you find a need for it.

[1.4.0] - 10/2/2019

  • Swipe up to dismiss banner

[1.3.0] - 9/26/2019

  • Dynamically sizeable banners
  • Improved library structure
  • Maintenance and documentation

[1.2.0] - 8/19/2019

  • Change when library fetches height information

[1.1.1] - 7/25/2019

  • Fixes another issue with the navigator state resetting after every hot reload. should be good to go now. Updated the example to represent new package architecture.
  • This update has breaking changes. Sorry for the inconvenience, but this should greatly improve the stability and usability of the package.

[1.1.0] - 7/25/2019

  • Fixes the issue where child is rebuilt everytime navigator is used or hot reload occurs

[1.0.2] - 7/15/2019

  • Enabled navigator key override to prevent hot reloading from resetting

[1.0.1+1] - 7/11/2019

  • Upgraded package dependency version

[1.0.1] - 7/11/2019

  • Added shield and shortened description

[1.0.0] - 7/11/2019

  • Example project
  • Demonstration GIF
  • Flutter formatter
  • Project description

[0.1.1] - 7/11/2019

  • Updated SDK version to enable pub parsing

[0.1.0] - 7/11/2019

  • Initial version of the package.
  • Basic documentation completed.


example #

A new Flutter project.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  dropdown_banner: ^1.4.0

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:dropdown_banner/dropdown_banner.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Nov 15, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.0
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.2 <3.0.0
dart_notification_center ^1.0.0+1 1.0.0+1
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies