Skip to content

hello-ring/z_dialog

Repository files navigation

z_dialog

ZDialog pub package

z_dialog is a brief Dialog

Example

build

build

build

Usage

to /example folder.

ZDialog.showAlert(context,
    title: 'Flutter',
    content:
        'Flutter is Google UI toolkit for building beautiful, natively compiled applications for mobile, web, desktop, and embedded devices from a single codebase.',
    actions: <Widget>[
        ZButton(
            isDark: true,
            text: '确定',
            onPressed: () {
                Navigator.of(context).pop();
            },
        ),
        ZButton(
            isDark: false,
            text: '取消',
            onPressed: () {
                Navigator.of(context).pop();
            },
        ),
    ]);

ZAlert.showBottomDialog(
    context, 
    circular: 12,
    options: ['Ring','Koa','Flutter'],
    onClick: (i, value) {
    Navigator.of(context).pop();
});

ZDialog.showCustomDialog(context,
    title: 'Custom',
    customWidget: Column(
        children: [
        Padding(
            padding: const EdgeInsets.all(18.0),
            child: Image.network(
                'https://flutter.cn/asset/flutter-hero-laptop2.png'),
        ),
        Text('Custom Widget')
        ],
    ),
    actions: <Widget>[
        ZButton(
            isDark: true,
            text: 'Ok',
            onPressed: () {
                Navigator.of(context).pop();
            },
        ),
        TextButton(
            onPressed: () {
                Navigator.of(context).pop();
            },
            child: Padding(
                padding: const EdgeInsets.only(left: 20, right: 20),
                child: Text(
                    'Cancel',
                    style: TextStyle(color: Colors.grey),
                ),
            ))
    ]);

information

z_dialog Much of the code references the Flutter Dialog