Commit 8f8ec02e by Karthik

3.0.3

parent 36788f1b
## [3.0.3]
* fixed Android Toast.LENGTH_*
## [3.0.2]
* fixed #70 #71
## [3.0.1] ## [3.0.1]
* Release build failed fix * Release build failed fix
......
...@@ -13,7 +13,7 @@ If you dont want to use androidx then use `fluttertoast` version `2.2.11` ...@@ -13,7 +13,7 @@ If you dont want to use androidx then use `fluttertoast` version `2.2.11`
```yaml ```yaml
# add this line to your dependencies # add this line to your dependencies
fluttertoast: ^3.0.1 fluttertoast: ^3.0.3
``` ```
```dart ```dart
......
...@@ -5,6 +5,7 @@ import android.graphics.PorterDuff; ...@@ -5,6 +5,7 @@ import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Build; import android.os.Build;
import android.os.Handler; import android.os.Handler;
import android.util.Log;
import android.view.Gravity; import android.view.Gravity;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.View; import android.view.View;
...@@ -43,17 +44,14 @@ public class FluttertoastPlugin implements MethodCallHandler { ...@@ -43,17 +44,14 @@ 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");
toast = Toast.makeText(ctx, msg, Toast.LENGTH_SHORT);
toast.setText(msg);
if(length.equals("long")) { if(length.equals("long")) {
toast.setDuration(Toast.LENGTH_LONG); toast = Toast.makeText(ctx, msg, Toast.LENGTH_LONG);
} else { } else {
toast.setDuration(Toast.LENGTH_SHORT); toast = Toast.makeText(ctx, msg, Toast.LENGTH_SHORT);
} }
toast.setText(msg);
Boolean sent = false; Boolean sent = false;
// final Handler handler = new Handler(); // final Handler handler = new Handler();
// final Runnable run = new Runnable() { // final Runnable run = new Runnable() {
......
...@@ -38,7 +38,6 @@ android { ...@@ -38,7 +38,6 @@ android {
targetSdkVersion 28 targetSdkVersion 28
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }
buildTypes { buildTypes {
...@@ -56,6 +55,4 @@ flutter { ...@@ -56,6 +55,4 @@ flutter {
dependencies { dependencies {
testImplementation 'junit:junit:4.12' testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.2-alpha01'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.2-alpha01'
} }
...@@ -23,7 +23,7 @@ class _MyAppState extends State<MyApp> { ...@@ -23,7 +23,7 @@ class _MyAppState extends State<MyApp> {
void showColoredToast() { void showColoredToast() {
Fluttertoast.showToast( Fluttertoast.showToast(
msg: "This is Colored Toast", msg: "This is Colored Toast with android duration of 5 Sec",
toastLength: Toast.LENGTH_SHORT, toastLength: Toast.LENGTH_SHORT,
backgroundColor: Colors.red, backgroundColor: Colors.red,
textColor: Colors.white); textColor: Colors.white);
......
...@@ -13,7 +13,7 @@ class Fluttertoast { ...@@ -13,7 +13,7 @@ class Fluttertoast {
static const MethodChannel _channel = static const MethodChannel _channel =
const MethodChannel('PonnamKarthik/fluttertoast'); const MethodChannel('PonnamKarthik/fluttertoast');
// for Version 3.x.x // for Version 4.x.x
// static Fluttertoast _instance; // static Fluttertoast _instance;
......
name: fluttertoast name: fluttertoast
description: Toast Library for FLutter description: Toast Library for FLutter
version: 3.0.1 version: 3.0.3
author: Karthik Ponnam <ponnamkarthik3@gmail.com> author: Karthik Ponnam <ponnamkarthik3@gmail.com>
homepage: https://github.com/PonnamKarthik/FlutterToast homepage: https://github.com/PonnamKarthik/FlutterToast
......
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