buildIcon method

  1. @override
Widget buildIcon(
  1. BuildContext context, {
  2. required double size,
  3. required Color color,
  4. String? semanticLabel,
})
override

Loads the SVG from the carpenter package at the requested logical-pixel width and height. Applies color with a source-in filter and forwards semanticLabel to the SVG renderer.

Implementation

@override
Widget buildIcon(
  BuildContext context, {
  required double size,
  required Color color,
  String? semanticLabel,
}) {
  return SvgPicture.asset(
    assetPath,
    package: 'carpenter',
    width: size,
    height: size,
    colorFilter: ColorFilter.mode(color, BlendMode.srcIn),
    semanticsLabel: semanticLabel,
  );
}