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
b2444366
Commit
b2444366
authored
Dec 02, 2018
by
Ben Getsug
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
attempt fixing ios background color
parent
f79f305e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
ios/Classes/FluttertoastPlugin.m
+11
-10
No files found.
ios/Classes/FluttertoastPlugin.m
View file @
b2444366
...
...
@@ -20,14 +20,15 @@ static NSString *const CHANNEL_NAME = @"PonnamKarthik/fluttertoast";
}
-
(
UIColor
*
)
getUIColorObjectFromInt
:
(
unsigned
int
)
value
{
UIColor
*
color
=
[
UIColor
colorWithRed
:((
CGFloat
)
((
value
&
0xFF
)
<<
16
))
/
255
green
:((
CGFloat
)
((
value
&
0xFF
)
<<
8
))
/
255
blue
:
((
CGFloat
)
((
value
&
0xFF
)
<<
0
))
/
255
alpha
:
((
CGFloat
)
((
value
&
0xFF
)
<<
24
))
/
255
];
return
color
;
-
(
UIColor
*
)
colorWithHex
:
(
NSUInteger
)
hex
{
CGFloat
red
,
green
,
blue
,
alpha
;
red
=
((
CGFloat
)((
hex
>>
16
)
&
0xFF
))
/
((
CGFloat
)
0xFF
);
green
=
((
CGFloat
)((
hex
>>
8
)
&
0xFF
))
/
((
CGFloat
)
0xFF
);
blue
=
((
CGFloat
)((
hex
>>
0
)
&
0xFF
))
/
((
CGFloat
)
0xFF
);
alpha
=
hex
>
0xFFFFFF
?
((
CGFloat
)((
hex
>>
24
)
&
0xFF
))
/
((
CGFloat
)
0xFF
)
:
1
;
return
[
UIColor
colorWithRed
:
red
green
:
green
blue
:
blue
alpha
:
alpha
];
}
-
(
void
)
handleMethodCall
:
(
FlutterMethodCall
*
)
call
result
:
(
FlutterResult
)
result
{
...
...
@@ -51,8 +52,8 @@ static NSString *const CHANNEL_NAME = @"PonnamKarthik/fluttertoast";
CSToastStyle
*
style
=
[[
CSToastStyle
alloc
]
initWithDefaultStyle
];
style
.
backgroundColor
=
[
self
getUIColorObjectFromInt
:
bgcolor
.
unsignedInt
Value
];
style
.
messageColor
=
[
self
getUIColorObjectFromInt
:
textcolor
.
unsignedInt
Value
];
style
.
backgroundColor
=
[
self
colorWithHex
:
bgcolor
.
unsignedInteger
Value
];
style
.
messageColor
=
[
self
colorWithHex
:
textcolor
.
unsignedInteger
Value
];
if
([
gravity
isEqualToString
:
@"top"
])
{
[[
UIApplication
sharedApplication
].
delegate
.
window
.
rootViewController
.
view
makeToast
:
msg
...
...
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