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
f09f28a2
Commit
f09f28a2
authored
Jan 18, 2019
by
Zac Chan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added font size
parent
74a5510f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
5 deletions
+19
-5
ios/Classes/FluttertoastPlugin.m
+17
-5
lib/fluttertoast.dart
+2
-0
No files found.
ios/Classes/FluttertoastPlugin.m
View file @
f09f28a2
...
...
@@ -44,6 +44,8 @@ static NSString *const CHANNEL_NAME = @"PonnamKarthik/fluttertoast";
NSNumber
*
bgcolor
=
call
.
arguments
[
@"bgcolor"
];
NSNumber
*
textcolor
=
call
.
arguments
[
@"textcolor"
];
NSNumber
*
size
=
call
.
arguments
[
@"size"
];
NSNumber
*
fontSize
=
call
.
arguments
[
@"fontSize"
];
double
fontSizeDouble
=
[
fontSize
doubleValue
];
int
time
=
1
;
@try
{
...
...
@@ -57,7 +59,7 @@ static NSString *const CHANNEL_NAME = @"PonnamKarthik/fluttertoast";
CSToastStyle
*
style
=
[[
CSToastStyle
alloc
]
initWithDefaultStyle
];
style
.
messageFont
=
[
UIFont
systemFontOfSize
:
fontSizeDouble
];
style
.
backgroundColor
=
[
self
colorWithHex
:
bgcolor
.
unsignedIntegerValue
];
style
.
messageColor
=
[
self
colorWithHex
:
textcolor
.
unsignedIntegerValue
];
...
...
@@ -65,7 +67,13 @@ static NSString *const CHANNEL_NAME = @"PonnamKarthik/fluttertoast";
[[
UIApplication
sharedApplication
].
delegate
.
window
.
rootViewController
.
view
makeToast
:
msg
duration
:
time
position
:
CSToastPositionTop
style
:
style
];
style
:
style
completion
:^
(
BOOL
didTap
){
NSNumber
*
boolNumber
=
[
NSNumber
numberWithBool
:
didTap
];
result
(
boolNumber
);
}];
}
else
if
([
gravity
isEqualToString
:
@"center"
])
{
[[
UIApplication
sharedApplication
].
delegate
.
window
.
rootViewController
.
view
makeToast
:
msg
duration
:
time
...
...
@@ -76,14 +84,18 @@ static NSString *const CHANNEL_NAME = @"PonnamKarthik/fluttertoast";
NSNumber
*
boolNumber
=
[
NSNumber
numberWithBool
:
didTap
];
result
(
boolNumber
);
}];
}
else
{
[[
UIApplication
sharedApplication
].
delegate
.
window
.
rootViewController
.
view
makeToast
:
msg
duration
:
time
position
:
CSToastPositionBottom
style
:
style
];
style
:
style
completion
:^
(
BOOL
didTap
){
NSNumber
*
boolNumber
=
[
NSNumber
numberWithBool
:
didTap
];
result
(
boolNumber
);
}];
}
}
else
{
...
...
lib/fluttertoast.dart
View file @
f09f28a2
...
...
@@ -35,6 +35,7 @@ class Fluttertoast {
@required
String
msg
,
Toast
toastLength
,
int
timeInSecForIos
=
1
,
double
fontSize
=
16.0
,
ToastGravity
gravity
,
Color
backgroundColor
,
Color
textColor
,
...
...
@@ -68,6 +69,7 @@ class Fluttertoast {
'gravity'
:
gravityToast
,
'bgcolor'
:
backgroundColor
!=
null
?
backgroundColor
.
value
:
null
,
'textcolor'
:
textColor
!=
null
?
textColor
.
value
:
null
,
'fontSize'
:
fontSize
,
};
bool
res
=
await
_channel
.
invokeMethod
(
'showToast'
,
params
);
...
...
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