mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
ToolBar withSizeOffsets() is now withPadding()
This commit is contained in:
parent
24d2e69108
commit
56ccfc4e74
@ -48,15 +48,15 @@ class Scaffold extends StatelessComponent {
|
||||
final Widget floatingActionButton;
|
||||
|
||||
Widget build(BuildContext context) {
|
||||
final offsetToolBar = toolBar?.withSizeOffsets(new EdgeDims.only(top: ui.window.padding.top));
|
||||
final ToolBar paddedToolBar = toolBar?.withPadding(new EdgeDims.only(top: ui.window.padding.top));
|
||||
final Widget materialBody = body != null ? new Material(child: body) : null;
|
||||
Widget toolBarAndBody;
|
||||
if (offsetToolBar != null && materialBody != null)
|
||||
toolBarAndBody = new CustomMultiChildLayout(<Widget>[materialBody, offsetToolBar],
|
||||
if (paddedToolBar != null && materialBody != null)
|
||||
toolBarAndBody = new CustomMultiChildLayout(<Widget>[materialBody, paddedToolBar],
|
||||
delegate: _toolBarAndBodyLayout
|
||||
);
|
||||
else
|
||||
toolBarAndBody = offsetToolBar ?? materialBody;
|
||||
toolBarAndBody = paddedToolBar ?? materialBody;
|
||||
|
||||
final List<Widget> bottomColumnChildren = <Widget>[];
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@ class ToolBar extends StatelessComponent {
|
||||
this.level: 2,
|
||||
this.backgroundColor,
|
||||
this.textTheme,
|
||||
this.sizeOffsets: EdgeDims.zero
|
||||
this.padding: EdgeDims.zero
|
||||
}) : super(key: key);
|
||||
|
||||
final Widget left;
|
||||
@ -31,9 +31,9 @@ class ToolBar extends StatelessComponent {
|
||||
final int level;
|
||||
final Color backgroundColor;
|
||||
final TextTheme textTheme;
|
||||
final EdgeDims sizeOffsets;
|
||||
final EdgeDims padding;
|
||||
|
||||
ToolBar withSizeOffsets(EdgeDims offsets) {
|
||||
ToolBar withPadding(EdgeDims newPadding) {
|
||||
return new ToolBar(
|
||||
key: key,
|
||||
left: left,
|
||||
@ -43,7 +43,7 @@ class ToolBar extends StatelessComponent {
|
||||
level: level,
|
||||
backgroundColor: backgroundColor,
|
||||
textTheme: textTheme,
|
||||
sizeOffsets: offsets
|
||||
padding: newPadding
|
||||
);
|
||||
}
|
||||
|
||||
@ -99,7 +99,7 @@ class ToolBar extends StatelessComponent {
|
||||
),
|
||||
child: new DefaultTextStyle(
|
||||
style: sideStyle,
|
||||
child: new Container(padding: sizeOffsets, child: new Column(columnChildren, justifyContent: FlexJustifyContent.collapse))
|
||||
child: new Container(padding: padding, child: new Column(columnChildren, justifyContent: FlexJustifyContent.collapse))
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user