File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
packages/flutter/lib/src/material Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -159,6 +159,31 @@ class Tab extends StatelessWidget implements PreferredSizeWidget {
159
159
/// If null, the height will be calculated based on the content of the [Tab] . When `icon` is not
160
160
/// null along with `child` or `text` , the default height is 72.0 pixels. Without an `icon` , the
161
161
/// height is 46.0 pixels.
162
+ ///
163
+ /// {@tool snippet}
164
+ ///
165
+ /// The provided tab height cannot be lower than the default height. Use
166
+ /// [PreferredSize] widget to adjust the overall [TabBar] height and match
167
+ /// the provided tab [height] :
168
+ ///
169
+ /// ```dart
170
+ /// bottom: const PreferredSize(
171
+ /// preferredSize: Size.fromHeight(20.0),
172
+ /// child: TabBar(
173
+ /// tabs: <Widget>[
174
+ /// Tab(
175
+ /// text: 'Tab 1',
176
+ /// height: 20.0,
177
+ /// ),
178
+ /// Tab(
179
+ /// text: 'Tab 2',
180
+ /// height: 20.0,
181
+ /// ),
182
+ /// ],
183
+ /// ),
184
+ /// ),
185
+ /// ```
186
+ /// {@end-tool}
162
187
final double ? height;
163
188
164
189
Widget _buildLabelText () {
You can’t perform that action at this time.
0 commit comments