@@ -59,7 +59,6 @@ class MotionToast extends StatefulWidget {
5959 this .contentPadding = EdgeInsets .zero,
6060 this .opacity = .9 ,
6161 }) : super (key: key) {
62- _initializeAnimationType ();
6362 _assertValidValues ();
6463 }
6564
@@ -104,7 +103,6 @@ class MotionToast extends StatefulWidget {
104103 primaryColor = successColor;
105104 secondaryColor = successSideBarColor;
106105 icon = Icons .check_circle_outline;
107- _initializeAnimationType ();
108106 _assertValidValues ();
109107 }
110108
@@ -149,7 +147,6 @@ class MotionToast extends StatefulWidget {
149147 primaryColor = warningColor;
150148 secondaryColor = warningSideBarColor;
151149 icon = Icons .warning;
152- _initializeAnimationType ();
153150 _assertValidValues ();
154151 }
155152
@@ -194,7 +191,6 @@ class MotionToast extends StatefulWidget {
194191 primaryColor = errorColor;
195192 secondaryColor = errorSideBarColor;
196193 icon = Icons .error;
197- _initializeAnimationType ();
198194 _assertValidValues ();
199195 }
200196
@@ -239,7 +235,6 @@ class MotionToast extends StatefulWidget {
239235 primaryColor = infoColor;
240236 secondaryColor = infoSideBarColor;
241237 icon = Icons .info;
242- _initializeAnimationType ();
243238 _assertValidValues ();
244239 }
245240
@@ -287,7 +282,6 @@ class MotionToast extends StatefulWidget {
287282 primaryColor = infoColor;
288283 secondaryColor = infoSideBarColor;
289284 icon = Icons .info;
290- _initializeAnimationType ();
291285 _assertValidValues ();
292286 }
293287
@@ -301,22 +295,6 @@ class MotionToast extends StatefulWidget {
301295 }
302296 }
303297
304- void _initializeAnimationType () {
305- if (toastAlignment.y == 1 &&
306- animationType == AnimationType .slideInFromTop) {
307- /// position.y == 1 means the toast is displayed at the bottom
308- /// if the animation type is fromTop it will be changed to fromBottom
309- // TODO change this to assert
310- animationType = AnimationType .slideInFromBottom;
311- } else if (toastAlignment.y == - 1 &&
312- animationType == AnimationType .slideInFromBottom) {
313- /// position.y == -1 means the toast is displayed at the top
314- /// if the animation type is fromBottom it will be changed to fromTop
315- // TODO change this to assert
316- animationType = AnimationType .slideInFromTop;
317- }
318- }
319-
320298 /// the text widget used for description message
321299 final Widget description;
322300
0 commit comments