Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
BakerJQ committed Oct 16, 2020
1 parent 92d63ae commit 6f75105
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 deletions.
35 changes: 31 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ An easy way to show a flutter custom popup widget.
## Screenshot
| Android | iOS |
| :------: | :------: |
| ![](https://raw.githubusercontent.com/BakerJQ/flutter_easy_popup/master/screenshot/android.gif) |
![](https://raw.githubusercontent.com/BakerJQ/flutter_easy_popup/master/screenshot/iOS.gif) |
| ![](https://raw.githubusercontent.com/BakerJQ/flutter_easy_popup/master/screenshot/android.gif) | ![](https://raw.githubusercontent.com/BakerJQ/flutter_easy_popup/master/screenshot/iOS.gif) |

| Example | Screenshot |
| :------: | :------: |
| [Dropdown Menu](https://github.com/BakerJQ/flutter_easy_popup/blob/master/example/lib/drop_down_menu.dart) | ![](https://raw.githubusercontent.com/BakerJQ/flutter_easy_popup/master/screenshot/dropdown.gif) |
| [App Operation Guide](https://github.com/BakerJQ/flutter_easy_popup/blob/master/example/lib/guide_popup.dart) | ![](https://raw.githubusercontent.com/BakerJQ/flutter_easy_popup/master/screenshot/guide.gif) |
| [Multi Highlights](https://github.com/BakerJQ/flutter_easy_popup/blob/master/example/lib/home_page.dart) | ![](https://raw.githubusercontent.com/BakerJQ/flutter_easy_popup/master/screenshot/multi_highlights.gif) |

## Example
You can run example by commands below.
```
cd ./example
flutter create .
Expand All @@ -29,7 +35,9 @@ dependencies:
git: https://github.com/BakerJQ/flutter_easy_popup.git
```
## Define Custom Popup Widget
## Usage
### Define Custom Popup Widget
Define your custom popup widget with *EasyPopupChild*, and implement *dismiss* function which does work that need to be done while dismiss, eg. show dismiss animation.
```dart
class CustomWidget extends StatefulWidget with EasyPopupChild {
Expand All @@ -43,9 +51,28 @@ class CustomWidget extends StatefulWidget with EasyPopupChild {
}
```

## Call Show
### Call Show
Call *EasyPopup.show()* to show your widget as a popup.
```dart
EasyPopup.show(context, CustomWidget());
```

### Call pop
Call *EasyPopup.pop()* to dismiss the popup.
```dart
EasyPopup.pop(context);
```

### Params
| Param | Desc |
| :------: | :------: |
| context | BuildContext |
| child | Your popup widget |
| offsetLT | Left and Top offset of the dark background |
| offsetRB | Right and Bottom offset of the dark background |
| cancelable | Whether the popup can be dismissed by touch the outside area, or press back button on Android |
| darkEnable | Whether to show the dark background |
| duration | Duration to show the animation |
| highlights | Rects to show highlight area |


Binary file added screenshot/dropdown.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshot/guide.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshot/multi_highlights.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6f75105

Please sign in to comment.