Нужна помощь в устранении ошибки сборки пикселей Flutter
Я продолжаю получать этот пиксель ошибки утверждения!= Null от оператора потокового построителя if, он не будет возвращать anyting из if, только из else. благодарю вас. очень смущенный
Widget build(BuildContext context) {
print("ffff23223r");
return new StreamBuilder(
stream: FirebaseAuth.instance.currentUser().asStream(),
builder: (context, theuser) {
{
if(theuser.hasData && theuser.data.isEmailVerified){
return Container(color:Colors.red
);//always gives me error
}
else{return intro(theuser);//works fine no matter whats here }
}
});
}
Ошибка:
Исключение произошло. 'package:flutter/src/widgets/scroll_position.dart': ошибочное утверждение: строка 661, позиция 12: 'пиксели!= ноль': не соответствует действительности.
static _doThrowNew (int assertionStart, int assertionEnd, Object message) native "AssertionError_throwNew";
1 ответ
Я обнаружил, что это необходимо поместить в представление вкладок:
return new StreamBuilder(
stream: FirebaseAuth.instance.currentUser().asStream(),
builder: (context, theuser) {
{
return Scaffold(
body: new TabBarView(controller: controller, children: <Widget>[
theuser.hasData && theuser.data.isEmailVerified
? main2MapPage(theuser)
: new intro(theuser),
]),
backgroundColor: Colors.redAccent,
);
}
});