popup_box 0.1.0

Flutter Android iOS web

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
100
pub points
73%
popularity

Publisher

rishitdagli.ml

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

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache 2.0 (LICENSE)

Dependencies

flutter

More

Packages that depend on popup_box