Skip to content

Commit

Permalink
Merge pull request #17 from cb-cloud/feature/replace-statefulwidget
Browse files Browse the repository at this point in the history
Refactoring to get rid of `StatefulWidget`.
  • Loading branch information
Kurogoma4D authored Mar 14, 2022
2 parents 2521fa8 + 444d0e9 commit 5a9a893
Show file tree
Hide file tree
Showing 7 changed files with 196 additions and 125 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## 1.1.0
### FEAT
- Added `InAppNotification.dismiss()` method that hides notification programmatically.
- from #14 .

### CHORE
- Refactored again.
- Get rid of `StatefulWidget`, using `findAncestorStateOfType()` method.
- This is expensive when using `BuildContext` that obtained from deep hierarchy of Widget tree, so it replaced with `getElementForInheritedWidgetOfExactType()` method on `InheritedWidget`.

## 1.0.2
### FIX
- Fixed a bug that `curve` option in `InAppNotification.show()` didn't affect.
Expand Down
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class _HomePageState extends State<HomePage> {
),
const SizedBox(height: 32),
ElevatedButton(
onPressed: () => InAppNotification.dismiss(),
onPressed: () => InAppNotification.dismiss(context: context),
child: Text('Dismiss Notification'),
)
],
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.0.2"
version: "1.1.0"
matcher:
dependency: transitive
description:
Expand Down
Loading

0 comments on commit 5a9a893

Please sign in to comment.