list_card.dart 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. import 'package:flutter/material.dart';
  2. import '../../core/theme/app_colors.dart';
  3. /// Pencil Component/ListCard — 列表卡片(报销申请列表等)
  4. class ListCard extends StatelessWidget {
  5. final String cardNo;
  6. final String description;
  7. final String amount;
  8. final String date;
  9. final Widget? statusTag;
  10. final VoidCallback? onTap;
  11. const ListCard({
  12. super.key,
  13. required this.cardNo,
  14. required this.description,
  15. required this.amount,
  16. required this.date,
  17. this.statusTag,
  18. this.onTap,
  19. });
  20. @override
  21. Widget build(BuildContext context) {
  22. return GestureDetector(
  23. onTap: onTap,
  24. child: Container(
  25. padding: const EdgeInsets.all(12),
  26. decoration: BoxDecoration(
  27. color: AppColors.bgCard,
  28. borderRadius: BorderRadius.circular(8),
  29. ),
  30. child: Column(
  31. crossAxisAlignment: CrossAxisAlignment.start,
  32. children: [
  33. Row(
  34. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  35. children: [
  36. Text(
  37. cardNo,
  38. style: const TextStyle(
  39. fontSize: 14,
  40. fontWeight: FontWeight.w600,
  41. color: AppColors.textPrimary,
  42. ),
  43. ),
  44. Text(
  45. amount,
  46. style: const TextStyle(
  47. fontSize: 16,
  48. fontWeight: FontWeight.w700,
  49. color: AppColors.amountPrimary,
  50. ),
  51. ),
  52. ],
  53. ),
  54. const SizedBox(height: 8),
  55. Text(
  56. description,
  57. style: const TextStyle(
  58. fontSize: 14,
  59. color: AppColors.textSecondary,
  60. ),
  61. ),
  62. const SizedBox(height: 8),
  63. Row(
  64. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  65. children: [
  66. Text(
  67. date,
  68. style: const TextStyle(
  69. fontSize: 12,
  70. color: AppColors.textPlaceholder,
  71. ),
  72. ),
  73. ?statusTag,
  74. ],
  75. ),
  76. ],
  77. ),
  78. ),
  79. );
  80. }
  81. }