Commit 22e4b256 by Karthik Ponnam

Fixed Unresolved reference: R

parent 1a3ce5cf
## [8.0.4]
- Fixed Unresolved reference: R (Issue with Android API 30)
## [8.0.3]
- flutter analyze fixes
......
......@@ -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
......
......@@ -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'
......
......@@ -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 {
......
......@@ -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
}
......
......@@ -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=false"
export "TRACK_WIDGET_CREATION=true"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.packages"
export "PACKAGE_CONFIG=/Users/karthikponnam/Desktop/my/plugins/FlutterToast/example/.dart_tool/package_config.json"
......@@ -20,7 +20,7 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/fluttertoast/ios"
SPEC CHECKSUMS:
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
fluttertoast: 6122fa75143e992b1d3470f61000f591a798cc58
Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
......
......@@ -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;
......
......@@ -2,6 +2,6 @@
<Workspace
version = "1.0">
<FileRef
location = "group:Runner.xcodeproj">
location = "self:">
</FileRef>
</Workspace>
......@@ -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
......
......@@ -78,7 +78,7 @@ packages:
path: ".."
relative: true
source: path
version: "8.0.3"
version: "8.0.4"
js:
dependency: transitive
description:
......
......@@ -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:
......
......@@ -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,
);
......
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment