Skip to content

Commit

Permalink
fixed minor issues and updated java v17 in github builc checks
Browse files Browse the repository at this point in the history
  • Loading branch information
ponnamkarthik committed Dec 14, 2024
1 parent 9c5595c commit d744885
Show file tree
Hide file tree
Showing 64 changed files with 960 additions and 594 deletions.
40 changes: 20 additions & 20 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ name: Build Checks
# events but only for the master branch
on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand All @@ -21,21 +21,21 @@ jobs:
working-directory: ./example
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- run: flutter --version
- name: Build APK
run: flutter build apk
- name: Build For iOS
run: flutter build ios --release --no-codesign
- name: flutter build web --release
run: flutter build web --release
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/setup-java@v2
with:
distribution: "zulu"
java-version: "17"
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
channel: "stable"
- run: flutter --version
- name: Build APK
run: flutter build apk
- name: Build For iOS
run: flutter build ios --release --no-codesign
- name: flutter build web --release
run: flutter build web --release
329 changes: 329 additions & 0 deletions .idea/caches/deviceStreaming.xml

Large diffs are not rendered by default.

40 changes: 21 additions & 19 deletions .idea/libraries/Dart_SDK.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## [8.2.10]

- Support for latest flutter version (3.27.0)
- minor fixes

## [8.2.9]

- Removes references to Flutter v1 android embedding classes.
Expand Down Expand Up @@ -65,13 +70,15 @@
- Added fadeDuration in FToast to set fade animation Duration
- Fixed Toast behind the screen #287 , #281
- Fixed #303

## [8.0.6]

- Only safe (?.) or non-null asserted (!!.) (#300)

## [8.0.5]

- Fixed Unresolved reference: R (Issue with Android API 30)

## [8.0.4]

- Fixed Unresolved reference: R (Issue with Android API 30)
Expand Down Expand Up @@ -169,7 +176,6 @@

- Web Fix after name change


## [5.0.1]

- Many things changes on android side (this will break your current implementation)
Expand Down
73 changes: 35 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# [fluttertoast](https://pub.dev/packages/fluttertoast)
# [fluttertoast](https://pub.dev/packages/fluttertoast)

Toast Library for Flutter

Expand All @@ -17,24 +16,22 @@ Now this toast library supports two kinds of toast messages one which requires `
This one has limited features and no control over UI


## Toast Which requires BuildContext

> Supported Platforms
>
> Supported Platforms
>
> - ALL
1. Full Control of the Toast
2. Toasts will be queued
3. Remove a toast
4. Clear the queue


## How to Use

```yaml
# add this line to your dependencies
fluttertoast: ^8.2.8
fluttertoast: ^8.2.10
```
```dart
Expand All @@ -55,19 +52,19 @@ Fluttertoast.showToast(
);
```

| property | description | default |
| --------------- | ------------------------------------------------------------------ |------------|
| msg | String (Not Null)(required) |required |
| toastLength | Toast.LENGTH_SHORT or Toast.LENGTH_LONG (optional) |Toast.LENGTH_SHORT |
| gravity | ToastGravity.TOP (or) ToastGravity.CENTER (or) ToastGravity.BOTTOM (Web Only supports top, bottom) | ToastGravity.BOTTOM |
| timeInSecForIosWeb | int (for ios & web) | 1 (sec) |
| backgroundColor | Colors.red |null |
| textcolor | Colors.white |null |
| fontSize | 16.0 (float) | null |
| fontAsset | Path to a font file in the Flutter app assets folder, e.g. 'assets/path/to/some-font.ttf' (String) | null |
| webShowClose | false (bool) | false |
| webBgColor | String (hex Color) | linear-gradient(to right, #00b09b, #96c93d) |
| webPosition | String (`left`, `center` or `right`) | right |
| property | description | default |
| ------------------ | -------------------------------------------------------------------------------------------------- | ------------------------------------------- |
| msg | String (Not Null)(required) | required |
| toastLength | Toast.LENGTH_SHORT or Toast.LENGTH_LONG (optional) | Toast.LENGTH_SHORT |
| gravity | ToastGravity.TOP (or) ToastGravity.CENTER (or) ToastGravity.BOTTOM (Web Only supports top, bottom) | ToastGravity.BOTTOM |
| timeInSecForIosWeb | int (for ios & web) | 1 (sec) |
| backgroundColor | Colors.red | null |
| textcolor | Colors.white | null |
| fontSize | 16.0 (float) | null |
| fontAsset | Path to a font file in the Flutter app assets folder, e.g. 'assets/path/to/some-font.ttf' (String) | null |
| webShowClose | false (bool) | false |
| webBgColor | String (hex Color) | linear-gradient(to right, #00b09b, #96c93d) |
| webPosition | String (`left`, `center` or `right`) | right |

### To cancel all the toasts call

Expand All @@ -79,9 +76,7 @@ Fluttertoast.cancel()

<img src="https://raw.githubusercontent.com/ponnamkarthik/FlutterToast/master/screenshot/toast_deprecated_setview.png" height="200px" />


> Custom Toast will not work on android 11 and above, it will only use *msg* and *toastLength* remaining all properties are ignored
> Custom Toast will not work on android 11 and above, it will only use _msg_ and _toastLength_ remaining all properties are ignored
### Custom Toast For Android

Expand Down Expand Up @@ -125,7 +120,7 @@ MaterialApp(
),
```

```dart
```dart
FToast fToast;
@override
Expand Down Expand Up @@ -161,7 +156,7 @@ _showToast() {
gravity: ToastGravity.BOTTOM,
toastDuration: Duration(seconds: 2),
);
// Custom Toast Position
fToast.showToast(
child: toast,
Expand All @@ -175,17 +170,21 @@ _showToast() {
});
}
```
```

Now Call `_showToast()`

For more details check `example` project

| property | description | default |
| --------------- | ------------------------------------------------------------------ |------------|
| child | Widget (Not Null)(required) |required |
| toastDuration | Duration (optional) | |
| gravity | ToastGravity.* | |
| property | description | default |
| ---------------------- | --------------------------- | --------------------------- |
| child | Widget (Not Null)(required) | required |
| toastDuration | Duration (optional) | |
| gravity | ToastGravity.\* | |
| positionedToastBuilder | PositionedToastBuilder | |
| fadeDuration | Duration | Duration(milliseconds: 350) |
| ignorePointer | boolean | false |
| isDismissible | boolean | false |

### Use NavigatorKey for Context(to access context globally)

Expand All @@ -202,15 +201,15 @@ FToast fToast = FToast();
fToast.init(yourNavKey.currentContext!);
```

### To cancel all the toasts call
```dart
### To cancel all the toasts call

```dart
// To remove present shwoing toast
fToast.removeCustomToast()
// To clear the queue
fToast.removeQueuedCustomToasts();
```
```

## Preview Images (No BuildContext)

Expand All @@ -220,15 +219,13 @@ fToast.removeQueuedCustomToasts();
<img src="https://raw.githubusercontent.com/ponnamkarthik/FlutterToast/master/screenshot/4.png" width="320px" />

## Preview Images (BuildContext)

<img src="https://raw.githubusercontent.com/ponnamkarthik/FlutterToast/master/screenshot/11.jpg" width="320px" />

<img src="https://raw.githubusercontent.com/ponnamkarthik/FlutterToast/master/screenshot/11.jpg" width="320px" />

## If you need any features suggest

...


## Buy Me a Coffee

<a href="https://www.buymeacoffee.com/karthikponnam" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a>
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import android.view.Gravity
import android.view.LayoutInflater
import android.widget.TextView
import android.widget.Toast
import android.util.Log
import androidx.core.content.ContextCompat
import io.flutter.FlutterInjector
import io.flutter.plugin.common.MethodCall
Expand Down Expand Up @@ -75,6 +76,7 @@ internal class MethodCallHandlerImpl(private var context: Context) : MethodCallH
}
mToast?.view = layout
} else {
Log.d("KARTHIK", "showToast: $bgcolor $textcolor $fontSize $fontAsset")
mToast = Toast.makeText(context, mMessage, mDuration)
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
val textView: TextView = mToast?.view!!.findViewById(android.R.id.message)
Expand Down
34 changes: 17 additions & 17 deletions example/.metadata
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled.
# This file should be version controlled and should not be manually edited.

version:
revision: eb6d86ee27deecba4a83536aa20f366a6044895c
channel: stable
revision: "8495dee1fd4aacbe9de707e7581203232f591b2f"
channel: "stable"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: eb6d86ee27deecba4a83536aa20f366a6044895c
base_revision: eb6d86ee27deecba4a83536aa20f366a6044895c
create_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
base_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
- platform: android
create_revision: eb6d86ee27deecba4a83536aa20f366a6044895c
base_revision: eb6d86ee27deecba4a83536aa20f366a6044895c
create_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
base_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
- platform: ios
create_revision: eb6d86ee27deecba4a83536aa20f366a6044895c
base_revision: eb6d86ee27deecba4a83536aa20f366a6044895c
create_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
base_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
- platform: linux
create_revision: eb6d86ee27deecba4a83536aa20f366a6044895c
base_revision: eb6d86ee27deecba4a83536aa20f366a6044895c
create_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
base_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
- platform: macos
create_revision: eb6d86ee27deecba4a83536aa20f366a6044895c
base_revision: eb6d86ee27deecba4a83536aa20f366a6044895c
create_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
base_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
- platform: web
create_revision: eb6d86ee27deecba4a83536aa20f366a6044895c
base_revision: eb6d86ee27deecba4a83536aa20f366a6044895c
create_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
base_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
- platform: windows
create_revision: eb6d86ee27deecba4a83536aa20f366a6044895c
base_revision: eb6d86ee27deecba4a83536aa20f366a6044895c
create_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
base_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f

# User provided section

Expand Down
4 changes: 3 additions & 1 deletion example/android/.gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
gradle-wrapper.jar
/.gradle
/captures/
/gradlew
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java

# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
# See https://flutter.dev/to/reference-keystore
key.properties
**/*.keystore
**/*.jks
Loading

0 comments on commit d744885

Please sign in to comment.