-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ec32a50
commit e6bbc43
Showing
3 changed files
with
52 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
## [0.0.1] - TODO: Add release date. | ||
|
||
* TODO: Describe initial release. | ||
## 0.1.0 | ||
First release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,53 @@ | ||
# in_app_notification | ||
# 💬 in_app_notification | ||
A Flutter package for show custom in-app notification. | ||
|
||
A new Flutter package project. | ||
<p align="center"> | ||
<image src="https://raw.githubusercontent.com/wiki/cb-cloud/flutter_in_app_notification/assets/doc/top.gif"/> | ||
</p> | ||
|
||
## Getting Started | ||
## ✍️ Usage | ||
|
||
This project is a starting point for a Dart | ||
[package](https://flutter.dev/developing-packages/), | ||
a library module containing code that can be shared easily across | ||
multiple Flutter or Dart projects. | ||
1. Import it. | ||
```yaml | ||
dependencies: | ||
in_app_notification: <latest-version> | ||
``` | ||
For help getting started with Flutter, view our | ||
[online documentation](https://flutter.dev/docs), which offers tutorials, | ||
samples, guidance on mobile development, and a full API reference. | ||
```dart | ||
import 'package:in_app_notification/in_app_notification.dart'; | ||
``` | ||
2. Place `InAppNotification` Widget into your app. | ||
We recommend to place it in the `builder` of the `MaterialApp`. | ||
|
||
```dart | ||
return MaterialApp( | ||
home: const HomePage(), | ||
builder: (context, child) => InAppNotification( | ||
safeAreaPadding: MediaQuery.of(context).viewPadding, | ||
minAlertHeight: 60.0, | ||
child: child, | ||
), | ||
); | ||
``` | ||
|
||
3. Get `InAppNotification` instance via `of()` method, and invoke `show()` method. | ||
|
||
```dart | ||
InAppNotification.of(context).show( | ||
child: YourOwnWidget(), | ||
onTap: () => print('Notification tapped!'), | ||
duration: Duration(milliseconds: _duration), | ||
); | ||
``` | ||
|
||
## 🗺 Loadmap / Known issue | ||
- Null-safety migration | ||
- Implementation for more gesture | ||
- Swipe horizontal | ||
- Performance optimization | ||
- Currently `InAppNotification` is recommended to use in `builder` of `MaterialApp`, but it means create instance each time of routing. | ||
- Animation improvement | ||
- So far, we have confirmed that using a Widget with a height higher than the `minAlertHeight ` specified for `InApp` will slightly break the animation. | ||
|
||
## 💭 Have a question? | ||
If you have a question or found issue, feel free to [create an issue](https://github.com/cb-cloud/flutter_in_app_notification/issues/new). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters