Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter Hive.box(';box#u name';).listenable()get,`The method';设置';在null“”时调用,在颤振时出错_Flutter_Dart_Flutter Layout_Flutter Hive - Fatal编程技术网

Flutter Hive.box(';box#u name';).listenable()get,`The method';设置';在null“”时调用,在颤振时出错

Flutter Hive.box(';box#u name';).listenable()get,`The method';设置';在null“”时调用,在颤振时出错,flutter,dart,flutter-layout,flutter-hive,Flutter,Dart,Flutter Layout,Flutter Hive,当我尝试使用没有键的Hive.box('box_name').listenable()时,发生错误: ════════ Exception caught by widgets library ═══════════════════════════════════ The following NoSuchMethodError was thrown building FutureBuilder<dynamic>(dirty, state: _FutureBuilderState<

当我尝试使用没有键的Hive.box('box_name').listenable()时,发生错误:

════════ Exception caught by widgets library ═══════════════════════════════════
The following NoSuchMethodError was thrown building FutureBuilder<dynamic>(dirty, state: _FutureBuilderState<dynamic>#566bb):
The method 'toSet' was called on null.
Receiver: null
Tried calling: toSet()

The relevant error-causing widget was
    FutureBuilder<dynamic> 
package:hive_benchmark/sketcpad/sketchpad.dart:109
When the exception was thrown, this was the stack
#0      Object.noSuchMethod  (dart:core-patch/object_patch.dart:53:5)
#1      BoxX.listenable 
package:hive_flutter/src/box_extensions.dart:11
#2      _DrawingScreenState.build.<anonymous closure> 
package:hive_benchmark/sketcpad/sketchpad.dart:120
#3      _FutureBuilderState.build 
package:flutter/…/widgets/async.dart:732
#4      StatefulElement.build 
package:flutter/…/widgets/framework.dart:4619
...
════════════════════════════════════════════════════════════════════════════════
════════ widgets库捕获到异常═══════════════════════════════════
生成FutureBuilder时引发了以下NoSuchMethodError(脏,状态:_FutureBuilderState#566bb):
对null调用了方法“toSet”。
收件人:空
已尝试呼叫:toSet()
导致错误的相关小部件已被删除
未来建设者
包装:hive_benchmark/sketcpad/sketchpad。省道:109
当抛出异常时,这是堆栈
#0 Object.noSuchMethod(省道:核心补片/对象补片。省道:53:5)
#1.x.listenable
包装:蜂箱颤振/src/box\u扩展。省道:11
#2_DrawingScreenState.build。
包装:hive_benchmark/sketcpad/sketchpad。省道:120
#3_FutureBuilderState.build
包:flatter/../widgets/async.dart:732
#4 StatefulElement.build
包:flatter/../widgets/framework.dart:4619
...
════════════════════════════════════════════════════════════════════════════════

这个问题已经解决,因为
蜂巢颤振:^0.3.0+2
只需升级依赖项