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
feat!: v3.0.0 #45
feat!: v3.0.0 #45
Conversation
Co-authored-by: Marcos Sevilla <31174242+marcossevilla@users.noreply.github.com>
- [sized_box_shrink_expand](https://dart-lang.github.io/linter/lints/sized_box_shrink_expand.html) | ||
- [unnecessary_constructor_name](https://dart-lang.github.io/linter/lints/unnecessary_constructor_name.html) | ||
- [unnecessary_late](https://dart-lang.github.io/linter/lints/unnecessary_late.html) | ||
- [use_colored_box](https://dart-lang.github.io/linter/lints/use_colored_box.html) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- [conditional_uri_does_not_exist](https://dart-lang.github.io/linter/lints/conditional_uri_does_not_exist.html) | ||
- [secure_pubspec_urls](https://dart-lang.github.io/linter/lints/secure_pubspec_urls.html) | ||
- [sized_box_shrink_expand](https://dart-lang.github.io/linter/lints/sized_box_shrink_expand.html) | ||
- [unnecessary_constructor_name](https://dart-lang.github.io/linter/lints/unnecessary_constructor_name.html) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this apply to dartdoc references?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean? 👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the new lint rule use_colored_box there is one small problem. What should we do if the color is optional? Currently we're using a Container with the color for such case. But now this is not allowed. We would need to return different widgets here if the color is null. Or is there a better way here? |
I would setup a default color to that widget 👍 if that doesn't help, you can share a sample of how you have that widget set up so we can suggest a better approach |
It's currently a simple carousel with an optional background color. The carousel usually has no background so that the color of the widget on which it is displayed is used. However, there are cases where it should have its own background. Small snippet (backgroundColor is optional): Widget build(BuildContext context) {
return Container(
color: backgroundColor,
child: CarouselSlider(
options: CarouselOptions(
onPageChanged: (index, reason) => onItemChanged?.call(index),
viewportFraction: viewportFraction,
aspectRatio: aspectRatio,
height: height,
pageSnapping: false,
scrollPhysics: TMXPageScrollPhysics.bookPageScrolling(viewportFraction: viewportFraction),
),
items: items.map((T item) => itemBuilder(item)).toList(),
),
);
} |
if you go to the container's color rabbit hole, you'll see the default value is Widget build(BuildContext context) {
return DecoratedBox(
color: backgroundColor ?? Colors.transparent,
child: CarouselSlider(
options: CarouselOptions(
onPageChanged: (index, reason) => onItemChanged?.call(index),
viewportFraction: viewportFraction,
aspectRatio: aspectRatio,
height: height,
pageSnapping: false,
scrollPhysics: TMXPageScrollPhysics.bookPageScrolling(viewportFraction: viewportFraction),
),
items: items.map((T item) => itemBuilder(item)).toList(),
),
);
} |
Description
^2.17.0
Type of Change