草庐IT

function-signature

全部标签

asynchronous - flutter : Question about Futures and async function

我有几个关于在dart中使用Futures的问题。假设我正在使用firestore,并且我有这样的功能来更新用户的信息:voidupdateOldUser(UseroldUser,StringnewInfo){DocumentReferenceuserToUpdateRef=userRef.document(oldUser.id);Firestore.instance.runTransaction((Transactiontransaction)async{DocumentSnapshotuserToUpdateSnapshot=awaittransaction.get(userToU

asynchronous - flutter : Question about Futures and async function

我有几个关于在dart中使用Futures的问题。假设我正在使用firestore,并且我有这样的功能来更新用户的信息:voidupdateOldUser(UseroldUser,StringnewInfo){DocumentReferenceuserToUpdateRef=userRef.document(oldUser.id);Firestore.instance.runTransaction((Transactiontransaction)async{DocumentSnapshotuserToUpdateSnapshot=awaittransaction.get(userToU

constructor - Dart Function.appy() 不适用于 Color.fromARGB(a, r, g, b);

尝试使用Function.apply()传递位置参数列表。但是为什么构造函数方法不适用于Color类?varx=Function.apply(Color.fromARGB,[255,66,165,245]);ErrorMessage:Thegetter'fromARGB'isn'tdefinedfortheclass'Color'.这是构造函数。constColor.fromARGB(inta,intr,intg,intb):value=(((a&0xff) 最佳答案 命名构造函数不是Dart中的Function。当前编写示例的方法

constructor - Dart Function.appy() 不适用于 Color.fromARGB(a, r, g, b);

尝试使用Function.apply()传递位置参数列表。但是为什么构造函数方法不适用于Color类?varx=Function.apply(Color.fromARGB,[255,66,165,245]);ErrorMessage:Thegetter'fromARGB'isn'tdefinedfortheclass'Color'.这是构造函数。constColor.fromARGB(inta,intr,intg,intb):value=(((a&0xff) 最佳答案 命名构造函数不是Dart中的Function。当前编写示例的方法

dart - Function/OnTap 中的 AlertDialog setstate

Flutter新手。我知道如何设置警报对话框的状态,但是需要点击才能像()=>_createPlayer这样的功能,它不想重建警报对话框。我想知道当您需要点击它们时如何在警报对话框上设置状态。File_image;GestureDetector(onTap:()=>_createPlayer(),点击后,会显示如下提示对话框:_createPlayer(){returnshowDialog(context:context,builder:(BuildContextcontext){returnAlertDialog(shape:RoundedRectangleBorder(border

dart - Function/OnTap 中的 AlertDialog setstate

Flutter新手。我知道如何设置警报对话框的状态,但是需要点击才能像()=>_createPlayer这样的功能,它不想重建警报对话框。我想知道当您需要点击它们时如何在警报对话框上设置状态。File_image;GestureDetector(onTap:()=>_createPlayer(),点击后,会显示如下提示对话框:_createPlayer(){returnshowDialog(context:context,builder:(BuildContextcontext){returnAlertDialog(shape:RoundedRectangleBorder(border

android - "Execution failed for task ' :app:packageDebug ' > Failed to generate v1 signature" exception while compiling Flutter

我对flutter的编译有问题我已经尝试过调试,但没有成功正在解决依赖关系...4,5s失败:构建失败,出现异常。出了什么问题:任务':app:packageDebug'执行失败。Failedtogeneratev1signature尝试:使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获得更多日志输出。使用--scan运行以获得完整的见解。在https://help.gradle.org获得更多帮助构建在10秒内失败运行Gradle任务“assembleDebug”...运行Gradle任务'assembleDebug'...完成11,3

android - "Execution failed for task ' :app:packageDebug ' > Failed to generate v1 signature" exception while compiling Flutter

我对flutter的编译有问题我已经尝试过调试,但没有成功正在解决依赖关系...4,5s失败:构建失败,出现异常。出了什么问题:任务':app:packageDebug'执行失败。Failedtogeneratev1signature尝试:使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获得更多日志输出。使用--scan运行以获得完整的见解。在https://help.gradle.org获得更多帮助构建在10秒内失败运行Gradle任务“assembleDebug”...运行Gradle任务'assembleDebug'...完成11,3

function - 如何从 Flutter 中的方法获取 AlertDialog 回调?

我在静态方法中有AlertDialog,因为我想在用户单击OK按钮时获得回调。我尝试使用typedef但无法理解。下面是我的代码:classDialogUtils{staticvoiddisplayDialogOKCallBack(BuildContextcontext,Stringtitle,Stringmessage){showDialog(context:context,builder:(BuildContextcontext){returnAlertDialog(title:newText(title,style:normalPrimaryStyle,),content:new

function - 如何从 Flutter 中的方法获取 AlertDialog 回调?

我在静态方法中有AlertDialog,因为我想在用户单击OK按钮时获得回调。我尝试使用typedef但无法理解。下面是我的代码:classDialogUtils{staticvoiddisplayDialogOKCallBack(BuildContextcontext,Stringtitle,Stringmessage){showDialog(context:context,builder:(BuildContextcontext){returnAlertDialog(title:newText(title,style:normalPrimaryStyle,),content:new