Prefer typing uninitialized variables and fields. Use generic function type syntax for parameters. The prefix 'image1' can't be used here because it's shadowed by a local declaration. Try renaming either the prefix or the local declaration.
class FirstPage extends StatefulWidget { FirstPage({ Key? key, required this.image1}) : super(key: key); final XFile image1; child: Image1.file(File(image1.path)),
Future<void> _openImagePicker() async { final XFile? pickedImage = await _picker.pickImage(source: ImageSource.gallery); if (pickedImage == null) return; Navigator.of(context) .push(MaterialPageRoute(builder: (_) => FirstPage(image1: pickedImage)));
child: Image1.file(File(image1.path)),
child
Widget
Image1.file
Image1
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)