Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marcelgarus/banners
Flutter package for dynamically displaying global banners at the top of the screen.
https://github.com/marcelgarus/banners
Last synced: 8 days ago
JSON representation
Flutter package for dynamically displaying global banners at the top of the screen.
- Host: GitHub
- URL: https://github.com/marcelgarus/banners
- Owner: MarcelGarus
- License: mit
- Created: 2020-04-18T13:11:55.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-05-12T18:56:19.000Z (over 2 years ago)
- Last Synced: 2024-05-01T15:33:11.730Z (6 months ago)
- Language: Dart
- Size: 104 KB
- Stars: 1
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
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 `Widget`s.
Use the `BannerScaffold` for automatically setting a color and respecting the status bar padding.```dart
/// 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.
```dart
return Bannered(
banners: [
// Some banner widgets.
],
child: Scaffold(...),
);
```