From 1fe05983e6e4f8886022eeee18a15c4a1456379f Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Thu, 26 Dec 2019 09:45:25 -0800 Subject: [PATCH] Fix typos in DefaultTabController.of documentation (#46907) Fix error in `DefaultTabController.of` documentation Co-authored-by: Shi-Hao Hong --- packages/flutter/lib/src/material/tab_controller.dart | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/flutter/lib/src/material/tab_controller.dart b/packages/flutter/lib/src/material/tab_controller.dart index da9549c0be..c1f6823015 100644 --- a/packages/flutter/lib/src/material/tab_controller.dart +++ b/packages/flutter/lib/src/material/tab_controller.dart @@ -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;