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
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
39 additions
and
53 deletions
+39
-53
CHANGELOG.md
+4
-0
README.md
+1
-1
android/build.gradle
+1
-1
android/src/main/kotlin/io/github/ponnamkarthik/toast/fluttertoast/MethodCallHandlerImpl.kt
+20
-20
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]
-
flutter analyze fixes
...
...
README.md
View file @
22e4b256
...
...
@@ -34,7 +34,7 @@ This one has limited features and no control over UI
```
yaml
# add this line to your dependencies
fluttertoast
:
^8.0.
3
fluttertoast
:
^8.0.
4
```
```
dart
...
...
android/build.gradle
View file @
22e4b256
...
...
@@ -25,7 +25,7 @@ apply plugin: 'com.android.library'
apply
plugin:
'kotlin-android'
android
{
compileSdkVersion
30
compileSdkVersion
29
sourceSets
{
main
.
java
.
srcDirs
+=
'src/main/kotlin'
...
...
android/src/main/kotlin/io/github/ponnamkarthik/toast/fluttertoast/MethodCallHandlerImpl.kt
View file @
22e4b256
...
...
@@ -34,7 +34,7 @@ internal class MethodCallHandlerImpl(var context: Context) : MethodCallHandler {
"center"
->
Gravity
.
CENTER
else
->
Gravity
.
BOTTOM
}
val
mDuration
:
Int
mDuration
=
if
(
length
==
"long"
)
{
Toast
.
LENGTH_LONG
...
...
@@ -42,7 +42,7 @@ internal class MethodCallHandlerImpl(var context: Context) : MethodCallHandler {
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
text
=
layout
.
findViewById
<
TextView
>(
R
.
id
.
text
)
text
.
text
=
mMessage
...
...
@@ -52,14 +52,14 @@ internal class MethodCallHandlerImpl(var context: Context) : MethodCallHandler {
}
else
{
context
.
resources
.
getDrawable
(
R
.
drawable
.
corner
)
}
if
(
bgcolor
!=
null
)
{
if
(
bgcolor
!=
null
)
{
gradientDrawable
.
setColorFilter
(
bgcolor
.
toInt
(),
PorterDuff
.
Mode
.
SRC_IN
)
}
text
.
background
=
gradientDrawable
if
(
textSize
!=
null
)
{
if
(
textSize
!=
null
)
{
text
.
textSize
=
textSize
.
toFloat
()
}
if
(
textcolor
!=
null
)
{
if
(
textcolor
!=
null
)
{
text
.
setTextColor
(
textcolor
.
toInt
())
}
mToast
=
Toast
(
context
)
...
...
@@ -67,34 +67,34 @@ internal class MethodCallHandlerImpl(var context: Context) : MethodCallHandler {
mToast
.
view
=
layout
}
else
{
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
{
val
textView
:
TextView
=
mToast
.
view
!!
.
findViewById
(
android
.
R
.
id
.
message
)
if
(
textSize
!=
null
)
{
if
(
textSize
!=
null
)
{
textView
.
textSize
=
textSize
.
toFloat
()
}
if
(
textcolor
!=
null
)
{
textView
.
setTextColor
(
textcolor
.
toInt
())
}
}
catch
(
e
:
Exception
)
{
}
catch
(
e
:
Exception
)
{
}
}
}
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
R
)
{
when
(
mGravity
)
{
Gravity
.
CENTER
->
{
mToast
.
setGravity
(
mGravity
,
0
,
0
)
}
Gravity
.
TOP
->
{
mToast
.
setGravity
(
mGravity
,
0
,
100
)
}
else
->
{
mToast
.
setGravity
(
mGravity
,
0
,
100
)
}
// if(Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
when
(
mGravity
)
{
Gravity
.
CENTER
->
{
mToast
.
setGravity
(
mGravity
,
0
,
0
)
}
Gravity
.
TOP
->
{
mToast
.
setGravity
(
mGravity
,
0
,
100
)
}
else
->
{
mToast
.
setGravity
(
mGravity
,
0
,
100
)
}
}
// }
if
(
context
is
Activity
)
{
(
context
as
Activity
).
runOnUiThread
{
mToast
.
show
()
}
}
else
{
...
...
example/android/app/build.gradle
View file @
22e4b256
...
...
@@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply
from:
"$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android
{
compileSdkVersion
30
compileSdkVersion
28
sourceSets
{
main
.
java
.
srcDirs
+=
'src/main/kotlin'
...
...
@@ -40,7 +40,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId
"com.example.FlutterToast_example"
minSdkVersion
16
targetSdkVersion
30
targetSdkVersion
28
versionCode
flutterVersionCode
.
toInteger
()
versionName
flutterVersionName
}
...
...
example/ios/Flutter/flutter_export_environment.sh
View file @
22e4b256
...
...
@@ -2,12 +2,12 @@
# 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_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
"SYMROOT=
${
SOURCE_ROOT
}
/../build/ios"
export
"FLUTTER_BUILD_NAME=1.0.0"
export
"FLUTTER_BUILD_NUMBER=1"
export
"DART_OBFUSCATION=false"
export
"TRACK_WIDGET_CREATION=
fals
e"
export
"TRACK_WIDGET_CREATION=
tru
e"
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:
:path: ".symlinks/plugins/fluttertoast/ios"
SPEC CHECKSUMS:
Flutter:
0e3d915762c693b495b44d77113d4970485de6e
c
Flutter:
434fef37c0980e73bb6479ef766c45957d4b510
c
fluttertoast: 6122fa75143e992b1d3470f61000f591a798cc58
Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
...
...
example/ios/Runner.xcodeproj/project.pbxproj
View file @
22e4b256
...
...
@@ -150,7 +150,6 @@
97C146EC1CF9000F007C117D
/* Resources */
,
9705A1C41CF9048500538489
/* Embed Frameworks */
,
3B06AD1E1E4923F5004D2608
/* Thin Binary */
,
4C8EBA6CE2BCF49B821A0E38
/* [CP] Embed Pods Frameworks */
,
);
buildRules
=
(
);
...
...
@@ -222,23 +221,6 @@
shellPath
=
/bin/sh
;
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 */
=
{
isa
=
PBXShellScriptBuildPhase
;
buildActionMask
=
2147483647
;
...
...
example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
View file @
22e4b256
...
...
@@ -2,6 +2,6 @@
<Workspace
version =
"1.0"
>
<FileRef
location =
"
group:Runner.xcodeproj
"
>
location =
"
self:
"
>
</FileRef>
</Workspace>
example/lib/toast_context.dart
View file @
22e4b256
...
...
@@ -8,7 +8,7 @@ class ToastContext extends StatefulWidget {
}
class
_ToastContextState
extends
State
<
ToastContext
>
{
FToast
fToast
;
late
FToast
fToast
;
Widget
toast
=
Container
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
24.0
,
vertical:
12.0
),
...
...
@@ -128,7 +128,7 @@ class _ToastContextState extends State<ToastContext> {
void
initState
()
{
super
.
initState
();
fToast
=
FToast
();
fToast
.
init
(
globalKey
.
currentState
.
context
);
fToast
.
init
(
globalKey
.
currentState
!
.
context
);
}
@override
...
...
example/pubspec.lock
View file @
22e4b256
...
...
@@ -78,7 +78,7 @@ packages:
path: ".."
relative: true
source: path
version: "8.0.
3
"
version: "8.0.
4
"
js:
dependency: transitive
description:
...
...
example/pubspec.yaml
View file @
22e4b256
...
...
@@ -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
environment
:
sdk
:
"
>=2.7.0
<3.0.0"
sdk
:
'
>=2.12.0
<3.0.0'
dependencies
:
flutter
:
...
...
example/test/widget_test.dart
View file @
22e4b256
...
...
@@ -19,7 +19,7 @@ void main() {
expect
(
find
.
byWidgetPredicate
(
(
Widget
widget
)
=>
widget
is
Text
&&
widget
.
data
.
startsWith
(
'Running on:'
),
widget
.
data
!
.
startsWith
(
'Running on:'
),
),
findsOneWidget
,
);
...
...
pubspec.yaml
View file @
22e4b256
name
:
fluttertoast
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
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