getListUiTemplate function
String
getListUiTemplate(
{ - required String className,
- required String isLoading,
- bool addApiCalling = false,
})
Implementation
String getListUiTemplate(
{required String className,
required String isLoading,
bool addApiCalling = false}) {
return '''
CustomBody(
title: "Active Projects",
isLoading: $isLoading,
backgroundColor: AppColors.white,
child: ListView.builder(
padding: EdgeInsets.all(16.sp),
itemCount: 10,
itemBuilder: (context, index) {
return Container(
width: 100.sw,
padding: EdgeInsets.all(12.sp),
margin: EdgeInsets.only(bottom: 16.sp),
decoration: BoxDecoration(
color: AppColors.white,
borderRadius: BorderRadius.circular(16.sp),
border: Border.all(color: AppColors.borderColor, width: 1),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Rounded Image Thumbnail
ClipRRect(
borderRadius: BorderRadius.circular(12.sp),
child: Container(
width: 75.sp,
height: 75.sp,
color: AppColors.indigoLight,
child: Icon(
Icons.image_outlined,
color: AppColors.primary.withOpacity(0.5),
size: 30.sp,
),
),
),
SizedBox(width: 15.sp),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TextWidget(
text: "Community Group \${index + 1}",
textSize: 17.sp,
fontWeight: FontWeight.w700,
color: AppColors.textPrimary,
),
SizedBox(height: 4.sp),
TextWidget(
text: "A creative community for developers and enterprise solutions.",
textSize: 13.sp,
color: AppColors.grey.withOpacity(0.9),
maxLines: 2,
),
SizedBox(height: 10.sp),
Row(
children: [
Icon(
Icons.group_outlined,
size: 16.sp,
color: AppColors.grey,
),
SizedBox(width: 6.sp),
TextWidget(
text: "1,254 member",
textSize: 12.sp,
color: AppColors.grey,
fontWeight: FontWeight.w500,
),
],
),
],
),
),
],
),
);
},
),
)''';
}