popup_box 0.1.0 copy "popup_box: ^0.1.0" to clipboard
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 #

Pub Build GitHub license Twitter

Table of Contents #

  1. Importing the dependency
  2. Parameters
  3. 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,
                  )
                ],
              ));
        },)
4
likes
40
pub points
0%
popularity

Publisher

verified publisherrishit.tech

A Flutter package to easily create popup boxes, complete customization and animations are possible.

Repository (GitHub)
View/report issues

License

Apache-2.0 (LICENSE)

Dependencies

flutter

More

Packages that depend on popup_box