class AddResultPage extends StatelessWidget {
const AddResultPage({
Key? key,
required this.faceImage,
required this.faceName,
}) : super(key: key);
final File? faceImage;
final String faceName;
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
children: [
faceImage == null ? Container() : Image.file(faceImage!),
// ignore: prefer_const_constructors
CircleAvatar(
radius: 50,
foregroundImage: ,
),
Text(faceName),
how insert image in CircleAvatar?
i don’t know why it is wrong…….
foregroundImage: faceImage,
i don’t know how to use CircleAvatar, file path….
please help….
3
Answers
I solved it!!
You can’t insert a file as an Image, what you can do though is to use
You are trying to assign the file into the
foregroundImage
which expects an Image Provider. Since you are trying to display the image from file, you should useFileImage(imageFIle)