草庐IT

firebase - 未处理的异常 : NoSuchMethodError: The method 'split' was called on null

这是一个简单的联系人应用程序,允许添加查看和编辑个人的联系方式。我无法完全理解这里的错误。classViewContactextendsStatefulWidget{finalStringid;ViewContact(this.id);@override_ViewContactStatecreateState()=>_ViewContactState(this.id);}class_ViewContactStateextendsState{DatabaseReference_databaseReference=FirebaseDatabase.instance.reference();

flutter : NoSuchMethodError: The method 'showSnackBar' was called on null

我在使用_showSnackbar时遇到了一些问题,我看到以下错误:Exceptionhasoccurred.NoSuchMethodError(NoSuchMethodError:Themethod'showSnackBar'wascalledonnull.Receiver:nullTriedcalling:showSnackBar(Instanceof'SnackBar'))但我确定我已经为ShowSnackbar创建了GlobalKey:final_scaffoldKey=GlobalKey();这是我的功能showsnackbarvoid_showSnackBar(BuildC

android - 从应用程序 : Method not found , 收到错误 -32601 Android 中的 Flutter 升级问题

升级flutter后,当我构建我的应用程序时,我开始收到以下错误:Executionfailedfortask':app:processDebugManifest'.[+5ms]>Manifestmergerfailed:Attributemeta-data#android.support.VERSION@valuevalue=(25.4.0)from[com.android.support:appcompat-v7:25.4.0]AndroidManifest.xml:28:13-35[+23ms]isalsopresentat[com.android.support:support

flutter - 抛出另一个异常 : NoSuchMethodError: The method '*' was called on null

我在将项目添加到CardList并尝试使用轮播显示它时遇到问题。该项目已添加到列表中,但当我尝试通过轮播查看它时,显示错误:I/flutter(12255):抛出另一个异常:NoSuchMethodError:Themethod'*'wascalledonnull.我已尝试不留下任何未初始化的内容,正如我在类似案例中读到的有关此问题的内容,但这无济于事。您可以在我的Github个人资料上查看我的代码:https://github.com/varamsky/notes这是模拟器屏幕的图像。enterimagedescriptionhere 最佳答案

flutter - NoSuchMethodError : The method 'map' was called on null 错误

有时animals.relatives是空的,所以t.name返回null,这是导致问题的原因我尝试了ifelse语句和trycatch,但我猜它在小部件内部不起作用?我不确定为什么它不起作用Column(children:[Text(animals.name),Text(animals.desc),Text("Relatives:"),Row(children:animals.relatives.map((t)=>FilterChip(label:Text(t.name),onSelected:(b){})).toList(),),]),如果t.name为null,我不希望其上方的行

dart - Flutter Sqflite 错误说 The method 'query' was called on null

我正在尝试从网络中获取一些数据并将其存储在sqlite数据库中。以下是模型类classStudentModel{intstatus;Stringmsg;StudentModelDatastudentModelData;StudentModel({this.status,this.msg,this.studentModelData});StudentModel.fromJson(Mapjson){status=json['status'];msg=json['msg'];studentModelData=json['data']!=null?newStudentModelData.fro

dart - 如何使用 Dart 的 Difference Method 和 DateTime 使用动态日期?

我正在构建的应用程序使用一种使用DurationDifference和DateTime的“Dayssince”计数器,但我希望计数器在默认情况下他们开始使用该应用程序的那一天开始,并且可以选择放入任何一个他们想要的日期。我的问题是,我如何动态生成计数器的开始日期作为他们开始使用该应用程序的日期,这是否可以通过数据库最简单地实现? 最佳答案 好的,所以从我的角度来看,使用shared_preferences似乎是一个很好的方法。共享首选项允许为用户存储一些键/值对,它是持久的,您可以更新它。这是包裹:https://pub.dartl

flutter - 如何修复 : "The method ' cast' was called on null"during transaction. 更新

我在尝试对我的Firestore集合执行事务更新时收到NoSuchMethodError。Receiver:nullTriedcalling:cast()#0Object.noSuchMethod(dart:core/runtime/libobject_patch.dart:50:5)#1MethodChannel.invokeMapMethod(package:flutter/src/services/platform_channel.dart:331:19)#2Firestore.runTransaction(file:///Users/wready/dev_tools/flutt

flutter - Flushbar 插件 : Error: The method 'attach' isn't defined for the class 'FocusScopeNode'

我之前的项目我使用了flushbar插件没有任何错误。但是我的新项目在尝试使用flushbar时出现错误..项目在没有flushbar的情况下运行良好。完整错误信息Compilermessage:file:///Users/bhanukaisuru/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flushbar-1.7.0/lib/flushbar.dart:207:3:Error:Type'FocusAttachment'notfound.FocusAttachment_focusAttachment;^^^^^^^^^^^

dart - flutter 错误 : Attempt to invoke virtual method 'void com.google.firebase.auth.internal.zzab.zzf(int)' on a null object reference, null

每当我构建我的应用程序时,我的应用程序都会成功构建,但在将其安装到设备时,我会遇到以下错误并且应用程序在设备上崩溃并显示白屏。Launchinglib/main.dartonPixel2XLindebugmode...Initializinggradle...Resolvingdependencies...Running'gradlewassembleDebug'...Configuration'compile'inproject':app'isdeprecated.Use'implementation'instead.registerResGeneratingTaskisdeprec