Sub6Resources / flutter_html

A Flutter widget for rendering static html as Flutter widgets (Will render over 80 different html tags!)
https://pub.dev/packages/flutter_html
MIT License
1.79k stars 860 forks source link

Fix analysis and code format issues #1148

Closed Sub6Resources closed 1 year ago

Sub6Resources commented 1 year ago

Prerequisite: #1147

This pull request seeks to clean up our codebase by adding a CI check for formatting and analysis issues. This will raise a flag so we don't merge unformatted code or code with analysis issues.

After adding the checks, the analyzer brought up 300 suggestions (but only one warning 🎉 ), so this pull request is going to touch a LOT of files. It fixes currently existing analysis and formatting issues.

Most of the changes are trivial (formatting/code style), so I'll list any non-trivial changes here:

codecov[bot] commented 1 year ago

Codecov Report

Base: 49.62% // Head: 49.70% // Increases project coverage by +0.07% :tada:

Coverage data is based on head (29899c5) compared to base (18c77db). Patch coverage: 60.26% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1148 +/- ## ========================================== + Coverage 49.62% 49.70% +0.07% ========================================== Files 18 18 Lines 2702 2682 -20 ========================================== - Hits 1341 1333 -8 + Misses 1361 1349 -12 ``` | [Impacted Files](https://codecov.io/gh/Sub6Resources/flutter_html/pull/1148?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matthew+Whitaker) | Coverage Δ | | |---|---|---| | [lib/src/interactable\_element.dart](https://codecov.io/gh/Sub6Resources/flutter_html/pull/1148/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matthew+Whitaker#diff-bGliL3NyYy9pbnRlcmFjdGFibGVfZWxlbWVudC5kYXJ0) | `83.33% <ø> (ø)` | | | [lib/src/layout\_element.dart](https://codecov.io/gh/Sub6Resources/flutter_html/pull/1148/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matthew+Whitaker#diff-bGliL3NyYy9sYXlvdXRfZWxlbWVudC5kYXJ0) | `36.58% <ø> (+0.11%)` | :arrow_up: | | [...ackages/flutter\_html\_svg/lib/flutter\_html\_svg.dart](https://codecov.io/gh/Sub6Resources/flutter_html/pull/1148/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matthew+Whitaker#diff-cGFja2FnZXMvZmx1dHRlcl9odG1sX3N2Zy9saWIvZmx1dHRlcl9odG1sX3N2Zy5kYXJ0) | `8.92% <ø> (+0.23%)` | :arrow_up: | | [lib/src/css\_parser.dart](https://codecov.io/gh/Sub6Resources/flutter_html/pull/1148/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matthew+Whitaker#diff-bGliL3NyYy9jc3NfcGFyc2VyLmRhcnQ=) | `13.64% <12.12%> (+0.15%)` | :arrow_up: | | [lib/src/replaced\_element.dart](https://codecov.io/gh/Sub6Resources/flutter_html/pull/1148/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matthew+Whitaker#diff-bGliL3NyYy9yZXBsYWNlZF9lbGVtZW50LmRhcnQ=) | `80.55% <50.00%> (-2.78%)` | :arrow_down: | | [lib/src/styled\_element.dart](https://codecov.io/gh/Sub6Resources/flutter_html/pull/1148/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matthew+Whitaker#diff-bGliL3NyYy9zdHlsZWRfZWxlbWVudC5kYXJ0) | `79.14% <50.00%> (-2.68%)` | :arrow_down: | | [lib/custom\_render.dart](https://codecov.io/gh/Sub6Resources/flutter_html/pull/1148/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matthew+Whitaker#diff-bGliL2N1c3RvbV9yZW5kZXIuZGFydA==) | `51.57% <68.18%> (+0.43%)` | :arrow_up: | | [lib/html\_parser.dart](https://codecov.io/gh/Sub6Resources/flutter_html/pull/1148/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matthew+Whitaker#diff-bGliL2h0bWxfcGFyc2VyLmRhcnQ=) | `73.34% <73.77%> (+0.42%)` | :arrow_up: | | [lib/flutter\_html.dart](https://codecov.io/gh/Sub6Resources/flutter_html/pull/1148/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matthew+Whitaker#diff-bGliL2ZsdXR0ZXJfaHRtbC5kYXJ0) | `69.31% <83.33%> (+0.35%)` | :arrow_up: | | [lib/src/css\_box\_widget.dart](https://codecov.io/gh/Sub6Resources/flutter_html/pull/1148/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matthew+Whitaker#diff-bGliL3NyYy9jc3NfYm94X3dpZGdldC5kYXJ0) | `64.46% <92.30%> (-0.39%)` | :arrow_down: | | ... and [6 more](https://codecov.io/gh/Sub6Resources/flutter_html/pull/1148/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matthew+Whitaker) | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matthew+Whitaker). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Matthew+Whitaker)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.