Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fluttertoast
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
songyanzhi
fluttertoast
Commits
15cb1414
Commit
15cb1414
authored
Dec 02, 2018
by
Ben Getsug
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
attempt fixing ios background color
parent
6e52d4a9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
31 deletions
+19
-31
lib/fluttertoast.dart
+19
-31
No files found.
lib/fluttertoast.dart
View file @
15cb1414
import
'dart:async'
;
import
'dart:async'
;
import
'dart:ui'
;
import
'package:flutter/services.dart'
;
import
'package:flutter/services.dart'
;
import
'package:meta/meta.dart'
;
import
'package:meta/meta.dart'
;
enum
Toast
{
LENGTH_SHORT
,
LENGTH_LONG
}
enum
Toast
{
enum
ToastGravity
{
TOP
,
BOTTOM
,
CENTER
}
LENGTH_SHORT
,
LENGTH_LONG
}
enum
ToastGravity
{
TOP
,
BOTTOM
,
CENTER
}
class
Fluttertoast
{
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
,
String
bgcolor
=
"null"
,
Color
backgroundColor
,
String
textcolor
=
"null"
Color
textColor
})
async
{
})
async
{
String
toast
=
"short"
;
String
toast
=
"short"
;
if
(
toastLength
==
Toast
.
LENGTH_LONG
)
{
if
(
toastLength
==
Toast
.
LENGTH_LONG
)
{
toast
=
"long"
;
toast
=
"long"
;
}
}
String
gravityToast
=
"bottom"
;
String
gravityToast
=
"bottom"
;
if
(
gravity
==
ToastGravity
.
TOP
)
{
if
(
gravity
==
ToastGravity
.
TOP
)
{
gravityToast
=
"top"
;
gravityToast
=
"top"
;
}
else
if
(
gravity
==
ToastGravity
.
CENTER
)
{
}
else
if
(
gravity
==
ToastGravity
.
CENTER
)
{
gravityToast
=
"center"
;
gravityToast
=
"center"
;
}
else
{
}
else
{
gravityToast
=
"bottom"
;
gravityToast
=
"bottom"
;
}
}
final
Map
<
String
,
dynamic
>
params
=
<
String
,
dynamic
>
{
final
Map
<
String
,
dynamic
>
params
=
<
String
,
dynamic
>{
'msg'
:
msg
,
'msg'
:
msg
,
'length'
:
toast
,
'length'
:
toast
,
'time'
:
timeInSecForIos
,
'time'
:
timeInSecForIos
,
'gravity'
:
gravityToast
,
'gravity'
:
gravityToast
,
'bgcolor'
:
b
gcolor
,
'bgcolor'
:
b
ackgroundColor
.
value
.
toString
()
??
"null"
,
'textcolor'
:
text
color
'textcolor'
:
text
Color
.
value
.
toString
()
??
"null"
};
};
String
res
=
await
_channel
.
invokeMethod
(
'showToast'
,
params
);
String
res
=
await
_channel
.
invokeMethod
(
'showToast'
,
params
);
return
res
;
return
res
;
}
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment