@@ -1308,13 +1308,7 @@ class SimpleDialog extends StatelessWidget {
13081308}
13091309
13101310Widget _buildMaterialDialogTransitions (BuildContext context, Animation <double > animation, Animation <double > secondaryAnimation, Widget child) {
1311- return FadeTransition (
1312- opacity: CurvedAnimation (
1313- parent: animation,
1314- curve: Curves .easeOut,
1315- ),
1316- child: child,
1317- );
1311+ return child;
13181312}
13191313
13201314/// Displays a Material dialog above the current contents of the app, with
@@ -1589,6 +1583,33 @@ class DialogRoute<T> extends RawDialogRoute<T> {
15891583 transitionDuration: const Duration (milliseconds: 150 ),
15901584 transitionBuilder: _buildMaterialDialogTransitions,
15911585 );
1586+
1587+ CurvedAnimation ? _curvedAnimation;
1588+
1589+ void _setAnimation (Animation <double > animation) {
1590+ if (_curvedAnimation? .parent != animation) {
1591+ _curvedAnimation? .dispose ();
1592+ _curvedAnimation = CurvedAnimation (
1593+ parent: animation,
1594+ curve: Curves .easeOut,
1595+ );
1596+ }
1597+ }
1598+
1599+ @override
1600+ Widget buildTransitions (BuildContext context, Animation <double > animation, Animation <double > secondaryAnimation, Widget child) {
1601+ _setAnimation (animation);
1602+ return FadeTransition (
1603+ opacity: _curvedAnimation! ,
1604+ child: super .buildTransitions (context, animation, secondaryAnimation, child),
1605+ );
1606+ }
1607+
1608+ @override
1609+ void dispose () {
1610+ _curvedAnimation? .dispose ();
1611+ super .dispose ();
1612+ }
15921613}
15931614
15941615double _scalePadding (double textScaleFactor) {
0 commit comments