Dart UI error
See original GitHub issueI pasted the demo code from google, it was ok. And several times later, the following appeared: the code has nothing wrong. I put it in Android Studio and the right info appeared in the phone. I reinstalled vs code, started a new project. But the problem is still there. Anyone can help?
The following is the demo code from google flutter website:
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Welcome to Flutter',
home: new Scaffold(
appBar: new AppBar(
title: new Text('Welcome to Flutter'),
),
body: new Center(
child: new Text("what's wrong?"),
),
),
);
}
}
The following is the wrong info:
PS D:\app\flutter_app\aaa\sss> dart "d:\app\flutter_app\aaa\sss\lib\main.dart"
file:///d:/app/flutter_app/aaa/sss/lib/main.dart:1: Warning: Interpreting this as package URI, 'package:sss/main.dart'.
file:///C:/flutter/packages/flutter/lib/src/material/animated_icons.dart:9:8: Error: Not found: 'dart:ui'
import 'dart:ui' as ui show Paint, Path, Canvas;
^
file:///C:/flutter/packages/flutter/lib/src/material/animated_icons.dart:10:8: Error: Not found: 'dart:ui'
import 'dart:ui' show lerpDouble;
^
file:///C:/flutter/packages/flutter/lib/src/material/app.dart:5:8: Error: Not found: 'dart:ui'
import 'dart:ui' as ui;
^
file:///C:/flutter/packages/flutter/lib/src/material/app_bar_theme.dart:5:8: Error: Not found: 'dart:ui'
import 'dart:ui' show lerpDouble;
^
file:///C:/flutter/packages/flutter/lib/src/material/arc.dart:6:8: Error: Not found: 'dart:ui'
import 'dart:ui' show lerpDouble;
^
file:///C:/flutter/packages/flutter/lib/src/material/bottom_app_bar_theme.dart:5:8: Error: Not found: 'dart:ui'
import 'dart:ui' show lerpDouble;
^
file:///C:/flutter/packages/flutter/lib/src/material/card_theme.dart:5:8: Error: Not found: 'dart:ui'
import 'dart:ui' show lerpDouble;
^
file:///C:/flutter/packages/flutter/lib/src/material/chip_theme.dart:5:8: Error: Not found: 'dart:ui'
import 'dart:ui' show lerpDouble;
^
file:///C:/flutter/packages/flutter/lib/src/material/colors.dart:5:8: Error: Not found: 'dart:ui'
import 'dart:ui' show Color;
^
file:///C:/flutter/packages/flutter/lib/src/material/dialog_theme.dart:5:8: Error: Not found: 'dart:ui'import 'dart:ui' show lerpDouble;
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
dart:ui:1: Error: Not found: dart:ui. flutter/dart: - Stack Overflow
In short, you are running a file as dart file, but you have imported flutter dependencies like widgets/material at the same time. Either...
Read more >Not found: 'dart:ui' when trying to run a Flutter project #3834
If it's neither of these, please run the Dart: Capture Debugging Logs command from the command palette ( F1 ), try to run...
Read more >How to solve Not found: 'dart:ui' error while running integration ...
[Solved]-How to solve Not found: 'dart:ui' error while running integration tests on Flutter-Flutter · select Edit Configurations · Press the + button and...
Read more >How to Handle errors on UI in Flutter - (English) - YouTube
Subscribe : https://goo.gl/X1cN6iTelegram Group: https://t.me/joinchat/Ea589xjrIwAJOQTsOpeNBAGithub: https://github.com/RenatoLucasMota.
Read more >How to solved 'dart:ui' error when going to run flutter app?
Solution. When you run the app, you will see 2 main. dart entry. Please pick the one with Flutter icon.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Errors loading
dart:ui
are usually caused by using a standard Dart SDK and not a Flutter SDK. Can you post yourpubspec.yaml
, and also how many levels deep the Flutter project is from the folder you opened in VS Code? (we only look a certain number of levels down the tree for Flutter projects).Here you go: https://github.com/Dart-Code/Dart-Code/issues/3834