popup_build 2.1.0 copy "popup_build: ^2.1.0" to clipboard
popup_build: ^2.1.0 copied to clipboard

A Flutter library that the creation of basic popup UIs such as dialogs, bottom sheets, selection sheets, etc.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:popup_build/popup_build.dart';

extension PopupExt on Popup {
  Popup get all10 => copyWith(
        outPadding: const EdgeInsets.all(10.0),
        inPadding: const EdgeInsets.all(10.0),
      );

  Popup get back => copyWith(
      button: Container(
          decoration: const BoxDecoration(
              color: Colors.grey,
              borderRadius: BorderRadius.all(Radius.circular(10))),
          child: const BackButton()));

  Popup get close => copyWith(
      button: Container(
          decoration: const BoxDecoration(
              color: Colors.grey,
              borderRadius: BorderRadius.all(Radius.circular(10))),
          child: const CloseButton()));
}

void main() => runApp(MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        body: SafeArea(
          child: Padding(
            padding: const EdgeInsets.all(20.0),
            child: Builder(
                builder: (context) => Row(
                      children: [
                        Expanded(
                          child: ElevatedButton(
                              onPressed: () => const Popup(Column(
                                    mainAxisSize: MainAxisSize.min,
                                    children: [
                                      Text('Bottom Sheet'),
                                      TextField(),
                                    ],
                                  ))
                                      .all10
                                      .icHandle
                                      .back
                                      .close
                                      .showSheet(context),
                              child: const Text('Bottom Sheet')),
                        ),
                        Expanded(
                          child: ElevatedButton(
                              onPressed: () => PopupActionSheet.build(
                                    const [
                                      Text('Item 1'),
                                      Text('Item 2'),
                                      Text('Item 3'),
                                    ],
                                  )
                                      .copyWith(
                                        outPadding: const EdgeInsets.all(20.0),
                                        inPadding:
                                            const EdgeInsets.only(bottom: 20.0),
                                      )
                                      .close
                                      .showAction(context),
                              child: const Text('Action Sheet')),
                        ),
                        Expanded(
                          child: ElevatedButton(
                              onPressed: () => const Popup(Text('Dialog'))
                                  .all10
                                  .close
                                  .showDialog(context),
                              child: const Text('Dialog')),
                        ),
                      ],
                    )),
          ),
        ),
      ),
    ));
0
likes
160
points
58
downloads

Publisher

verified publisherhunghv.com

Weekly Downloads

A Flutter library that the creation of basic popup UIs such as dialogs, bottom sheets, selection sheets, etc.

Repository (GitHub)

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, flutter_svg

More

Packages that depend on popup_build