storehouse_item.dart 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. import 'package:flutter/material.dart';
  2. import 'package:lszlgl/config/borders.dart';
  3. class StorehouseItem extends StatelessWidget {
  4. final String? left;
  5. final String? right;
  6. final bool special;
  7. const StorehouseItem({
  8. super.key,
  9. this.left,
  10. this.right,
  11. this.special = false,
  12. });
  13. @override
  14. Widget build(BuildContext context) {
  15. return Padding(
  16. padding: const EdgeInsets.symmetric(vertical: 4),
  17. child: Row(
  18. crossAxisAlignment: CrossAxisAlignment.start,
  19. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  20. children: [
  21. Expanded(
  22. child: Text(
  23. left ?? '',
  24. style: special ? TextStyles.titA : TextStyles.titB,
  25. maxLines: null,
  26. ),
  27. ),
  28. const SizedBox(width: 20),
  29. Expanded(
  30. child: special
  31. ? Padding(
  32. padding: const EdgeInsets.only(left: 40),
  33. child: Container(
  34. alignment: Alignment.center,
  35. decoration: BoxDecoration(
  36. color: const Color(0xFFE0F2F1),
  37. border: Border.all(color: const Color(0xFF4DB6AC), width: 1.0),
  38. borderRadius: BorderRadius.circular(12) // 设置边框样式
  39. ),
  40. child: Text(right ?? '',
  41. style: const TextStyle(fontSize: 14, color: Color(0xFF4DB6AC)))),
  42. )
  43. : Text(
  44. right ?? '',
  45. style: TextStyles.titC,
  46. maxLines: null,
  47. textAlign: TextAlign.right,
  48. ),
  49. ),
  50. ],
  51. ),
  52. );
  53. }
  54. }
  55. // 绿色圆点加标题
  56. class StoreHouseTit extends StatelessWidget {
  57. final String tit;
  58. const StoreHouseTit({super.key, required this.tit});
  59. @override
  60. Widget build(BuildContext context) {
  61. return Padding(
  62. padding: const EdgeInsets.only(left: 6),
  63. child: Row(
  64. children: [
  65. Container(
  66. width: 10,
  67. height: 10,
  68. decoration:const BoxDecoration(
  69. color: Color(0xFF4DB6AC),
  70. shape: BoxShape.circle,
  71. ),
  72. ),
  73. const SizedBox(width: 4),
  74. Text(tit,style: TextStyles.titA)
  75. ],
  76. ),
  77. );
  78. }
  79. }
  80. // const Color(0xFFE0F2F1) const Color(0xFF4DB6AC)
  81. // Text(right ?? '',style:const TextStyle(fontSize: 15,color: Color(0xFF4DB6AC