Improve container widget (#98389)
This commit is contained in:
parent
513df67edb
commit
d61caaad26
@ -389,10 +389,9 @@ class Container extends StatelessWidget {
|
||||
maxHeight: 0.0,
|
||||
child: ConstrainedBox(constraints: const BoxConstraints.expand()),
|
||||
);
|
||||
}
|
||||
|
||||
if (alignment != null)
|
||||
} else if (alignment != null) {
|
||||
current = Align(alignment: alignment!, child: current);
|
||||
}
|
||||
|
||||
final EdgeInsetsGeometry? effectivePadding = _paddingIncludingDecoration;
|
||||
if (effectivePadding != null)
|
||||
|
@ -633,6 +633,21 @@ void main() {
|
||||
expect(tapped, false);
|
||||
});
|
||||
|
||||
testWidgets('Container discards alignment when the child parameter is null and constraints is not Tight', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(1)),
|
||||
),
|
||||
alignment: Alignment.centerLeft
|
||||
));
|
||||
|
||||
expect(
|
||||
find.byType(Align),
|
||||
findsNothing,
|
||||
);
|
||||
});
|
||||
|
||||
testWidgets('using clipBehaviour and shadow, should not clip the shadow', (WidgetTester tester) async {
|
||||
final Container container = Container(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
|
Loading…
x
Reference in New Issue
Block a user