Commit 5eb44433 authored by Adam Barth's avatar Adam Barth

Address review comments from previous patches (#3600)

This patch addresses late-breaking comments on previous patches.
parent c2cccc7b
......@@ -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 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`
* `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.
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.scrollableKey,
this.appBarBehavior: AppBarBehavior.anchor,
this.resizeToAvoidWindowPadding: true
this.resizeToAvoidBottomPadding: true
}) : super(key: key) {
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
/// [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;
/// 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.
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
/// scaffold, the body can be resized to avoid overlapping the keyboard, which
/// prevents widgets inside the body from being obscured by the keyboard.
///
/// Defaults to true.
final bool resizeToAvoidWindowPadding;
final bool resizeToAvoidBottomPadding;
/// The state from the closest instance of this class that encloses the given context.
static ScaffoldState of(BuildContext context) => context.ancestorStateOfType(const TypeMatcher<ScaffoldState>());
......@@ -613,8 +614,8 @@ class ScaffoldState extends State<Scaffold> {
@override
Widget build(BuildContext context) {
EdgeInsets padding = MediaQuery.of(context).padding;
if (!config.resizeToAvoidWindowPadding)
padding = new EdgeInsets.only(top: padding.top);
if (!config.resizeToAvoidBottomPadding)
padding = new EdgeInsets.fromLTRB(padding.left, padding.top, padding.right, 0.0);
if (_snackBars.length > 0) {
final ModalRoute<dynamic> route = ModalRoute.of(context);
......
......@@ -115,10 +115,9 @@ class TextTheme {
/// The two material design text themes.
///
/// [Typography.black] and [Typography.white] define the two text themes used in
/// material design. The black text theme, which uses darkly colored glyphs, is
/// used on lightly colored backgrounds in light themes. The white text theme,
/// which uses lightly colored glyphs, is used on darkly colored backgrounds in
/// in light themes and in dark themes.
/// material design. The black text theme, which uses dark glyphs, is used on
/// light backgrounds in light themes. The white text theme, which uses light
/// glyphs, is used in dark themes and on dark backgrounds in in light themes.
///
/// To obtain the current text theme, call [Theme.of] with the current
/// [BuildContext] and read the [ThemeData.textTheme] property.
......@@ -131,9 +130,9 @@ class TextTheme {
class 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();
/// A material design text theme with lightly colored glyphs.
/// A material design text theme with light glyphs.
static const TextTheme white = const TextTheme._white();
}
......@@ -35,7 +35,7 @@ void main() {
child: new Scaffold(
appBar: new AppBar(title: new Text('Title')),
body: new Container(key: bodyKey),
resizeToAvoidWindowPadding: false
resizeToAvoidBottomPadding: false
)
));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment