Skip to content

Commit 3904903

Browse files
authored
Feat--wrapper-material (#106)
Signed-off-by: CaiJingLong <[email protected]>
1 parent 922a953 commit 3904903

File tree

4 files changed

+25
-9
lines changed

4 files changed

+25
-9
lines changed

.github/workflows/runnable.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ on:
1010

1111
jobs:
1212
analyze:
13-
name: Analyze on ${{ matrix.os }}
13+
name: Analyze on ${{ matrix.os }} with flutter ${{ matrix.version }}
1414
runs-on: ${{ matrix.os }}
1515
strategy:
1616
matrix:
1717
os: [ ubuntu-latest ]
1818
version: [
19-
'', # Stable
20-
'3.0.0' # Minimum
19+
'3.16.0', # Stable
20+
'3.7.0' # Minimum
2121
]
2222
steps:
23-
- uses: actions/checkout@v3
23+
- uses: actions/checkout@v4
2424
- uses: actions/setup-java@v3
2525
with:
2626
distribution: 'adopt'
@@ -49,7 +49,7 @@ jobs:
4949
matrix:
5050
os: [ macos-latest ]
5151
steps:
52-
- uses: actions/checkout@v3
52+
- uses: actions/checkout@v4
5353
- uses: actions/setup-java@v3
5454
with:
5555
distribution: 'adopt'
@@ -71,7 +71,7 @@ jobs:
7171
matrix:
7272
os: [ ubuntu-latest ]
7373
steps:
74-
- uses: actions/checkout@v3
74+
- uses: actions/checkout@v4
7575
- uses: actions/setup-java@v3
7676
with:
7777
distribution: 'adopt'

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Change log
22

3+
## 3.4.0
4+
5+
Feat:
6+
7+
- Wrapper a `Material` widget when the `OKToast` widget is not wrapped with `Material`.
8+
- The min support of flutter SDK version to 3.7.0.
9+
310
## 3.3.2+1
411

512
- Fix `Theatre` constructor and get rid of `View` for compatibilities. (#103)

lib/src/widget/oktoast.dart

+10-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class _OKToastState extends State<OKToast> {
8989
],
9090
);
9191

92-
final Widget w = Directionality(
92+
Widget w = Directionality(
9393
textDirection: widget.textDirection,
9494
child: overlay,
9595
);
@@ -102,6 +102,15 @@ class _OKToastState extends State<OKToast> {
102102
final OKToastAnimationBuilder animationBuilder =
103103
widget.animationBuilder ?? _defaultBuildAnimation;
104104

105+
final haveMaterialParent = Material.maybeOf(context) != null;
106+
107+
if (!haveMaterialParent) {
108+
w = Material(
109+
color: Colors.transparent,
110+
child: w,
111+
);
112+
}
113+
105114
return ToastTheme(
106115
backgroundColor: widget.backgroundColor,
107116
radius: widget.radius,

pubspec.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
name: oktoast
22
description: A pure flutter toast library, support custom style/widget, easy achieve the same effect with native toasts.
33
repository: https://github.com/OpenFlutter/flutter_oktoast
4-
version: 3.3.2+1
4+
version: 3.4.0
55

66
environment:
77
sdk: '>=2.17.0 <4.0.0'
8-
flutter: '>=3.0.0'
8+
flutter: '>=3.7.0'
99

1010
dependencies:
1111
flutter:

0 commit comments

Comments
 (0)