前提・実現したいこと
ここに質問の内容を詳しく書いてください。
flutter の勉強しております。
エラーメッセージが発生しました。
解る方がいましたら教えて頂けると助かります。
発生している問題・エラーメッセージ
The name 'User' isn't a type so it can't be used as a type argument. The method 'User' isn't defined for the type '_TopPageState'. The method 'User' isn't defined for the type '_TopPageState'.
該当のソースコード
import 'package:flutter/material.dart'; class TopPage extends StatefulWidget { const TopPage({Key? key}) : super(key: key); @override _TopPageState createState() => _TopPageState(); } class _TopPageState extends State<TopPage> { List<User> userList = [ User( name: '田中', uid: 'wdwd', imagePath: '', lastMessage:'田中', ), User( name: '小林', uid: 'wdwd', imagePath: 'https: //', lastMessage:'田中' ), ]; @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('チャットアプリ'), ), body: Center(child: Text('TOPぺージ')), ); } }
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2022/01/07 16:46