FLUTTER ECOSYSTEM

bruce-brookshire/flutter_dropdown_banner

Flutter用のドロップダウンバナーで、ユーザーにイベントを通知したり、アクションを促すことができます

flutter_dropdown_banner のプロジェクト画像
Stars
25
Forks
5
最終プッシュ(UTC)
2020/04/29
プロジェクト状態
公開中
Bruce Brookshire GitHub avatar
GITHUB User

Bruce Brookshire ↗

Director of Engineering, Dallas @ FortyAU

@fortyauDallas, TX
言語DartObjective-CJava

使用している依存関係

依存関係一覧 3 件

元の README

以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。

README を開く / 閉じる

Pub

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.

https://raw.githubusercontent.com/bruce-brookshire/flutter_dropdown_banner/HEAD/demonstration.gif

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 {
  ...
  @override
  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() {
    DropdownBanner.showBanner(
      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.