File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
packages/flutter/test/widgets Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ import 'package:flutter/material.dart' ;
2+ import 'package:flutter/rendering.dart' ;
3+ import 'package:flutter/widgets.dart' ;
4+ import 'package:flutter_test/flutter_test.dart' ;
5+
6+ void main () {
7+ testWidgets ('PhysicalModel - creates a physical model layer when it needs compositing' , (WidgetTester tester) async {
8+ await tester.pumpWidget (new Directionality (
9+ textDirection: TextDirection .ltr,
10+ child: new PhysicalModel (
11+ shape: BoxShape .rectangle,
12+ color: Colors .grey,
13+ shadowColor: Colors .red,
14+ elevation: 1.0 ,
15+ child: new TextField (controller: new TextEditingController ()),
16+ ),
17+ ));
18+ await tester.pump ();
19+
20+ final RenderPhysicalModel renderPhysicalModel = tester.allRenderObjects.firstWhere ((RenderObject object) => object is RenderPhysicalModel );
21+ expect (renderPhysicalModel.needsCompositing, true );
22+
23+ final PhysicalModelLayer physicalModelLayer = tester.layers.firstWhere ((Layer layer) => layer is PhysicalModelLayer );
24+ expect (physicalModelLayer.shadowColor, Colors .red);
25+ expect (physicalModelLayer.color, Colors .grey);
26+ expect (physicalModelLayer.elevation, 1.0 );
27+ });
28+ }
You can’t perform that action at this time.
0 commit comments