Closed
Description
class _SmartExposureAnalysisWidget extends StatelessWidget {
const _SmartExposureAnalysisWidget({
required this.pathImgSelectedLut,
required this.imagePath,
required this.previewGeneratorChangeNotifier,
});
final String? pathImgSelectedLut;
final String? imagePath;
final PreviewGeneratorChangeNotifier previewGeneratorChangeNotifier;
@override
Widget build(BuildContext context) {
if (imagePath == null) {
return const SizedBox.shrink();
}
if (pathImgSelectedLut == null) {
return ExposureAnalysisWidget(
imagePath, previewGeneratorChangeNotifier);
}
return ExposureAnalysisWidget(
pathImgSelectedLut, previewGeneratorChangeNotifier);
}
}
The argument type 'String?' can't be assigned to the parameter type 'String'.
Because imagePath
is final
and is checked for null in the build function, I don't see why I should have a !
or a local variable to avoid this error message.
Am I missing something?