mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00

Rather than reading out the maxWidth, we should call constrainWidth to factor in the minWidth, which might be bigger.
17 lines
570 B
Dart
17 lines
570 B
Dart
import 'package:sky/rendering.dart';
|
|
import 'package:test/test.dart';
|
|
|
|
import 'rendering_tester.dart';
|
|
|
|
void main() {
|
|
test('Overconstrained flex', () {
|
|
RenderDecoratedBox box = new RenderDecoratedBox(decoration: new BoxDecoration());
|
|
RenderFlex flex = new RenderFlex(children: [ box ]);
|
|
layout(flex, constraints: const BoxConstraints(
|
|
minWidth: 200.0, maxWidth: 100.0, minHeight: 200.0, maxHeight: 100.0));
|
|
|
|
expect(flex.size.width, equals(200.0), reason: "flex width");
|
|
expect(flex.size.height, equals(200.0), reason: "flex height");
|
|
});
|
|
}
|