草庐IT

dart - Flutter调用showTimePicker函数报错: The getter 'modalBarrierDismissLabel' was called on null

@overrideWidgetbuild(BuildContextcontext){returnMaterialApp(home:Scaffold(appBar:AppBar(title:Text("HelloFlutter"),),body:Column(children:[GestureDetector(onTap:(){showTimePicker(context:context,initialTime:constTimeOfDay(hour:7,minute:0),);},child:Text("22:30"))像这样尝试将timePicker添加到我的Flutter应用程序中

android - Flutter:为什么我会收到 "Vertical viewport was given unbounded height"错误?

我是flutter的新手,下面是我的代码import'package:flutter/material.dart';classHomepageextendsStatelessWidget{@overrideWidgetbuild(BuildContextcontext){//TODO:implementbuildreturnScaffold(appBar:AppBar(title:Text("ChocoFactory"),),body:HomepageUI(),);}}classHomepageUIextendsStatefulWidget{@overrideStatecreateSt

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-studio - Flutter create command was unsuccessful 错误

我正在Androidstudio中创建一个新的flutter项目。我为项目命名并选择Flutterapplication。然后我点击完成,然后什么也没有发生。Android工作室说"Fluttercreatecommandwasunsuccessful"当我使用文件资源管理器导航到命令目录时,会使用我提供的项目名称创建一个新文件夹,但它是空的。请帮忙。 最佳答案 简单的AndroidStudio重启对我来说就成功了 关于android-studio-Fluttercreatecomman

ios - Flutter check if app was in memory when launched (How to check if splash screen is shown in iOS)

背景对于Android,事情很简单,当用户使用后退按钮时,应用程序会被销毁,而当他点击主页按钮时,应用程序就会停止,它仍在内存中。但是在iOS中,事情变得有点棘手。当我在iOS应用程序中按下主页按钮时,应用程序可能会被系统终止(如果它没有进行任何后台工作)但它何时可以终止,这是未知的。问题假设我有闪屏,那么如果应用不在内存中,那么iOS系统会显示闪屏,但是如果应用已经在内存中,那么iOS系统会直接带你到应用页面.所以,我想知道我们如何检查应用程序是否在内存中。我的意思是如何检查是否显示启动画面。 最佳答案 当应用程序启动并且它在内存

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

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