Refactor tabbar code sample (#76387)
This commit is contained in:
parent
722a085f10
commit
f86c859bea
@ -574,42 +574,42 @@ class _TabBarScrollController extends ScrollController {
|
||||
///
|
||||
/// ```dart
|
||||
/// Widget build(BuildContext context) {
|
||||
/// return DefaultTabController(
|
||||
/// initialIndex: 1,
|
||||
/// length: 3,
|
||||
/// child: Scaffold(
|
||||
/// appBar: AppBar(
|
||||
/// title: const Text('TabBar Widget'),
|
||||
/// bottom: const TabBar(
|
||||
/// tabs: <Widget>[
|
||||
/// Tab(
|
||||
/// icon: Icon(Icons.cloud_outlined),
|
||||
/// ),
|
||||
/// Tab(
|
||||
/// icon: Icon(Icons.beach_access_sharp),
|
||||
/// ),
|
||||
/// Tab(
|
||||
/// icon: Icon(Icons.brightness_5_sharp),
|
||||
/// ),
|
||||
/// ],
|
||||
/// ),
|
||||
/// ),
|
||||
/// body: const TabBarView(
|
||||
/// children: <Widget>[
|
||||
/// Center(
|
||||
/// child: Text('It\'s cloudy here'),
|
||||
/// ),
|
||||
/// Center(
|
||||
/// child: Text('It\'s rainy here'),
|
||||
/// ),
|
||||
/// Center(
|
||||
/// child: Text('It\'s sunny here'),
|
||||
/// ),
|
||||
/// ],
|
||||
/// ),
|
||||
/// ),
|
||||
/// );
|
||||
/// }
|
||||
/// return DefaultTabController(
|
||||
/// initialIndex: 1,
|
||||
/// length: 3,
|
||||
/// child: Scaffold(
|
||||
/// appBar: AppBar(
|
||||
/// title: const Text('TabBar Widget'),
|
||||
/// bottom: const TabBar(
|
||||
/// tabs: <Widget>[
|
||||
/// Tab(
|
||||
/// icon: Icon(Icons.cloud_outlined),
|
||||
/// ),
|
||||
/// Tab(
|
||||
/// icon: Icon(Icons.beach_access_sharp),
|
||||
/// ),
|
||||
/// Tab(
|
||||
/// icon: Icon(Icons.brightness_5_sharp),
|
||||
/// ),
|
||||
/// ],
|
||||
/// ),
|
||||
/// ),
|
||||
/// body: const TabBarView(
|
||||
/// children: <Widget>[
|
||||
/// Center(
|
||||
/// child: Text('It\'s cloudy here'),
|
||||
/// ),
|
||||
/// Center(
|
||||
/// child: Text('It\'s rainy here'),
|
||||
/// ),
|
||||
/// Center(
|
||||
/// child: Text('It\'s sunny here'),
|
||||
/// ),
|
||||
/// ],
|
||||
/// ),
|
||||
/// ),
|
||||
/// );
|
||||
/// }
|
||||
/// ```
|
||||
/// {@end-tool}
|
||||
///
|
||||
|
Loading…
x
Reference in New Issue
Block a user