@overrIDe Widget build(BuildContext context) { var _children = <Widget>[ new Center( child: new Text(Widget.prov.fname + Widget.prov.lname,style: new TextStyle(FontSize: 20.0,FontWeight: FontWeight.bold),),new Center( child: new Container( padding: new EdgeInsets.only( left: 125.0,right: 125.0,bottom: 50.0),child: new Image.network('http://174.138.61.246:8080/getimage/'+Widget.prov.pic.assetname),) ),new Form( key: _formKey,autovalIDate: _autovalIDate,onWillPop: _warnUserAboutInvalIDData,child: new Expanded( child: new ListVIEw( padding: const EdgeInsets.symmetric(horizontal: 16.0),children: <Widget>[ new TextFormFIEld( decoration: const inputdecoration( icon: const Icon(Icons.person),hintText: 'First name?',labelText: 'First name *',onSaved: (String value) { referral.fname = value; },valIDator: _valIDatename,new TextFormFIEld( decoration: const inputdecoration( icon: const Icon(Icons.person),hintText: 'Last name?',labelText: 'Last name *',onSaved: (String value) { referral.lname = value; },new TextFormFIEld( decoration: const inputdecoration( icon: const Icon(Icons.phone),hintText: 'How to contact?',labelText: 'Phone Number *',prefixText: '+1' ),keyboardType: TextinputType.phone,onSaved: (String value) { referral.contact = value; },valIDator: _valIDatePhoneNumber,// TextinputFormatters are applIEd in sequence. inputFormatters: <TextinputFormatter> [ WhiteListingTextinputFormatter.digitsOnly,// Fit the valIDating format. _phoneNumberFormatter,],new TextFormFIEld( decoration: const inputdecoration( hintText: 'Tell us about patIEnt',helperText: 'It does not have to be detailed yet',labelText: 'Referral Details',maxlines: 5,new _DateTimePicker( labelText: 'dob',selectedDate: _fromDate,selectDate: (DateTime date) { setState(() { referral.dob = date; }); },new inputDecorator( decoration: const inputdecoration( labelText: 'Type of Appointment',hintText: 'Choose an Appointment Type',isEmpty: _typeAppt == null,child: new Dropdownbutton<String>( value: _typeAppt,isDense: true,onChanged: (String newValue) { setState(() { _typeAppt = newValue; }); },items: _allTypeAppt.map((String value) { return new DropdownMenuItem<String>( value: value,child: new Text(value),); }).toList(),) ) ),/*new Refreshindicator( child: new ListVIEw.builder( itemBuilder: _itemBuilder,itemCount: Listcount,onRefresh: _onRefresh,*/ ]; return new Scaffold( appbar: new Appbar(Title: new Text("My ProvIDer")),body: new Column( children: _children,); }解决方法 我认为问题是你没有保存放入TextFIElds的值(例如一个状态).
从您的代码我假设您使用ListVIEw.builder()来设置ListVIEw.如 documentation中所述,此方法仅呈现视野中的孩子.将子项滚动到视图外后,它将从ListVIEw中删除,只有在将其滚动到视图中后才会再次添加.由于删除了TextFIEld,因此也会删除该值.
要永久保存值,我建议使用TextFIElds并将输入保存到TextFIEld的onChanged()
方法中,或者使用TextEditingController.
以上是内存溢出为你收集整理的当我滚动时,颤动的表格数据消失了全部内容,希望文章能够帮你解决当我滚动时,颤动的表格数据消失了所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)