Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error running script that uses flutter library #35608

Closed
icatalud opened this issue Jul 5, 2019 · 4 comments
Closed

Error running script that uses flutter library #35608

icatalud opened this issue Jul 5, 2019 · 4 comments
Labels
a: tests "flutter test", flutter_test, or one of our tests

Comments

@icatalud
Copy link

icatalud commented Jul 5, 2019

When attempting to run a scripts that uses Element and Widgets, but no rendering, the only way I can run it, is using 'flutter test' command, but this does not satisfy my needs, since assertions cannot be disabled.

When I run it with dart command it throws error about not finding dart:ui on many packages, like:

.../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;

.../flutter/packages/flutter/lib/src/material/animated_icons.dart:10:8: Error: Not found: 'dart:ui'
import 'dart:ui' show lerpDouble;

Is this a bug?

@BondarenkoStas BondarenkoStas added the a: tests "flutter test", flutter_test, or one of our tests label Sep 30, 2019
@BondarenkoStas
Copy link

May be related to #27826 and #32680

@jonahwilliams
Copy link
Member

You cannot run code that depends on dart:ui even transitively, such as Flutter, on the standalone dart VM.

@icatalud
Copy link
Author

@jonahwilliams , @BondarenkoStas

You cannot run code that depends on dart:ui even transitively, such as Flutter, on the standalone dart VM.

I didn't know if it was possible or not, but I raised the issue because I wondered, shouldn't it be possible somehow? It's particularly useful for running Flutter dependent scripts.

I required this long time ago for running Flutter benchmarks that don't create a UI.

Flutter test is the only way I found to be able to run such scripts. The problem is that tests have assertions on (there is no way to disable them), they are therefore not good for benchmarking. Is there currently a way to run code that depends on dart:ui without using Flutter or Flutter test?

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: tests "flutter test", flutter_test, or one of our tests
Projects
None yet
Development

No branches or pull requests

3 participants