Commit a8ec8c5d by Ben Getsug

attempt fixing ios background color

parent 15cb1414
...@@ -12,13 +12,14 @@ class Fluttertoast { ...@@ -12,13 +12,14 @@ class Fluttertoast {
static const MethodChannel _channel = static const MethodChannel _channel =
const MethodChannel('PonnamKarthik/fluttertoast'); const MethodChannel('PonnamKarthik/fluttertoast');
static Future<String> showToast( static Future<String> showToast({
{@required String msg, @required String msg,
Toast toastLength, Toast toastLength,
int timeInSecForIos = 1, int timeInSecForIos = 1,
ToastGravity gravity, ToastGravity gravity,
Color backgroundColor, Color backgroundColor,
Color textColor}) async { Color textColor,
}) async {
String toast = "short"; String toast = "short";
if (toastLength == Toast.LENGTH_LONG) { if (toastLength == Toast.LENGTH_LONG) {
toast = "long"; toast = "long";
...@@ -38,8 +39,9 @@ class Fluttertoast { ...@@ -38,8 +39,9 @@ class Fluttertoast {
'length': toast, 'length': toast,
'time': timeInSecForIos, 'time': timeInSecForIos,
'gravity': gravityToast, 'gravity': gravityToast,
'bgcolor': backgroundColor.value.toString() ?? "null", 'bgcolor':
'textcolor': textColor.value.toString() ?? "null" backgroundColor != null ? backgroundColor.value.toString() : "null",
'textcolor': textColor != null ? textColor.value.toString() : "null"
}; };
String res = await _channel.invokeMethod('showToast', params); String res = await _channel.invokeMethod('showToast', params);
return res; return res;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment