Flutter(Dart)でアプリを作成しています。
Flutter
1List<String> appBarList = ['StyleRecord', 'グラフ', '履歴', '設定'];
上記でappBar用のリストを作成しました。
title部分に行列から特定の列のタイトルを抽出して表示しようとしました。
Flutter
1Widget build(BuildContext context) { 2 return Scaffold( 3 appBar: AppBar(title: Text(appBarList[_currentIndex])),
エラー文は下記の通りです。
type 'List<dynamic>' is not a subtype of type 'List<String>' of 'function result'
String形式のListを宣言しているつもりですが、なぜか<dynamic>になってしまいます。
_currentIndexはページ遷移にも使っており、特に問題はないと考えています。
よろしくお願いいたします。
あなたの回答
tips
プレビュー