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
22e4b256
Commit
22e4b256
authored
Apr 16, 2021
by
Karthik Ponnam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed Unresolved reference: R
parent
1a3ce5cf
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
28 additions
and
42 deletions
+28
-42
CHANGELOG.md
+4
-0
README.md
+1
-1
android/build.gradle
+1
-1
android/src/main/kotlin/io/github/ponnamkarthik/toast/fluttertoast/MethodCallHandlerImpl.kt
+9
-9
example/android/app/build.gradle
+2
-2
example/ios/Flutter/flutter_export_environment.sh
+3
-3
example/ios/Podfile.lock
+1
-1
example/ios/Runner.xcodeproj/project.pbxproj
+0
-18
example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
+1
-1
example/lib/toast_context.dart
+2
-2
example/pubspec.lock
+1
-1
example/pubspec.yaml
+1
-1
example/test/widget_test.dart
+1
-1
pubspec.yaml
+1
-1
No files found.
CHANGELOG.md
View file @
22e4b256
## [8.0.4]
-
Fixed Unresolved reference: R (Issue with Android API 30)
## [8.0.3]
## [8.0.3]
-
flutter analyze fixes
-
flutter analyze fixes
...
...
README.md
View file @
22e4b256
...
@@ -34,7 +34,7 @@ This one has limited features and no control over UI
...
@@ -34,7 +34,7 @@ This one has limited features and no control over UI
```
yaml
```
yaml
# add this line to your dependencies
# add this line to your dependencies
fluttertoast
:
^8.0.
3
fluttertoast
:
^8.0.
4
```
```
```
dart
```
dart
...
...
android/build.gradle
View file @
22e4b256
...
@@ -25,7 +25,7 @@ apply plugin: 'com.android.library'
...
@@ -25,7 +25,7 @@ apply plugin: 'com.android.library'
apply
plugin:
'kotlin-android'
apply
plugin:
'kotlin-android'
android
{
android
{
compileSdkVersion
30
compileSdkVersion
29
sourceSets
{
sourceSets
{
main
.
java
.
srcDirs
+=
'src/main/kotlin'
main
.
java
.
srcDirs
+=
'src/main/kotlin'
...
...
android/src/main/kotlin/io/github/ponnamkarthik/toast/fluttertoast/MethodCallHandlerImpl.kt
View file @
22e4b256
...
@@ -42,7 +42,7 @@ internal class MethodCallHandlerImpl(var context: Context) : MethodCallHandler {
...
@@ -42,7 +42,7 @@ internal class MethodCallHandlerImpl(var context: Context) : MethodCallHandler {
Toast
.
LENGTH_SHORT
Toast
.
LENGTH_SHORT
}
}
if
(
bgcolor
!=
null
&&
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
R
)
{
if
(
bgcolor
!=
null
&&
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
Q
)
{
val
layout
=
(
context
.
getSystemService
(
Context
.
LAYOUT_INFLATER_SERVICE
)
as
LayoutInflater
).
inflate
(
R
.
layout
.
toast_custom
,
null
)
val
layout
=
(
context
.
getSystemService
(
Context
.
LAYOUT_INFLATER_SERVICE
)
as
LayoutInflater
).
inflate
(
R
.
layout
.
toast_custom
,
null
)
val
text
=
layout
.
findViewById
<
TextView
>(
R
.
id
.
text
)
val
text
=
layout
.
findViewById
<
TextView
>(
R
.
id
.
text
)
text
.
text
=
mMessage
text
.
text
=
mMessage
...
@@ -52,14 +52,14 @@ internal class MethodCallHandlerImpl(var context: Context) : MethodCallHandler {
...
@@ -52,14 +52,14 @@ internal class MethodCallHandlerImpl(var context: Context) : MethodCallHandler {
}
else
{
}
else
{
context
.
resources
.
getDrawable
(
R
.
drawable
.
corner
)
context
.
resources
.
getDrawable
(
R
.
drawable
.
corner
)
}
}
if
(
bgcolor
!=
null
)
{
if
(
bgcolor
!=
null
)
{
gradientDrawable
.
setColorFilter
(
bgcolor
.
toInt
(),
PorterDuff
.
Mode
.
SRC_IN
)
gradientDrawable
.
setColorFilter
(
bgcolor
.
toInt
(),
PorterDuff
.
Mode
.
SRC_IN
)
}
}
text
.
background
=
gradientDrawable
text
.
background
=
gradientDrawable
if
(
textSize
!=
null
)
{
if
(
textSize
!=
null
)
{
text
.
textSize
=
textSize
.
toFloat
()
text
.
textSize
=
textSize
.
toFloat
()
}
}
if
(
textcolor
!=
null
)
{
if
(
textcolor
!=
null
)
{
text
.
setTextColor
(
textcolor
.
toInt
())
text
.
setTextColor
(
textcolor
.
toInt
())
}
}
mToast
=
Toast
(
context
)
mToast
=
Toast
(
context
)
...
@@ -67,22 +67,22 @@ internal class MethodCallHandlerImpl(var context: Context) : MethodCallHandler {
...
@@ -67,22 +67,22 @@ internal class MethodCallHandlerImpl(var context: Context) : MethodCallHandler {
mToast
.
view
=
layout
mToast
.
view
=
layout
}
else
{
}
else
{
mToast
=
Toast
.
makeText
(
context
,
mMessage
,
mDuration
)
mToast
=
Toast
.
makeText
(
context
,
mMessage
,
mDuration
)
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
R
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
Q
)
{
try
{
try
{
val
textView
:
TextView
=
mToast
.
view
!!
.
findViewById
(
android
.
R
.
id
.
message
)
val
textView
:
TextView
=
mToast
.
view
!!
.
findViewById
(
android
.
R
.
id
.
message
)
if
(
textSize
!=
null
)
{
if
(
textSize
!=
null
)
{
textView
.
textSize
=
textSize
.
toFloat
()
textView
.
textSize
=
textSize
.
toFloat
()
}
}
if
(
textcolor
!=
null
)
{
if
(
textcolor
!=
null
)
{
textView
.
setTextColor
(
textcolor
.
toInt
())
textView
.
setTextColor
(
textcolor
.
toInt
())
}
}
}
catch
(
e
:
Exception
)
{
}
catch
(
e
:
Exception
)
{
}
}
}
}
}
}
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
R
)
{
// if(Build.VERSION.SDK_INT < Build.VERSION_CODES.Q
) {
when
(
mGravity
)
{
when
(
mGravity
)
{
Gravity
.
CENTER
->
{
Gravity
.
CENTER
->
{
mToast
.
setGravity
(
mGravity
,
0
,
0
)
mToast
.
setGravity
(
mGravity
,
0
,
0
)
...
@@ -94,7 +94,7 @@ internal class MethodCallHandlerImpl(var context: Context) : MethodCallHandler {
...
@@ -94,7 +94,7 @@ internal class MethodCallHandlerImpl(var context: Context) : MethodCallHandler {
mToast
.
setGravity
(
mGravity
,
0
,
100
)
mToast
.
setGravity
(
mGravity
,
0
,
100
)
}
}
}
}
}
//
}
if
(
context
is
Activity
)
{
if
(
context
is
Activity
)
{
(
context
as
Activity
).
runOnUiThread
{
mToast
.
show
()
}
(
context
as
Activity
).
runOnUiThread
{
mToast
.
show
()
}
}
else
{
}
else
{
...
...
example/android/app/build.gradle
View file @
22e4b256
...
@@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
...
@@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply
from:
"$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply
from:
"$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android
{
android
{
compileSdkVersion
30
compileSdkVersion
28
sourceSets
{
sourceSets
{
main
.
java
.
srcDirs
+=
'src/main/kotlin'
main
.
java
.
srcDirs
+=
'src/main/kotlin'
...
@@ -40,7 +40,7 @@ android {
...
@@ -40,7 +40,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId
"com.example.FlutterToast_example"
applicationId
"com.example.FlutterToast_example"
minSdkVersion
16
minSdkVersion
16
targetSdkVersion
30
targetSdkVersion
28
versionCode
flutterVersionCode
.
toInteger
()
versionCode
flutterVersionCode
.
toInteger
()
versionName
flutterVersionName
versionName
flutterVersionName
}
}
...
...
example/ios/Flutter/flutter_export_environment.sh
View file @
22e4b256
...
@@ -2,12 +2,12 @@
...
@@ -2,12 +2,12 @@
# This is a generated file; do not edit or check into version control.
# This is a generated file; do not edit or check into version control.
export
"FLUTTER_ROOT=/usr/local/Caskroom/flutter/1.22.3/flutter"
export
"FLUTTER_ROOT=/usr/local/Caskroom/flutter/1.22.3/flutter"
export
"FLUTTER_APPLICATION_PATH=/Users/karthikponnam/Desktop/my/plugins/FlutterToast/example"
export
"FLUTTER_APPLICATION_PATH=/Users/karthikponnam/Desktop/my/plugins/FlutterToast/example"
export
"FLUTTER_TARGET=lib/main.dart"
export
"FLUTTER_TARGET=
/Users/karthikponnam/Desktop/my/plugins/FlutterToast/example/
lib/main.dart"
export
"FLUTTER_BUILD_DIR=build"
export
"FLUTTER_BUILD_DIR=build"
export
"SYMROOT=
${
SOURCE_ROOT
}
/../build/ios"
export
"SYMROOT=
${
SOURCE_ROOT
}
/../build/ios"
export
"FLUTTER_BUILD_NAME=1.0.0"
export
"FLUTTER_BUILD_NAME=1.0.0"
export
"FLUTTER_BUILD_NUMBER=1"
export
"FLUTTER_BUILD_NUMBER=1"
export
"DART_OBFUSCATION=false"
export
"DART_OBFUSCATION=false"
export
"TRACK_WIDGET_CREATION=
fals
e"
export
"TRACK_WIDGET_CREATION=
tru
e"
export
"TREE_SHAKE_ICONS=false"
export
"TREE_SHAKE_ICONS=false"
export
"PACKAGE_CONFIG=
.packages
"
export
"PACKAGE_CONFIG=
/Users/karthikponnam/Desktop/my/plugins/FlutterToast/example/.dart_tool/package_config.json
"
example/ios/Podfile.lock
View file @
22e4b256
...
@@ -20,7 +20,7 @@ EXTERNAL SOURCES:
...
@@ -20,7 +20,7 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/fluttertoast/ios"
:path: ".symlinks/plugins/fluttertoast/ios"
SPEC CHECKSUMS:
SPEC CHECKSUMS:
Flutter:
0e3d915762c693b495b44d77113d4970485de6e
c
Flutter:
434fef37c0980e73bb6479ef766c45957d4b510
c
fluttertoast: 6122fa75143e992b1d3470f61000f591a798cc58
fluttertoast: 6122fa75143e992b1d3470f61000f591a798cc58
Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
...
...
example/ios/Runner.xcodeproj/project.pbxproj
View file @
22e4b256
...
@@ -150,7 +150,6 @@
...
@@ -150,7 +150,6 @@
97C146EC1CF9000F007C117D
/* Resources */
,
97C146EC1CF9000F007C117D
/* Resources */
,
9705A1C41CF9048500538489
/* Embed Frameworks */
,
9705A1C41CF9048500538489
/* Embed Frameworks */
,
3B06AD1E1E4923F5004D2608
/* Thin Binary */
,
3B06AD1E1E4923F5004D2608
/* Thin Binary */
,
4C8EBA6CE2BCF49B821A0E38
/* [CP] Embed Pods Frameworks */
,
);
);
buildRules
=
(
buildRules
=
(
);
);
...
@@ -222,23 +221,6 @@
...
@@ -222,23 +221,6 @@
shellPath
=
/bin/sh
;
shellPath
=
/bin/sh
;
shellScript
=
"/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"
;
shellScript
=
"/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"
;
};
};
4C8EBA6CE2BCF49B821A0E38
/* [CP] Embed Pods Frameworks */
=
{
isa
=
PBXShellScriptBuildPhase
;
buildActionMask
=
2147483647
;
files
=
(
);
inputFileListPaths
=
(
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist"
,
);
name
=
"[CP] Embed Pods Frameworks"
;
outputFileListPaths
=
(
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist"
,
);
runOnlyForDeploymentPostprocessing
=
0
;
shellPath
=
/bin/sh
;
shellScript
=
"\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"
;
showEnvVarsInLog
=
0
;
};
738D6934AB90330F1F008F9A
/* [CP] Check Pods Manifest.lock */
=
{
738D6934AB90330F1F008F9A
/* [CP] Check Pods Manifest.lock */
=
{
isa
=
PBXShellScriptBuildPhase
;
isa
=
PBXShellScriptBuildPhase
;
buildActionMask
=
2147483647
;
buildActionMask
=
2147483647
;
...
...
example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
View file @
22e4b256
...
@@ -2,6 +2,6 @@
...
@@ -2,6 +2,6 @@
<Workspace
<Workspace
version =
"1.0"
>
version =
"1.0"
>
<FileRef
<FileRef
location =
"
group:Runner.xcodeproj
"
>
location =
"
self:
"
>
</FileRef>
</FileRef>
</Workspace>
</Workspace>
example/lib/toast_context.dart
View file @
22e4b256
...
@@ -8,7 +8,7 @@ class ToastContext extends StatefulWidget {
...
@@ -8,7 +8,7 @@ class ToastContext extends StatefulWidget {
}
}
class
_ToastContextState
extends
State
<
ToastContext
>
{
class
_ToastContextState
extends
State
<
ToastContext
>
{
FToast
fToast
;
late
FToast
fToast
;
Widget
toast
=
Container
(
Widget
toast
=
Container
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
24.0
,
vertical:
12.0
),
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
24.0
,
vertical:
12.0
),
...
@@ -128,7 +128,7 @@ class _ToastContextState extends State<ToastContext> {
...
@@ -128,7 +128,7 @@ class _ToastContextState extends State<ToastContext> {
void
initState
()
{
void
initState
()
{
super
.
initState
();
super
.
initState
();
fToast
=
FToast
();
fToast
=
FToast
();
fToast
.
init
(
globalKey
.
currentState
.
context
);
fToast
.
init
(
globalKey
.
currentState
!
.
context
);
}
}
@override
@override
...
...
example/pubspec.lock
View file @
22e4b256
...
@@ -78,7 +78,7 @@ packages:
...
@@ -78,7 +78,7 @@ packages:
path: ".."
path: ".."
relative: true
relative: true
source: path
source: path
version: "8.0.
3
"
version: "8.0.
4
"
js:
js:
dependency: transitive
dependency: transitive
description:
description:
...
...
example/pubspec.yaml
View file @
22e4b256
...
@@ -6,7 +6,7 @@ description: Demonstrates how to use the FlutterToast plugin.
...
@@ -6,7 +6,7 @@ description: Demonstrates how to use the FlutterToast plugin.
publish_to
:
'
none'
# Remove this line if you wish to publish to pub.dev
publish_to
:
'
none'
# Remove this line if you wish to publish to pub.dev
environment
:
environment
:
sdk
:
"
>=2.7.0
<3.0.0"
sdk
:
'
>=2.12.0
<3.0.0'
dependencies
:
dependencies
:
flutter
:
flutter
:
...
...
example/test/widget_test.dart
View file @
22e4b256
...
@@ -19,7 +19,7 @@ void main() {
...
@@ -19,7 +19,7 @@ void main() {
expect
(
expect
(
find
.
byWidgetPredicate
(
find
.
byWidgetPredicate
(
(
Widget
widget
)
=>
widget
is
Text
&&
(
Widget
widget
)
=>
widget
is
Text
&&
widget
.
data
.
startsWith
(
'Running on:'
),
widget
.
data
!
.
startsWith
(
'Running on:'
),
),
),
findsOneWidget
,
findsOneWidget
,
);
);
...
...
pubspec.yaml
View file @
22e4b256
name
:
fluttertoast
name
:
fluttertoast
description
:
Toast Library for Flutter, Easily create toast messages in single line of code
description
:
Toast Library for Flutter, Easily create toast messages in single line of code
version
:
8.0.
3
version
:
8.0.
4
homepage
:
https://github.com/PonnamKarthik/FlutterToast
homepage
:
https://github.com/PonnamKarthik/FlutterToast
issue_tracker
:
https://github.com/ponnamkarthik/FlutterToast/issues
issue_tracker
:
https://github.com/ponnamkarthik/FlutterToast/issues
...
...
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