Fix typos in DefaultTabController.of documentation (#46907)
Fix error in `DefaultTabController.of` documentation Co-authored-by: Shi-Hao Hong <shihaohong@google.com>
This commit is contained in:
parent
39c5f1ea29
commit
1fe05983e6
@ -8,6 +8,9 @@ import 'package:flutter/widgets.dart';
|
||||
|
||||
import 'constants.dart';
|
||||
|
||||
// Examples can assume:
|
||||
// BuildContext context;
|
||||
|
||||
/// Coordinates tab selection between a [TabBar] and a [TabBarView].
|
||||
///
|
||||
/// The [index] property is the index of the selected tab and the [animation]
|
||||
@ -336,11 +339,13 @@ class DefaultTabController extends StatefulWidget {
|
||||
|
||||
/// The closest instance of this class that encloses the given context.
|
||||
///
|
||||
/// Typical usage:
|
||||
/// {@tool sample}
|
||||
/// Typical usage is as follows:
|
||||
///
|
||||
/// ```dart
|
||||
/// TabController controller = DefaultTabBarController.of(context);
|
||||
/// TabController controller = DefaultTabController.of(context);
|
||||
/// ```
|
||||
/// {@end-tool}
|
||||
static TabController of(BuildContext context) {
|
||||
final _TabControllerScope scope = context.dependOnInheritedWidgetOfExactType<_TabControllerScope>();
|
||||
return scope?.controller;
|
||||
|
Loading…
x
Reference in New Issue
Block a user