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
8e8acaac
Unverified
Commit
8e8acaac
authored
Sep 23, 2020
by
Yuqian Li
Committed by
GitHub
Sep 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Overflow back with deprecation (#66305)
parent
33d01519
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
2 deletions
+45
-2
stack.dart
packages/flutter/lib/src/rendering/stack.dart
+18
-0
basic.dart
packages/flutter/lib/src/widgets/basic.dart
+26
-2
stack_test.dart
packages/flutter/test/widgets/stack_test.dart
+1
-0
No files found.
packages/flutter/lib/src/rendering/stack.dart
View file @
8e8acaac
...
...
@@ -268,6 +268,24 @@ enum StackFit {
passthrough
,
}
/// Whether overflowing children should be clipped, or their overflow be
/// visible.
///
/// Deprecated. Use [Stack.clipBehavior] instead.
@Deprecated
(
'Use clipBehavior instead. See the migration guide in flutter.dev/go/clip-behavior. '
'This feature was deprecated after v1.22.0-12.0.pre.'
)
enum
Overflow
{
/// Overflowing children will be visible.
///
/// The visible overflow area will not accept hit testing.
visible
,
/// Overflowing children will be clipped to the bounds of their parent.
clip
,
}
/// Implements the stack layout algorithm.
///
/// In a stack layout, the children are positioned on top of each other in the
...
...
packages/flutter/lib/src/widgets/basic.dart
View file @
8e8acaac
...
...
@@ -42,6 +42,7 @@ export 'package:flutter/rendering.dart' show
MainAxisAlignment
,
MainAxisSize
,
MultiChildLayoutDelegate
,
Overflow
,
PaintingContext
,
PointerCancelEvent
,
PointerCancelEventListener
,
...
...
@@ -3275,6 +3276,11 @@ class Stack extends MultiChildRenderObjectWidget {
this
.
alignment
=
AlignmentDirectional
.
topStart
,
this
.
textDirection
,
this
.
fit
=
StackFit
.
loose
,
@Deprecated
(
'Use clipBehavior instead. See the migration guide in flutter.dev/go/clip-behavior. '
'This feature was deprecated after v1.22.0-12.0.pre.'
)
this
.
overflow
=
Overflow
.
clip
,
this
.
clipBehavior
=
Clip
.
hardEdge
,
List
<
Widget
>
children
=
const
<
Widget
>[],
})
:
assert
(
clipBehavior
!=
null
),
...
...
@@ -3315,6 +3321,24 @@ class Stack extends MultiChildRenderObjectWidget {
/// ([StackFit.expand]).
final
StackFit
fit
;
/// Whether overflowing children should be clipped. See [Overflow].
///
/// Some children in a stack might overflow its box. When this flag is set to
/// [Overflow.clip], children cannot paint outside of the stack's box.
///
/// When set to [Overflow.visible], the visible overflow area will not accept
/// hit testing.
///
/// This overrides [clipBehavior] for now due to a staged roll out.
/// We will remove it and only use [clipBehavior] soon.
///
/// Deprecated. Use [clipBehavior] instead.
@Deprecated
(
'Use clipBehavior instead. See the migration guide in flutter.dev/go/clip-behavior. '
'This feature was deprecated after v1.22.0-12.0.pre.'
)
final
Overflow
overflow
;
/// {@macro flutter.widgets.Clip}
///
/// Defaults to [Clip.hardEdge].
...
...
@@ -3339,7 +3363,7 @@ class Stack extends MultiChildRenderObjectWidget {
alignment:
alignment
,
textDirection:
textDirection
??
Directionality
.
of
(
context
),
fit:
fit
,
clipBehavior:
clipBehavior
,
clipBehavior:
overflow
==
Overflow
.
visible
?
Clip
.
none
:
clipBehavior
,
);
}
...
...
@@ -3350,7 +3374,7 @@ class Stack extends MultiChildRenderObjectWidget {
..
alignment
=
alignment
..
textDirection
=
textDirection
??
Directionality
.
of
(
context
)
..
fit
=
fit
..
clipBehavior
=
clipBehavior
;
..
clipBehavior
=
overflow
==
Overflow
.
visible
?
Clip
.
none
:
clipBehavior
;
}
@override
...
...
packages/flutter/test/widgets/stack_test.dart
View file @
8e8acaac
...
...
@@ -453,6 +453,7 @@ void main() {
textDirection:
TextDirection
.
ltr
,
child:
Center
(
child:
Stack
(
overflow:
Overflow
.
visible
,
clipBehavior:
Clip
.
none
,
children:
const
<
Widget
>[
SizedBox
(
...
...
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