Skip to content

Commit

Permalink
modify: organize README
Browse files Browse the repository at this point in the history
  • Loading branch information
Kurogoma4D committed Jun 1, 2021
1 parent ec32a50 commit e6bbc43
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 14 deletions.
5 changes: 2 additions & 3 deletions CHANGELOG.md
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.
59 changes: 49 additions & 10 deletions README.md
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).
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: in_app_notification
description: A new Flutter package project.
description: A Flutter package for show custom in-app notification.
version: 0.0.1
repository: https://github.com/cb-cloud/flutter_in_app_notification

Expand Down

0 comments on commit e6bbc43

Please sign in to comment.