gpt4 book ai didi

android - 参数 'body' 未定义

转载 作者:IT王子 更新时间:2023-10-29 07:19:23 26 4
gpt4 key购买 nike

Compiler message:
lib/main.dart:12:11: Error: No named parameter with the name 'body'.
body: Image(
^^^^
import 'package:flutter/material.dart';

//main fuction is the starting point for all our apps.
void main() {
runApp(
MaterialApp(
home: Scaffold(
backgroundColor: Colors.blueGrey[150],
appBar: AppBar(
title: Text('I Am Rich'),
backgroundColor: Colors.deepOrange,
body: Image(
image:
NetworkImage('https://www.w3schools.com/w3css/img_lights.jpg'),
),
),
),
),
);
}

最佳答案

bodyScaffold的参数,不是AppBar

     Scaffold(
backgroundColor: Colors.blueGrey[150],
appBar: AppBar(
title: Text('I Am Rich'),
backgroundColor: Colors.deepOrange,

),
body: Image(
image:
NetworkImage('https://www.w3schools.com/w3css/img_lights.jpg'),
),
),

更多信息在这里:https://api.flutter.dev/flutter/material/Scaffold-class.html

关于android - 参数 'body' 未定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56349850/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com