how to show a Custom Dialog Box with animation in flutter?

Issue

I want to show a Custom dialoge box like this on pressing a button in flutter, is there is any package or widgets that can archive this??
something similar this

Solution

this is the best method for a widget like this (Custom dialog box)this will give you a good scale transition and you can set any widget as a custom dialog box.

showGeneralDialog(
    barrierColor: Colors.black.withOpacity(0.5),
    transitionBuilder: (context, a1, a2, widget) {
      return Transform.scale(
        scale: a1.value,
        //here inside opacity define your child instead projectdetails()
        child: Opacity(opacity: a1.value, child: ProjectDetails()),
      );
    },
    transitionDuration: Duration(milliseconds: 200),
    barrierDismissible: true,
    barrierLabel: '',
    context: context,
    pageBuilder: (context, animation1, animation2) {
    //return a emty container 
      return Container();

    });

Answered By – MhdBasilE

Answer Checked By – Clifford M. (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published.