Skip to content
This repository was archived by the owner on Feb 5, 2024. It is now read-only.

Commit bb37fc3

Browse files
committed
Removing last late modifiers
1 parent a49fbc6 commit bb37fc3

2 files changed

Lines changed: 11 additions & 10 deletions

File tree

lib/ui/pages/qr_scanner/Scanner.dart

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class _ScannerState extends State<Scanner> with SingleTickerProviderStateMixin {
2929
final GlobalKey qrKey = GlobalKey(debugLabel: 'QR');
3030
AnimationController? _animationController;
3131
bool isPlaying = false;
32-
late MobileScannerController cameraController;
32+
MobileScannerController? cameraController;
3333
final TextEditingController _textFieldController = TextEditingController();
3434
CredManager? credManager;
3535

@@ -67,7 +67,7 @@ class _ScannerState extends State<Scanner> with SingleTickerProviderStateMixin {
6767
void dispose() {
6868
super.dispose();
6969
_animationController?.dispose();
70-
cameraController.dispose();
70+
cameraController!.dispose();
7171
}
7272

7373
@override
@@ -141,7 +141,8 @@ class _ScannerState extends State<Scanner> with SingleTickerProviderStateMixin {
141141
IconButton(
142142
iconSize: 80,
143143
icon: ValueListenableBuilder(
144-
valueListenable: cameraController.cameraFacingState,
144+
valueListenable:
145+
cameraController!.cameraFacingState,
145146
builder: (context, state, child) {
146147
switch (state as CameraFacing) {
147148
case CameraFacing.front:
@@ -159,7 +160,7 @@ class _ScannerState extends State<Scanner> with SingleTickerProviderStateMixin {
159160
}
160161
},
161162
),
162-
onPressed: () => cameraController.switchCamera(),
163+
onPressed: () => cameraController!.switchCamera(),
163164
),
164165
],
165166
),
@@ -178,10 +179,10 @@ class _ScannerState extends State<Scanner> with SingleTickerProviderStateMixin {
178179
isPlaying = !isPlaying;
179180
if (isPlaying) {
180181
_animationController?.forward();
181-
cameraController.stop();
182+
cameraController!.stop();
182183
} else {
183184
_animationController?.reverse();
184-
cameraController.start();
185+
cameraController!.start();
185186
}
186187
});
187188
}

lib/weather/bg/weather_night_star_bg.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class WeatherNightStarBg extends StatefulWidget {
1919

2020
class _WeatherNightStarBgState extends State<WeatherNightStarBg>
2121
with SingleTickerProviderStateMixin {
22-
late AnimationController _controller;
22+
AnimationController? _controller;
2323
List<_StarParam> _starParams = [];
2424
List<_MeteorParam> _meteorParams = [];
2525
WeatherDataState _state = WeatherDataState.init;
@@ -38,7 +38,7 @@ class _WeatherNightStarBgState extends State<WeatherNightStarBg>
3838
_state = WeatherDataState.loading;
3939
initStarParams();
4040
setState(() {
41-
_controller.repeat();
41+
_controller!.repeat();
4242
});
4343
_state = WeatherDataState.finish;
4444
}
@@ -63,15 +63,15 @@ class _WeatherNightStarBgState extends State<WeatherNightStarBg>
6363
/// 初始化动画信息
6464
_controller =
6565
AnimationController(duration: Duration(seconds: 5), vsync: this);
66-
_controller.addListener(() {
66+
_controller!.addListener(() {
6767
setState(() {});
6868
});
6969
super.initState();
7070
}
7171

7272
@override
7373
void dispose() {
74-
_controller.dispose();
74+
_controller!.dispose();
7575
super.dispose();
7676
}
7777

0 commit comments

Comments
 (0)