Fix analyzer errors in sample code (#10648)
This commit is contained in:
parent
a9f1cb8c0a
commit
db75aa768c
@ -17,13 +17,14 @@ export 'package:meta/meta.dart' show
|
||||
required;
|
||||
|
||||
// Examples can assume:
|
||||
// String _name;
|
||||
// bool _first;
|
||||
// bool _lights;
|
||||
// bool _visible;
|
||||
// double _volume;
|
||||
// dynamic _selection;
|
||||
// dynamic _last;
|
||||
// dynamic _calculation;
|
||||
// dynamic _last;
|
||||
// dynamic _selection;
|
||||
|
||||
export 'src/foundation/assertions.dart';
|
||||
export 'src/foundation/basic_types.dart';
|
||||
|
@ -14,12 +14,24 @@ import 'constants.dart';
|
||||
/// The selected tab's index can be changed with [animateTo].
|
||||
///
|
||||
/// A stateful widget that builds a [TabBar] or a [TabBarView] can create
|
||||
/// a TabController and share it directly.
|
||||
/// a [TabController] and share it directly.
|
||||
///
|
||||
/// When the [TabBar] and [TabBarView] don't have a convenient stateful
|
||||
/// ancestor, a [TabController] can be shared with the [DefaultTabController]
|
||||
/// inherited widget.
|
||||
///
|
||||
/// ## Sample code
|
||||
///
|
||||
/// This widget introduces a [Scaffold] with an [AppBar] and a [TabBar].
|
||||
///
|
||||
/// ```dart
|
||||
/// class _MyDemoState extends State<MyDemo> with SingleTickerProviderStateMixin {
|
||||
/// class MyTabbedPage extends StatefulWidget {
|
||||
/// const MyTabbedPage({ Key key }) : super(key: key);
|
||||
/// @override
|
||||
/// _MyTabbedPageState createState() => new _MyTabbedPageState();
|
||||
/// }
|
||||
///
|
||||
/// class _MyTabbedPageState extends State<MyTabbedPage> with SingleTickerProviderStateMixin {
|
||||
/// final List<Tab> myTabs = <Tab>[
|
||||
/// new Tab(text: 'LEFT'),
|
||||
/// new Tab(text: 'RIGHT'),
|
||||
@ -58,10 +70,6 @@ import 'constants.dart';
|
||||
/// }
|
||||
/// }
|
||||
/// ```
|
||||
///
|
||||
/// When the [TabBar] and [TabBarView] don't have a convenient stateful
|
||||
/// ancestor, a TabController can be shared with the [DefaultTabController]
|
||||
/// inherited widget.
|
||||
class TabController extends ChangeNotifier {
|
||||
/// Creates an object that manages the state required by [TabBar] and a [TabBarView].
|
||||
///
|
||||
|
@ -143,7 +143,7 @@ class DefaultTextStyle extends InheritedWidget {
|
||||
///
|
||||
/// ```dart
|
||||
/// new Text(
|
||||
/// 'Hello, $name! How are you?',
|
||||
/// 'Hello, $_name! How are you?',
|
||||
/// textAlign: TextAlign.center,
|
||||
/// overflow: TextOverflow.ellipsis,
|
||||
/// style: new TextStyle(fontWeight: FontWeight.bold),
|
||||
|
Loading…
x
Reference in New Issue
Block a user