phase3: nullable fields/methods, casts, ?.call, condition fixes across 11 files. 108->72

This commit is contained in:
2026-08-01 01:16:25 +08:00
parent b8b70a87f9
commit 137eca4c69
12 changed files with 164 additions and 164 deletions

View File

@@ -228,11 +228,11 @@ class _SlidingUpPanelState extends State<SlidingUpPanel> with SingleTickerProvid
duration: const Duration(milliseconds: 300),
value: widget.defaultPanelState == PanelState.CLOSED ? 0.0 : 1.0 //set the default panel state (i.e. set initial value of _ac)
)..addListener((){
if(widget.onPanelSlide != null) widget.onPanelSlide(_ac.value);
if(widget.onPanelSlide != null) widget.onPanelSlide?.call(_ac.value);
if(widget.onPanelOpened != null && _ac.value == 1.0) widget.onPanelOpened();
if(widget.onPanelOpened != null && _ac.value == 1.0) widget.onPanelOpened?.call();
if(widget.onPanelClosed != null && _ac.value == 0.0) widget.onPanelClosed();
if(widget.onPanelClosed != null && _ac.value == 0.0) widget.onPanelClosed?.call();
});
// prevent the panel content from being scrolled only if the widget is
@@ -326,7 +326,7 @@ class _SlidingUpPanelState extends State<SlidingUpPanel> with SingleTickerProvid
height: widget.maxHeight,
child: widget.panel != null
? widget.panel
: widget.panelBuilder(_sc),
: widget.panelBuilder!(_sc),
),
),
@@ -391,7 +391,7 @@ class _SlidingUpPanelState extends State<SlidingUpPanel> with SingleTickerProvid
// this is because the listener is designed only for use with linking the scrolling of
// panels and using it for panels that don't want to linked scrolling yields odd results
Widget _gestureHandler({Widget? child}){
if (!widget.isDraggable) return child;
if (!widget.isDraggable) return child!;
if (widget.panel != null){
return GestureDetector(