我从How to create a checkbox using listview中获取了以下代码,当一个项目被选中时,它将检查所有项目。如何将代码修复为不检查所有项? class CheckBoxInListView extends StatefulWidget {
@override
_CheckBoxInListViewState createState() => _CheckBoxInListViewState();
}
class _CheckBoxInListViewState extends State<CheckBoxInListView> {
我在我的assets文件夹中保存了一个json文件,我只想在我的Listview.Builder中显示json文件,但这里的问题是在应用程序初始化之前,我在控制台而不是移动屏幕上收到以下错误。 The following NoSuchMethodError was thrown building FutureBuilder<String>(dirty, state:
I/flutter (11766): _FutureBuilderState<String>#ef73b):
I/flutter (11766): The getter 'length'
因此,我想在我的颤振项目中包括包。因此,我将其添加到pubspec.yaml文件中的依赖项中。但是当我运行这个应用程序时,它立即崩溃了,并收到了错误信息:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mycompany.myapp/com.mycompany.myapp.MainActivity}:
java.lang.ClassCastException: com.mycompany.myapp.MainActivity cannot be cast to io.flutter
我在StatelessWidget中有一个ListView。它有项目,并且每个项目都包含一个复选框。当有人检查一个项目时,我希望ListView将其作为参数发送到另一个页面。但是当我这样做的时候,它会给我这个错误:
I/flutter ( 7067): The following UnsupportedError was thrown while handling a gesture:
I/flutter ( 7067): Unsupported operation: Cannot add to an unmodifiable list
I/flutter ( 7067): When the