Open alverone opened 3 months ago
This pull request aims to fix some of the analysis and other issues without changing the functionality and/or introducing breaking changes.
lints
flutter_lints
[reference to class]
LinkViewHorizontal
LinkViewVertical
showMultiMedia
InkWell
AnyLinkPreview
super.initState()
initState
AnyLinkPreview.builder()
sized_box_for_whitespace prefer_const_constructors comment_references avoid_multiple_declarations_per_line noop_primitive_operations cascade_invocations avoid_redundant_argument_values lines_longer_than_80_chars prefer_int_literals prefer_const_constructors_in_immutables avoid_void_async require_trailing_commas
Description
This pull request aims to fix some of the analysis and other issues without changing the functionality and/or introducing breaking changes.
Change log:
lints
toflutter_lints
, which are more suitable for Flutter packages;[reference to class]
);LinkViewHorizontal
and theLinkViewVertical
widgets:showMultiMedia
to be non-null since the potential casting of a nullable type could lead to runtime issues;InkWell
widgets, which led to visible rectangular corners on tap;LinkViewVertical
widget, fixed the border-radius parameter to use the widget parameter instead of a constant value of 12;AnyLinkPreview
widget:super.initState()
in the overriddeninitState
method to the top [as required by framework](https://api.flutter.dev/flutter/widgets/State/initState.html#:~:text=Implementations%20of%20this%20method%20should%20start%20with%20a%20call%20to%20the%20inherited%20method%2C%20as%20in%20super.initState().);initState
;AnyLinkPreview.builder()
constructor into a separate widget for simplification;Details
Enabled/added rules:
Screenshots of the example app (before & after):
Screenshots:
#### After: