E/flutter (3045):[ERROR:flutter/lib/ui/ui_dart_state.cc(186)] 未处理的异常:NoSuchMethodError:类“List”没有实例方法“call”。
这是我的代码:
import 'package:flutter/material.dart';
void main(IniApp) => runApp(IniApp(home: IniApp()));
class IniApp extends StatelessWidget {
@override Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: Text("who's is emir"),),
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children:[
Center(
child: Center(
child: Text("Nama Saya Emir Afawan\n"
"NIM Saya 20180801028\n"
"Hobby Saya Volleyball\n"
"Pekerjaan Saya Kuliah\n"
"Status Saya Belajar"),
),
),
],
),
),
);
}
答案 0 :(得分:0)
main 函数有一个奇怪的行为,试图用不存在的 home 参数调用 IniApp。尝试通过调用一次来简化它:void main() => runApp(IniApp());