Dart & Flutter

[Flutter] _minScrollExtent Null check Error

ju_young 2023. 5. 9. 00:02
728x90

src>flutter>packages>flutter>lib>src>widgets>scroll_position.dart

Before

@override
double get minScrollExtent => _minScrollExtent!;
double? _minScrollExtent;

@override
double get maxScrollExtent => _maxScrollExtent!;
double? _maxScrollExtent;

After

@override
double get minScrollExtent => _minScrollExtent;
double _minScrollExtent = 0.0;

@override
double get maxScrollExtent => _maxScrollExtent;
double _maxScrollExtent = 0.0;

[reference]

https://github.com/flutter/flutter/issues/60578#issuecomment-832004578

https://stackoverflow.com/questions/68777336/flutter-network-image-inside-listwheelscrollview-not-working-on-init

728x90