草庐IT

null_unspecified

全部标签

flutter - 从 InkWell 的 onTap 调用 Future<Null> 函数

我创建了一个带有onTap函数调用的InkWellnewInkWell(onTap:_handleSelectedDate,...)Handle_handleSelectedDate定义为Future,如下所示Future_handleSelectedDate(BuildContextcontext,AppModelmodel)async{varendYear=newDateTime.now().year+10;varstartYear=newDateTime.now().year-100;DateTimepicked=awaitshowDatePicker(context:conte

flutter - 从 InkWell 的 onTap 调用 Future<Null> 函数

我创建了一个带有onTap函数调用的InkWellnewInkWell(onTap:_handleSelectedDate,...)Handle_handleSelectedDate定义为Future,如下所示Future_handleSelectedDate(BuildContextcontext,AppModelmodel)async{varendYear=newDateTime.now().year+10;varstartYear=newDateTime.now().year-100;DateTimepicked=awaitshowDatePicker(context:conte

dart - 为什么从其他文件访问时 Flutter GlobalKey 的 currentState 为 NULL

这是我的代码:import'package:flutter/material.dart';voidmain(){runApp(newMyStatefulApp(key:App.appStateKey));}///Part[A].NodifferencewhenappStateKeyisdefinedasvariable.classApp{staticfinalGlobalKeyappStateKey=newGlobalKey();}///Part[B]classMyStatefulAppextendsStatefulWidget{MyStatefulApp({Keykey}):supe

dart - 为什么从其他文件访问时 Flutter GlobalKey 的 currentState 为 NULL

这是我的代码:import'package:flutter/material.dart';voidmain(){runApp(newMyStatefulApp(key:App.appStateKey));}///Part[A].NodifferencewhenappStateKeyisdefinedasvariable.classApp{staticfinalGlobalKeyappStateKey=newGlobalKey();}///Part[B]classMyStatefulAppextendsStatefulWidget{MyStatefulApp({Keykey}):supe

dart - Flutter - 在 null 上调用了方法 'map'

我在尝试使用对象模型从我的apiJSON添加元素到DropdownMenuItem时收到以下错误这里是错误:Themethod'map'wascalledonnull.Receiver:nullTriedcalling:map>(Closure:(Provinces)=>DropdownMenuItem)这是我的Dart代码:import'dart:async';import'dart:convert';import'package:flutter/material.dart';import'package:sj/utils/constants.dart';import'package

dart - Flutter - 在 null 上调用了方法 'map'

我在尝试使用对象模型从我的apiJSON添加元素到DropdownMenuItem时收到以下错误这里是错误:Themethod'map'wascalledonnull.Receiver:nullTriedcalling:map>(Closure:(Provinces)=>DropdownMenuItem)这是我的Dart代码:import'dart:async';import'dart:convert';import'package:flutter/material.dart';import'package:sj/utils/constants.dart';import'package

android - Flutter - getter 'length' 在 null 上被调用

我正在尝试开发一个flutter应用程序。这种flutter正在为纸牌游戏创建团队。创建团队后,可以通过统计积分,不用考虑每个人有多少积分。但是我遇到了一个异常,我知道异常在哪里以及它意味着什么,但我不知道如何解决这个问题。我希望你们中的一些人能帮助我。这是抛出错误的代码:import'package:flutter/material.dart';classPunktezaehlerextendsStatefulWidget{finalListspieler_namen;Punktezaehler(this.spieler_namen);@overrideStatecreateStat

android - Flutter - getter 'length' 在 null 上被调用

我正在尝试开发一个flutter应用程序。这种flutter正在为纸牌游戏创建团队。创建团队后,可以通过统计积分,不用考虑每个人有多少积分。但是我遇到了一个异常,我知道异常在哪里以及它意味着什么,但我不知道如何解决这个问题。我希望你们中的一些人能帮助我。这是抛出错误的代码:import'package:flutter/material.dart';classPunktezaehlerextendsStatefulWidget{finalListspieler_namen;Punktezaehler(this.spieler_namen);@overrideStatecreateStat

android - Flutter 项目运行时显示错误无效参数 : The source must not be null

我是Flutter的新手。我在尝试运行时创建了一个简单的flutter项目。我收到此错误来自adb的意外失败:无效参数:源不得为null在emulator-5554上启动应用程序时出错这是我简单的flutter应用程序代码:import`package:flutter/material.dart`;voidmain(){runApp(newCenter(child:newText("hello,world",textDirection:TextDirection.ltr,)));}谁能告诉我可能是什么问题?我应该如何修复它? 最佳答案

android - Flutter 项目运行时显示错误无效参数 : The source must not be null

我是Flutter的新手。我在尝试运行时创建了一个简单的flutter项目。我收到此错误来自adb的意外失败:无效参数:源不得为null在emulator-5554上启动应用程序时出错这是我简单的flutter应用程序代码:import`package:flutter/material.dart`;voidmain(){runApp(newCenter(child:newText("hello,world",textDirection:TextDirection.ltr,)));}谁能告诉我可能是什么问题?我应该如何修复它? 最佳答案