Jaime Blasco

fix: prepare for will pop deprecation

@@ -46,8 +46,11 @@ class ModalBottomSheet extends StatefulWidget { @@ -46,8 +46,11 @@ class ModalBottomSheet extends StatefulWidget {
46 required this.child, 46 required this.child,
47 this.minFlingVelocity = _minFlingVelocity, 47 this.minFlingVelocity = _minFlingVelocity,
48 double? closeProgressThreshold, 48 double? closeProgressThreshold,
49 - this.willPopThreshold = _willPopThreshold,  
50 - }) : closeProgressThreshold = 49 + @Deprecated('Use preventPopThreshold instead') double? willPopThreshold,
  50 + double? preventPopThreshold,
  51 + }) : preventPopThreshold =
  52 + preventPopThreshold ?? willPopThreshold ?? _willPopThreshold,
  53 + closeProgressThreshold =
51 closeProgressThreshold ?? _closeProgressThreshold; 54 closeProgressThreshold ?? _closeProgressThreshold;
52 55
53 /// The closeProgressThreshold parameter 56 /// The closeProgressThreshold parameter
@@ -107,9 +110,9 @@ class ModalBottomSheet extends StatefulWidget { @@ -107,9 +110,9 @@ class ModalBottomSheet extends StatefulWidget {
107 /// Determines how fast the sheet should be flinged before closing. 110 /// Determines how fast the sheet should be flinged before closing.
108 final double minFlingVelocity; 111 final double minFlingVelocity;
109 112
110 - /// The willPopThreshold parameter 113 + /// The preventPopThreshold parameter
111 /// Determines how far the sheet should be flinged before closing. 114 /// Determines how far the sheet should be flinged before closing.
112 - final double willPopThreshold; 115 + final double preventPopThreshold;
113 116
114 @override 117 @override
115 ModalBottomSheetState createState() => ModalBottomSheetState(); 118 ModalBottomSheetState createState() => ModalBottomSheetState();
@@ -185,6 +185,7 @@ class ModalSheetRoute<T> extends PageRoute<T> { @@ -185,6 +185,7 @@ class ModalSheetRoute<T> extends PageRoute<T> {
185 return _animationController!; 185 return _animationController!;
186 } 186 }
187 187
  188 + // ignore: deprecated_member_use
188 bool get _hasScopedWillPopCallback => hasScopedWillPopCallback; 189 bool get _hasScopedWillPopCallback => hasScopedWillPopCallback;
189 190
190 @override 191 @override
@@ -2,6 +2,8 @@ @@ -2,6 +2,8 @@
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
  5 +// ignore_for_file: deprecated_member_use
  6 +
5 import 'package:flutter/material.dart'; 7 import 'package:flutter/material.dart';
6 import 'package:flutter/rendering.dart'; 8 import 'package:flutter/rendering.dart';
7 import 'package:flutter/widgets.dart'; 9 import 'package:flutter/widgets.dart';