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??
2 Answers
There is no package as such that you need to the best of my knowledge.
You'll have to make
this a custom widget
make sure the root of the widget is StatefulBuilder
so that you can have your carousel work as desired.
And then simply call
showDialog(
context: context,
builder: (BuildContext context) => WidgetYouMade()
);
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();
});