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
653e7dc3
Commit
653e7dc3
authored
Dec 20, 2018
by
Karthik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
default toast style fix
parent
6b2987a0
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
17 additions
and
19 deletions
+17
-19
CHANGELOG.md
+4
-0
README.md
+1
-1
android/src/main/java/io/github/ponnamkarthik/toast/fluttertoast/FluttertoastPlugin.java
+4
-10
example/android/build.gradle
+1
-1
example/android/gradle/wrapper/gradle-wrapper.properties
+2
-2
lib/fluttertoast.dart
+4
-4
pubspec.yaml
+1
-1
No files found.
CHANGELOG.md
View file @
653e7dc3
## [2.2.1]
*
default toast style fix #38
## [2.2.0]
*
Background color fixed #29
...
...
README.md
View file @
653e7dc3
...
...
@@ -11,7 +11,7 @@ Android Toast Library for Flutter
```
yaml
# add this line to your dependencies
fluttertoast
:
^2.2.
0
fluttertoast
:
^2.2.
1
```
```
dart
...
...
android/src/main/java/io/github/ponnamkarthik/toast/fluttertoast/FluttertoastPlugin.java
View file @
653e7dc3
...
...
@@ -7,6 +7,7 @@ import android.graphics.PorterDuff;
import
android.graphics.drawable.Drawable
;
import
android.os.Build
;
import
android.support.v4.content.ContextCompat
;
import
android.util.Log
;
import
android.view.Gravity
;
import
android.widget.TextView
;
import
android.widget.Toast
;
...
...
@@ -22,8 +23,6 @@ public class FluttertoastPlugin implements MethodCallHandler {
Context
ctx
;
int
defaultTextColor
=
Color
.
TRANSPARENT
;
FluttertoastPlugin
(
Context
context
)
{
ctx
=
context
;
}
...
...
@@ -43,6 +42,7 @@ public class FluttertoastPlugin implements MethodCallHandler {
Number
bgcolor
=
call
.
argument
(
"bgcolor"
);
Number
textcolor
=
call
.
argument
(
"textcolor"
);
Toast
toast
=
Toast
.
makeText
(
ctx
,
msg
,
Toast
.
LENGTH_SHORT
);
toast
.
setText
(
msg
);
...
...
@@ -66,10 +66,6 @@ public class FluttertoastPlugin implements MethodCallHandler {
TextView
text
=
toast
.
getView
().
findViewById
(
android
.
R
.
id
.
message
);
if
(
defaultTextColor
==
0
)
{
defaultTextColor
=
text
.
getCurrentTextColor
();
}
if
(
bgcolor
!=
null
)
{
Drawable
shapeDrawable
=
ContextCompat
.
getDrawable
(
ctx
,
R
.
drawable
.
toast_bg
);
...
...
@@ -84,10 +80,8 @@ public class FluttertoastPlugin implements MethodCallHandler {
}
try
{
text
.
setTextColor
(
textcolor
!=
null
?
textcolor
.
intValue
()
:
defaultTextColor
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
if
(
textcolor
!=
null
)
{
text
.
setTextColor
(
textcolor
.
intValue
());
}
toast
.
show
();
...
...
example/android/build.gradle
View file @
653e7dc3
...
...
@@ -8,7 +8,7 @@ buildscript {
}
dependencies
{
classpath
'com.android.tools.build:gradle:3.
1.2
'
classpath
'com.android.tools.build:gradle:3.
2.1
'
}
}
...
...
example/android/gradle/wrapper/gradle-wrapper.properties
View file @
653e7dc3
#
Fri Jun 23 08:50:38 CEST 2017
#
Thu Dec 20 12:42:32 IST 2018
distributionBase
=
GRADLE_USER_HOME
distributionPath
=
wrapper/dists
zipStoreBase
=
GRADLE_USER_HOME
zipStorePath
=
wrapper/dists
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-4.
4
-all.zip
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-4.
6
-all.zip
lib/fluttertoast.dart
View file @
653e7dc3
...
...
@@ -17,8 +17,8 @@ class Fluttertoast {
Toast
toastLength
,
int
timeInSecForIos
=
1
,
ToastGravity
gravity
,
Color
backgroundColor
=
const
Color
.
fromARGB
(
255
,
0
,
0
,
0
)
,
Color
textColor
=
const
Color
.
fromARGB
(
255
,
255
,
255
,
255
)
,
Color
backgroundColor
,
Color
textColor
,
})
async
{
String
toast
=
"short"
;
if
(
toastLength
==
Toast
.
LENGTH_LONG
)
{
...
...
@@ -39,8 +39,8 @@ class Fluttertoast {
'length'
:
toast
,
'time'
:
timeInSecForIos
,
'gravity'
:
gravityToast
,
'bgcolor'
:
backgroundColor
.
value
,
'textcolor'
:
textColor
.
value
,
'bgcolor'
:
backgroundColor
!=
null
?
backgroundColor
.
value
:
backgroundColor
,
'textcolor'
:
textColor
!=
null
?
textColor
.
value
:
textColor
,
};
String
res
=
await
_channel
.
invokeMethod
(
'showToast'
,
params
);
return
res
;
...
...
pubspec.yaml
View file @
653e7dc3
name
:
fluttertoast
description
:
Toast Library for FLutter
version
:
2.2.
0
version
:
2.2.
1
author
:
Karthik Ponnam <ponnamkarthik3@gmail.com>
homepage
:
https://github.com/PonnamKarthik/FlutterToast
...
...
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