I am using Android Studio for my Flutter program, and I want to include a dart file like what the Flutter Gallery app does, such that I use it as an asset instead of it being part of my program. How can I do that? A workaround is to use a file extension like 'txt' instead of 'dart', but that is not great.
I tried marking the file as plain text by right-clicking on the file, that does not help. I can bear the error warnings, but Android Studio does not allow me to reload the program if that file cannot be compiled (shown below).
There is an option for analysis_options.yaml
analyzer:
exclude:
- "path/to/the/file/to/exclude.dart"
- "or/pattern/**/*.dart
but it's not fully working yet.
See
https://github.com/dart-lang/sdk/issues/34053
https://github.com/dart-lang/sdk/issues/25551
for more details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With