我在 aTextField
的帮助下进行了渲染StreamBuilder
,遵循BLoC
带有接收器和流的模式。
Widget field(SignUpBloc signUpBloc) {
return StreamBuilder(
stream: signUpBloc.outFirstName,
builder: (context, snapshot) {
return TextField(
style: TextStyle(fontSize: 15.0),
onChanged: signUpBloc.inFirstName,
decoration: InputDecoration(
errorStyle: TextStyle(fontSize: 15.0),
errorText: snapshot.error
),
);
},
);
}
我的问题是如何设置初始值?我已尝试使用StreamBuilder
'initialData
属性,但TextField
.