No errors in the code and as far as I can see the pubspec.yaml file is functional, as it worked before.
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: SafeArea(
child: Column(
children: [
Card(
child: Image.asset('anyaparent.jpeg'),
),
],
),
),
),
);
try doing like this
Image.asset('images/anyaparent.jpeg'),
Check your image path images/anyaparent.jpeg
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: SafeArea(
child: Column(
children: [
Card(
child: Image.asset('images/anyaparent.jpeg'),
),
],
),
),
),
);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.