Skip to content

Commit

Permalink
fix: prepare for will pop deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesblasco committed Mar 12, 2024
1 parent 2e4826d commit 17bc799
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
11 changes: 7 additions & 4 deletions modal_bottom_sheet/lib/src/bottom_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ class ModalBottomSheet extends StatefulWidget {
required this.child,
this.minFlingVelocity = _minFlingVelocity,
double? closeProgressThreshold,
this.willPopThreshold = _willPopThreshold,
}) : closeProgressThreshold =
@Deprecated('Use preventPopThreshold instead') double? willPopThreshold,
double? preventPopThreshold,
}) : preventPopThreshold =
preventPopThreshold ?? willPopThreshold ?? _willPopThreshold,
closeProgressThreshold =
closeProgressThreshold ?? _closeProgressThreshold;

/// The closeProgressThreshold parameter
Expand Down Expand Up @@ -107,9 +110,9 @@ class ModalBottomSheet extends StatefulWidget {
/// Determines how fast the sheet should be flinged before closing.
final double minFlingVelocity;

/// The willPopThreshold parameter
/// The preventPopThreshold parameter
/// Determines how far the sheet should be flinged before closing.
final double willPopThreshold;
final double preventPopThreshold;

@override
ModalBottomSheetState createState() => ModalBottomSheetState();
Expand Down
1 change: 1 addition & 0 deletions modal_bottom_sheet/lib/src/bottom_sheet_route.dart
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ class ModalSheetRoute<T> extends PageRoute<T> {
return _animationController!;
}

// ignore: deprecated_member_use
bool get _hasScopedWillPopCallback => hasScopedWillPopCallback;

@override
Expand Down
2 changes: 2 additions & 0 deletions sheet/lib/src/route/sheet_route.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// ignore_for_file: deprecated_member_use

import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
Expand Down

0 comments on commit 17bc799

Please sign in to comment.