popup_box 0.1.0 popup_box: ^0.1.0 copied to clipboard
A Flutter package to easily create popup boxes, complete customization and animations are possible.
popup_box Flutter #
Table of Contents #
- Importing the dependency
- Parameters
- Making a button
3.1 Starter declaration
3.2 Making the Text
3.2 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: <Widget>[
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: <Widget>[
Text(
'Hi',
style: TextStyle(fontSize: 40, color: Colors.black),
),
SizedBox(
height: 30,
)
],
));
},)