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:
Jonathan White 2019-12-26 09:45:25 -08:00 committed by Shi-Hao Hong
parent 39c5f1ea29
commit 1fe05983e6

View File

@ -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;