Address review comments from previous patches (#3600)
This patch addresses late-breaking comments on previous patches.
This commit is contained in:
parent
c2cccc7b3b
commit
5eb4443343
@ -78,10 +78,10 @@ Individual tests can also be run directly, e.g. `flutter test lib/my_app_test.da
|
|||||||
|
|
||||||
Flutter tests use [package:flutter_test](https://github.com/flutter/flutter/tree/master/packages/flutter_test) which provides flutter-specific extensions on top of [package:test](https://pub.dartlang.org/packages/test).
|
Flutter tests use [package:flutter_test](https://github.com/flutter/flutter/tree/master/packages/flutter_test) which provides flutter-specific extensions on top of [package:test](https://pub.dartlang.org/packages/test).
|
||||||
|
|
||||||
`flutter test` runs tests inside the flutter shell. Some packages inside the flutter repository can be run inside the dart command line VM as well as the flutter shell, `packages/flutter_tools` is one such examples:
|
`flutter test` runs tests inside the flutter shell. Some packages inside the flutter repository can be run inside the dart command line VM as well as the flutter shell, `packages/flutter_tools` is one such example:
|
||||||
|
|
||||||
* `cd packages/flutter_tools`
|
* `cd packages/flutter_tools`
|
||||||
* `pub run test`
|
* `dart test/all.dart`
|
||||||
|
|
||||||
`flutter test --flutter-repo` is a shortcut for those working on the flutter repository itself which runs all tests inside the `flutter` package regardless of the current working directory.
|
`flutter test --flutter-repo` is a shortcut for those working on the flutter repository itself which runs all tests inside the `flutter` package regardless of the current working directory.
|
||||||
To run all the tests for the entire Flutter repository, the same way that Travis runs them, run `travis/test.sh`.
|
To run all the tests for the entire Flutter repository, the same way that Travis runs them, run `travis/test.sh`.
|
||||||
|
@ -231,7 +231,7 @@ class Scaffold extends StatefulWidget {
|
|||||||
this.drawer,
|
this.drawer,
|
||||||
this.scrollableKey,
|
this.scrollableKey,
|
||||||
this.appBarBehavior: AppBarBehavior.anchor,
|
this.appBarBehavior: AppBarBehavior.anchor,
|
||||||
this.resizeToAvoidWindowPadding: true
|
this.resizeToAvoidBottomPadding: true
|
||||||
}) : super(key: key) {
|
}) : super(key: key) {
|
||||||
assert(scrollableKey != null ? (appBarBehavior != AppBarBehavior.anchor) : true);
|
assert(scrollableKey != null ? (appBarBehavior != AppBarBehavior.anchor) : true);
|
||||||
}
|
}
|
||||||
@ -243,7 +243,7 @@ class Scaffold extends StatefulWidget {
|
|||||||
///
|
///
|
||||||
/// Displayed below the app bar and behind the [floatingActionButton] and
|
/// Displayed below the app bar and behind the [floatingActionButton] and
|
||||||
/// [drawer]. To avoid the body being resized to avoid the window padding
|
/// [drawer]. To avoid the body being resized to avoid the window padding
|
||||||
/// (e.g., from the onscreen keyboard), see [resizeToAvoidWindowPadding].
|
/// (e.g., from the onscreen keyboard), see [resizeToAvoidBottomPadding].
|
||||||
final Widget body;
|
final Widget body;
|
||||||
|
|
||||||
/// A button displayed on top of the body.
|
/// A button displayed on top of the body.
|
||||||
@ -267,14 +267,15 @@ class Scaffold extends StatefulWidget {
|
|||||||
/// By default, the [appBar] does not respond to scrolling.
|
/// By default, the [appBar] does not respond to scrolling.
|
||||||
final AppBarBehavior appBarBehavior;
|
final AppBarBehavior appBarBehavior;
|
||||||
|
|
||||||
/// Whether the [body] (and other floating widgets) should size themselves to avoid the window's padding.
|
/// Whether the [body] (and other floating widgets) should size themselves to
|
||||||
|
/// avoid the window's bottom padding.
|
||||||
///
|
///
|
||||||
/// For example, if there is an onscreen keyboard displayed above the
|
/// For example, if there is an onscreen keyboard displayed above the
|
||||||
/// scaffold, the body can be resized to avoid overlapping the keyboard, which
|
/// scaffold, the body can be resized to avoid overlapping the keyboard, which
|
||||||
/// prevents widgets inside the body from being obscured by the keyboard.
|
/// prevents widgets inside the body from being obscured by the keyboard.
|
||||||
///
|
///
|
||||||
/// Defaults to true.
|
/// Defaults to true.
|
||||||
final bool resizeToAvoidWindowPadding;
|
final bool resizeToAvoidBottomPadding;
|
||||||
|
|
||||||
/// The state from the closest instance of this class that encloses the given context.
|
/// The state from the closest instance of this class that encloses the given context.
|
||||||
static ScaffoldState of(BuildContext context) => context.ancestorStateOfType(const TypeMatcher<ScaffoldState>());
|
static ScaffoldState of(BuildContext context) => context.ancestorStateOfType(const TypeMatcher<ScaffoldState>());
|
||||||
@ -613,8 +614,8 @@ class ScaffoldState extends State<Scaffold> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
EdgeInsets padding = MediaQuery.of(context).padding;
|
EdgeInsets padding = MediaQuery.of(context).padding;
|
||||||
if (!config.resizeToAvoidWindowPadding)
|
if (!config.resizeToAvoidBottomPadding)
|
||||||
padding = new EdgeInsets.only(top: padding.top);
|
padding = new EdgeInsets.fromLTRB(padding.left, padding.top, padding.right, 0.0);
|
||||||
|
|
||||||
if (_snackBars.length > 0) {
|
if (_snackBars.length > 0) {
|
||||||
final ModalRoute<dynamic> route = ModalRoute.of(context);
|
final ModalRoute<dynamic> route = ModalRoute.of(context);
|
||||||
|
@ -115,10 +115,9 @@ class TextTheme {
|
|||||||
/// The two material design text themes.
|
/// The two material design text themes.
|
||||||
///
|
///
|
||||||
/// [Typography.black] and [Typography.white] define the two text themes used in
|
/// [Typography.black] and [Typography.white] define the two text themes used in
|
||||||
/// material design. The black text theme, which uses darkly colored glyphs, is
|
/// material design. The black text theme, which uses dark glyphs, is used on
|
||||||
/// used on lightly colored backgrounds in light themes. The white text theme,
|
/// light backgrounds in light themes. The white text theme, which uses light
|
||||||
/// which uses lightly colored glyphs, is used on darkly colored backgrounds in
|
/// glyphs, is used in dark themes and on dark backgrounds in in light themes.
|
||||||
/// in light themes and in dark themes.
|
|
||||||
///
|
///
|
||||||
/// To obtain the current text theme, call [Theme.of] with the current
|
/// To obtain the current text theme, call [Theme.of] with the current
|
||||||
/// [BuildContext] and read the [ThemeData.textTheme] property.
|
/// [BuildContext] and read the [ThemeData.textTheme] property.
|
||||||
@ -131,9 +130,9 @@ class TextTheme {
|
|||||||
class Typography {
|
class Typography {
|
||||||
Typography._();
|
Typography._();
|
||||||
|
|
||||||
/// A material design text theme with darkly colored glyphs.
|
/// A material design text theme with dark glyphs.
|
||||||
static const TextTheme black = const TextTheme._black();
|
static const TextTheme black = const TextTheme._black();
|
||||||
|
|
||||||
/// A material design text theme with lightly colored glyphs.
|
/// A material design text theme with light glyphs.
|
||||||
static const TextTheme white = const TextTheme._white();
|
static const TextTheme white = const TextTheme._white();
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ void main() {
|
|||||||
child: new Scaffold(
|
child: new Scaffold(
|
||||||
appBar: new AppBar(title: new Text('Title')),
|
appBar: new AppBar(title: new Text('Title')),
|
||||||
body: new Container(key: bodyKey),
|
body: new Container(key: bodyKey),
|
||||||
resizeToAvoidWindowPadding: false
|
resizeToAvoidBottomPadding: false
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user