Skip to content

Commit

Permalink
Scaffold message functionality work (#8)
Browse files Browse the repository at this point in the history
* ScaffoldMessenger functionality added with example

* version updated to v1.0.3 and changelog.md updated

* git cache cleared
  • Loading branch information
princeteck authored Oct 26, 2022
1 parent d93ad3d commit f22d25f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### [1.0.3] - 2022-10-26 Release
* Task: Scaffold Messenger section Supporting `showSnackBar`.
* Task: added example.
* Task: version bumped to 1.0.3.
### [1.0.2] - 2022-10-26 Release
* Task: Theme section added with current variables as following : `theme`, `backgroundColor`, `typography`, `brightness`.
* Task: added example.
Expand Down
10 changes: 10 additions & 0 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,16 @@ class Demo extends StatelessWidget {
const Text('Texting horizontal spacer'),
],
),
TextButton.icon(
onPressed: () {
context.showSnackBar(const SnackBar(
content: Text('Snackbar example!'),
duration: Duration(seconds: 5)));
},
icon: const Icon(
Icons.podcasts,
),
label: const Text('Snackbar in context')),
],
),
),
Expand Down
4 changes: 4 additions & 0 deletions lib/src/extensions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,8 @@ extension uih on BuildContext {

/// Return `Theme` based [brightness]
Brightness get brightness => theme.brightness;

// Scaffold Message Section
showSnackBar(SnackBar child) =>
ScaffoldMessenger.of(this).showSnackBar(child);
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: uih
description: UiH ( Ui Helper ) is a flutter / dart utility package created to help people improve ui consistency throughout the multiple platform respective to the Ui Design and various hardware factor in real time. Access MediaQuery sizing info directly on the context, also adds some helper methods for sizing and layout.
version: 1.0.2
version: 1.0.3
homepage: https://packages.prodevplus.com/uih

environment:
Expand Down

0 comments on commit f22d25f

Please sign in to comment.