diff --git a/README.md b/README.md
index 41934a8a..193857f7 100644
--- a/README.md
+++ b/README.md
@@ -72,6 +72,14 @@ Fluttertoast.showToast(
Fluttertoast.cancel()
```
+### Note Android Proguard
+
+If you are using proguard in your app, you must add the following rules to your `proguard-rules.pro` file. Otherwise, toasts will not be visible in a release build.
+
+```
+-keep class io.github.ponnamkarthik.toast.** { *; }
+```
+
### Note Android
diff --git a/ios/fluttertoast/Sources/fluttertoast/UIView+Toast.m b/ios/fluttertoast/Sources/fluttertoast/UIView+Toast.m
index 6717128f..c7569b26 100644
--- a/ios/fluttertoast/Sources/fluttertoast/UIView+Toast.m
+++ b/ios/fluttertoast/Sources/fluttertoast/UIView+Toast.m
@@ -395,7 +395,13 @@ - (void)makeToastActivity:(id)position {
activityView.layer.shadowOffset = style.shadowOffset;
}
- UIActivityIndicatorView *activityIndicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
+ UIActivityIndicatorView *activityIndicatorView;
+ if (@available(iOS 13.0, *)) {
+ activityIndicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleLarge];
+ activityIndicatorView.color = [UIColor whiteColor];
+ } else {
+ activityIndicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
+ }
activityIndicatorView.center = CGPointMake(activityView.bounds.size.width / 2, activityView.bounds.size.height / 2);
[activityView addSubview:activityIndicatorView];
[activityIndicatorView startAnimating];
diff --git a/lib/fluttertoast.dart b/lib/fluttertoast.dart
index f199dd31..340909c4 100644
--- a/lib/fluttertoast.dart
+++ b/lib/fluttertoast.dart
@@ -53,7 +53,12 @@ class Fluttertoast {
/// Let say you have an active show
/// Use this method to hide the toast immediately
static Future cancel() async {
- bool? res = await _channel.invokeMethod("cancel");
+ bool? res;
+ try {
+ res = await _channel.invokeMethod("cancel");
+ } on MissingPluginException {
+ // Ignore MissingPluginException for unsupported platforms like Windows
+ }
isCurrentlyShowingToast = false; // Update variable
return res;
}
@@ -119,7 +124,12 @@ class Fluttertoast {
isCurrentlyShowingToast = true; // Update variable
- bool? res = await _channel.invokeMethod('showToast', params);
+ bool? res;
+ try {
+ res = await _channel.invokeMethod('showToast', params);
+ } on MissingPluginException {
+ // Ignore MissingPluginException for unsupported platforms like Windows
+ }
// Assuming the platform will invoke 'cancel' method after showing toast
Future.delayed(Duration(seconds: timeInSecForIosWeb), () {