我正在尝试为应用程序使用自定义颜色主题。
这是main.dart文件
import 'package:flutter/material.dart';
import 'pages/HomePage.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context)
我从一个API请求中获取值,并将它们存储到要添加到List<String>的String变量中。当打印这个变量时,prints是很好的,但是当我将它们添加到列表中时,我会得到NoSuchMethodError: The method 'add' was called on null.。这是否意味着我没有真正将它们转换为字符串?你能发现我做错了什么吗? 一如既往的感谢您的时间和帮助。 方法如下: Future<List<String>> getCityDb(String isoLocationDb) async {
print(
我在代码中收到以下NoSuchMethodError:
I/flutter ( 6579): The following NoSuchMethodError was thrown building:
I/flutter ( 6579): Class 'List<DocumentSnapshot>' has no instance method 'call'.
I/flutter ( 6579): Receiver: Instance(length:2) of '_GrowableList'
I/flutter ( 6579): Tri
我想要创建一个加载程序数据,在数据加载的最后,屏幕将自动更改屏幕(使用Navigator)。
但我有一些问题。
Unhandled Exception: NoSuchMethodError: The method 'ancestorStateOfType' was called on null.
在方法"getDataOfUser()“的末尾,"print(a)”执行得很好,但是当它试图更改屏幕时,它会崩溃,我有以下错误:
E/flutter (32148): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhand
我有点卡住了,我的flutter应用程序中有一个块,当摄像头找到二维码时,需要调用配置检查(isConfigured())。但我总是遇到错误:flutter/lib/ui/ui_dart_state.cc(157)未处理的异常:未处理的错误NoSuchMethodError:方法'isConfigured‘在null上被调用。接收方:尝试调用的isConfigured()为空,出现在'QrBloc‘的块实例中。
这就是区块
class QrBloc extends Bloc<QrEvent, QrState> {
final ValidateTicket val
我使用底部导航栏,内部我使用标签栏。但是标签栏有交换行为。我想禁用交换行为。所以,我使用了NeverScrollableScrollPhysics,但这显示了一个错误。错误是Multiple widgets used the same GlobalKey。我为每个选项卡栏视图项目提供了不同的键,但同样的问题也出现了。下面是我的代码: Widget build(BuildContext context) {
return new Scaffold(
key: _homeScaffoldKey,
body: new TabBarView(
physics: NeverScroll
我在我的assets文件夹中保存了一个json文件,我只想在我的Listview.Builder中显示json文件,但这里的问题是在应用程序初始化之前,我在控制台而不是移动屏幕上收到以下错误。 The following NoSuchMethodError was thrown building FutureBuilder<String>(dirty, state:
I/flutter (11766): _FutureBuilderState<String>#ef73b):
I/flutter (11766): The getter 'length'
I/flutter ( 4941): The getter 'openAppDrawerTooltip' was called on null. I/flutter ( 4941): Receiver: null I/flutter ( 4941): Tried calling: openAppDrawerTooltip I/flutter ( 4941): Another exception was thrown: NoSuchMethodError: The getter 'openAppDrawerTooltip' was called on null.
我正在努力学习如何在颤振中实现沼泽地数据库,而我却被困在了这个错误上:
I/flutter ( 5303): Moor: Sent SELECT * FROM tasks; with args []
E/flutter ( 5303): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: Unhandled error Null check operator used on a null value occurred in Instance of 'TodoBloc'.
E/flutter ( 53
我正在尝试从云火存储中获取url列表,并使用从fire基础存储中获取的图像。
图像按预期加载,但控制台显示一些错误,如下所示。
I/flutter (24353): The following NoSuchMethodError was thrown during a
scheduler callback:
I/flutter (24353): The getter 'image' was called on null.
I/flutter (24353): Receiver: null
I/flutter (24353): Tried calling: image
I/fl
我正在尝试用下面的代码设置苹果登录。当轻敲按钮时,没有任何反应。 我得到以下错误: Tried calling: authorizationCode
flutter: NoSuchMethodError: The getter 'authorizationCode' was called on null.
Receiver: null 我该怎么解决这个问题? Future<bool> get appleSignInAvailable => AppleSignIn.isAvailable();
Future<User> appleSignIn
我用颤振蜂箱包存储数据。
在检查我的列表中是否有元素时,Flutter抛出以下NoSuchMethodError
E/flutter (22594): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)]
Unhandled Exception: NoSuchMethodError: Class 'List<String>' has no instance method 'contain'.
为什么contain不能工作?
if (!Hive.box("monthDataList").get(
[ERROR:flutter/shell/common/shell.cc(184)] Dart Error: Unhandled exception:
E/flutter (23720): NoSuchMethodError: Class 'MethodChannel' has no instance method 'invokeMethod' with matching arguments.
E/flutter (23720): Receiver: Instance of 'MethodChannel'
E/flutter (23720): T
当从.json执行文件时,我在flutter和dart中编程时出现此错误。有人知道如何修复它吗? ════════ Exception caught by image resource service ════════════════════════════
The following NoSuchMethodError was thrown resolving an image codec:
The getter 'length' was called on null.
Receiver: null
Tried calling: length
When the excep
在Android上以调试模式运行Flutter应用程序。按back按钮关闭应用程序,然后使用任务切换程序切换回应用程序。然后执行热重新加载。
flutter_tools将抛出一个异常:
Exception from flutter run: NoSuchMethodError: Class 'NoSuchMethodError' has no instance method '[]'.
Receiver: Instance of 'NoSuchMethodError'
Tried calling: []("code
我是个新手,我正试图在我的项目中使用flutter_tts,但酒吧的get并不能解决这个问题。我已经在其他应用程序中使用了这个API,但是我不能再在那里使用它了。其他软件包也很好,就像flutter_tts和firebase_auth一样。任何帮助都将不胜感激。
pubspec:
name: aa
description: aa
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1
environment:
sdk: ">=2.1