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