vector_drawable_test.dart 762 B

1234567891011121314151617181920212223242526
  1. import 'dart:ui' show Size, PathFillType;
  2. import 'package:flutter_svg/src/vector_drawable.dart';
  3. import 'package:test/test.dart';
  4. void main() {
  5. test('DrawableRoot can mergeStyle', () {
  6. const DrawableStyle styleA = DrawableStyle(
  7. groupOpacity: 0.5,
  8. pathFillType: PathFillType.evenOdd,
  9. );
  10. const DrawableStyle styleB = DrawableStyle(
  11. pathFillType: PathFillType.nonZero,
  12. );
  13. DrawableRoot root = DrawableRoot(
  14. '', // No id
  15. const DrawableViewport(Size(100, 100), Size(100, 100)),
  16. <Drawable>[],
  17. DrawableDefinitionServer(),
  18. styleA,
  19. );
  20. expect(root.style.pathFillType, styleA.pathFillType);
  21. root = root.mergeStyle(styleB);
  22. expect(root.style.pathFillType, styleB.pathFillType);
  23. });
  24. }