Merge remote-tracking branch 'upstream/master'
# Conflicts: # example/lib/modals/circular_modal.dart # lib/src/bottom_sheet.dart # lib/src/bottom_sheets/bar_bottom_sheet.dart # lib/src/bottom_sheets/cupertino_bottom_sheet.dart # lib/src/utils/modal_scroll_controller.dart
Showing
15 changed files
with
207 additions
and
172 deletions
@@ -15,10 +15,12 @@ | @@ -15,10 +15,12 @@ | ||
15 | *.iws | 15 | *.iws |
16 | .idea/ | 16 | .idea/ |
17 | 17 | ||
18 | -# The .vscode folder contains launch configuration and tasks you configure in | ||
19 | -# VS Code which you may wish to be included in version control, so this line | ||
20 | -# is commented out by default. | ||
21 | -#.vscode/ | 18 | +# Visual Studio Code related |
19 | +.classpath | ||
20 | +.project | ||
21 | +.settings/ | ||
22 | +.vscode/* | ||
23 | + | ||
22 | 24 | ||
23 | # Flutter/Dart/Pub related | 25 | # Flutter/Dart/Pub related |
24 | **/doc/api/ | 26 | **/doc/api/ |
1 | +## 2.0.1 - Small fixes | ||
2 | ++ Fixes bug with will pop scope | ||
3 | ++ Replaces VelocityTracker deprecated constructor | ||
4 | ++ Add optional RouteSettings to all showModal methods | ||
5 | + | ||
1 | ## 2.0.0-nullsafety.1 - Null Safety support | 6 | ## 2.0.0-nullsafety.1 - Null Safety support |
2 | + Fixes #119 & #113 | 7 | + Fixes #119 & #113 |
3 | 8 |
@@ -149,27 +149,28 @@ class PhotoShareBottomSheet extends StatelessWidget { | @@ -149,27 +149,28 @@ class PhotoShareBottomSheet extends StatelessWidget { | ||
149 | margin: EdgeInsets.symmetric(horizontal: 4), | 149 | margin: EdgeInsets.symmetric(horizontal: 4), |
150 | child: Column( | 150 | child: Column( |
151 | children: <Widget>[ | 151 | children: <Widget>[ |
152 | - if(app.imageUrl != null) | ||
153 | - Material( | ||
154 | - child: ClipRRect( | ||
155 | - child: Container( | ||
156 | - height: 60, | ||
157 | - width: 60, | ||
158 | - decoration: BoxDecoration( | ||
159 | - image: DecorationImage( | ||
160 | - image: AssetImage(app.imageUrl!), | ||
161 | - fit: BoxFit.cover), | ||
162 | - color: Colors.white, | ||
163 | - borderRadius: | ||
164 | - BorderRadius.circular(15)), | 152 | + if (app.imageUrl != null) |
153 | + Material( | ||
154 | + child: ClipRRect( | ||
155 | + child: Container( | ||
156 | + height: 60, | ||
157 | + width: 60, | ||
158 | + decoration: BoxDecoration( | ||
159 | + image: DecorationImage( | ||
160 | + image: | ||
161 | + AssetImage(app.imageUrl!), | ||
162 | + fit: BoxFit.cover), | ||
163 | + color: Colors.white, | ||
164 | + borderRadius: | ||
165 | + BorderRadius.circular(15)), | ||
166 | + ), | ||
165 | ), | 167 | ), |
168 | + shape: RoundedRectangleBorder( | ||
169 | + borderRadius: | ||
170 | + BorderRadius.circular(15)), | ||
171 | + elevation: 12, | ||
172 | + shadowColor: Colors.black12, | ||
166 | ), | 173 | ), |
167 | - shape: RoundedRectangleBorder( | ||
168 | - borderRadius: | ||
169 | - BorderRadius.circular(15)), | ||
170 | - elevation: 12, | ||
171 | - shadowColor: Colors.black12, | ||
172 | - ), | ||
173 | SizedBox(height: 8), | 174 | SizedBox(height: 8), |
174 | Text( | 175 | Text( |
175 | app.title, | 176 | app.title, |
@@ -185,62 +186,62 @@ class PhotoShareBottomSheet extends StatelessWidget { | @@ -185,62 +186,62 @@ class PhotoShareBottomSheet extends StatelessWidget { | ||
185 | ), | 186 | ), |
186 | ), | 187 | ), |
187 | SliverPadding( | 188 | SliverPadding( |
188 | - padding: EdgeInsets.symmetric(horizontal: 18, vertical: 6), | ||
189 | - sliver: SliverList( | ||
190 | - delegate: SliverChildListDelegate.fixed( | ||
191 | - List<Widget>.from(actions.map( | ||
192 | - (action) => Container( | ||
193 | - padding: EdgeInsets.symmetric( | ||
194 | - vertical: 16, horizontal: 16), | ||
195 | - child: Text( | ||
196 | - action.title, | ||
197 | - style: CupertinoTheme.of(context) | ||
198 | - .textTheme | ||
199 | - .textStyle, | ||
200 | - )), | ||
201 | - )).addItemInBetween(Divider( | ||
202 | - height: 1, | ||
203 | - ))), | ||
204 | - )), | ||
205 | - | 189 | + padding: |
190 | + EdgeInsets.symmetric(horizontal: 18, vertical: 6), | ||
191 | + sliver: SliverList( | ||
192 | + delegate: SliverChildListDelegate.fixed( | ||
193 | + List<Widget>.from(actions.map( | ||
194 | + (action) => Container( | ||
195 | + padding: EdgeInsets.symmetric( | ||
196 | + vertical: 16, horizontal: 16), | ||
197 | + child: Text( | ||
198 | + action.title, | ||
199 | + style: CupertinoTheme.of(context) | ||
200 | + .textTheme | ||
201 | + .textStyle, | ||
202 | + )), | ||
203 | + )).addItemInBetween(Divider( | ||
204 | + height: 1, | ||
205 | + ))), | ||
206 | + )), | ||
206 | SliverPadding( | 207 | SliverPadding( |
207 | - padding: EdgeInsets.symmetric(horizontal: 18, vertical: 6), | ||
208 | - sliver: SliverList( | ||
209 | - delegate: SliverChildListDelegate.fixed( | ||
210 | - List<Widget>.from(actions1.map( | ||
211 | - (action) => Container( | ||
212 | - padding: EdgeInsets.symmetric( | ||
213 | - vertical: 16, horizontal: 16), | ||
214 | - child: Text( | ||
215 | - action.title, | ||
216 | - style: CupertinoTheme.of(context) | ||
217 | - .textTheme | ||
218 | - .textStyle, | ||
219 | - )), | ||
220 | - )).addItemInBetween(Divider( | ||
221 | - height: 1, | ||
222 | - ))), | ||
223 | - ) | ||
224 | - ), | 208 | + padding: |
209 | + EdgeInsets.symmetric(horizontal: 18, vertical: 6), | ||
210 | + sliver: SliverList( | ||
211 | + delegate: SliverChildListDelegate.fixed( | ||
212 | + List<Widget>.from(actions1.map( | ||
213 | + (action) => Container( | ||
214 | + padding: EdgeInsets.symmetric( | ||
215 | + vertical: 16, horizontal: 16), | ||
216 | + child: Text( | ||
217 | + action.title, | ||
218 | + style: CupertinoTheme.of(context) | ||
219 | + .textTheme | ||
220 | + .textStyle, | ||
221 | + )), | ||
222 | + )).addItemInBetween(Divider( | ||
223 | + height: 1, | ||
224 | + ))), | ||
225 | + )), | ||
225 | SliverPadding( | 226 | SliverPadding( |
226 | - padding: EdgeInsets.symmetric(horizontal: 18, vertical: 4), | ||
227 | - sliver: SliverList( | ||
228 | - delegate: SliverChildListDelegate.fixed( | ||
229 | - List<Widget>.from(actions2.map( | ||
230 | - (action) => Container( | ||
231 | - padding: EdgeInsets.symmetric( | ||
232 | - vertical: 16, horizontal: 16), | ||
233 | - child: Text( | ||
234 | - action.title, | ||
235 | - style: CupertinoTheme.of(context) | ||
236 | - .textTheme | ||
237 | - .textStyle, | ||
238 | - )), | ||
239 | - )).addItemInBetween(Divider( | ||
240 | - height: 1, | ||
241 | - ))), | ||
242 | - ) | ||
243 | - ), | 227 | + padding: |
228 | + EdgeInsets.symmetric(horizontal: 18, vertical: 4), | ||
229 | + sliver: SliverList( | ||
230 | + delegate: SliverChildListDelegate.fixed( | ||
231 | + List<Widget>.from(actions2.map( | ||
232 | + (action) => Container( | ||
233 | + padding: EdgeInsets.symmetric( | ||
234 | + vertical: 16, horizontal: 16), | ||
235 | + child: Text( | ||
236 | + action.title, | ||
237 | + style: CupertinoTheme.of(context) | ||
238 | + .textTheme | ||
239 | + .textStyle, | ||
240 | + )), | ||
241 | + )).addItemInBetween(Divider( | ||
242 | + height: 1, | ||
243 | + ))), | ||
244 | + )), | ||
244 | SliverSafeArea( | 245 | SliverSafeArea( |
245 | top: false, | 246 | top: false, |
246 | sliver: SliverPadding( | 247 | sliver: SliverPadding( |
@@ -268,19 +269,19 @@ class PhotoShareBottomSheet extends StatelessWidget { | @@ -268,19 +269,19 @@ class PhotoShareBottomSheet extends StatelessWidget { | ||
268 | margin: EdgeInsets.symmetric(horizontal: 4), | 269 | margin: EdgeInsets.symmetric(horizontal: 4), |
269 | child: Column( | 270 | child: Column( |
270 | children: <Widget>[ | 271 | children: <Widget>[ |
271 | - if(person.imageUrl != null) | ||
272 | - Material( | ||
273 | - child: CircleAvatar( | ||
274 | - backgroundImage: AssetImage( | ||
275 | - person.imageUrl!, | 272 | + if (person.imageUrl != null) |
273 | + Material( | ||
274 | + child: CircleAvatar( | ||
275 | + backgroundImage: AssetImage( | ||
276 | + person.imageUrl!, | ||
277 | + ), | ||
278 | + radius: 30, | ||
279 | + backgroundColor: Colors.white, | ||
276 | ), | 280 | ), |
277 | - radius: 30, | ||
278 | - backgroundColor: Colors.white, | 281 | + shape: CircleBorder(), |
282 | + elevation: 12, | ||
283 | + shadowColor: Colors.black12, | ||
279 | ), | 284 | ), |
280 | - shape: CircleBorder(), | ||
281 | - elevation: 12, | ||
282 | - shadowColor: Colors.black12, | ||
283 | - ), | ||
284 | SizedBox(height: 8), | 285 | SizedBox(height: 8), |
285 | Text( | 286 | Text( |
286 | person.title, | 287 | person.title, |
@@ -2,8 +2,6 @@ import 'package:flutter/cupertino.dart'; | @@ -2,8 +2,6 @@ import 'package:flutter/cupertino.dart'; | ||
2 | import 'package:flutter/material.dart'; | 2 | import 'package:flutter/material.dart'; |
3 | 3 | ||
4 | class SimpleModal extends StatelessWidget { | 4 | class SimpleModal extends StatelessWidget { |
5 | - | ||
6 | - | ||
7 | const SimpleModal({Key? key}) : super(key: key); | 5 | const SimpleModal({Key? key}) : super(key: key); |
8 | 6 | ||
9 | @override | 7 | @override |
@@ -7,42 +7,42 @@ packages: | @@ -7,42 +7,42 @@ packages: | ||
7 | name: async | 7 | name: async |
8 | url: "https://pub.dartlang.org" | 8 | url: "https://pub.dartlang.org" |
9 | source: hosted | 9 | source: hosted |
10 | - version: "2.5.0-nullsafety.3" | 10 | + version: "2.8.2" |
11 | boolean_selector: | 11 | boolean_selector: |
12 | dependency: transitive | 12 | dependency: transitive |
13 | description: | 13 | description: |
14 | name: boolean_selector | 14 | name: boolean_selector |
15 | url: "https://pub.dartlang.org" | 15 | url: "https://pub.dartlang.org" |
16 | source: hosted | 16 | source: hosted |
17 | - version: "2.1.0-nullsafety.3" | 17 | + version: "2.1.0" |
18 | characters: | 18 | characters: |
19 | dependency: transitive | 19 | dependency: transitive |
20 | description: | 20 | description: |
21 | name: characters | 21 | name: characters |
22 | url: "https://pub.dartlang.org" | 22 | url: "https://pub.dartlang.org" |
23 | source: hosted | 23 | source: hosted |
24 | - version: "1.1.0-nullsafety.5" | 24 | + version: "1.2.0" |
25 | charcode: | 25 | charcode: |
26 | dependency: transitive | 26 | dependency: transitive |
27 | description: | 27 | description: |
28 | name: charcode | 28 | name: charcode |
29 | url: "https://pub.dartlang.org" | 29 | url: "https://pub.dartlang.org" |
30 | source: hosted | 30 | source: hosted |
31 | - version: "1.2.0-nullsafety.3" | 31 | + version: "1.3.1" |
32 | clock: | 32 | clock: |
33 | dependency: transitive | 33 | dependency: transitive |
34 | description: | 34 | description: |
35 | name: clock | 35 | name: clock |
36 | url: "https://pub.dartlang.org" | 36 | url: "https://pub.dartlang.org" |
37 | source: hosted | 37 | source: hosted |
38 | - version: "1.1.0-nullsafety.3" | 38 | + version: "1.1.0" |
39 | collection: | 39 | collection: |
40 | dependency: transitive | 40 | dependency: transitive |
41 | description: | 41 | description: |
42 | name: collection | 42 | name: collection |
43 | url: "https://pub.dartlang.org" | 43 | url: "https://pub.dartlang.org" |
44 | source: hosted | 44 | source: hosted |
45 | - version: "1.15.0-nullsafety.5" | 45 | + version: "1.15.0" |
46 | cupertino_icons: | 46 | cupertino_icons: |
47 | dependency: "direct main" | 47 | dependency: "direct main" |
48 | description: | 48 | description: |
@@ -56,7 +56,7 @@ packages: | @@ -56,7 +56,7 @@ packages: | ||
56 | name: fake_async | 56 | name: fake_async |
57 | url: "https://pub.dartlang.org" | 57 | url: "https://pub.dartlang.org" |
58 | source: hosted | 58 | source: hosted |
59 | - version: "1.2.0-nullsafety.3" | 59 | + version: "1.2.0" |
60 | flutter: | 60 | flutter: |
61 | dependency: "direct main" | 61 | dependency: "direct main" |
62 | description: flutter | 62 | description: flutter |
@@ -67,41 +67,60 @@ packages: | @@ -67,41 +67,60 @@ packages: | ||
67 | description: flutter | 67 | description: flutter |
68 | source: sdk | 68 | source: sdk |
69 | version: "0.0.0" | 69 | version: "0.0.0" |
70 | + flutter_web_plugins: | ||
71 | + dependency: transitive | ||
72 | + description: flutter | ||
73 | + source: sdk | ||
74 | + version: "0.0.0" | ||
75 | + js: | ||
76 | + dependency: transitive | ||
77 | + description: | ||
78 | + name: js | ||
79 | + url: "https://pub.dartlang.org" | ||
80 | + source: hosted | ||
81 | + version: "0.6.4" | ||
70 | matcher: | 82 | matcher: |
71 | dependency: transitive | 83 | dependency: transitive |
72 | description: | 84 | description: |
73 | name: matcher | 85 | name: matcher |
74 | url: "https://pub.dartlang.org" | 86 | url: "https://pub.dartlang.org" |
75 | source: hosted | 87 | source: hosted |
76 | - version: "0.12.10-nullsafety.3" | 88 | + version: "0.12.11" |
89 | + material_color_utilities: | ||
90 | + dependency: transitive | ||
91 | + description: | ||
92 | + name: material_color_utilities | ||
93 | + url: "https://pub.dartlang.org" | ||
94 | + source: hosted | ||
95 | + version: "0.1.4" | ||
77 | meta: | 96 | meta: |
78 | dependency: transitive | 97 | dependency: transitive |
79 | description: | 98 | description: |
80 | name: meta | 99 | name: meta |
81 | url: "https://pub.dartlang.org" | 100 | url: "https://pub.dartlang.org" |
82 | source: hosted | 101 | source: hosted |
83 | - version: "1.3.0-nullsafety.6" | 102 | + version: "1.7.0" |
84 | modal_bottom_sheet: | 103 | modal_bottom_sheet: |
85 | dependency: "direct main" | 104 | dependency: "direct main" |
86 | description: | 105 | description: |
87 | path: ".." | 106 | path: ".." |
88 | relative: true | 107 | relative: true |
89 | source: path | 108 | source: path |
90 | - version: "2.0.0-nullsafety.1" | 109 | + version: "2.0.1" |
91 | path: | 110 | path: |
92 | dependency: transitive | 111 | dependency: transitive |
93 | description: | 112 | description: |
94 | name: path | 113 | name: path |
95 | url: "https://pub.dartlang.org" | 114 | url: "https://pub.dartlang.org" |
96 | source: hosted | 115 | source: hosted |
97 | - version: "1.8.0-nullsafety.3" | 116 | + version: "1.8.1" |
98 | plugin_platform_interface: | 117 | plugin_platform_interface: |
99 | dependency: transitive | 118 | dependency: transitive |
100 | description: | 119 | description: |
101 | name: plugin_platform_interface | 120 | name: plugin_platform_interface |
102 | url: "https://pub.dartlang.org" | 121 | url: "https://pub.dartlang.org" |
103 | source: hosted | 122 | source: hosted |
104 | - version: "1.1.0-nullsafety.1" | 123 | + version: "2.1.2" |
105 | sky_engine: | 124 | sky_engine: |
106 | dependency: transitive | 125 | dependency: transitive |
107 | description: flutter | 126 | description: flutter |
@@ -113,91 +132,105 @@ packages: | @@ -113,91 +132,105 @@ packages: | ||
113 | name: source_span | 132 | name: source_span |
114 | url: "https://pub.dartlang.org" | 133 | url: "https://pub.dartlang.org" |
115 | source: hosted | 134 | source: hosted |
116 | - version: "1.8.0-nullsafety.4" | 135 | + version: "1.8.2" |
117 | stack_trace: | 136 | stack_trace: |
118 | dependency: transitive | 137 | dependency: transitive |
119 | description: | 138 | description: |
120 | name: stack_trace | 139 | name: stack_trace |
121 | url: "https://pub.dartlang.org" | 140 | url: "https://pub.dartlang.org" |
122 | source: hosted | 141 | source: hosted |
123 | - version: "1.10.0-nullsafety.6" | 142 | + version: "1.10.0" |
124 | stream_channel: | 143 | stream_channel: |
125 | dependency: transitive | 144 | dependency: transitive |
126 | description: | 145 | description: |
127 | name: stream_channel | 146 | name: stream_channel |
128 | url: "https://pub.dartlang.org" | 147 | url: "https://pub.dartlang.org" |
129 | source: hosted | 148 | source: hosted |
130 | - version: "2.1.0-nullsafety.3" | 149 | + version: "2.1.0" |
131 | string_scanner: | 150 | string_scanner: |
132 | dependency: transitive | 151 | dependency: transitive |
133 | description: | 152 | description: |
134 | name: string_scanner | 153 | name: string_scanner |
135 | url: "https://pub.dartlang.org" | 154 | url: "https://pub.dartlang.org" |
136 | source: hosted | 155 | source: hosted |
137 | - version: "1.1.0-nullsafety.3" | 156 | + version: "1.1.0" |
138 | term_glyph: | 157 | term_glyph: |
139 | dependency: transitive | 158 | dependency: transitive |
140 | description: | 159 | description: |
141 | name: term_glyph | 160 | name: term_glyph |
142 | url: "https://pub.dartlang.org" | 161 | url: "https://pub.dartlang.org" |
143 | source: hosted | 162 | source: hosted |
144 | - version: "1.2.0-nullsafety.3" | 163 | + version: "1.2.0" |
145 | test_api: | 164 | test_api: |
146 | dependency: transitive | 165 | dependency: transitive |
147 | description: | 166 | description: |
148 | name: test_api | 167 | name: test_api |
149 | url: "https://pub.dartlang.org" | 168 | url: "https://pub.dartlang.org" |
150 | source: hosted | 169 | source: hosted |
151 | - version: "0.2.19-nullsafety.6" | ||
152 | - typed_data: | 170 | + version: "0.4.9" |
171 | + url_launcher: | ||
172 | + dependency: "direct main" | ||
173 | + description: | ||
174 | + name: url_launcher | ||
175 | + url: "https://pub.dartlang.org" | ||
176 | + source: hosted | ||
177 | + version: "6.0.20" | ||
178 | + url_launcher_android: | ||
153 | dependency: transitive | 179 | dependency: transitive |
154 | description: | 180 | description: |
155 | - name: typed_data | 181 | + name: url_launcher_android |
156 | url: "https://pub.dartlang.org" | 182 | url: "https://pub.dartlang.org" |
157 | source: hosted | 183 | source: hosted |
158 | - version: "1.3.0-nullsafety.5" | ||
159 | - url_launcher: | ||
160 | - dependency: "direct main" | 184 | + version: "6.0.15" |
185 | + url_launcher_ios: | ||
186 | + dependency: transitive | ||
161 | description: | 187 | description: |
162 | - name: url_launcher | 188 | + name: url_launcher_ios |
163 | url: "https://pub.dartlang.org" | 189 | url: "https://pub.dartlang.org" |
164 | source: hosted | 190 | source: hosted |
165 | - version: "6.0.0-nullsafety.1" | 191 | + version: "6.0.15" |
166 | url_launcher_linux: | 192 | url_launcher_linux: |
167 | dependency: transitive | 193 | dependency: transitive |
168 | description: | 194 | description: |
169 | name: url_launcher_linux | 195 | name: url_launcher_linux |
170 | url: "https://pub.dartlang.org" | 196 | url: "https://pub.dartlang.org" |
171 | source: hosted | 197 | source: hosted |
172 | - version: "0.1.0-nullsafety.1" | 198 | + version: "3.0.0" |
173 | url_launcher_macos: | 199 | url_launcher_macos: |
174 | dependency: transitive | 200 | dependency: transitive |
175 | description: | 201 | description: |
176 | name: url_launcher_macos | 202 | name: url_launcher_macos |
177 | url: "https://pub.dartlang.org" | 203 | url: "https://pub.dartlang.org" |
178 | source: hosted | 204 | source: hosted |
179 | - version: "0.1.0-nullsafety.1" | 205 | + version: "3.0.0" |
180 | url_launcher_platform_interface: | 206 | url_launcher_platform_interface: |
181 | dependency: transitive | 207 | dependency: transitive |
182 | description: | 208 | description: |
183 | name: url_launcher_platform_interface | 209 | name: url_launcher_platform_interface |
184 | url: "https://pub.dartlang.org" | 210 | url: "https://pub.dartlang.org" |
185 | source: hosted | 211 | source: hosted |
186 | - version: "2.0.0-nullsafety.1" | 212 | + version: "2.0.5" |
213 | + url_launcher_web: | ||
214 | + dependency: transitive | ||
215 | + description: | ||
216 | + name: url_launcher_web | ||
217 | + url: "https://pub.dartlang.org" | ||
218 | + source: hosted | ||
219 | + version: "2.0.9" | ||
187 | url_launcher_windows: | 220 | url_launcher_windows: |
188 | dependency: transitive | 221 | dependency: transitive |
189 | description: | 222 | description: |
190 | name: url_launcher_windows | 223 | name: url_launcher_windows |
191 | url: "https://pub.dartlang.org" | 224 | url: "https://pub.dartlang.org" |
192 | source: hosted | 225 | source: hosted |
193 | - version: "0.1.0-nullsafety.1" | 226 | + version: "3.0.0" |
194 | vector_math: | 227 | vector_math: |
195 | dependency: transitive | 228 | dependency: transitive |
196 | description: | 229 | description: |
197 | name: vector_math | 230 | name: vector_math |
198 | url: "https://pub.dartlang.org" | 231 | url: "https://pub.dartlang.org" |
199 | source: hosted | 232 | source: hosted |
200 | - version: "2.1.0-nullsafety.5" | 233 | + version: "2.1.2" |
201 | sdks: | 234 | sdks: |
202 | - dart: ">=2.12.0-29.10.beta <3.0.0" | ||
203 | - flutter: ">=1.12.13+hotfix.5 <2.0.0" | 235 | + dart: ">=2.16.0-100.0.dev <3.0.0" |
236 | + flutter: ">=2.10.0" |
@@ -45,7 +45,7 @@ class ModalBottomSheet extends StatefulWidget { | @@ -45,7 +45,7 @@ class ModalBottomSheet extends StatefulWidget { | ||
45 | required this.expanded, | 45 | required this.expanded, |
46 | required this.onClosing, | 46 | required this.onClosing, |
47 | required this.child, | 47 | required this.child, |
48 | - }) : super(key: key); | 48 | + }) : super(key: key); |
49 | 49 | ||
50 | /// The closeProgressThreshold parameter | 50 | /// The closeProgressThreshold parameter |
51 | /// specifies when the bottom sheet will be dismissed when user drags it. | 51 | /// specifies when the bottom sheet will be dismissed when user drags it. |
@@ -225,7 +225,7 @@ class _ModalBottomSheetState extends State<ModalBottomSheet> | @@ -225,7 +225,7 @@ class _ModalBottomSheetState extends State<ModalBottomSheet> | ||
225 | _bounceDragController.reverse(); | 225 | _bounceDragController.reverse(); |
226 | 226 | ||
227 | var canClose = true; | 227 | var canClose = true; |
228 | - if (widget.shouldClose != null && hasReachedWillPopThreshold) { | 228 | + if (widget.shouldClose != null) { |
229 | _cancelClose(); | 229 | _cancelClose(); |
230 | canClose = await shouldClose(); | 230 | canClose = await shouldClose(); |
231 | } | 231 | } |
@@ -291,9 +291,8 @@ class _ModalBottomSheetState extends State<ModalBottomSheet> | @@ -291,9 +291,8 @@ class _ModalBottomSheetState extends State<ModalBottomSheet> | ||
291 | 291 | ||
292 | // Otherwise the calculate the velocity with a VelocityTracker | 292 | // Otherwise the calculate the velocity with a VelocityTracker |
293 | if (_velocityTracker == null) { | 293 | if (_velocityTracker == null) { |
294 | - //final pointerKind = defaultPointerDeviceKind(context); | ||
295 | - // ignore: deprecated_member_use | ||
296 | - _velocityTracker = VelocityTracker(); | 294 | + final pointerKind = defaultPointerDeviceKind(context); |
295 | + _velocityTracker = VelocityTracker.withKind(pointerKind); | ||
297 | _startTime = DateTime.now(); | 296 | _startTime = DateTime.now(); |
298 | } | 297 | } |
299 | 298 | ||
@@ -482,5 +481,4 @@ PointerDeviceKind defaultPointerDeviceKind(BuildContext context) { | @@ -482,5 +481,4 @@ PointerDeviceKind defaultPointerDeviceKind(BuildContext context) { | ||
482 | case TargetPlatform.fuchsia: | 481 | case TargetPlatform.fuchsia: |
483 | return PointerDeviceKind.unknown; | 482 | return PointerDeviceKind.unknown; |
484 | } | 483 | } |
485 | - return PointerDeviceKind.unknown; | ||
486 | } | 484 | } |
@@ -237,6 +237,7 @@ Future<T?> showCustomModalBottomSheet<T>({ | @@ -237,6 +237,7 @@ Future<T?> showCustomModalBottomSheet<T>({ | ||
237 | bool isDismissible = true, | 237 | bool isDismissible = true, |
238 | bool enableDrag = true, | 238 | bool enableDrag = true, |
239 | Duration? duration, | 239 | Duration? duration, |
240 | + RouteSettings? settings, | ||
240 | }) async { | 241 | }) async { |
241 | assert(debugCheckHasMediaQuery(context)); | 242 | assert(debugCheckHasMediaQuery(context)); |
242 | assert(debugCheckHasMaterialLocalizations(context)); | 243 | assert(debugCheckHasMaterialLocalizations(context)); |
@@ -260,6 +261,7 @@ Future<T?> showCustomModalBottomSheet<T>({ | @@ -260,6 +261,7 @@ Future<T?> showCustomModalBottomSheet<T>({ | ||
260 | enableDrag: enableDrag, | 261 | enableDrag: enableDrag, |
261 | animationCurve: animationCurve, | 262 | animationCurve: animationCurve, |
262 | duration: duration, | 263 | duration: duration, |
264 | + settings: settings, | ||
263 | )); | 265 | )); |
264 | return result; | 266 | return result; |
265 | } | 267 | } |
@@ -90,6 +90,7 @@ Future<T?> showBarModalBottomSheet<T>({ | @@ -90,6 +90,7 @@ Future<T?> showBarModalBottomSheet<T>({ | ||
90 | bool enableDrag = true, | 90 | bool enableDrag = true, |
91 | Widget? topControl, | 91 | Widget? topControl, |
92 | Duration? duration, | 92 | Duration? duration, |
93 | + RouteSettings? settings, | ||
93 | SystemUiOverlayStyle? overlayStyle, | 94 | SystemUiOverlayStyle? overlayStyle, |
94 | }) async { | 95 | }) async { |
95 | assert(debugCheckHasMediaQuery(context)); | 96 | assert(debugCheckHasMediaQuery(context)); |
@@ -115,6 +116,7 @@ Future<T?> showBarModalBottomSheet<T>({ | @@ -115,6 +116,7 @@ Future<T?> showBarModalBottomSheet<T>({ | ||
115 | enableDrag: enableDrag, | 116 | enableDrag: enableDrag, |
116 | animationCurve: animationCurve, | 117 | animationCurve: animationCurve, |
117 | duration: duration, | 118 | duration: duration, |
119 | + settings: settings, | ||
118 | )); | 120 | )); |
119 | return result; | 121 | return result; |
120 | } | 122 | } |
@@ -19,7 +19,8 @@ import '../../modal_bottom_sheet.dart'; | @@ -19,7 +19,8 @@ import '../../modal_bottom_sheet.dart'; | ||
19 | const double _kPreviousPageVisibleOffset = 10; | 19 | const double _kPreviousPageVisibleOffset = 10; |
20 | 20 | ||
21 | const Radius _kDefaultTopRadius = Radius.circular(12); | 21 | const Radius _kDefaultTopRadius = Radius.circular(12); |
22 | -const BoxShadow _kDefaultBoxShadow = BoxShadow(blurRadius: 10, color: Colors.black12, spreadRadius: 5); | 22 | +const BoxShadow _kDefaultBoxShadow = |
23 | + BoxShadow(blurRadius: 10, color: Colors.black12, spreadRadius: 5); | ||
23 | 24 | ||
24 | /// Cupertino Bottom Sheet Container | 25 | /// Cupertino Bottom Sheet Container |
25 | /// | 26 | /// |
@@ -40,14 +41,13 @@ class _CupertinoBottomSheetContainer extends StatelessWidget { | @@ -40,14 +41,13 @@ class _CupertinoBottomSheetContainer extends StatelessWidget { | ||
40 | this.shadow, | 41 | this.shadow, |
41 | }) : super(key: key); | 42 | }) : super(key: key); |
42 | 43 | ||
43 | - | ||
44 | @override | 44 | @override |
45 | Widget build(BuildContext context) { | 45 | Widget build(BuildContext context) { |
46 | final topSafeAreaPadding = MediaQuery.of(context).padding.top; | 46 | final topSafeAreaPadding = MediaQuery.of(context).padding.top; |
47 | final topPadding = _kPreviousPageVisibleOffset + topSafeAreaPadding; | 47 | final topPadding = _kPreviousPageVisibleOffset + topSafeAreaPadding; |
48 | 48 | ||
49 | final _shadow = shadow ?? _kDefaultBoxShadow; | 49 | final _shadow = shadow ?? _kDefaultBoxShadow; |
50 | - BoxShadow(blurRadius: 10, color: Colors.black12, spreadRadius: 5); | 50 | + BoxShadow(blurRadius: 10, color: Colors.black12, spreadRadius: 5); |
51 | final _backgroundColor = | 51 | final _backgroundColor = |
52 | backgroundColor ?? CupertinoTheme.of(context).scaffoldBackgroundColor; | 52 | backgroundColor ?? CupertinoTheme.of(context).scaffoldBackgroundColor; |
53 | return Padding( | 53 | return Padding( |
@@ -138,7 +138,6 @@ class CupertinoModalBottomSheetRoute<T> extends ModalBottomSheetRoute<T> { | @@ -138,7 +138,6 @@ class CupertinoModalBottomSheetRoute<T> extends ModalBottomSheetRoute<T> { | ||
138 | 138 | ||
139 | final Curve? previousRouteAnimationCurve; | 139 | final Curve? previousRouteAnimationCurve; |
140 | 140 | ||
141 | - | ||
142 | final BoxShadow? boxShadow; | 141 | final BoxShadow? boxShadow; |
143 | 142 | ||
144 | // Background color behind all routes | 143 | // Background color behind all routes |
@@ -169,7 +168,7 @@ class CupertinoModalBottomSheetRoute<T> extends ModalBottomSheetRoute<T> { | @@ -169,7 +168,7 @@ class CupertinoModalBottomSheetRoute<T> extends ModalBottomSheetRoute<T> { | ||
169 | this.topRadius = _kDefaultTopRadius, | 168 | this.topRadius = _kDefaultTopRadius, |
170 | this.previousRouteAnimationCurve, | 169 | this.previousRouteAnimationCurve, |
171 | this.overlayStyle, | 170 | this.overlayStyle, |
172 | - }) : super( | 171 | + }) : super( |
173 | closeProgressThreshold: closeProgressThreshold, | 172 | closeProgressThreshold: closeProgressThreshold, |
174 | scrollController: scrollController, | 173 | scrollController: scrollController, |
175 | containerBuilder: containerBuilder, | 174 | containerBuilder: containerBuilder, |
@@ -194,8 +193,7 @@ class CupertinoModalBottomSheetRoute<T> extends ModalBottomSheetRoute<T> { | @@ -194,8 +193,7 @@ class CupertinoModalBottomSheetRoute<T> extends ModalBottomSheetRoute<T> { | ||
194 | Widget child, | 193 | Widget child, |
195 | ) { | 194 | ) { |
196 | final paddingTop = MediaQuery.of(context).padding.top; | 195 | final paddingTop = MediaQuery.of(context).padding.top; |
197 | - final distanceWithScale = | ||
198 | - (paddingTop + _kPreviousPageVisibleOffset) * 0.9; | 196 | + final distanceWithScale = (paddingTop + _kPreviousPageVisibleOffset) * 0.9; |
199 | final offsetY = secondaryAnimation.value * (paddingTop - distanceWithScale); | 197 | final offsetY = secondaryAnimation.value * (paddingTop - distanceWithScale); |
200 | final scale = 1 - secondaryAnimation.value / 10; | 198 | final scale = 1 - secondaryAnimation.value / 10; |
201 | return AnimatedBuilder( | 199 | return AnimatedBuilder( |
@@ -231,7 +229,6 @@ class _CupertinoModalTransition extends StatelessWidget { | @@ -231,7 +229,6 @@ class _CupertinoModalTransition extends StatelessWidget { | ||
231 | final Radius topRadius; | 229 | final Radius topRadius; |
232 | final Curve? animationCurve; | 230 | final Curve? animationCurve; |
233 | final Color backgroundColor; | 231 | final Color backgroundColor; |
234 | - final BoxShadow? boxShadow; | ||
235 | final SystemUiOverlayStyle? overlayStyle; | 232 | final SystemUiOverlayStyle? overlayStyle; |
236 | 233 | ||
237 | final Widget body; | 234 | final Widget body; |
@@ -243,7 +240,6 @@ class _CupertinoModalTransition extends StatelessWidget { | @@ -243,7 +240,6 @@ class _CupertinoModalTransition extends StatelessWidget { | ||
243 | required this.topRadius, | 240 | required this.topRadius, |
244 | this.backgroundColor = Colors.black, | 241 | this.backgroundColor = Colors.black, |
245 | this.animationCurve, | 242 | this.animationCurve, |
246 | - this.boxShadow, | ||
247 | this.overlayStyle, | 243 | this.overlayStyle, |
248 | }) : super(key: key); | 244 | }) : super(key: key); |
249 | 245 |
@@ -20,6 +20,7 @@ Future<T?> showMaterialModalBottomSheet<T>({ | @@ -20,6 +20,7 @@ Future<T?> showMaterialModalBottomSheet<T>({ | ||
20 | bool isDismissible = true, | 20 | bool isDismissible = true, |
21 | bool enableDrag = true, | 21 | bool enableDrag = true, |
22 | Duration? duration, | 22 | Duration? duration, |
23 | + RouteSettings? settings, | ||
23 | }) async { | 24 | }) async { |
24 | assert(debugCheckHasMediaQuery(context)); | 25 | assert(debugCheckHasMediaQuery(context)); |
25 | assert(debugCheckHasMaterialLocalizations(context)); | 26 | assert(debugCheckHasMaterialLocalizations(context)); |
@@ -44,6 +45,7 @@ Future<T?> showMaterialModalBottomSheet<T>({ | @@ -44,6 +45,7 @@ Future<T?> showMaterialModalBottomSheet<T>({ | ||
44 | enableDrag: enableDrag, | 45 | enableDrag: enableDrag, |
45 | animationCurve: animationCurve, | 46 | animationCurve: animationCurve, |
46 | duration: duration, | 47 | duration: duration, |
48 | + settings: settings, | ||
47 | )); | 49 | )); |
48 | return result; | 50 | return result; |
49 | } | 51 | } |
@@ -16,7 +16,7 @@ class ModalScrollController extends InheritedWidget { | @@ -16,7 +16,7 @@ class ModalScrollController extends InheritedWidget { | ||
16 | Key? key, | 16 | Key? key, |
17 | required this.controller, | 17 | required this.controller, |
18 | required Widget child, | 18 | required Widget child, |
19 | - }) : super( | 19 | + }) : super( |
20 | key: key, | 20 | key: key, |
21 | child: PrimaryScrollController( | 21 | child: PrimaryScrollController( |
22 | controller: controller, | 22 | controller: controller, |
@@ -7,49 +7,49 @@ packages: | @@ -7,49 +7,49 @@ packages: | ||
7 | name: async | 7 | name: async |
8 | url: "https://pub.dartlang.org" | 8 | url: "https://pub.dartlang.org" |
9 | source: hosted | 9 | source: hosted |
10 | - version: "2.5.0-nullsafety.3" | 10 | + version: "2.8.2" |
11 | boolean_selector: | 11 | boolean_selector: |
12 | dependency: transitive | 12 | dependency: transitive |
13 | description: | 13 | description: |
14 | name: boolean_selector | 14 | name: boolean_selector |
15 | url: "https://pub.dartlang.org" | 15 | url: "https://pub.dartlang.org" |
16 | source: hosted | 16 | source: hosted |
17 | - version: "2.1.0-nullsafety.3" | 17 | + version: "2.1.0" |
18 | characters: | 18 | characters: |
19 | dependency: transitive | 19 | dependency: transitive |
20 | description: | 20 | description: |
21 | name: characters | 21 | name: characters |
22 | url: "https://pub.dartlang.org" | 22 | url: "https://pub.dartlang.org" |
23 | source: hosted | 23 | source: hosted |
24 | - version: "1.1.0-nullsafety.5" | 24 | + version: "1.2.0" |
25 | charcode: | 25 | charcode: |
26 | dependency: transitive | 26 | dependency: transitive |
27 | description: | 27 | description: |
28 | name: charcode | 28 | name: charcode |
29 | url: "https://pub.dartlang.org" | 29 | url: "https://pub.dartlang.org" |
30 | source: hosted | 30 | source: hosted |
31 | - version: "1.2.0-nullsafety.3" | 31 | + version: "1.3.1" |
32 | clock: | 32 | clock: |
33 | dependency: transitive | 33 | dependency: transitive |
34 | description: | 34 | description: |
35 | name: clock | 35 | name: clock |
36 | url: "https://pub.dartlang.org" | 36 | url: "https://pub.dartlang.org" |
37 | source: hosted | 37 | source: hosted |
38 | - version: "1.1.0-nullsafety.3" | 38 | + version: "1.1.0" |
39 | collection: | 39 | collection: |
40 | dependency: transitive | 40 | dependency: transitive |
41 | description: | 41 | description: |
42 | name: collection | 42 | name: collection |
43 | url: "https://pub.dartlang.org" | 43 | url: "https://pub.dartlang.org" |
44 | source: hosted | 44 | source: hosted |
45 | - version: "1.15.0-nullsafety.5" | 45 | + version: "1.15.0" |
46 | fake_async: | 46 | fake_async: |
47 | dependency: transitive | 47 | dependency: transitive |
48 | description: | 48 | description: |
49 | name: fake_async | 49 | name: fake_async |
50 | url: "https://pub.dartlang.org" | 50 | url: "https://pub.dartlang.org" |
51 | source: hosted | 51 | source: hosted |
52 | - version: "1.2.0-nullsafety.3" | 52 | + version: "1.2.0" |
53 | flutter: | 53 | flutter: |
54 | dependency: "direct main" | 54 | dependency: "direct main" |
55 | description: flutter | 55 | description: flutter |
@@ -66,21 +66,28 @@ packages: | @@ -66,21 +66,28 @@ packages: | ||
66 | name: matcher | 66 | name: matcher |
67 | url: "https://pub.dartlang.org" | 67 | url: "https://pub.dartlang.org" |
68 | source: hosted | 68 | source: hosted |
69 | - version: "0.12.10-nullsafety.3" | 69 | + version: "0.12.11" |
70 | + material_color_utilities: | ||
71 | + dependency: transitive | ||
72 | + description: | ||
73 | + name: material_color_utilities | ||
74 | + url: "https://pub.dartlang.org" | ||
75 | + source: hosted | ||
76 | + version: "0.1.4" | ||
70 | meta: | 77 | meta: |
71 | dependency: transitive | 78 | dependency: transitive |
72 | description: | 79 | description: |
73 | name: meta | 80 | name: meta |
74 | url: "https://pub.dartlang.org" | 81 | url: "https://pub.dartlang.org" |
75 | source: hosted | 82 | source: hosted |
76 | - version: "1.3.0-nullsafety.6" | 83 | + version: "1.7.0" |
77 | path: | 84 | path: |
78 | dependency: transitive | 85 | dependency: transitive |
79 | description: | 86 | description: |
80 | name: path | 87 | name: path |
81 | url: "https://pub.dartlang.org" | 88 | url: "https://pub.dartlang.org" |
82 | source: hosted | 89 | source: hosted |
83 | - version: "1.8.0-nullsafety.3" | 90 | + version: "1.8.1" |
84 | pedantic: | 91 | pedantic: |
85 | dependency: "direct dev" | 92 | dependency: "direct dev" |
86 | description: | 93 | description: |
@@ -99,56 +106,49 @@ packages: | @@ -99,56 +106,49 @@ packages: | ||
99 | name: source_span | 106 | name: source_span |
100 | url: "https://pub.dartlang.org" | 107 | url: "https://pub.dartlang.org" |
101 | source: hosted | 108 | source: hosted |
102 | - version: "1.8.0-nullsafety.4" | 109 | + version: "1.8.2" |
103 | stack_trace: | 110 | stack_trace: |
104 | dependency: transitive | 111 | dependency: transitive |
105 | description: | 112 | description: |
106 | name: stack_trace | 113 | name: stack_trace |
107 | url: "https://pub.dartlang.org" | 114 | url: "https://pub.dartlang.org" |
108 | source: hosted | 115 | source: hosted |
109 | - version: "1.10.0-nullsafety.6" | 116 | + version: "1.10.0" |
110 | stream_channel: | 117 | stream_channel: |
111 | dependency: transitive | 118 | dependency: transitive |
112 | description: | 119 | description: |
113 | name: stream_channel | 120 | name: stream_channel |
114 | url: "https://pub.dartlang.org" | 121 | url: "https://pub.dartlang.org" |
115 | source: hosted | 122 | source: hosted |
116 | - version: "2.1.0-nullsafety.3" | 123 | + version: "2.1.0" |
117 | string_scanner: | 124 | string_scanner: |
118 | dependency: transitive | 125 | dependency: transitive |
119 | description: | 126 | description: |
120 | name: string_scanner | 127 | name: string_scanner |
121 | url: "https://pub.dartlang.org" | 128 | url: "https://pub.dartlang.org" |
122 | source: hosted | 129 | source: hosted |
123 | - version: "1.1.0-nullsafety.3" | 130 | + version: "1.1.0" |
124 | term_glyph: | 131 | term_glyph: |
125 | dependency: transitive | 132 | dependency: transitive |
126 | description: | 133 | description: |
127 | name: term_glyph | 134 | name: term_glyph |
128 | url: "https://pub.dartlang.org" | 135 | url: "https://pub.dartlang.org" |
129 | source: hosted | 136 | source: hosted |
130 | - version: "1.2.0-nullsafety.3" | 137 | + version: "1.2.0" |
131 | test_api: | 138 | test_api: |
132 | dependency: transitive | 139 | dependency: transitive |
133 | description: | 140 | description: |
134 | name: test_api | 141 | name: test_api |
135 | url: "https://pub.dartlang.org" | 142 | url: "https://pub.dartlang.org" |
136 | source: hosted | 143 | source: hosted |
137 | - version: "0.2.19-nullsafety.6" | ||
138 | - typed_data: | ||
139 | - dependency: transitive | ||
140 | - description: | ||
141 | - name: typed_data | ||
142 | - url: "https://pub.dartlang.org" | ||
143 | - source: hosted | ||
144 | - version: "1.3.0-nullsafety.5" | 144 | + version: "0.4.9" |
145 | vector_math: | 145 | vector_math: |
146 | dependency: transitive | 146 | dependency: transitive |
147 | description: | 147 | description: |
148 | name: vector_math | 148 | name: vector_math |
149 | url: "https://pub.dartlang.org" | 149 | url: "https://pub.dartlang.org" |
150 | source: hosted | 150 | source: hosted |
151 | - version: "2.1.0-nullsafety.5" | 151 | + version: "2.1.2" |
152 | sdks: | 152 | sdks: |
153 | - dart: ">=2.12.0-29.10.beta <3.0.0" | ||
154 | - flutter: ">=1.12.0 <2.0.0" | 153 | + dart: ">=2.14.0 <3.0.0" |
154 | + flutter: ">=2.0.0" |
1 | name: modal_bottom_sheet | 1 | name: modal_bottom_sheet |
2 | description: 'Create awesome and powerful modal bottom sheets. Material, Cupertino iOS 13 or create your own style' | 2 | description: 'Create awesome and powerful modal bottom sheets. Material, Cupertino iOS 13 or create your own style' |
3 | -version: 2.0.0-nullsafety.1 | 3 | +version: 2.0.1 |
4 | homepage: 'https://github.com/jamesblasco/modal_bottom_sheet' | 4 | homepage: 'https://github.com/jamesblasco/modal_bottom_sheet' |
5 | 5 | ||
6 | environment: | 6 | environment: |
7 | - sdk: ">=2.12.0-29.10.beta <3.0.0" | ||
8 | - flutter: ">=1.12.0 <2.0.0" | 7 | + sdk: ">=2.12.0 <3.0.0" |
8 | + flutter: ">=2.0.0" | ||
9 | 9 | ||
10 | dependencies: | 10 | dependencies: |
11 | flutter: | 11 | flutter: |
-
Please register or login to post a comment