Committed by
GitHub
fix: flutter 3.7 (#324)
* fix: deprecate duplicated name * fix: support flutter 3.7 * feat: add pre release version
Showing
27 changed files
with
39 additions
and
42 deletions
@@ -260,7 +260,7 @@ class _MyHomePageState extends State<MyHomePage> { | @@ -260,7 +260,7 @@ class _MyHomePageState extends State<MyHomePage> { | ||
260 | padding: EdgeInsets.fromLTRB(16, 20, 16, 8), | 260 | padding: EdgeInsets.fromLTRB(16, 20, 16, 8), |
261 | child: Text( | 261 | child: Text( |
262 | title, | 262 | title, |
263 | - style: Theme.of(context).textTheme.caption, | 263 | + style: Theme.of(context).textTheme.bodySmall, |
264 | ), | 264 | ), |
265 | ); | 265 | ); |
266 | } | 266 | } |
@@ -75,7 +75,7 @@ class _ModalBottomSheetState<T> extends State<_ModalBottomSheet<T>> { | @@ -75,7 +75,7 @@ class _ModalBottomSheetState<T> extends State<_ModalBottomSheet<T>> { | ||
75 | Widget build(BuildContext context) { | 75 | Widget build(BuildContext context) { |
76 | assert(debugCheckHasMediaQuery(context)); | 76 | assert(debugCheckHasMediaQuery(context)); |
77 | assert(widget.route._animationController != null); | 77 | assert(widget.route._animationController != null); |
78 | - final scrollController = PrimaryScrollController.of(context) ?? | 78 | + final scrollController = PrimaryScrollController.maybeOf(context) ?? |
79 | (_scrollController ??= ScrollController()); | 79 | (_scrollController ??= ScrollController()); |
80 | return ModalScrollController( | 80 | return ModalScrollController( |
81 | controller: scrollController, | 81 | controller: scrollController, |
@@ -122,12 +122,6 @@ class _ModalBottomSheetState<T> extends State<_ModalBottomSheet<T>> { | @@ -122,12 +122,6 @@ class _ModalBottomSheetState<T> extends State<_ModalBottomSheet<T>> { | ||
122 | } | 122 | } |
123 | } | 123 | } |
124 | 124 | ||
125 | -@Deprecated( | ||
126 | - 'ModalBottomSheetRoute has been introduced in Flutter 3.7, to avoid name ' | ||
127 | - 'conflicts, this class has been renamed to ModalSheetRoute in this ' | ||
128 | - 'packages. ModalBottomSheetRoute will be removed in the next major version.') | ||
129 | -typedef ModalBottomSheetRoute<T> = ModalSheetRoute<T>; | ||
130 | - | ||
131 | class ModalSheetRoute<T> extends PageRoute<T> { | 125 | class ModalSheetRoute<T> extends PageRoute<T> { |
132 | ModalSheetRoute({ | 126 | ModalSheetRoute({ |
133 | this.closeProgressThreshold, | 127 | this.closeProgressThreshold, |
@@ -491,11 +491,6 @@ class _CupertinoScaffoldState extends State<CupertinoScaffold> | @@ -491,11 +491,6 @@ class _CupertinoScaffoldState extends State<CupertinoScaffold> | ||
491 | } | 491 | } |
492 | 492 | ||
493 | @override | 493 | @override |
494 | - void dispose() { | ||
495 | - super.dispose(); | ||
496 | - } | ||
497 | - | ||
498 | - @override | ||
499 | Widget build(BuildContext context) { | 494 | Widget build(BuildContext context) { |
500 | return CupertinoScaffoldInheirted( | 495 | return CupertinoScaffoldInheirted( |
501 | animation: animationController, | 496 | animation: animationController, |
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.1.2 | 3 | +version: 3.0.0-pre |
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.17.0 <3.0.0" | 7 | sdk: ">=2.17.0 <3.0.0" |
8 | - flutter: ">=3.0.0" | 8 | + flutter: ">=3.7.0" |
9 | 9 | ||
10 | dependencies: | 10 | dependencies: |
11 | flutter: | 11 | flutter: |
@@ -87,7 +87,7 @@ class ListWidget extends StatelessWidget { | @@ -87,7 +87,7 @@ class ListWidget extends StatelessWidget { | ||
87 | return Container( | 87 | return Container( |
88 | child: Text( | 88 | child: Text( |
89 | 'Location', | 89 | 'Location', |
90 | - style: Theme.of(context).textTheme.headline6, | 90 | + style: Theme.of(context).textTheme.titleLarge, |
91 | ), | 91 | ), |
92 | padding: const EdgeInsets.all(20), | 92 | padding: const EdgeInsets.all(20), |
93 | alignment: Alignment.center, | 93 | alignment: Alignment.center, |
@@ -329,7 +329,7 @@ class SectionTitle extends StatelessWidget { | @@ -329,7 +329,7 @@ class SectionTitle extends StatelessWidget { | ||
329 | padding: const EdgeInsets.all(16), | 329 | padding: const EdgeInsets.all(16), |
330 | child: Text( | 330 | child: Text( |
331 | text, | 331 | text, |
332 | - style: Theme.of(context).textTheme.headline6, | 332 | + style: Theme.of(context).textTheme.titleLarge, |
333 | ), | 333 | ), |
334 | ); | 334 | ); |
335 | } | 335 | } |
@@ -7,7 +7,7 @@ class ComplexModal extends StatelessWidget { | @@ -7,7 +7,7 @@ class ComplexModal extends StatelessWidget { | ||
7 | @override | 7 | @override |
8 | Widget build(BuildContext context) { | 8 | Widget build(BuildContext context) { |
9 | final ScrollController primaryScrollController = | 9 | final ScrollController primaryScrollController = |
10 | - PrimaryScrollController.of(context)!; | 10 | + PrimaryScrollController.maybeOf(context)!; |
11 | return Material( | 11 | return Material( |
12 | child: WillPopScope( | 12 | child: WillPopScope( |
13 | onWillPop: () async { | 13 | onWillPop: () async { |
@@ -145,8 +145,8 @@ class BookDetailsScreen extends StatelessWidget { | @@ -145,8 +145,8 @@ class BookDetailsScreen extends StatelessWidget { | ||
145 | child: Column( | 145 | child: Column( |
146 | crossAxisAlignment: CrossAxisAlignment.stretch, | 146 | crossAxisAlignment: CrossAxisAlignment.stretch, |
147 | children: <Widget>[ | 147 | children: <Widget>[ |
148 | - Text(book.title, style: Theme.of(context).textTheme.headline6), | ||
149 | - Text(book.author, style: Theme.of(context).textTheme.subtitle1), | 148 | + Text(book.title, style: Theme.of(context).textTheme.titleLarge), |
149 | + Text(book.author, style: Theme.of(context).textTheme.titleMedium), | ||
150 | ], | 150 | ], |
151 | ), | 151 | ), |
152 | ), | 152 | ), |
@@ -158,8 +158,8 @@ class BookDetailsScreen extends StatelessWidget { | @@ -158,8 +158,8 @@ class BookDetailsScreen extends StatelessWidget { | ||
158 | child: Column( | 158 | child: Column( |
159 | crossAxisAlignment: CrossAxisAlignment.stretch, | 159 | crossAxisAlignment: CrossAxisAlignment.stretch, |
160 | children: <Widget>[ | 160 | children: <Widget>[ |
161 | - Text(book.title, style: Theme.of(context).textTheme.headline6), | ||
162 | - Text(book.author, style: Theme.of(context).textTheme.subtitle1), | 161 | + Text(book.title, style: Theme.of(context).textTheme.titleLarge), |
162 | + Text(book.author, style: Theme.of(context).textTheme.titleMedium), | ||
163 | ], | 163 | ], |
164 | ), | 164 | ), |
165 | ), | 165 | ), |
@@ -145,8 +145,8 @@ class BookDetailsScreen extends StatelessWidget { | @@ -145,8 +145,8 @@ class BookDetailsScreen extends StatelessWidget { | ||
145 | child: Column( | 145 | child: Column( |
146 | crossAxisAlignment: CrossAxisAlignment.stretch, | 146 | crossAxisAlignment: CrossAxisAlignment.stretch, |
147 | children: <Widget>[ | 147 | children: <Widget>[ |
148 | - Text(book.title, style: Theme.of(context).textTheme.headline6), | ||
149 | - Text(book.author, style: Theme.of(context).textTheme.subtitle1), | 148 | + Text(book.title, style: Theme.of(context).textTheme.titleLarge), |
149 | + Text(book.author, style: Theme.of(context).textTheme.titleMedium), | ||
150 | ], | 150 | ], |
151 | ), | 151 | ), |
152 | ), | 152 | ), |
@@ -291,7 +291,7 @@ class MapSheet extends StatelessWidget { | @@ -291,7 +291,7 @@ class MapSheet extends StatelessWidget { | ||
291 | child: Text( | 291 | child: Text( |
292 | 'Latest near you', | 292 | 'Latest near you', |
293 | style: | 293 | style: |
294 | - Theme.of(context).textTheme.headline6, | 294 | + Theme.of(context).textTheme.titleLarge, |
295 | ), | 295 | ), |
296 | padding: EdgeInsets.all(20), | 296 | padding: EdgeInsets.all(20), |
297 | alignment: Alignment.centerLeft, | 297 | alignment: Alignment.centerLeft, |
@@ -31,7 +31,7 @@ class ScrollableSheet extends StatelessWidget { | @@ -31,7 +31,7 @@ class ScrollableSheet extends StatelessWidget { | ||
31 | return Container( | 31 | return Container( |
32 | child: Text( | 32 | child: Text( |
33 | 'Location', | 33 | 'Location', |
34 | - style: Theme.of(context).textTheme.headline6, | 34 | + style: Theme.of(context).textTheme.titleLarge, |
35 | ), | 35 | ), |
36 | padding: const EdgeInsets.all(20), | 36 | padding: const EdgeInsets.all(20), |
37 | alignment: Alignment.center, | 37 | alignment: Alignment.center, |
@@ -36,7 +36,7 @@ class ScrollableSnapSheet extends StatelessWidget { | @@ -36,7 +36,7 @@ class ScrollableSnapSheet extends StatelessWidget { | ||
36 | return Container( | 36 | return Container( |
37 | child: Text( | 37 | child: Text( |
38 | 'Location', | 38 | 'Location', |
39 | - style: Theme.of(context).textTheme.headline6, | 39 | + style: Theme.of(context).textTheme.titleLarge, |
40 | ), | 40 | ), |
41 | padding: const EdgeInsets.all(20), | 41 | padding: const EdgeInsets.all(20), |
42 | alignment: Alignment.center, | 42 | alignment: Alignment.center, |
@@ -14,8 +14,8 @@ class SimpleSheet extends StatelessWidget { | @@ -14,8 +14,8 @@ class SimpleSheet extends StatelessWidget { | ||
14 | crossAxisAlignment: CrossAxisAlignment.stretch, | 14 | crossAxisAlignment: CrossAxisAlignment.stretch, |
15 | children: <Widget>[ | 15 | children: <Widget>[ |
16 | const SizedBox(height: 20), | 16 | const SizedBox(height: 20), |
17 | - Text('Title', style: Theme.of(context).textTheme.headline3), | ||
18 | - Text('Subtitle', style: Theme.of(context).textTheme.headline6), | 17 | + Text('Title', style: Theme.of(context).textTheme.displaySmall), |
18 | + Text('Subtitle', style: Theme.of(context).textTheme.titleLarge), | ||
19 | ], | 19 | ], |
20 | ), | 20 | ), |
21 | ), | 21 | ), |
@@ -324,7 +324,7 @@ class SectionTitle extends StatelessWidget { | @@ -324,7 +324,7 @@ class SectionTitle extends StatelessWidget { | ||
324 | padding: const EdgeInsets.fromLTRB(16, 20, 16, 8), | 324 | padding: const EdgeInsets.fromLTRB(16, 20, 16, 8), |
325 | child: Text( | 325 | child: Text( |
326 | title, | 326 | title, |
327 | - style: Theme.of(context).textTheme.caption, | 327 | + style: Theme.of(context).textTheme.bodySmall, |
328 | ), | 328 | ), |
329 | ); | 329 | ); |
330 | } | 330 | } |
@@ -86,7 +86,7 @@ class SectionTitle extends StatelessWidget { | @@ -86,7 +86,7 @@ class SectionTitle extends StatelessWidget { | ||
86 | padding: const EdgeInsets.fromLTRB(16, 20, 16, 8), | 86 | padding: const EdgeInsets.fromLTRB(16, 20, 16, 8), |
87 | child: Text( | 87 | child: Text( |
88 | title, | 88 | title, |
89 | - style: Theme.of(context).textTheme.caption, | 89 | + style: Theme.of(context).textTheme.bodySmall, |
90 | ), | 90 | ), |
91 | ); | 91 | ); |
92 | } | 92 | } |
@@ -139,6 +139,7 @@ class SheetPrimaryScrollPosition extends ScrollPositionWithSingleContext { | @@ -139,6 +139,7 @@ class SheetPrimaryScrollPosition extends ScrollPositionWithSingleContext { | ||
139 | velocity, | 139 | velocity, |
140 | ), | 140 | ), |
141 | context.vsync, | 141 | context.vsync, |
142 | + true, | ||
142 | ), | 143 | ), |
143 | ); | 144 | ); |
144 | 145 | ||
@@ -178,6 +179,7 @@ class SheetPrimaryScrollPosition extends ScrollPositionWithSingleContext { | @@ -178,6 +179,7 @@ class SheetPrimaryScrollPosition extends ScrollPositionWithSingleContext { | ||
178 | velocity, | 179 | velocity, |
179 | ), | 180 | ), |
180 | context.vsync, | 181 | context.vsync, |
182 | + true, | ||
181 | ), | 183 | ), |
182 | ); | 184 | ); |
183 | return; | 185 | return; |
@@ -49,7 +49,8 @@ class ScrollToTopStatusBarState extends State<ScrollToTopStatusBarHandler> { | @@ -49,7 +49,8 @@ class ScrollToTopStatusBarState extends State<ScrollToTopStatusBarHandler> { | ||
49 | } | 49 | } |
50 | 50 | ||
51 | void _handleStatusBarTap(BuildContext context) { | 51 | void _handleStatusBarTap(BuildContext context) { |
52 | - final ScrollController? controller = PrimaryScrollController.of(context); | 52 | + final ScrollController? controller = |
53 | + PrimaryScrollController.maybeOf(context); | ||
53 | if (controller != null && controller.hasClients) { | 54 | if (controller != null && controller.hasClients) { |
54 | controller.animateTo( | 55 | controller.animateTo( |
55 | 0.0, | 56 | 0.0, |
1 | name: sheet | 1 | name: sheet |
2 | description: A fully customizable draggable bottom sheet. | 2 | description: A fully customizable draggable bottom sheet. |
3 | -version: 0.0.4+1 | 3 | +version: 1.0.0-pre |
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.17.0 <3.0.0" | 7 | sdk: ">=2.17.0 <3.0.0" |
8 | - flutter: ">=3.3.0" | 8 | + flutter: ">=3.7.0" |
9 | 9 | ||
10 | dependencies: | 10 | dependencies: |
11 | flutter: | 11 | flutter: |
-
Please register or login to post a comment