【Flutter】「The class ‘List’ doesn’t have an unnamed constructor.」の意味と対策

Flutterのエラー「The class ‘List’ doesn’t have an unnamed constructor.」の意味と対策について紹介します。

スポンサーリンク

「The class ‘my class’ doesn’t have an unnamed constructor」の意味

Flutterでデバッグすると以下のようなエラーが出ることがあります。

The class 'List' doesn't have an unnamed constructor. (Documentation)  
Try using one of the named constructors defined in 'List'.
class Todo {
class TodoListState extends State {
  DbHelper helper = DbHelper();
  List? todos;
  var calender = Calendar();

  @override
  Widget build(BuildContext context) {


    if (todos == null) {
      todos = List();
      getData();
    }


(略)

}
【Flutter入門】iOS、Android、Windowsアプリ開発
FlutterによるiOS、Android、Windowsアプリ開発について入門者向けに紹介します。
flutter
スポンサーリンク

コメント