dialog_context 0.1.2 copy "dialog_context: ^0.1.2" to clipboard
dialog_context: ^0.1.2 copied to clipboard

discontinuedreplaced by: one_context

Show Dialog, BottomSheet, ModalBottomSheet and SnackBar without BuildContext.

Pub Version PRs Welcome

Show Dialog, BottomSheet, ModalBottomSheet and SnackBar with no need BuildContext. #

To be discontinued, use the OneContext package: one_context

https://pub.dev/packages/one_context #

// example snackBar
DialogContext().showSnackBar(
    snackBar: SnackBar(content: Text('My awesome snackBar!'))
);
// example dialog
DialogContext().showDialog(
    builder: (context) => AlertDialog( 
        title: new Text("The Title"),
        content: new Text("The Body"),
    )
);
// example bottomSheet
DialogContext().showBottomSheet(
    builder: (context) => Container(
    alignment: Alignment.topCenter,
    height: 200,
    child: IconButton(
        icon: Icon(Icons.arrow_drop_down),
        iconSize: 50,
        color: Colors.white,
        onPressed: () => Navigator.pop(context)),
    ),
);

Important: Use the DialogContext().builder in MaterialApp #

MaterialApp(
  builder: DialogContext().builder, /// important: Use [DialogContext().builder] builder here!
  home: MyHomePage(title: 'Dialogs without BuildContext'),
);

Add dependency

  dependencies:
    dialog_context: ^0.1.1
5
likes
40
pub points
34%
popularity

Publisher

unverified uploader

Show Dialog, BottomSheet, ModalBottomSheet and SnackBar without BuildContext.

Repository (GitHub)
View/report issues

License

BSD-3-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on dialog_context