@@ -1917,20 +1917,13 @@ class ScaffoldState extends State<Scaffold> with TickerProviderStateMixin, Resto
1917
1917
1918
1918
/// Whether this scaffold has a non-null [Scaffold.appBar] .
1919
1919
bool get hasAppBar => widget.appBar != null ;
1920
-
1921
1920
/// Whether this scaffold has a non-null [Scaffold.drawer] .
1922
1921
bool get hasDrawer => widget.drawer != null ;
1923
-
1924
1922
/// Whether this scaffold has a non-null [Scaffold.endDrawer] .
1925
1923
bool get hasEndDrawer => widget.endDrawer != null ;
1926
-
1927
1924
/// Whether this scaffold has a non-null [Scaffold.floatingActionButton] .
1928
1925
bool get hasFloatingActionButton => widget.floatingActionButton != null ;
1929
1926
1930
- /// Whether this scaffold requires [Scaffold.appBar] to automatically add
1931
- /// dismiss button.
1932
- bool get requiresAppBarDismiss => _persistentSheetHistoryEntry != null ;
1933
-
1934
1927
double ? _appBarMaxHeight;
1935
1928
/// The max height the [Scaffold.appBar] uses.
1936
1929
///
@@ -2058,28 +2051,28 @@ class ScaffoldState extends State<Scaffold> with TickerProviderStateMixin, Resto
2058
2051
PersistentBottomSheetController <dynamic >? _currentBottomSheet;
2059
2052
final GlobalKey _currentBottomSheetKey = GlobalKey ();
2060
2053
2061
- LocalHistoryEntry ? _persistentSheetHistoryEntry;
2062
2054
void _maybeBuildPersistentBottomSheet () {
2063
2055
if (widget.bottomSheet != null && _currentBottomSheet == null ) {
2064
2056
// The new _currentBottomSheet is not a local history entry so a "back" button
2065
2057
// will not be added to the Scaffold's appbar and the bottom sheet will not
2066
2058
// support drag or swipe to dismiss.
2067
2059
final AnimationController animationController = BottomSheet .createAnimationController (this )..value = 1.0 ;
2060
+ LocalHistoryEntry ? persistentSheetHistoryEntry;
2068
2061
bool _persistentBottomSheetExtentChanged (DraggableScrollableNotification notification) {
2069
2062
if (notification.extent > notification.initialExtent) {
2070
- if (_persistentSheetHistoryEntry == null ) {
2071
- _persistentSheetHistoryEntry = LocalHistoryEntry (onRemove: () {
2063
+ if (persistentSheetHistoryEntry == null ) {
2064
+ persistentSheetHistoryEntry = LocalHistoryEntry (onRemove: () {
2072
2065
if (notification.extent > notification.initialExtent) {
2073
2066
DraggableScrollableActuator .reset (notification.context);
2074
2067
}
2075
2068
showBodyScrim (false , 0.0 );
2076
2069
_floatingActionButtonVisibilityValue = 1.0 ;
2077
- _persistentSheetHistoryEntry = null ;
2070
+ persistentSheetHistoryEntry = null ;
2078
2071
});
2079
- ModalRoute .of (context)! .addLocalHistoryEntry (_persistentSheetHistoryEntry ! );
2072
+ ModalRoute .of (context)! .addLocalHistoryEntry (persistentSheetHistoryEntry ! );
2080
2073
}
2081
- } else if (_persistentSheetHistoryEntry != null ) {
2082
- ModalRoute .of (context)! .removeLocalHistoryEntry (_persistentSheetHistoryEntry ! );
2074
+ } else if (persistentSheetHistoryEntry != null ) {
2075
+ ModalRoute .of (context)! .removeLocalHistoryEntry (persistentSheetHistoryEntry ! );
2083
2076
}
2084
2077
return false ;
2085
2078
}
0 commit comments