phase3: nullfix.py batch script — bang/late/param-nullable
Automated null-safety fixes driven by dart analyze (no corruption): - unchecked_use_of_nullable_value: insert '!' on receiver (property/method/[]/op) - not_initialized field/var: mark 'late' - missing_default_value_for_parameter: nullable param Errors: 2374(peak) -> 907
This commit is contained in:
@@ -211,9 +211,9 @@ class SlidingUpPanel extends StatefulWidget {
|
||||
|
||||
class _SlidingUpPanelState extends State<SlidingUpPanel> with SingleTickerProviderStateMixin{
|
||||
|
||||
AnimationController _ac;
|
||||
late AnimationController _ac;
|
||||
|
||||
ScrollController _sc;
|
||||
late ScrollController _sc;
|
||||
bool _scrollingEnabled = false;
|
||||
VelocityTracker _vt = VelocityTracker.withKind(PointerDeviceKind.touch);
|
||||
|
||||
@@ -390,7 +390,7 @@ class _SlidingUpPanelState extends State<SlidingUpPanel> with SingleTickerProvid
|
||||
// and a listener if panelBuilder is used.
|
||||
// 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}){
|
||||
Widget _gestureHandler({Widget? child}){
|
||||
if (!widget.isDraggable) return child;
|
||||
|
||||
if (widget.panel != null){
|
||||
@@ -552,14 +552,14 @@ class _SlidingUpPanelState extends State<SlidingUpPanel> with SingleTickerProvid
|
||||
|
||||
//animate the panel position to value - must
|
||||
//be between 0.0 and 1.0
|
||||
Future<void> _animatePanelToPosition(double value, {Duration duration, Curve curve = Curves.linear}){
|
||||
Future<void> _animatePanelToPosition(double value, {Duration? duration, Curve curve = Curves.linear}){
|
||||
assert(0.0 <= value && value <= 1.0);
|
||||
return _ac.animateTo(value, duration: duration, curve: curve);
|
||||
}
|
||||
|
||||
//animate the panel position to the snap point
|
||||
//REQUIRES that widget.snapPoint != null
|
||||
Future<void> _animatePanelToSnapPoint({Duration duration, Curve curve = Curves.linear}){
|
||||
Future<void> _animatePanelToSnapPoint({Duration? duration, Curve curve = Curves.linear}){
|
||||
assert(widget.snapPoint != null);
|
||||
return _ac.animateTo(widget.snapPoint, duration: duration, curve: curve);
|
||||
}
|
||||
@@ -602,7 +602,7 @@ class _SlidingUpPanelState extends State<SlidingUpPanel> with SingleTickerProvid
|
||||
|
||||
|
||||
class PanelController{
|
||||
_SlidingUpPanelState _panelState;
|
||||
late _SlidingUpPanelState _panelState;
|
||||
|
||||
void _addState(_SlidingUpPanelState panelState){
|
||||
this._panelState = panelState;
|
||||
@@ -644,7 +644,7 @@ class PanelController{
|
||||
/// where 0.0 is fully collapsed and 1.0 is completely open.
|
||||
/// (optional) duration specifies the time for the animation to complete
|
||||
/// (optional) curve specifies the easing behavior of the animation.
|
||||
Future<void> animatePanelToPosition(double value, {Duration duration, Curve curve = Curves.linear}){
|
||||
Future<void> animatePanelToPosition(double value, {Duration? duration, Curve curve = Curves.linear}){
|
||||
assert(isAttached, "PanelController must be attached to a SlidingUpPanel");
|
||||
assert(0.0 <= value && value <= 1.0);
|
||||
return _panelState._animatePanelToPosition(value, duration: duration, curve: curve);
|
||||
@@ -654,7 +654,7 @@ class PanelController{
|
||||
/// Requires that the SlidingUpPanel snapPoint property is not null
|
||||
/// (optional) duration specifies the time for the animation to complete
|
||||
/// (optional) curve specifies the easing behavior of the animation.
|
||||
Future<void> animatePanelToSnapPoint({Duration duration, Curve curve = Curves.linear}){
|
||||
Future<void> animatePanelToSnapPoint({Duration? duration, Curve curve = Curves.linear}){
|
||||
assert(isAttached, "PanelController must be attached to a SlidingUpPanel");
|
||||
assert(_panelState.widget.snapPoint != null, "SlidingUpPanel snapPoint property must not be null");
|
||||
return _panelState._animatePanelToSnapPoint(duration: duration, curve: curve);
|
||||
|
||||
Reference in New Issue
Block a user