Is that Flutter need required and late for null safety in sdk version up to 2.7.0?
217
change your code to:
final CameraController _controller;
final Future<void> _initializeControllerFuture;
...
const DisplayPictureScreen({Key key, @required this.imagePath})
: super(key: key);
Author by
Druwa
Updated on December 13, 2022Comments
-
Druwa over 1 year
In the below code, this code occurs error that
late
andrequired
are not available in the flutter version 2.7.0.late CameraController _controller; late Future<void> _initializeControllerFuture; ... const DisplayPictureScreen({Key? key, required this.imagePath}) : super(key: key);
So, I change the flutter version up to 2.1.2 like this, and solved this problem right away.
environment: sdk: ">=2.12.0 <3.0.0"
Is that Flutter need other definition instead of
required
andlate
for null safety in sdk version up to 2.7.0?If yes, how I changes definition
required
andlate
in sdk version up to 2.7.0?