Jaime Blasco
Committed by GitHub

fix: flutter 3.7 (#324)

* fix: deprecate duplicated name

* fix: support flutter 3.7

* feat: add pre release version
1 1
  2 +## 3.0.0-pre - Flutter 3.7
  3 +
  4 ++ Migrates to Flutter 3.7
  5 ++ ModalBottomSheetRoute has been renamed to ModalSheetRoute so it does not conflict with the new class from Flutter 3.7
  6 +
2 ## 2.1.1 7 ## 2.1.1
3 + Bug fixes 8 + Bug fixes
4 9
@@ -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 }
@@ -254,4 +254,4 @@ packages: @@ -254,4 +254,4 @@ packages:
254 version: "2.1.4" 254 version: "2.1.4"
255 sdks: 255 sdks:
256 dart: ">=2.18.0 <4.0.0" 256 dart: ">=2.18.0 <4.0.0"
257 - flutter: ">=3.0.0" 257 + flutter: ">=3.7.0"
@@ -14,8 +14,8 @@ publish_to: none @@ -14,8 +14,8 @@ publish_to: none
14 version: 1.0.0+1 14 version: 1.0.0+1
15 15
16 environment: 16 environment:
17 - flutter: ">=3.0.0"  
18 sdk: '>=2.17.0 <3.0.0' 17 sdk: '>=2.17.0 <3.0.0'
  18 + flutter: ">=3.7.0"
19 19
20 20
21 dependencies: 21 dependencies:
@@ -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,
@@ -170,4 +170,4 @@ packages: @@ -170,4 +170,4 @@ packages:
170 version: "2.1.4" 170 version: "2.1.4"
171 sdks: 171 sdks:
172 dart: ">=2.18.0 <4.0.0" 172 dart: ">=2.18.0 <4.0.0"
173 - flutter: ">=3.0.0" 173 + flutter: ">=3.7.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.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:
1 -## [0.0.1] - TODO: Add release date. 1 +# [1.0.0-pre] - Adds support for Flutter 3.7
2 2
3 -* TODO: Describe initial release. 3 +* This version requires Flutter 3.7 as the new framework version contains several breaking changes that affect the package
@@ -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 }
@@ -222,4 +222,4 @@ packages: @@ -222,4 +222,4 @@ packages:
222 version: "2.1.4" 222 version: "2.1.4"
223 sdks: 223 sdks:
224 dart: ">=2.18.0 <4.0.0" 224 dart: ">=2.18.0 <4.0.0"
225 - flutter: ">=3.3.0" 225 + flutter: ">=3.7.0"
@@ -5,7 +5,7 @@ version: 1.0.0+1 @@ -5,7 +5,7 @@ version: 1.0.0+1
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:
@@ -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,
@@ -434,4 +434,4 @@ packages: @@ -434,4 +434,4 @@ packages:
434 version: "3.1.1" 434 version: "3.1.1"
435 sdks: 435 sdks:
436 dart: ">=2.18.0 <4.0.0" 436 dart: ">=2.18.0 <4.0.0"
437 - flutter: ">=3.3.0" 437 + flutter: ">=3.7.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: