getPresentationWidgetsShimmerPageTemplate function
String
getPresentationWidgetsShimmerPageTemplate(
- String projectName
)
Implementation
String getPresentationWidgetsShimmerPageTemplate(String projectName) {
return '''
import 'package:flutter/material.dart';
import 'package:${projectName}/core/utils/responsive_size.dart';
import 'package:${projectName}/presentation/widgets/shimmer_wrapper.dart';
class ShimmerPage extends StatelessWidget {
const ShimmerPage({super.key});
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
padding: EdgeInsets.only(
bottom: MediaQuery.of(context).viewPadding.bottom + 20.sp,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
/// Image
Skeleton(width: 100.sw, height: 45.sh),
SizedBox(height: 20.sp),
Padding(
padding: EdgeInsets.symmetric(horizontal: 15.sp),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
/// Category
Skeleton(width: 80.sp, height: 20.sp),
SizedBox(height: 15.sp),
/// Title
Skeleton(width: 80.sw, height: 22.sp),
SizedBox(height: 10.sp),
/// Title line 2
Skeleton(width: 60.sw, height: 22.sp),
SizedBox(height: 15.sp),
/// Date
Skeleton(width: 120.sp, height: 14.sp),
SizedBox(height: 15.sp),
/// Description
...List.generate(
6,
(_) => Padding(
padding: EdgeInsets.only(bottom: 10.sp),
child: Skeleton(width: 100.sw, height: 14.sp),
),
),
],
),
),
],
),
);
}
}
''';
}