I have a login screen using rxdart library
when typing keyboard dismissing. because of the rebuild the ConnectionState of StreamBuilder
in iOS build of flutter.
Widget handleLogin() {
return StreamBuilder(
stream: lgbloc.loginData,
builder: (BuildContext context, AsyncSnapshot<dynamic> snapshot) {
print(snapshot.connectionState);
if (snapshot.hasError ) {
isClick = false;
_controller.reverse();
Timer(Duration(seconds: 3), (){snapshot.hasError.toString();});
return setLoginText();
}
else {
_skLoginModel = snapshot.data;
if(_skLoginModel != null){
if (_skLoginModel.user != null){
isClick = false;
_controller.reverse();
initBloc.saveData(_skLoginModel.user);
return loginFinish();
}
else if (_skLoginModel.error != null && _skLoginModel.error.isNotEmpty){
_controller.reverse();
Timer(Duration(milliseconds: 500), (){
showInSnackBar(_skLoginModel.error);
_skLoginModel.error = null;
isClick = false;
});
return setLoginText();
}
else{
if(isClick){
_controller.forward();
return setLoading();
}
else{
_controller.reverse();
return setLoginText();
}
}
}
else {
_controller.reverse();
return setLoginText();
}
}
});
}
I expect still keyboard showing.