mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
46 lines
1.2 KiB
Dart
46 lines
1.2 KiB
Dart
import 'package:flutter/widgets.dart';
|
|
import 'package:test/test.dart';
|
|
|
|
import 'widget_tester.dart';
|
|
|
|
void main() {
|
|
test('Can hit test flex children of stacks', () {
|
|
testWidgets((WidgetTester tester) {
|
|
bool didReceiveTap = false;
|
|
tester.pumpWidget(
|
|
new Container(
|
|
decoration: const BoxDecoration(
|
|
backgroundColor: const Color(0xFF00FF00)
|
|
),
|
|
child: new Stack(<Widget>[
|
|
new Positioned(
|
|
top: 10.0,
|
|
left: 10.0,
|
|
child: new Column(<Widget>[
|
|
new GestureDetector(
|
|
onTap: () {
|
|
didReceiveTap = true;
|
|
},
|
|
child: new Container(
|
|
decoration: const BoxDecoration(
|
|
backgroundColor: const Color(0xFF0000FF)
|
|
),
|
|
width: 100.0,
|
|
height: 100.0,
|
|
child: new Center(
|
|
child: new Text('X')
|
|
)
|
|
)
|
|
)
|
|
])
|
|
)
|
|
])
|
|
)
|
|
);
|
|
|
|
tester.tap(tester.findText('X'));
|
|
expect(didReceiveTap, isTrue);
|
|
});
|
|
});
|
|
}
|