Update Tab.height parameter doc for tab height lower than default (#157443)

Fixes [TabBar.height adds a gap between the AppBar.toolbar and AppBar.bottom](https://github.com/flutter/flutter/issues/156200)
This commit is contained in:
Taha Tesser 2024-10-24 12:43:36 +03:00 committed by GitHub
parent 6bef61a454
commit 0167f02e90
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -159,6 +159,31 @@ class Tab extends StatelessWidget implements PreferredSizeWidget {
/// If null, the height will be calculated based on the content of the [Tab]. When `icon` is not
/// null along with `child` or `text`, the default height is 72.0 pixels. Without an `icon`, the
/// height is 46.0 pixels.
///
/// {@tool snippet}
///
/// The provided tab height cannot be lower than the default height. Use
/// [PreferredSize] widget to adjust the overall [TabBar] height and match
/// the provided tab [height]:
///
/// ```dart
/// bottom: const PreferredSize(
/// preferredSize: Size.fromHeight(20.0),
/// child: TabBar(
/// tabs: <Widget>[
/// Tab(
/// text: 'Tab 1',
/// height: 20.0,
/// ),
/// Tab(
/// text: 'Tab 2',
/// height: 20.0,
/// ),
/// ],
/// ),
/// ),
/// ```
/// {@end-tool}
final double? height;
Widget _buildLabelText() {