Skip to content

Instantly share code, notes, and snippets.

@Ticore
Created April 26, 2020 02:28
Show Gist options
  • Save Ticore/f189b4a145d15819ab37647bd6b462e1 to your computer and use it in GitHub Desktop.
Save Ticore/f189b4a145d15819ab37647bd6b462e1 to your computer and use it in GitHub Desktop.
Flutter Dump Trees Test
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
Directionality icon = Directionality(
child: Icon(Icons.favorite, size: 12),
textDirection: TextDirection.ltr,
);
ShaderMask shaderMask = ShaderMask(
shaderCallback: (Rect bounds) {
return RadialGradient(
colors: <Color>[Colors.black, Colors.white],
).createShader(bounds);
},
child: icon,
);
testWidgets('dump widget tree: ShaderMask()', (WidgetTester tester) async {
await tester.pumpWidget(shaderMask);
debugDumpApp();
debugDumpRenderTree();
debugDumpLayerTree();
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment