gpt4 book ai didi

android - Dart :UI not found while trying to run . 飞镖文件

转载 作者:行者123 更新时间:2023-12-04 13:56:13 26 4
gpt4 key购买 nike

我试图在 Flutter 项目中运行我的 .dart 文件,以查看 SQlite 数据库在 Flutter 应用程序中的工作方式。所以我正在执行我的 .dart 文件,然后出现了这个错误

C:\Users\ChangNoi\Desktop\GitHub\project_fight_2\lib\backend>dart database.dart
database.dart: Warning: Interpreting this as package URI,'package:projectfight2/backend/database.dart'.

/C:/Program%20Files/Flutter/packages/flutter/lib/src/services/binary_messenger.dart:7:8: Error: Notfound: 'dart:ui'
import 'dart:ui' as ui;
^
/C:/Program%20Files/Flutter/packages/flutter/lib/src/services/binding.dart:7:8: Error: Not found: 'dart:ui'
import 'dart:ui' as ui;
^
/C:/Program%20Files/Flutter/packages/flutter/lib/src/services/font_loader.dart:7:8: Error: Not found: 'dart:ui'
import 'dart:ui';
^
/C:/Program%20Files/Flutter/packages/flutter/lib/src/services/platform_messages.dart:7:8: Error: Not found: 'dart:ui'
import 'dart:ui' as ui;
^
/C:/Program%20Files/Flutter/packages/flutter/lib/src/services/platform_views.dart:7:8: Error: Not found: 'dart:ui'
import 'dart:ui';
^
/C:/Program%20Files/Flutter/packages/flutter/lib/src/services/raw_keyboard.dart:7:8: Error: Not found: 'dart:ui'
import 'dart:ui';
^
/C:/Program%20Files/Flutter/packages/flutter/lib/src/services/system_channels.dart:5:8: Error: Not found: 'dart:ui'
import 'dart:ui';
^
/C:/Program%20Files/Flutter/packages/flutter/lib/src/services/system_chrome.dart:6:8: Error: Not found: 'dart:ui'
import 'dart:ui';
^
/C:/Program%20Files/Flutter/packages/flutter/lib/src/services/system_chrome.dart:12:1: Error: Not found: 'dart:ui'
export 'dart:ui' show Brightness;

我不确定为什么在多次重新启动 IDE 并调用 flutter pub get 后仍会出现此错误

这是我的 flutter 医生的完整结果
[√] Flutter (Channel master, 1.19.0-2.0.pre.143, on Microsoft Windows [Version 10.0.18362.836], locale en-US)
• Flutter version 1.19.0-2.0.pre.143 at C:\Program Files\Flutter
• Framework revision 9d58a87066 (5 hours ago), 2020-05-22 22:37:01 -0700
• Engine revision 9ce1e5c5c7
• Dart version 2.9.0 (build 2.9.0-10.0.dev 7706afbcf5)


[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at C:\Users\ChangNoi\AppData\Local\Android\sdk
• Platform android-29, build-tools 29.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
• All Android licenses accepted.

[√] Android Studio (version 3.6)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 45.1.1
• Dart plugin version 192.8052
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)

[√] VS Code, 64-bit edition (version 1.45.1)
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension version 3.10.2

[√] Connected device (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 7.1.1 (API 25) (emulator)

最佳答案

运行app的时候会发现2个main.dart中选择Flutter的那个旁边的图标。

enter image description here

引用 here

关于android - Dart :UI not found while trying to run . 飞镖文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61970696/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com