diff --git a/lib/helpers/widgets/my_custom_skeleton.dart b/lib/helpers/widgets/my_custom_skeleton.dart index c390e7a..d9cd2d1 100644 --- a/lib/helpers/widgets/my_custom_skeleton.dart +++ b/lib/helpers/widgets/my_custom_skeleton.dart @@ -33,6 +33,99 @@ class SkeletonLoaders { ); } +// Inside SkeletonLoaders class + static Widget paymentRequestListSkeletonLoader() { + return ListView.separated( + padding: const EdgeInsets.fromLTRB(12, 12, 12, 80), + itemCount: 6, + separatorBuilder: (_, __) => + Divider(color: Colors.grey.shade300, height: 20), + itemBuilder: (context, index) { + return Container( + padding: const EdgeInsets.symmetric(vertical: 8), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // Category name placeholder + Container( + height: 14, + width: 120, + decoration: BoxDecoration( + color: Colors.grey.shade300, + borderRadius: BorderRadius.circular(4), + ), + ), + const SizedBox(height: 6), + + // Payee placeholder + Row( + children: [ + Container( + height: 12, + width: 50, + decoration: BoxDecoration( + color: Colors.grey.shade200, + borderRadius: BorderRadius.circular(4), + ), + ), + const SizedBox(width: 8), + Expanded( + child: Container( + height: 12, + decoration: BoxDecoration( + color: Colors.grey.shade300, + borderRadius: BorderRadius.circular(4), + ), + ), + ), + ], + ), + const SizedBox(height: 6), + + // Due date and status placeholders + Row( + children: [ + // Due date label + value + Row( + children: [ + Container( + height: 12, + width: 50, + decoration: BoxDecoration( + color: Colors.grey.shade200, + borderRadius: BorderRadius.circular(4), + ), + ), + const SizedBox(width: 6), + Container( + height: 12, + width: 80, + decoration: BoxDecoration( + color: Colors.grey.shade300, + borderRadius: BorderRadius.circular(4), + ), + ), + ], + ), + const Spacer(), + // Status chip placeholder + Container( + height: 20, + width: 60, + decoration: BoxDecoration( + color: Colors.grey.shade300, + borderRadius: BorderRadius.circular(6), + ), + ), + ], + ), + ], + ), + ); + }, + ); + } + // Add this inside SkeletonLoaders class static Widget paymentRequestDetailSkeletonLoader() { return SingleChildScrollView( diff --git a/lib/view/finance/payment_request_screen.dart b/lib/view/finance/payment_request_screen.dart index 84697ec..42719ee 100644 --- a/lib/view/finance/payment_request_screen.dart +++ b/lib/view/finance/payment_request_screen.dart @@ -9,6 +9,7 @@ import 'package:marco/model/finance/payment_request_filter_bottom_sheet.dart'; import 'package:marco/model/finance/add_payment_request_bottom_sheet.dart'; import 'package:marco/helpers/utils/date_time_utils.dart'; import 'package:marco/view/finance/payment_request_detail_screen.dart'; +import 'package:marco/helpers/widgets/my_custom_skeleton.dart'; class PaymentRequestMainScreen extends StatefulWidget { const PaymentRequestMainScreen({super.key}); @@ -263,7 +264,7 @@ class _PaymentRequestMainScreenState extends State return Obx(() { if (paymentController.isLoading.value && paymentController.paymentRequests.isEmpty) { - return const Center(child: CircularProgressIndicator()); + return SkeletonLoaders.paymentRequestListSkeletonLoader(); } final list = filteredList(isHistory: isHistory);