Skip to content

Commit

Permalink
Added debugFillProperties to SvgPicture to enable easier debugging. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
bramp authored Oct 16, 2023
1 parent 6a24687 commit b6b399e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions packages/flutter_svg/lib/svg.dart
Original file line number Diff line number Diff line change
Expand Up @@ -496,4 +496,22 @@ class SvgPicture extends StatelessWidget {
matchTextDirection: matchTextDirection,
);
}

@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
super.debugFillProperties(properties);

properties.add(StringProperty('bytesLoader', bytesLoader.toString(), showName: false));
properties.add(DoubleProperty('width', width, defaultValue: null));
properties.add(DoubleProperty('height', height, defaultValue: null));
properties.add(EnumProperty<AlignmentGeometry>('alignment', alignment, defaultValue: Alignment.center));
properties.add(DiagnosticsProperty<bool>('allowDrawingOutsideViewBox', allowDrawingOutsideViewBox, defaultValue: false));
properties.add(EnumProperty<Clip>('clipBehavior', clipBehavior, defaultValue: BoxFit.contain));
properties.add(StringProperty('colorFilter', colorFilter.toString(), defaultValue: null));
properties.add(EnumProperty<BoxFit>('fit', fit, defaultValue: BoxFit.contain));
properties.add(DiagnosticsProperty<Function>('placeholderBuilder', placeholderBuilder, defaultValue: null));
properties.add(DiagnosticsProperty<bool>('matchTextDirection', matchTextDirection, defaultValue: false));
properties.add(DiagnosticsProperty<bool>('excludeFromSemantics', excludeFromSemantics, defaultValue: false));
properties.add(StringProperty('semanticsLabel', semanticsLabel, defaultValue: null));
}
}

0 comments on commit b6b399e

Please sign in to comment.