我正在使用 android studio 2022 构建一个 flutter 应用程序,但是当我使用 Scaffold 时,它显示应该提供“home”,但 flutter 文档页面上没有文档显示 Scaffold 小部件具有该参数。以下错误:
required parameter 'home' must be provided,
还有一些类似上面的错误。
我正在使用 flutter 3.24 和 dart 3.5
Check the comment Under the material widget home is missing maybe in your code this error only occurred when you skipped the home parameter.
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: MyHomePage(), // Ensure you provide the 'home' parameter here
);
}
}