From 2589068aad8bd2198a188e3e487d96a11b8e63f8 Mon Sep 17 00:00:00 2001 From: CaiJingLong Date: Fri, 17 Nov 2023 15:05:56 +0800 Subject: [PATCH 1/5] feat: Wrapper a material for oktoast Signed-off-by: CaiJingLong --- lib/src/widget/oktoast.dart | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/src/widget/oktoast.dart b/lib/src/widget/oktoast.dart index 87bd02b..a51c5ed 100644 --- a/lib/src/widget/oktoast.dart +++ b/lib/src/widget/oktoast.dart @@ -89,7 +89,7 @@ class _OKToastState extends State { ], ); - final Widget w = Directionality( + Widget w = Directionality( textDirection: widget.textDirection, child: overlay, ); @@ -102,6 +102,15 @@ class _OKToastState extends State { final OKToastAnimationBuilder animationBuilder = widget.animationBuilder ?? _defaultBuildAnimation; + final haveMaterialParent = Material.maybeOf(context) != null; + + if (!haveMaterialParent) { + w = Material( + color: Colors.transparent, + child: w, + ); + } + return ToastTheme( backgroundColor: widget.backgroundColor, radius: widget.radius, From 47d61e1a35d284a4eec3c28ea3b0477eef9b4163 Mon Sep 17 00:00:00 2001 From: CaiJingLong Date: Fri, 17 Nov 2023 15:07:57 +0800 Subject: [PATCH 2/5] feat: wrapper a material for toast Signed-off-by: CaiJingLong --- CHANGELOG.md | 6 ++++++ pubspec.yaml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb18783..ad8fdbd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change log +## 3.4.0 + +Feat: + +- Wrapper a `Material` widget when the `OKToast` widget is not wrapped with `Material`. + ## 3.3.2+1 - Fix `Theatre` constructor and get rid of `View` for compatibilities. (#103) diff --git a/pubspec.yaml b/pubspec.yaml index ebd0443..28acf99 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: oktoast description: A pure flutter toast library, support custom style/widget, easy achieve the same effect with native toasts. repository: https://github.com/OpenFlutter/flutter_oktoast -version: 3.3.2+1 +version: 3.4.0 environment: sdk: '>=2.17.0 <4.0.0' From bcfeb3bc30bb8e2db493f5f86520cd1a6f9e41fd Mon Sep 17 00:00:00 2001 From: CaiJingLong Date: Fri, 17 Nov 2023 15:21:38 +0800 Subject: [PATCH 3/5] feat: Upgrade flutter min version - update CI Signed-off-by: CaiJingLong --- .github/workflows/runnable.yml | 10 +++++----- pubspec.yaml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/runnable.yml b/.github/workflows/runnable.yml index 8c6a9b8..0a56202 100644 --- a/.github/workflows/runnable.yml +++ b/.github/workflows/runnable.yml @@ -16,11 +16,11 @@ jobs: matrix: os: [ ubuntu-latest ] version: [ - '', # Stable - '3.0.0' # Minimum + '3.16.0', # Stable + '3.7.0' # Minimum ] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-java@v3 with: distribution: 'adopt' @@ -49,7 +49,7 @@ jobs: matrix: os: [ macos-latest ] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-java@v3 with: distribution: 'adopt' @@ -71,7 +71,7 @@ jobs: matrix: os: [ ubuntu-latest ] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-java@v3 with: distribution: 'adopt' diff --git a/pubspec.yaml b/pubspec.yaml index 28acf99..83e5748 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -5,7 +5,7 @@ version: 3.4.0 environment: sdk: '>=2.17.0 <4.0.0' - flutter: '>=3.0.0' + flutter: '>=3.7.0' dependencies: flutter: From 763bbf3c73361ebf9c5b315f56e1dc986d815d52 Mon Sep 17 00:00:00 2001 From: CaiJingLong Date: Fri, 17 Nov 2023 15:23:13 +0800 Subject: [PATCH 4/5] ci: Change CI name Signed-off-by: CaiJingLong --- .github/workflows/runnable.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/runnable.yml b/.github/workflows/runnable.yml index 0a56202..30cf5c2 100644 --- a/.github/workflows/runnable.yml +++ b/.github/workflows/runnable.yml @@ -10,7 +10,7 @@ on: jobs: analyze: - name: Analyze on ${{ matrix.os }} + name: Analyze on ${{ matrix.os }} with flutter ${{ matrix.version }} runs-on: ${{ matrix.os }} strategy: matrix: From e2f4179a7e456dd1f891e12d419c0dcd98fd611b Mon Sep 17 00:00:00 2001 From: CaiJingLong Date: Fri, 17 Nov 2023 15:25:19 +0800 Subject: [PATCH 5/5] docs: Update changelog Signed-off-by: CaiJingLong --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad8fdbd..7b3b0d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ Feat: - Wrapper a `Material` widget when the `OKToast` widget is not wrapped with `Material`. +- The min support of flutter SDK version to 3.7.0. ## 3.3.2+1