Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
1e257925
Commit
1e257925
authored
Mar 24, 2016
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2881 from abarth/from_ltrb
Replace EdgeInsets.TRBL with EdgeInsets.fromLTRB
parents
cc72a8e5
c8c325d0
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
39 additions
and
32 deletions
+39
-32
tabs_fab_demo.dart
examples/material_gallery/lib/demo/tabs_fab_demo.dart
+1
-1
stock_row.dart
examples/stocks/lib/stock_row.dart
+1
-1
constants.dart
packages/flutter/lib/src/material/constants.dart
+1
-1
dialog.dart
packages/flutter/lib/src/material/dialog.dart
+2
-2
box_painter.dart
packages/flutter/lib/src/painting/box_painter.dart
+1
-1
edge_insets.dart
packages/flutter/lib/src/painting/edge_insets.dart
+30
-23
app.dart
packages/flutter/lib/src/widgets/app.dart
+1
-1
scrollable_list_hit_testing_test.dart
...flutter/test/widget/scrollable_list_hit_testing_test.dart
+2
-2
No files found.
examples/material_gallery/lib/demo/tabs_fab_demo.dart
View file @
1e257925
...
...
@@ -78,7 +78,7 @@ class _TabsFabDemoState extends State<TabsFabDemo> {
return
new
Container
(
key:
new
ValueKey
<
String
>(
page
.
label
),
padding:
const
EdgeInsets
.
TRBL
(
48.0
,
48.0
,
96.0
,
48
.0
),
padding:
const
EdgeInsets
.
fromLTRB
(
48.0
,
48.0
,
48.0
,
96
.0
),
child:
new
Card
(
child:
new
Center
(
child:
new
Text
(
page
.
label
,
style:
textStyle
)
...
...
examples/stocks/lib/stock_row.dart
View file @
1e257925
...
...
@@ -72,7 +72,7 @@ class StockRow extends StatelessWidget {
onDoubleTap:
_getHandler
(
onDoubleTap
),
onLongPress:
_getHandler
(
onLongPressed
),
child:
new
Container
(
padding:
const
EdgeInsets
.
TRBL
(
16.0
,
16.0
,
20.0
,
16
.0
),
padding:
const
EdgeInsets
.
fromLTRB
(
16.0
,
16.0
,
16.0
,
20
.0
),
decoration:
new
BoxDecoration
(
border:
new
Border
(
bottom:
new
BorderSide
(
color:
Theme
.
of
(
context
).
dividerColor
)
...
...
packages/flutter/lib/src/material/constants.dart
View file @
1e257925
...
...
@@ -33,7 +33,7 @@ const double kFadingEdgeLength = 12.0;
const
double
kPressedStateDuration
=
64.0
;
// units?
const
Duration
kThemeChangeDuration
=
const
Duration
(
milliseconds:
200
);
const
EdgeInsets
kDialogHeadingPadding
=
const
EdgeInsets
.
TRBL
(
24.0
,
24.0
,
20.0
,
24
.0
);
const
EdgeInsets
kDialogHeadingPadding
=
const
EdgeInsets
.
fromLTRB
(
24.0
,
24.0
,
24.0
,
20
.0
);
const
double
kRadialReactionRadius
=
24.0
;
// Pixels
const
Duration
kRadialReactionDuration
=
const
Duration
(
milliseconds:
200
);
...
...
packages/flutter/lib/src/material/dialog.dart
View file @
1e257925
...
...
@@ -62,7 +62,7 @@ class Dialog extends StatelessWidget {
if
(
title
!=
null
)
{
EdgeInsets
padding
=
titlePadding
;
if
(
padding
==
null
)
padding
=
new
EdgeInsets
.
TRBL
(
24.0
,
24.0
,
content
==
null
?
20.0
:
0.0
,
24
.0
);
padding
=
new
EdgeInsets
.
fromLTRB
(
24.0
,
24.0
,
24.0
,
content
==
null
?
20.0
:
0
.0
);
dialogBody
.
add
(
new
Padding
(
padding:
padding
,
child:
new
DefaultTextStyle
(
...
...
@@ -75,7 +75,7 @@ class Dialog extends StatelessWidget {
if
(
content
!=
null
)
{
EdgeInsets
padding
=
contentPadding
;
if
(
padding
==
null
)
padding
=
const
EdgeInsets
.
TRBL
(
20.0
,
24
.0
,
24.0
,
24.0
);
padding
=
const
EdgeInsets
.
fromLTRB
(
24.0
,
20
.0
,
24.0
,
24.0
);
dialogBody
.
add
(
new
Padding
(
padding:
padding
,
child:
new
DefaultTextStyle
(
...
...
packages/flutter/lib/src/painting/box_painter.dart
View file @
1e257925
...
...
@@ -112,7 +112,7 @@ class Border {
/// The widths of the sides of this border represented as an EdgeInsets.
EdgeInsets
get
dimensions
{
return
new
EdgeInsets
.
TRBL
(
top
.
width
,
right
.
width
,
bottom
.
width
,
left
.
width
);
return
new
EdgeInsets
.
fromLTRB
(
left
.
width
,
top
.
width
,
right
.
width
,
bottom
.
width
);
}
/// Whether all four sides of the border are identical.
...
...
packages/flutter/lib/src/painting/edge_insets.dart
View file @
1e257925
...
...
@@ -12,8 +12,15 @@ import 'basic_types.dart';
/// example, the padding inside a box can be represented using this class.
class
EdgeInsets
{
/// Constructs insets from offsets from the top, right, bottom and left.
///
/// We'll be removing this function sometime soon. Please use
/// [EdgeInsets.fromLTRB] instead.
@Deprecated
(
'soon. Use fromLTRB instead.'
)
const
EdgeInsets
.
TRBL
(
this
.
top
,
this
.
right
,
this
.
bottom
,
this
.
left
);
/// Constructs insets from offsets from the left, top, right, and bottom.
const
EdgeInsets
.
fromLTRB
(
this
.
left
,
this
.
top
,
this
.
right
,
this
.
bottom
);
/// Constructs insets where all the offsets are value.
const
EdgeInsets
.
all
(
double
value
)
:
top
=
value
,
right
=
value
,
bottom
=
value
,
left
=
value
;
...
...
@@ -56,63 +63,63 @@ class EdgeInsets {
Size
get
collapsedSize
=>
new
Size
(
horizontal
,
vertical
);
/// An EdgeInsets with top and bottom as well as left and right flipped.
EdgeInsets
get
flipped
=>
new
EdgeInsets
.
TRBL
(
bottom
,
left
,
top
,
right
);
EdgeInsets
get
flipped
=>
new
EdgeInsets
.
fromLTRB
(
left
,
top
,
right
,
bottom
);
Rect
inflateRect
(
Rect
rect
)
{
return
new
Rect
.
fromLTRB
(
rect
.
left
-
left
,
rect
.
top
-
top
,
rect
.
right
+
right
,
rect
.
bottom
+
bottom
);
}
EdgeInsets
operator
-(
EdgeInsets
other
)
{
return
new
EdgeInsets
.
TRBL
(
return
new
EdgeInsets
.
fromLTRB
(
left
-
other
.
left
,
top
-
other
.
top
,
right
-
other
.
right
,
bottom
-
other
.
bottom
,
left
-
other
.
left
bottom
-
other
.
bottom
);
}
EdgeInsets
operator
+(
EdgeInsets
other
)
{
return
new
EdgeInsets
.
TRBL
(
return
new
EdgeInsets
.
fromLTRB
(
left
+
other
.
left
,
top
+
other
.
top
,
right
+
other
.
right
,
bottom
+
other
.
bottom
,
left
+
other
.
left
bottom
+
other
.
bottom
);
}
EdgeInsets
operator
*(
double
other
)
{
return
new
EdgeInsets
.
TRBL
(
return
new
EdgeInsets
.
fromLTRB
(
left
*
other
,
top
*
other
,
right
*
other
,
bottom
*
other
,
left
*
other
bottom
*
other
);
}
EdgeInsets
operator
/(
double
other
)
{
return
new
EdgeInsets
.
TRBL
(
return
new
EdgeInsets
.
fromLTRB
(
left
/
other
,
top
/
other
,
right
/
other
,
bottom
/
other
,
left
/
other
bottom
/
other
);
}
EdgeInsets
operator
~/(
double
other
)
{
return
new
EdgeInsets
.
TRBL
(
return
new
EdgeInsets
.
fromLTRB
(
(
left
~/
other
).
toDouble
(),
(
top
~/
other
).
toDouble
(),
(
right
~/
other
).
toDouble
(),
(
bottom
~/
other
).
toDouble
(),
(
left
~/
other
).
toDouble
()
(
bottom
~/
other
).
toDouble
()
);
}
EdgeInsets
operator
%(
double
other
)
{
return
new
EdgeInsets
.
TRBL
(
return
new
EdgeInsets
.
fromLTRB
(
left
%
other
,
top
%
other
,
right
%
other
,
bottom
%
other
,
left
%
other
bottom
%
other
);
}
...
...
@@ -126,16 +133,16 @@ class EdgeInsets {
return
b
*
t
;
if
(
b
==
null
)
return
a
*
(
1.0
-
t
);
return
new
EdgeInsets
.
TRBL
(
return
new
EdgeInsets
.
fromLTRB
(
ui
.
lerpDouble
(
a
.
left
,
b
.
left
,
t
),
ui
.
lerpDouble
(
a
.
top
,
b
.
top
,
t
),
ui
.
lerpDouble
(
a
.
right
,
b
.
right
,
t
),
ui
.
lerpDouble
(
a
.
bottom
,
b
.
bottom
,
t
),
ui
.
lerpDouble
(
a
.
left
,
b
.
left
,
t
)
ui
.
lerpDouble
(
a
.
bottom
,
b
.
bottom
,
t
)
);
}
/// An EdgeInsets with zero offsets in each direction.
static
const
EdgeInsets
zero
=
const
EdgeInsets
.
TRBL
(
0.0
,
0.0
,
0.0
,
0.0
);
static
const
EdgeInsets
zero
=
const
EdgeInsets
.
all
(
0.0
);
@override
bool
operator
==(
dynamic
other
)
{
...
...
packages/flutter/lib/src/widgets/app.dart
View file @
1e257925
...
...
@@ -105,7 +105,7 @@ class WidgetsApp extends StatefulWidget {
}
EdgeInsets
_getPadding
(
ui
.
WindowPadding
padding
)
{
return
new
EdgeInsets
.
TRBL
(
padding
.
top
,
padding
.
right
,
padding
.
bottom
,
padding
.
left
);
return
new
EdgeInsets
.
fromLTRB
(
padding
.
left
,
padding
.
top
,
padding
.
right
,
padding
.
bottom
);
}
class
WidgetsAppState
<
T
extends
WidgetsApp
>
extends
State
<
T
>
implements
BindingObserver
{
...
...
packages/flutter/test/widget/scrollable_list_hit_testing_test.dart
View file @
1e257925
...
...
@@ -100,7 +100,7 @@ void main() {
new
ScrollableList
(
key:
new
GlobalKey
(),
itemExtent:
290.0
,
padding:
new
EdgeInsets
.
TRBL
(
20.0
,
15.0
,
10.0
,
5
.0
),
padding:
new
EdgeInsets
.
fromLTRB
(
5.0
,
20.0
,
15.0
,
10
.0
),
children:
items
.
map
((
int
item
)
{
return
new
Container
(
child:
new
GestureDetector
(
...
...
@@ -135,7 +135,7 @@ void main() {
key:
new
GlobalKey
(),
itemExtent:
290.0
,
scrollAnchor:
ViewportAnchor
.
end
,
padding:
new
EdgeInsets
.
TRBL
(
20.0
,
15.0
,
10.0
,
5
.0
),
padding:
new
EdgeInsets
.
fromLTRB
(
5.0
,
20.0
,
15.0
,
10
.0
),
children:
items
.
map
((
int
item
)
{
return
new
Container
(
child:
new
GestureDetector
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment