0

尽我所能

> import 'package:alnoor/poTesting/poClass.dart';
>     import 'package:alnoor/poTesting/poTestingForm.dart';
>     import 'package:flutter/material.dart';
>     
>     class PoTesting extends StatefulWidget {
>       PoTesting({Key key}) : super(key: key);
>     
>       _PoTestingState createState() => _PoTestingState();
>     }
>     
>     class _PoTestingState extends State<PoTesting> {
>       List itemList = [];
>       @override
>       Widget build(BuildContext context) {
>         var _user = User();
>     
>         return Scaffold(
>             appBar: AppBar(
>               title: Text("data"),
>             ),
>             floatingActionButton: FloatingActionButton(
>               child: Icon(Icons.add),
>               onPressed: () {
>                 setState(() {
>                   itemList.add("value");
>                 });
>               },
>             ),
>             body: Container(
>               height: 500,
>               child: new ListView.builder(
>                 addRepaintBoundaries: true,
>                 shrinkWrap: true,
>                 itemCount: 25,
>                 itemBuilder: (context, i) {
>                   return UserForm(
>                     user: _user,
>                   );
>                 },
>               ),
>             ));
>       }
>     }
4

1 回答 1

0

问题已解决的参考 github 问题是由于每次创建新小部件时创建新的状态实例而发生的,它只呈现前三个小部件状态不知道为什么,所以我每次都停止验证状态

于 2019-08-30T10:27:19.563 回答