草庐IT

null_unspecified

全部标签

dart - flutter - 异步函数总是返回 null,而它不是 null

我正在为我的项目使用Blocarchitect。我正在尝试在我的应用程序的Ui中使用我的Bloc文件中的函数,并将表单发送到服务器并使用响应。但是当我打电话时它返回null。虽然响应在我的应用程序的其他部分(即repo等)中不为空,但这里是我的Ui代码:MaterialButton(color:Colors.deepPurple,minWidth:screenAwareSize(500,context),onPressed:(){_submitForm(authBloc,user,pass);},void_submitForm(AuthBlocauthBloc,Stringuser,S

dart - flutter - 异步函数总是返回 null,而它不是 null

我正在为我的项目使用Blocarchitect。我正在尝试在我的应用程序的Ui中使用我的Bloc文件中的函数,并将表单发送到服务器并使用响应。但是当我打电话时它返回null。虽然响应在我的应用程序的其他部分(即repo等)中不为空,但这里是我的Ui代码:MaterialButton(color:Colors.deepPurple,minWidth:screenAwareSize(500,context),onPressed:(){_submitForm(authBloc,user,pass);},void_submitForm(AuthBlocauthBloc,Stringuser,S

javascript - getter 'data' 在 null 上被调用

我想从Firestore的文档中读取数据,但它给出了一个错误。代码如下:@overrideWidgetbuild(BuildContextcontext){finalbloc=BlocProvider.of(context);DocumentSnapshotdoc;returnScaffold(appBar:AppBar(title:Text("Youraccount"),backgroundColor:Colors.blueGrey[900]),body:Container(color:Colors.blueGrey[800],child:Form(key:_formKey,chil

javascript - getter 'data' 在 null 上被调用

我想从Firestore的文档中读取数据,但它给出了一个错误。代码如下:@overrideWidgetbuild(BuildContextcontext){finalbloc=BlocProvider.of(context);DocumentSnapshotdoc;returnScaffold(appBar:AppBar(title:Text("Youraccount"),backgroundColor:Colors.blueGrey[900]),body:Container(color:Colors.blueGrey[800],child:Form(key:_formKey,chil

ios - Flutter ios shared preference show setstring on null 错误

我有我的flutter应用程序,登录时我调用共享首选项来存储一些值,例如token、用户ID等。所有这一切都在ios和android上运行良好。现在突然在ios上,它给了我NoSuchMethodError:Themethod'setString'wascalledonnull这是代码片段。try{//finaljsonResponse=json.decode(responseJson);Loginlogin1=newLogin.fromJson(responseJson);token=login1.token;print(login1.fleetID);awaitAuthUtils.

ios - Flutter ios shared preference show setstring on null 错误

我有我的flutter应用程序,登录时我调用共享首选项来存储一些值,例如token、用户ID等。所有这一切都在ios和android上运行良好。现在突然在ios上,它给了我NoSuchMethodError:Themethod'setString'wascalledonnull这是代码片段。try{//finaljsonResponse=json.decode(responseJson);Loginlogin1=newLogin.fromJson(responseJson);token=login1.token;print(login1.fleetID);awaitAuthUtils.

dart - 断言失败 : 'userRepository != null' : is not true

在使用Flutter的简单实现应用程序中,我正在使用Bloc并且我正在尝试将此构造函数用作:classSimpleBlocDelegateextendsBlocDelegate{@overridevoidonEvent(Blocbloc,Objectevent){super.onEvent(bloc,event);print(event);}@overridevoidonTransition(Blocbloc,Transitiontransition){super.onTransition(bloc,transition);print(transition);}@overridevoi

dart - 断言失败 : 'userRepository != null' : is not true

在使用Flutter的简单实现应用程序中,我正在使用Bloc并且我正在尝试将此构造函数用作:classSimpleBlocDelegateextendsBlocDelegate{@overridevoidonEvent(Blocbloc,Objectevent){super.onEvent(bloc,event);print(event);}@overridevoidonTransition(Blocbloc,Transitiontransition){super.onTransition(bloc,transition);print(transition);}@overridevoi

firebase - 从 firebase 检索时,字符串在离开 child 后返回 null

我正在使用以下代码从firebase实时数据库获取数据到我的flutter应用程序中。classhomeScreenextendsStatelessWidget{finalDBRef=FirebaseDatabase.instance.reference();finalStringdataToFetch;Stringname;...getData(name,dataToFetch);...voidgetData(Stringname,StringdataToFetch){DBRef.child("dataToFetch").once().then((DataSnapshotdataSn

firebase - 从 firebase 检索时,字符串在离开 child 后返回 null

我正在使用以下代码从firebase实时数据库获取数据到我的flutter应用程序中。classhomeScreenextendsStatelessWidget{finalDBRef=FirebaseDatabase.instance.reference();finalStringdataToFetch;Stringname;...getData(name,dataToFetch);...voidgetData(Stringname,StringdataToFetch){DBRef.child("dataToFetch").once().then((DataSnapshotdataSn