JackJonson / flutter_animated_dialog

A new Flutter dialog with a series of beautiful animations, slide fade rotate size scale rotate3D animations.
Apache License 2.0
22 stars 39 forks source link

Unable to set dialog size #1

Closed liyao20190808 closed 3 years ago

liyao20190808 commented 3 years ago

When i wrap my widget with a Container, set width or height is not working,the dialog is always fullscreen showAnimatedDialog( context: context, barrierDismissible: true, builder: (BuildContext context) { return Container( padding: EdgeInsets.all(10.0), width: 200.0, child: FlutterLogo( size: 150.0, ), ); }, animationType: DialogTransitionType.size, curve: Curves.linear, );

Seferi commented 3 years ago

I'm having the same problem. Is there a solution to this?

JackJonson commented 3 years ago

Using a 'Center' widget wrap your widget like this :

Center( child: Material( color: Colors.transparent, child: Container( width: 200, height: 200, child: ChildWidget() ) );