builder method
Implementation
@override
Widget builder(BuildContext context, theme) {
return Container(
padding: padding,
decoration: BoxDecoration(
border: theme.border,
borderRadius: theme.borderRadius,
color: theme.backgroundColor,
),
child: Row(
spacing: theme.spacing ?? 0,
children: [
IconWidget(
Assets.icons.fileCheck,
theme: theme.fileIconThemeData,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
file.name,
style: theme.nameTextStyle,
maxLines: 2,
overflow: .ellipsis,
),
Text(
'${file.format}, ${file.weight}',
style: theme.infoTextStyle,
),
],
),
),
Builder(
builder: (context) {
if (file.isLoading) {
return LoadingWidget(
theme: theme.loadingThemeData,
margin: loadingMargin,
);
}
if (actionBuilder != null) {
return actionBuilder!.call(file);
}
return const SizedBox.shrink();
},
),
],
),
);
}