build method

  1. @override
Widget build(
  1. BuildContext context,
  2. TreeState state,
  3. dynamic nodeState
)
override

Implementation

@override
Widget build(
  final BuildContext context,
  final TreeState state,
  final WidgetState nodeState,
) {
  final color = fill.type == FFillType.none
      ? null
      : fill.getColor(
          state.variables.whereType<ColorVariableEntity>().toList(),
          state.colorStyles,
          state.theme);
  final img = image.getImage(
    deviceType: state.deviceType,
    forPlay: state.forPlay,
    context: context,
    loop: nodeState.loop,
  ) as String;
  var result = img.isNotEmpty
      ? img
      : 'https://api.buildwiththeta.com/storage/v1/object/public/theta-assets/logos/Theta_extended_negative.svg';
  return SvgPicture.network(
    result,
    width: width.get(
      forPlay: state.forPlay,
      deviceType: state.deviceType,
      deviceInfo: state.deviceInfo,
      context: context,
      isWidth: true,
    ),
    height: height.get(
      forPlay: state.forPlay,
      deviceType: state.deviceType,
      deviceInfo: state.deviceInfo,
      context: context,
      isWidth: false,
    ),
    // ignore: deprecated_member_use
    color: color,
    fit: BoxFit.contain,
  );
}