diff --git a/example/android/.gitignore b/example/android/.gitignore index 0a741cb..3a147cb 100644 --- a/example/android/.gitignore +++ b/example/android/.gitignore @@ -2,6 +2,7 @@ gradle-wrapper.jar /.gradle /captures/ /gradlew +/app/.cxx /gradlew.bat /local.properties GeneratedPluginRegistrant.java diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 67e2098..19a563e 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -8,8 +8,8 @@ plugins { android { namespace = "com.example.example" - compileSdk = 34 - ndkVersion = "27.0.12077973" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion compileOptions { sourceCompatibility = JavaVersion.VERSION_1_8 diff --git a/example/lib/main.dart b/example/lib/main.dart index 885d5c4..604dc01 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -219,6 +219,7 @@ class _HomePageState extends State { void _displaySuccessMotionToast() { MotionToast toast = MotionToast.success( + animationType: AnimationType.slideInFromBottom, description: const Text( 'This is a description example', style: TextStyle(fontSize: 12), diff --git a/lib/motion_toast.dart b/lib/motion_toast.dart index 3204ebc..f9e148e 100644 --- a/lib/motion_toast.dart +++ b/lib/motion_toast.dart @@ -59,7 +59,6 @@ class MotionToast extends StatefulWidget { this.contentPadding = EdgeInsets.zero, this.opacity = .9, }) : super(key: key) { - _initializeAnimationType(); _assertValidValues(); } @@ -104,7 +103,6 @@ class MotionToast extends StatefulWidget { primaryColor = successColor; secondaryColor = successSideBarColor; icon = Icons.check_circle_outline; - _initializeAnimationType(); _assertValidValues(); } @@ -149,7 +147,6 @@ class MotionToast extends StatefulWidget { primaryColor = warningColor; secondaryColor = warningSideBarColor; icon = Icons.warning; - _initializeAnimationType(); _assertValidValues(); } @@ -194,7 +191,6 @@ class MotionToast extends StatefulWidget { primaryColor = errorColor; secondaryColor = errorSideBarColor; icon = Icons.error; - _initializeAnimationType(); _assertValidValues(); } @@ -239,7 +235,6 @@ class MotionToast extends StatefulWidget { primaryColor = infoColor; secondaryColor = infoSideBarColor; icon = Icons.info; - _initializeAnimationType(); _assertValidValues(); } @@ -287,7 +282,6 @@ class MotionToast extends StatefulWidget { primaryColor = infoColor; secondaryColor = infoSideBarColor; icon = Icons.info; - _initializeAnimationType(); _assertValidValues(); } @@ -301,22 +295,6 @@ class MotionToast extends StatefulWidget { } } - void _initializeAnimationType() { - if (toastAlignment.y == 1 && - animationType == AnimationType.slideInFromTop) { - /// position.y == 1 means the toast is displayed at the bottom - /// if the animation type is fromTop it will be changed to fromBottom - // TODO change this to assert - animationType = AnimationType.slideInFromBottom; - } else if (toastAlignment.y == -1 && - animationType == AnimationType.slideInFromBottom) { - /// position.y == -1 means the toast is displayed at the top - /// if the animation type is fromBottom it will be changed to fromTop - // TODO change this to assert - animationType = AnimationType.slideInFromTop; - } - } - /// the text widget used for description message final Widget description;