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
c0bcb4fc
Unverified
Commit
c0bcb4fc
authored
Mar 19, 2021
by
Mouad Debbar
Committed by
GitHub
Mar 19, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "ConstraintsTransformBox (#77994)" (#78661)
This reverts commit
8c44abc0
.
parent
8c44abc0
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
88 additions
and
473 deletions
+88
-473
debug_overflow_indicator.dart
...s/flutter/lib/src/rendering/debug_overflow_indicator.dart
+1
-2
shifted_box.dart
packages/flutter/lib/src/rendering/shifted_box.dart
+69
-160
basic.dart
packages/flutter/lib/src/widgets/basic.dart
+16
-247
box_test.dart
packages/flutter/test/rendering/box_test.dart
+0
-42
debug_overflow_indicator_test.dart
...flutter/test/rendering/debug_overflow_indicator_test.dart
+1
-1
basic_test.dart
packages/flutter/test/widgets/basic_test.dart
+1
-21
No files found.
packages/flutter/lib/src/rendering/debug_overflow_indicator.dart
View file @
c0bcb4fc
...
@@ -85,8 +85,7 @@ class _OverflowRegionData {
...
@@ -85,8 +85,7 @@ class _OverflowRegionData {
///
///
/// See also:
/// See also:
///
///
/// * [RenderConstraintsTransformBox], [RenderUnconstrainedBox] and
/// * [RenderUnconstrainedBox] and [RenderFlex] for examples of classes that use this indicator mixin.
/// [RenderFlex], for examples of classes that use this indicator mixin.
mixin
DebugOverflowIndicatorMixin
on
RenderObject
{
mixin
DebugOverflowIndicatorMixin
on
RenderObject
{
static
const
Color
_black
=
Color
(
0xBF000000
);
static
const
Color
_black
=
Color
(
0xBF000000
);
static
const
Color
_yellow
=
Color
(
0xBFFFFF00
);
static
const
Color
_yellow
=
Color
(
0xBFFFFF00
);
...
...
packages/flutter/lib/src/rendering/shifted_box.dart
View file @
c0bcb4fc
This diff is collapsed.
Click to expand it.
packages/flutter/lib/src/widgets/basic.dart
View file @
c0bcb4fc
This diff is collapsed.
Click to expand it.
packages/flutter/test/rendering/box_test.dart
View file @
c0bcb4fc
...
@@ -378,48 +378,6 @@ void main() {
...
@@ -378,48 +378,6 @@ void main() {
expect
(
unconstrained
.
getMaxIntrinsicWidth
(
100.0
),
equals
(
200.0
));
expect
(
unconstrained
.
getMaxIntrinsicWidth
(
100.0
),
equals
(
200.0
));
});
});
group
(
'ConstraintsTransfromBox'
,
()
{
FlutterErrorDetails
?
firstErrorDetails
;
void
exhaustErrors
()
{
FlutterErrorDetails
?
next
;
do
{
next
=
renderer
.
takeFlutterErrorDetails
();
firstErrorDetails
??=
next
;
}
while
(
next
!=
null
);
}
tearDown
(()
{
firstErrorDetails
=
null
;
});
test
(
'throws if the resulting constraints are not normalized'
,
()
{
final
RenderConstrainedBox
child
=
RenderConstrainedBox
(
additionalConstraints:
const
BoxConstraints
.
tightFor
(
height:
0
));
final
RenderConstraintsTransformBox
box
=
RenderConstraintsTransformBox
(
alignment:
Alignment
.
center
,
textDirection:
TextDirection
.
ltr
,
constraintsTransform:
(
BoxConstraints
constraints
)
=>
const
BoxConstraints
(
maxHeight:
-
1
,
minHeight:
200
),
child:
child
,
);
layout
(
box
,
constraints:
const
BoxConstraints
(),
onErrors:
exhaustErrors
);
expect
(
firstErrorDetails
?.
toString
(),
contains
(
'is not normalized'
));
});
test
(
'overflow is reported when insufficient size is given'
,
()
{
final
RenderConstrainedBox
child
=
RenderConstrainedBox
(
additionalConstraints:
const
BoxConstraints
.
tightFor
(
width:
double
.
maxFinite
));
final
RenderConstraintsTransformBox
box
=
RenderConstraintsTransformBox
(
alignment:
Alignment
.
center
,
textDirection:
TextDirection
.
ltr
,
constraintsTransform:
(
BoxConstraints
constraints
)
=>
constraints
.
copyWith
(
maxWidth:
double
.
infinity
),
child:
child
,
);
// No error reported.
layout
(
box
,
constraints:
const
BoxConstraints
(),
phase:
EnginePhase
.
composite
,
onErrors:
expectOverflowedErrors
);
});
});
test
(
'getMinIntrinsicWidth error handling'
,
()
{
test
(
'getMinIntrinsicWidth error handling'
,
()
{
final
RenderUnconstrainedBox
unconstrained
=
RenderUnconstrainedBox
(
final
RenderUnconstrainedBox
unconstrained
=
RenderUnconstrainedBox
(
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
...
...
packages/flutter/test/rendering/debug_overflow_indicator_test.dart
View file @
c0bcb4fc
...
@@ -36,7 +36,7 @@ void main() {
...
@@ -36,7 +36,7 @@ void main() {
final
dynamic
exception
=
tester
.
takeException
();
final
dynamic
exception
=
tester
.
takeException
();
expect
(
exception
,
isFlutterError
);
expect
(
exception
,
isFlutterError
);
expect
(
exception
.
diagnostics
.
first
.
level
,
DiagnosticLevel
.
summary
);
expect
(
exception
.
diagnostics
.
first
.
level
,
DiagnosticLevel
.
summary
);
expect
(
exception
.
diagnostics
.
first
.
toString
(),
startsWith
(
'A Render
ConstraintsTransform
Box overflowed by '
));
expect
(
exception
.
diagnostics
.
first
.
toString
(),
startsWith
(
'A Render
Unconstrained
Box overflowed by '
));
expect
(
find
.
byType
(
UnconstrainedBox
),
paints
..
rect
());
expect
(
find
.
byType
(
UnconstrainedBox
),
paints
..
rect
());
await
tester
.
pumpWidget
(
await
tester
.
pumpWidget
(
...
...
packages/flutter/test/widgets/basic_test.dart
View file @
c0bcb4fc
...
@@ -323,7 +323,6 @@ void main() {
...
@@ -323,7 +323,6 @@ void main() {
const
UnconstrainedBox
(
constrainedAxis:
Axis
.
vertical
,).
toString
(),
const
UnconstrainedBox
(
constrainedAxis:
Axis
.
vertical
,).
toString
(),
equals
(
'UnconstrainedBox(alignment: Alignment.center, constrainedAxis: vertical)'
),
equals
(
'UnconstrainedBox(alignment: Alignment.center, constrainedAxis: vertical)'
),
);
);
expect
(
expect
(
const
UnconstrainedBox
(
constrainedAxis:
Axis
.
horizontal
,
textDirection:
TextDirection
.
rtl
,
alignment:
Alignment
.
topRight
).
toString
(),
const
UnconstrainedBox
(
constrainedAxis:
Axis
.
horizontal
,
textDirection:
TextDirection
.
rtl
,
alignment:
Alignment
.
topRight
).
toString
(),
equals
(
'UnconstrainedBox(alignment: Alignment.topRight, constrainedAxis: horizontal, textDirection: rtl)'
),
equals
(
'UnconstrainedBox(alignment: Alignment.topRight, constrainedAxis: horizontal, textDirection: rtl)'
),
...
@@ -332,32 +331,13 @@ void main() {
...
@@ -332,32 +331,13 @@ void main() {
testWidgets
(
'UnconstrainedBox can set and update clipBehavior'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'UnconstrainedBox can set and update clipBehavior'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
const
UnconstrainedBox
());
await
tester
.
pumpWidget
(
const
UnconstrainedBox
());
final
Render
ConstraintsTransformBox
renderObject
=
tester
.
allRenderObjects
.
whereType
<
RenderConstraintsTransform
Box
>().
first
;
final
Render
UnconstrainedBox
renderObject
=
tester
.
allRenderObjects
.
whereType
<
RenderUnconstrained
Box
>().
first
;
expect
(
renderObject
.
clipBehavior
,
equals
(
Clip
.
none
));
expect
(
renderObject
.
clipBehavior
,
equals
(
Clip
.
none
));
await
tester
.
pumpWidget
(
const
UnconstrainedBox
(
clipBehavior:
Clip
.
antiAlias
));
await
tester
.
pumpWidget
(
const
UnconstrainedBox
(
clipBehavior:
Clip
.
antiAlias
));
expect
(
renderObject
.
clipBehavior
,
equals
(
Clip
.
antiAlias
));
expect
(
renderObject
.
clipBehavior
,
equals
(
Clip
.
antiAlias
));
});
});
group
(
'ConstraintsTransformBox'
,
()
{
test
(
'toString'
,
()
{
expect
(
const
ConstraintsTransformBox
(
constraintsTransform:
ConstraintsTransformBox
.
unconstrained
,
).
toString
(),
equals
(
'ConstraintsTransformBox(alignment: Alignment.center, constraints transform: unconstrained)'
),
);
expect
(
const
ConstraintsTransformBox
(
textDirection:
TextDirection
.
rtl
,
alignment:
Alignment
.
topRight
,
constraintsTransform:
ConstraintsTransformBox
.
widthUnconstrained
,
).
toString
(),
equals
(
'ConstraintsTransformBox(alignment: Alignment.topRight, textDirection: rtl, constraints transform: width constraints removed)'
),
);
});
});
group
(
'ColoredBox'
,
()
{
group
(
'ColoredBox'
,
()
{
late
_MockCanvas
mockCanvas
;
late
_MockCanvas
mockCanvas
;
late
_MockPaintingContext
mockContext
;
late
_MockPaintingContext
mockContext
;
...
...
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