build method

  1. @override
Widget build(
  1. BuildContext context,
  2. AppState appState,
  3. PageState pageState,
  4. AppStylesState stylesState,
  5. dynamic nodeState,
)
override

Implementation

@override
Widget build(
  final BuildContext context,
  final AppState appState,
  final PageState pageState,
  final AppStylesState stylesState,
  final WidgetState nodeState,
) {
  final value = image.get(context: context, loop: nodeState.loop).toString();
  return Lottie.network(
    /// if the image is null, it will return a default image
    value.isNotEmpty
        ? value
        : 'https://assets10.lottiefiles.com/packages/lf20_ptplezpy.json',
    width: width.get(
      context: context,
      isWidth: true,
    ),
    height: height.get(
      context: context,
      isWidth: false,
    ),
    fit: BoxFit.contain,
    errorBuilder: (context, exception, stackTrace) {
      return Container(
        color: Colors.transparent,
        child: const Placeholder(),
      );
    },
  );
}