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
5c2b6d39
Commit
5c2b6d39
authored
Aug 28, 2019
by
Karthik Ponnam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
v3.1.1
parent
893e9e4d
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
103 deletions
+23
-103
android/build.gradle
+1
-1
android/src/main/java/io/github/ponnamkarthik/toast/fluttertoast/FluttertoastPlugin.java
+17
-3
example/android/build.gradle
+1
-1
example/android/gradle/wrapper/gradle-wrapper.properties
+2
-2
lib/generated/i18n.dart
+0
-94
pubspec.yaml
+2
-2
No files found.
android/build.gradle
View file @
5c2b6d39
...
@@ -40,5 +40,5 @@ android {
...
@@ -40,5 +40,5 @@ android {
}
}
dependencies
{
dependencies
{
// implementation fileTree(dir: 'libs', include: ['*.jar'])
// implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation
'androidx.core:core:1.0.2'
//
implementation 'androidx.core:core:1.0.2'
}
}
android/src/main/java/io/github/ponnamkarthik/toast/fluttertoast/FluttertoastPlugin.java
View file @
5c2b6d39
...
@@ -4,7 +4,6 @@ import android.content.Context;
...
@@ -4,7 +4,6 @@ import android.content.Context;
import
android.graphics.PorterDuff
;
import
android.graphics.PorterDuff
;
import
android.graphics.drawable.Drawable
;
import
android.graphics.drawable.Drawable
;
import
androidx.core.content.res.ResourcesCompat
;
import
android.view.Gravity
;
import
android.view.Gravity
;
import
android.view.LayoutInflater
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.View
;
...
@@ -44,7 +43,7 @@ public class FluttertoastPlugin implements MethodCallHandler {
...
@@ -44,7 +43,7 @@ public class FluttertoastPlugin implements MethodCallHandler {
Number
textcolor
=
call
.
argument
(
"textcolor"
);
Number
textcolor
=
call
.
argument
(
"textcolor"
);
Number
textSize
=
call
.
argument
(
"fontSize"
);
Number
textSize
=
call
.
argument
(
"fontSize"
);
if
(
bgcolor
!=
null
&&
textcolor
!=
null
&&
textSize
!=
null
)
{
LayoutInflater
inflater
=
(
LayoutInflater
)
ctx
.
getSystemService
(
Context
.
LAYOUT_INFLATER_SERVICE
);
LayoutInflater
inflater
=
(
LayoutInflater
)
ctx
.
getSystemService
(
Context
.
LAYOUT_INFLATER_SERVICE
);
View
layout
=
inflater
.
inflate
(
R
.
layout
.
toast_custom
,
null
);
View
layout
=
inflater
.
inflate
(
R
.
layout
.
toast_custom
,
null
);
...
@@ -80,7 +79,9 @@ public class FluttertoastPlugin implements MethodCallHandler {
...
@@ -80,7 +79,9 @@ public class FluttertoastPlugin implements MethodCallHandler {
Drawable
shapeDrawable
;
Drawable
shapeDrawable
;
shapeDrawable
=
ResourcesCompat
.
getDrawable
(
ctx
.
getResources
(),
R
.
drawable
.
toast_bg
,
null
);
// shapeDrawable = ctx.getDrawable(ctx.getResources(), R.drawable.toast_bg, null);
shapeDrawable
=
ctx
.
getResources
().
getDrawable
(
R
.
drawable
.
toast_bg
);
if
(
bgcolor
!=
null
&&
shapeDrawable
!=
null
)
{
if
(
bgcolor
!=
null
&&
shapeDrawable
!=
null
)
{
shapeDrawable
.
setColorFilter
(
bgcolor
.
intValue
(),
PorterDuff
.
Mode
.
SRC_IN
);
shapeDrawable
.
setColorFilter
(
bgcolor
.
intValue
(),
PorterDuff
.
Mode
.
SRC_IN
);
...
@@ -112,6 +113,19 @@ public class FluttertoastPlugin implements MethodCallHandler {
...
@@ -112,6 +113,19 @@ public class FluttertoastPlugin implements MethodCallHandler {
}
}
toast
.
show
();
toast
.
show
();
}
else
{
int
toastLength
;
if
(
length
.
equals
(
"long"
))
{
toastLength
=
Toast
.
LENGTH_LONG
;
}
else
{
toastLength
=
Toast
.
LENGTH_SHORT
;
}
Toast
toast
=
Toast
.
makeText
(
ctx
,
msg
,
toastLength
);
toast
.
show
();
}
result
.
success
(
true
);
result
.
success
(
true
);
break
;
break
;
...
...
example/android/build.gradle
View file @
5c2b6d39
...
@@ -8,7 +8,7 @@ buildscript {
...
@@ -8,7 +8,7 @@ buildscript {
}
}
dependencies
{
dependencies
{
classpath
'com.android.tools.build:gradle:3.
2.1
'
classpath
'com.android.tools.build:gradle:3.
5.0
'
}
}
}
}
...
...
example/android/gradle/wrapper/gradle-wrapper.properties
View file @
5c2b6d39
#
Mon Feb 25 01:11:37
IST 2019
#
Wed Aug 28 13:18:11
IST 2019
distributionBase
=
GRADLE_USER_HOME
distributionBase
=
GRADLE_USER_HOME
distributionPath
=
wrapper/dists
distributionPath
=
wrapper/dists
zipStoreBase
=
GRADLE_USER_HOME
zipStoreBase
=
GRADLE_USER_HOME
zipStorePath
=
wrapper/dists
zipStorePath
=
wrapper/dists
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-
4.10
.1-all.zip
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-
5.4
.1-all.zip
lib/generated/i18n.dart
deleted
100644 → 0
View file @
893e9e4d
import
'dart:async'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/material.dart'
;
// ignore_for_file: non_constant_identifier_names
// ignore_for_file: camel_case_types
// ignore_for_file: prefer_single_quotes
//This file is automatically generated. DO NOT EDIT, all your changes would be lost.
class
S
implements
WidgetsLocalizations
{
const
S
();
static
const
GeneratedLocalizationsDelegate
delegate
=
GeneratedLocalizationsDelegate
();
static
S
of
(
BuildContext
context
)
=>
Localizations
.
of
<
S
>(
context
,
S
);
@override
TextDirection
get
textDirection
=>
TextDirection
.
ltr
;
}
class
en
extends
S
{
const
en
();
}
class
GeneratedLocalizationsDelegate
extends
LocalizationsDelegate
<
S
>
{
const
GeneratedLocalizationsDelegate
();
List
<
Locale
>
get
supportedLocales
{
return
const
<
Locale
>[
Locale
(
"en"
,
""
),
];
}
LocaleListResolutionCallback
listResolution
({
Locale
fallback
})
{
return
(
List
<
Locale
>
locales
,
Iterable
<
Locale
>
supported
)
{
if
(
locales
==
null
||
locales
.
isEmpty
)
{
return
fallback
??
supported
.
first
;
}
else
{
return
_resolve
(
locales
.
first
,
fallback
,
supported
);
}
};
}
LocaleResolutionCallback
resolution
({
Locale
fallback
})
{
return
(
Locale
locale
,
Iterable
<
Locale
>
supported
)
{
return
_resolve
(
locale
,
fallback
,
supported
);
};
}
Locale
_resolve
(
Locale
locale
,
Locale
fallback
,
Iterable
<
Locale
>
supported
)
{
if
(
locale
==
null
||
!
isSupported
(
locale
))
{
return
fallback
??
supported
.
first
;
}
final
Locale
languageLocale
=
Locale
(
locale
.
languageCode
,
""
);
if
(
supported
.
contains
(
locale
))
{
return
locale
;
}
else
if
(
supported
.
contains
(
languageLocale
))
{
return
languageLocale
;
}
else
{
final
Locale
fallbackLocale
=
fallback
??
supported
.
first
;
return
fallbackLocale
;
}
}
@override
Future
<
S
>
load
(
Locale
locale
)
{
final
String
lang
=
getLang
(
locale
);
if
(
lang
!=
null
)
{
switch
(
lang
)
{
case
"en"
:
return
SynchronousFuture
<
S
>(
const
en
());
default
:
// NO-OP.
}
}
return
SynchronousFuture
<
S
>(
const
S
());
}
@override
bool
isSupported
(
Locale
locale
)
=>
locale
!=
null
&&
supportedLocales
.
contains
(
locale
);
@override
bool
shouldReload
(
GeneratedLocalizationsDelegate
old
)
=>
false
;
}
String
getLang
(
Locale
l
)
=>
l
==
null
?
null
:
l
.
countryCode
!=
null
&&
l
.
countryCode
.
isEmpty
?
l
.
languageCode
:
l
.
toString
();
pubspec.yaml
View file @
5c2b6d39
name
:
fluttertoast
name
:
fluttertoast
description
:
Toast Library for FLutter
description
:
Toast Library for FLutter
version
:
3.1.
0
version
:
3.1.
1
author
:
Karthik Ponnam <ponnamkarthik3@gmail.com>
author
:
Karthik Ponnam <ponnamkarthik3@gmail.com>
homepage
:
https://github.com/PonnamKarthik/FlutterToast
homepage
:
https://github.com/PonnamKarthik/FlutterToast
...
@@ -10,7 +10,7 @@ environment:
...
@@ -10,7 +10,7 @@ environment:
dependencies
:
dependencies
:
flutter
:
flutter
:
sdk
:
flutter
sdk
:
flutter
meta
:
^1.1.
6
meta
:
^1.1.
7
# For information on the generic Dart part of this file, see the
# For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec
# following page: https://www.dartlang.org/tools/pub/pubspec
...
...
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