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
9ce3f76c
Unverified
Commit
9ce3f76c
authored
Feb 23, 2021
by
allysonjp715
Committed by
GitHub
Feb 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a EdgeInsetsDirectional.all constructor similar to EdgeInsets.all (#76542)
parent
90c66f5d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
edge_insets.dart
packages/flutter/lib/src/painting/edge_insets.dart
+16
-0
edge_insets_test.dart
packages/flutter/test/painting/edge_insets_test.dart
+2
-0
No files found.
packages/flutter/lib/src/painting/edge_insets.dart
View file @
9ce3f76c
...
...
@@ -663,6 +663,22 @@ class EdgeInsetsDirectional extends EdgeInsetsGeometry {
this
.
bottom
=
0.0
,
});
/// Creates insets where all the offsets are `value`.
///
/// {@tool snippet}
///
/// Typical eight-pixel margin on all sides:
///
/// ```dart
/// const EdgeInsetsDirectional.all(8.0)
/// ```
/// {@end-tool}
const
EdgeInsetsDirectional
.
all
(
double
value
)
:
start
=
value
,
top
=
value
,
end
=
value
,
bottom
=
value
;
/// An [EdgeInsetsDirectional] with zero offsets in each direction.
///
/// Consider using [EdgeInsets.zero] instead, since that object has the same
...
...
packages/flutter/test/painting/edge_insets_test.dart
View file @
9ce3f76c
...
...
@@ -54,6 +54,8 @@ void main() {
test
(
'EdgeInsets.resolve()'
,
()
{
expect
(
const
EdgeInsetsDirectional
.
fromSTEB
(
10.0
,
20.0
,
30.0
,
40.0
).
resolve
(
TextDirection
.
ltr
),
const
EdgeInsets
.
fromLTRB
(
10.0
,
20.0
,
30.0
,
40.0
));
expect
(
const
EdgeInsetsDirectional
.
fromSTEB
(
99.0
,
98.0
,
97.0
,
96.0
).
resolve
(
TextDirection
.
rtl
),
const
EdgeInsets
.
fromLTRB
(
97.0
,
98.0
,
99.0
,
96.0
));
expect
(
const
EdgeInsetsDirectional
.
all
(
50.0
).
resolve
(
TextDirection
.
ltr
),
const
EdgeInsets
.
fromLTRB
(
50.0
,
50.0
,
50.0
,
50.0
));
expect
(
const
EdgeInsetsDirectional
.
all
(
50.0
).
resolve
(
TextDirection
.
rtl
),
const
EdgeInsets
.
fromLTRB
(
50.0
,
50.0
,
50.0
,
50.0
));
expect
(
const
EdgeInsetsDirectional
.
only
(
start:
963.25
).
resolve
(
TextDirection
.
ltr
),
const
EdgeInsets
.
fromLTRB
(
963.25
,
0.0
,
0.0
,
0.0
));
expect
(
const
EdgeInsetsDirectional
.
only
(
top:
963.25
).
resolve
(
TextDirection
.
ltr
),
const
EdgeInsets
.
fromLTRB
(
0.0
,
963.25
,
0.0
,
0.0
));
expect
(
const
EdgeInsetsDirectional
.
only
(
end:
963.25
).
resolve
(
TextDirection
.
ltr
),
const
EdgeInsets
.
fromLTRB
(
0.0
,
0.0
,
963.25
,
0.0
));
...
...
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