English | 中文

Introduce

The function and design idea of package refer to giffy_dialog,compared with giffy_dialog, provides higher degree of freedom and stronger scalability,you can use various types of prompts preset in the package, or you can set the widget you want to display.Compared to giffy_ Dialog, customization is not limited to images, you can also pass in any widget or custom animation.proste_dialog needs ShowDialog to display. If you want to use animation effects in the display process, you can refer to the flutter_animated_dialog.

Usage

Note that if you pass in duration, the dialog will disappear automatically after the specified time. Even if your showconfirmbutton, showcancelbutton and showcloseicon are all true, the button will not be displayed

  1. ProsteDialog dialog of preset animation prompt in package
parameterparameterTypedefault
insetPaddingEdgeInsetsEdgeInsets.symmetric(horizontal: 40.0, vertical: 24.0)
dialogRadiusdouble5
typeDialogTipTypeDialogTipType.success
titleTextnull
contentText(required)null
titlePaddingEdgeInsetsEdgeInsets.only(top: 15, left: 15, right: 15)
contentPaddingEdgeInsetsEdgeInsets.all(10)
confirmButtonTextTextText('Confirm')
cancelButtonTextTextText('Cancel')
showConfirmButtonbooltrue
showCancelButtonbooltrue
buttonRadiusdouble5
confirmButtonColorColornull
cancelButtonColorColornull
onConfirmvoid Funtion()null
onCancelvoid Funtion()null
durationDurationnull

showDialog(
  context: context,
  builder: (_) => ProsteDialog(
    type: _tipType,
    content: Text('this is package preinstall dialog'),
    insetPadding: EdgeInsets.all(15),
    dialogRadius: 10,
    title: Text('this is package preinstall dialog title'),
    titlePadding: EdgeInsets.only(top: 20),
    contentPadding: EdgeInsets.all(15),
    confirmButtonText: Text('next', style: TextStyle(color: Colors.white)),
    cancelButtonText: Text('back', style: TextStyle(color: Colors.green)),
    showConfirmButton: true,
    showCancelButton: true,
    confirmButtonColor: Colors.cyan,
    cancelButtonColor: Colors.black,
    onConfirm: () {
      print('preinstall confirm pressed');
      Navigator.pop(context);
    },
    onCancel: () {
      print('preinstall cancel pressed');
      Navigator.pop(context);
    },
  ),
);

  1. ProsteCustomDialog customize dialog for header
parameterparameterTypedefault
insetPaddingEdgeInsetsEdgeInsets.symmetric(horizontal: 40.0, vertical: 24.0)
dialogRadiusdouble5
headerWidgetnull
titleTextnull
contentText(required)null
titlePaddingEdgeInsetsEdgeInsets.only(top: 15, left: 15, right: 15)
contentPaddingEdgeInsetsEdgeInsets.all(10)
confirmButtonTextTextText('Confirm')
cancelButtonTextTextText('Cancel')
showConfirmButtonbooltrue
showCancelButtonbooltrue
buttonRadiusdouble5
confirmButtonColorColornull
cancelButtonColorColornull
onConfirmvoid Funtion()null
onCancelvoid Funtion()null
durationDurationnull

showDialog(
  context: context,
  builder: (_) => ProsteCustomDialog(
    insetPadding: EdgeInsets.zero,
    dialogRadius: 50,
    header: AnimatedBuilder(
      animation: _animationController,
      builder: (context, child) {
        return Container(
          height: _animation.value,
          alignment: Alignment.center,
          child: CircularProgressIndicator(),
        );
      },
    ),
    title: Text('this is diy title'),
    content: Text('this is diy dialog'),
    titlePadding: EdgeInsets.only(top: 20),
    contentPadding: EdgeInsets.only(top: 50),
    confirmButtonText: Text('next', style: TextStyle(color: Colors.white)),
    cancelButtonText: Text('back', style: TextStyle(color: Colors.green)),
    showConfirmButton: false,
    showCancelButton: true,
    confirmButtonColor: Colors.cyan,
    cancelButtonColor: Colors.black,
    onConfirm: () {
      print('diy confirm pressed');
      Navigator.pop(context);
    },
    onCancel: () {
      print('diy cancel pressed');
      Navigator.pop(context);
    },
  ),
);

  1. ProsteAdvertiseDialog Dialog box with pictures only
parameterparameterTypedefault
factordouble (0< value <=1).9
imageImageProvider(required)null
closeIconColorColorsColors.white70
onImagePressedvoid Function()null
onImagePressedvoid Function()null
showCloseIconboolfalse
imageRadiusBorderRadiusBorderRadius.zero
closeBtnSizedouble32
durationDurationnull

showDialog(
  context: context,
  builder: (_) => ProsteAdvertiseDialog(
    factor: .6,
    showCloseIcon: true,
    closeIconColor: Colors.pink,
    closeBtnSize: 20,
    image: NetworkImage(networkImg),
    imageRadius: BorderRadius.circular(10),
    onImagePressed: () {
      print('image pressed');
      Navigator.pop(context);
    },
    onClosePressed: () {
      print('close pressed');
      Navigator.pop(context);
    },
  ),
);

Issue

If there is any problem or bug, please submit it to issue, I will deal with it as soon as I see it, thanks!

Libraries

proste_dialog