...
This commit is contained in:
commit
ef4329530a
@ -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(
|
||||
|
||||
@ -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<PaymentRequestMainScreen>
|
||||
return Obx(() {
|
||||
if (paymentController.isLoading.value &&
|
||||
paymentController.paymentRequests.isEmpty) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
return SkeletonLoaders.paymentRequestListSkeletonLoader();
|
||||
}
|
||||
|
||||
final list = filteredList(isHistory: isHistory);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user