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:
2026-07-25 18:13:01 +08:00
parent 8f3d3509ea
commit fce670664b
99 changed files with 1013 additions and 838 deletions

View File

@@ -6,8 +6,8 @@ import 'style.dart';
class Carousel extends StatefulWidget {
Carousel({
double height = 200.0,
List<Widget> pages,
bool autoPlay,
List<Widget>? pages,
bool? autoPlay,
Duration duration = const Duration(seconds: 2),
Duration animationDuration = const Duration(milliseconds: 1000),
})
@@ -30,7 +30,7 @@ class Carousel extends StatefulWidget {
class CarouselState extends State<Carousel> {
final _pageController = new PageController();
Timer _timer;
late Timer _timer;
int _currentPage = 0;
bool reverse = false;
GlobalKey<IndicatorState> _indicatorStateKey = new GlobalKey();
@@ -80,7 +80,7 @@ class CarouselState extends State<Carousel> {
children: widget.pages,
onPageChanged: (index) {
_currentPage = index;
_indicatorStateKey.currentState.changeIndex(index);
_indicatorStateKey.currentState!.changeIndex(index);
},
),
),
@@ -102,7 +102,7 @@ class CarouselState extends State<Carousel> {
}
class Indicator extends StatefulWidget {
Indicator({Key? key, int count})
Indicator({Key? key, int? count})
: count = count,
super(key: key);