Нужна помощь в устранении ошибки сборки пикселей Flutter - PullRequest
0 голосов
/ 24 сентября 2018

Я продолжаю получать этот пиксель ошибки утверждения! = 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, объектное сообщение) "AssertionError_throwNew";

1 Ответ

0 голосов
/ 27 сентября 2018

Я обнаружил, что его нужно поместить в панель вкладок:

 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,
        );
      }
    });
...