build method
Widget
build(
- BuildContext context,
- AppState appState,
- PageState pageState,
- AppStylesState stylesState,
- 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(),
);
},
);
}