Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rishit-dagli/popup_box
A Flutter package to create popup boxes.
https://github.com/rishit-dagli/popup_box
Last synced: 20 days ago
JSON representation
A Flutter package to create popup boxes.
- Host: GitHub
- URL: https://github.com/rishit-dagli/popup_box
- Owner: Rishit-dagli
- License: apache-2.0
- Created: 2020-02-16T05:18:02.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-09-16T14:24:55.000Z (about 4 years ago)
- Last Synced: 2024-10-04T20:23:06.114Z (about 1 month ago)
- Language: Dart
- Homepage: https://pub.dev/packages/popup_box
- Size: 115 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# popup_box Flutter
![Pub](https://img.shields.io/badge/pub-v0.1.0-orange)
![Build](https://img.shields.io/badge/build-passing-brightgreen)
[![GitHub license](https://img.shields.io/github/license/Rishit-dagli/popup_box)](https://github.com/Rishit-dagli/popup_box/blob/master/LICENSE)
![GitHub followers](https://img.shields.io/github/followers/Rishit-dagli?label=Follow&style=social)
[![Twitter](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Fgithub.com%2FRishit-dagli%2Fpopup_box)](https://twitter.com/intent/tweet?text=Wow:&url=https%3A%2F%2Fgithub.com%2FRishit-dagli%2Fpopup_box)
![Twitter Follow](https://img.shields.io/twitter/follow/rishit_dagli?label=Follow&style=social)## Table of Contents
1. [Importing the dependency](#importing-the-dependency)
2. [Parameters](#parameters)
3. [Making a button](#making-a-button)
3.1 [Starter declaration](#starter-declaration)
3.2 [Making the Text](#making-the-text)
3.2 [Putting together the code](#putting-together-the-code)## Importing the dependency
* `pubsec.yaml`
```
dependencies:
popup_box:
```* `*.dart`
```
import 'package:popup_box/popup_box.dart';
```## Parameters
* `@required BuildContext context`
* `@required Widget willDisplayWidget`
* `@required Widget button`## Usage with an example
### Starter declaration
```
floatingActionButton: FloatingActionButton(
onPressed: () async {
await PopupBox.showPopupBox()}
```### Making a button
```
floatingActionButton: FloatingActionButton(
onPressed: () async {
await PopupBox.showPopupBox(
context: context,
button: MaterialButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
color: Colors.blue,
child: Text(
'Ok',
style: TextStyle(fontSize: 20),
),
onPressed: () {
Navigator.of(context).pop();
},
),
```### Making the Text
```
willDisplayWidget: Column(
children: [
Text(
'Hi',
style: TextStyle(fontSize: 40, color: Colors.black),
),
SizedBox(
height: 30,
)
],
));
```### Putting together the code
```
floatingActionButton: FloatingActionButton(
onPressed: () async {
await PopupBox.showPopupBox(
context: context,
button: MaterialButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
color: Colors.blue,
child: Text(
'Ok',
style: TextStyle(fontSize: 20),
),
onPressed: () {
Navigator.of(context).pop();
},
),
willDisplayWidget: Column(
children: [
Text(
'Hi',
style: TextStyle(fontSize: 40, color: Colors.black),
),
SizedBox(
height: 30,
)
],
));
},)
```