当我在项目中使用依赖注入时,我的小部件测试失败。 我的错误如下: Testing started at 10:07 AM ...
C:\src\flutter\bin\flutter.bat --no-color test --machine --plain-name "Exist FloatingActionButton" test\features\announcement\presentation\widgets_test\announcement_widget_test.dart
══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══
我想要创建一个应用程序,它的UI可以根据设备方向进行更新。在Portait布局中,我使用一个抽屉显示一些元素()。在景观布局中,没有抽屉,但元素显示在屏幕左侧()的一列中。当抽屉关闭时,程序就能工作了。
但是,当我在打开时将从portait切换到横向时,我得到了"setState()或在小部件树被锁定时调用的markNeedsBuild()“的错误,堆栈提供了以下信息:
Built build\app\outputs\apk\debug\app-debug.apk.
I/FlutterActivityDelegate(28527): onResume setting current a
我第一次使用颤振模块包,并且可能做错了什么,但是每当我使用使用颤振模块的Null check operator used on a null value扩展方法的小部件运行小部件测试时,我都会得到一个context.watch错误。
该错误通常如下所示:
The following _CastError was thrown building DailyBalanceGraph(dirty, state:
_DailyBalanceGraphState#87329):
Null check operator used on a null value
The relevant error-ca
这是我的main.dart
class MyApp extends StatelessWidget {
var login = new Login("xxxxxxx", "xxxxxxxxx");
final scaffoldKey = new GlobalKey<ScaffoldState>();
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Fetch Data Example',
theme: Theme
我正在尝试在我的颤音应用程序中将侧抽屉实现为一个小部件。
home.dart
import '../widgets/navigation_drawer_widget.dart'; //imported the nav drawer class from widgets directory
class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return DefaultTabController(length: 2,
chi
我知道有很多类似于NoSuchMethodError: The method '#**something**#' was called on null.标题的问题,通常在尝试访问空对象的方法时会出现这个问题。但是,在我的示例中,当我试图将以下代码添加到我的StatefulWidget时,会显示此异常
_handleMyBusinessesTap() {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => PageBusinessList(
在我的例子中,当我使用ExpansionPanelList时,我需要检查面板内的小部件是否可见。 如果不可见,tester.tap(find.text('More Info'))将抛出异常: Warning: A call to tap() with finder "exactly one widget with text "More Info" (ignoring offstage widgets): Text("More Info", dependencies: [MediaQuery, DefaultTextStyle])"
我正在为自己开发一个简单的颤振插件。现在我被困在活动上了。它总是说我用来存储活动的变量是null。即使将变量myActivity设置在onAttachedToActivity中,似乎也不起作用。
I/flutter ( 6555): PlatformException(error, lateinit property mActivity has not been initialized, null)
I/flutter ( 6555):
I/flutter ( 6555): When the exception was thrown, this was the stack:
I/flutte
对于在flutter中创建的BMI应用程序,我正在编写一个测试,所以当我运行测试时,我得到以下错误:
═╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═
The following assertion was thrown building home_screen(dirty, state: _home_screenState#60944):
Ensure to initialize ScreenUtil before accessing it.
Please execute the init method : ScreenUtil.init()
'p
我是Bloc编程模式的新手,在使用我的bloc类中的Dropdown时遇到了一个问题:
final _dropDown = BehaviorSubject<String>();
Stream<String> get dropDownStream => _dropDown.stream;
Sink<String> get dropDownSink => _dropDown.sink;
final _dropdownValues = BehaviorSubject<List<String>>(seedValue: [
我的颤振应用程序在启动屏幕上冻结了,我得到了以下错误日志:
Built build\app\outputs\apk\debug\app-debug.apk.
I/Choreographer(18870): Skipped 75 frames! The application may be doing too much work on its main thread.
D/EGL_emulation(18870): eglMakeCurrent: 0xe8885480: ver 3 0 (tinfo 0xe88835a0)
I/OpenGLRenderer(18870): Davey! dur
当升级到颤振3.0.0时,在运行应用程序时会出现一个问题,
(应用程序可以工作,但终端中有错误/s(警告/s))。
这似乎是一个有约束力的问题。
错误(警告)是:警告:空感知操作的操作数'!‘有'WidgetsBinding‘类型,它排除null。
: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
../…/src/keyboard_visibility.dart:21
- 'WidgetsBindin
最近我一直在更新个人资料。下面是一个场景,HomePage => => Profile => HomePage。当我回来的时候,这就是我得到的错误。
⡿flutter: ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
flutter: The following assertion was thrown building BlocListener<HomeBloc, HomeState>(dirty, state
我在行中添加了InkWell作为Widget,但是它给我带来了一个错误:
flutter: ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
flutter: The following assertion was thrown building InkWell(gestures: [tap], clipped to BoxShape.rectangle,
flutter: dirty, state: _InkResponseState<