-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Add indicatorWeight, indicatorPadding to TabBar #10600
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
Add indicatorWeight, indicatorPadding to TabBar #10600
Conversation
| this.unselectedLabelStyle, | ||
| }) : assert(tabs != null && tabs.length > 1), | ||
| assert(isScrollable != null), | ||
| assert(indicatorWeight > 0.0), |
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.
first assert not null
| TabBar({ | ||
| Key key, | ||
| @required this.tabs, | ||
| this.controller, |
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.
constructor docs should be updated to list what shouldn't be null, etc.
| final List<double> offsets = _indicatorPainter?.tabOffsets; | ||
| _indicatorPainter = new _IndicatorPainter(_controller)..tabOffsets = offsets; | ||
| _indicatorPainter = new _IndicatorPainter(_controller, widget.indicatorWeight, widget.indicatorPadding) | ||
| ..tabOffsets = offsets; |
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.
Why aren't the tab offsets passed in as an argument?
|
LGTM except for the part where you mutate the state of the painter. All the mutable state should be private, and all the configuration should come in through the constructor. |
Enable customizing the selected tab indicator line's weight and how far it's padded on the left and right vis the selected tab's bounds.
Fixes #10475