Skip to content

Conversation

@HansMuller
Copy link
Contributor

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

@HansMuller
Copy link
Contributor Author

@Hixie

this.unselectedLabelStyle,
}) : assert(tabs != null && tabs.length > 1),
assert(isScrollable != null),
assert(indicatorWeight > 0.0),
Copy link
Contributor

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,
Copy link
Contributor

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;
Copy link
Contributor

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?

@Hixie
Copy link
Contributor

Hixie commented Jun 9, 2017

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.

@HansMuller HansMuller merged commit 09eba82 into flutter:master Jun 9, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ability to customize the height and width of the selected tab indicator in a TabBar

3 participants