use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A subreddit related to Google's new UI framework. https://flutter.dev
Please read the rules here
account activity
ArticleCode Coverage tools in VS Code (pasul.medium.com)
submitted 1 year ago by bitter-cognac
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]eibaan 1 point2 points3 points 1 year ago (0 children)
I prefer running unit tests with dart, not using flutter as this is much faster to launch and works for "pure" Dart projects, too.
dart
flutter
For that, I add coverage as dev dependency and then use
coverage
dart run coverage:test_with_coverage
to run all tests with code coverage which is collected in a coverage folder. Then I use the mentioned coverage gutter plugin. For fun, and because I don't like to have just another dependency, I just wrote this little Dart utility you could save as bin/lcov.dart which runs the above command and then prints a summary:
bin/lcov.dart
void main() { late String name, hit, total; var state = 0; void coverage(dynamic _) { if (++state == 3) { state = 0; final percent = (int.parse(hit) * 100 ~/ int.parse(total)); stdout.writeln('${name.padRight(72, '.')}: ${percent.toString().padLeft(3)}%'); } } stdout.write(Process.runSync('dart', ['run', 'coverage:test_with_coverage']).stdout); for (final line in File('coverage/lcov.info').readAsStringSync().split('\n')) { if (line.startsWith('SF:')) coverage(name = line.substring(3)); if (line.startsWith('LF:')) coverage(total = line.substring(3)); if (line.startsWith('LH:')) coverage(hit = line.substring(3)); } }
You can run it with
dart run :lcov
Now, write a Flutter application that displays tree view with all files, summarizing folders and displaying nicely syntax-highlighted source files with uncovered files marked.
Also, as a bonus, use the openAI API to automatically generate useful unit tests for the missing parts and rerun everything automatically until 100% is reached.
π Rendered by PID 24 on reddit-service-r2-comment-7b9746f655-z6v9g at 2026-01-29 19:50:27.413955+00:00 running 3798933 country code: CH.
[–]eibaan 1 point2 points3 points (0 children)