草庐IT

p_p_dynamic

全部标签

flutter - 类型 'String' 不是类型 'ImageProvider<dynamic>' 的子类型

我有类别列表,点击每个类别会在新屏幕中显示该类别的用户。新屏幕有一个image小部件和text小部件。如果用户有个人资料图片,我会收到此错误,如果没有与该用户关联的个人资料图片,则会显示不会引发此错误的默认图片。Widget_getProfilePic(Propro){//Iftheprohasprovidedaprofilepictureif(pro.profilePhoto.length>0){//Iftheproisavailableforavideocallif(statusMap[pro.onlineStatus]=="Online,available"){returnCir

flutter - 类型 'String' 不是类型 'ImageProvider<dynamic>' 的子类型

我有类别列表,点击每个类别会在新屏幕中显示该类别的用户。新屏幕有一个image小部件和text小部件。如果用户有个人资料图片,我会收到此错误,如果没有与该用户关联的个人资料图片,则会显示不会引发此错误的默认图片。Widget_getProfilePic(Propro){//Iftheprohasprovidedaprofilepictureif(pro.profilePhoto.length>0){//Iftheproisavailableforavideocallif(statusMap[pro.onlineStatus]=="Online,available"){returnCir

dart - 返回类型 'Map<String,Dynamic>' 不是匿名闭包定义的字符串

我正在尝试使用List.generate(length,generator)创建一个列表功能,但它给出了一个错误ThereturntypeMapisn'tastring,asdefinedbyanonymousclosure.这是代码。List_generateList(){returnList.generate(20,(i)=>{"Hello$i"});}错误: 最佳答案 List_generateList(){returnList.generate(20,(i)=>"Hello$i");}Removedthecurlybrack

dart - 返回类型 'Map<String,Dynamic>' 不是匿名闭包定义的字符串

我正在尝试使用List.generate(length,generator)创建一个列表功能,但它给出了一个错误ThereturntypeMapisn'tastring,asdefinedbyanonymousclosure.这是代码。List_generateList(){returnList.generate(20,(i)=>{"Hello$i"});}错误: 最佳答案 List_generateList(){returnList.generate(20,(i)=>"Hello$i");}Removedthecurlybrack

flutter - 类型 List<dynamic> 不是类型 'Map<String, dynamic>' 的子类型

我正在尝试从API获取数据。我收到错误消息“类型列表不是map的子类型。我是新手,不明白我在哪里犯了错误。这是我的fetchpost函数:FuturefetchPost()async{finalresponse=awaithttp.get('http://starlord.hackerearth.com/beercraft');if(response.statusCode==200){returnPost.fromJson(json.decode(response.body));}else{throwException('Failedtoloadpost');}}在我的主屏幕中,我使用

flutter - 类型 List<dynamic> 不是类型 'Map<String, dynamic>' 的子类型

我正在尝试从API获取数据。我收到错误消息“类型列表不是map的子类型。我是新手,不明白我在哪里犯了错误。这是我的fetchpost函数:FuturefetchPost()async{finalresponse=awaithttp.get('http://starlord.hackerearth.com/beercraft');if(response.statusCode==200){returnPost.fromJson(json.decode(response.body));}else{throwException('Failedtoloadpost');}}在我的主屏幕中,我使用

android - Flutter Firebase Error Null fundtion(FirebaseUser)无法分配给参数,仪表类型 FutureOr <dynamic>

在我的Firebase身份验证中,我遇到了错误:error:Theargumenttype'NullFunction(FirebaseUser)'can'tbeassignedtotheparametertype'FutureOrFunction(AuthResult)'.(argument_type_not_assignableat[authentication]lib\loginpage.dart:44)如果导入firebase_auth和flutterMaterialonPressed:(){FirebaseAuth.instance.signInWithEmailAndPass

android - Flutter Firebase Error Null fundtion(FirebaseUser)无法分配给参数,仪表类型 FutureOr <dynamic>

在我的Firebase身份验证中,我遇到了错误:error:Theargumenttype'NullFunction(FirebaseUser)'can'tbeassignedtotheparametertype'FutureOrFunction(AuthResult)'.(argument_type_not_assignableat[authentication]lib\loginpage.dart:44)如果导入firebase_auth和flutterMaterialonPressed:(){FirebaseAuth.instance.signInWithEmailAndPass

dart - 类型 '(PlatformException) => void' 不是类型 '(Object) => FutureOr<dynamic> Flutter 的子类型

我在Flutter中使用事件channel将信标数据从NativeSDK返回到Flutter。在最近的Flutter升级之前,它工作正常。现在,我收到以下错误。type'(PlatformException)=>void'isnotasubtypeoftype'(Object)=>FutureOr具有以下堆栈跟踪:#0_registerErrorHandler(dart:async/async_error.dart:22:60)#1_BufferingStreamSubscription.onError(dart:async/stream_impl.dart:146:16)#2new_

dart - 类型 '(PlatformException) => void' 不是类型 '(Object) => FutureOr<dynamic> Flutter 的子类型

我在Flutter中使用事件channel将信标数据从NativeSDK返回到Flutter。在最近的Flutter升级之前,它工作正常。现在,我收到以下错误。type'(PlatformException)=>void'isnotasubtypeoftype'(Object)=>FutureOr具有以下堆栈跟踪:#0_registerErrorHandler(dart:async/async_error.dart:22:60)#1_BufferingStreamSubscription.onError(dart:async/stream_impl.dart:146:16)#2new_