storehouse_item.dart 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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 Container(
  62. height: 44,
  63. decoration: const BoxDecoration(
  64. borderRadius: BorderRadius.all(Radius.circular(12)),
  65. gradient: LinearGradient(
  66. begin: Alignment.topCenter,
  67. end: Alignment.bottomCenter,
  68. colors: [Color.fromARGB(255, 224, 245, 255), Color(0xFFFFFFFF)])),
  69. // padding: const EdgeInsets.only(left: 6),
  70. child: Row(
  71. children: [
  72. Container(
  73. width: 3,
  74. height: 18,
  75. decoration: const BoxDecoration(
  76. color: Color(0xFF60B5F4), borderRadius: BorderRadius.all(Radius.circular(2))),
  77. ),
  78. const SizedBox(width: 4),
  79. Text(tit, style: const TextStyle(fontSize: 15, fontWeight: FontWeight.w600))
  80. ],
  81. ),
  82. );
  83. }
  84. }
  85. class SHImageAndNameWidget extends StatelessWidget {
  86. final String image;
  87. final String title;
  88. final String? content;
  89. final String imageR;
  90. final String titleR;
  91. final String? contentR;
  92. final double fontSize;
  93. const SHImageAndNameWidget(
  94. {super.key,
  95. required this.image,
  96. required this.title,
  97. required this.content,
  98. required this.fontSize,
  99. required this.imageR,
  100. required this.titleR,
  101. required this.contentR});
  102. @override
  103. Widget build(BuildContext context) {
  104. return Padding(
  105. padding: const EdgeInsets.all(12.0),
  106. child: Row(
  107. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  108. children: [
  109. Flexible(
  110. flex: 5,
  111. child: Row(
  112. children: [
  113. Image.asset(
  114. image,
  115. width: 32,
  116. height: 32,
  117. ),
  118. const SizedBox(
  119. width: 6,
  120. ),
  121. Expanded(
  122. child: Column(
  123. crossAxisAlignment: CrossAxisAlignment.start,
  124. children: [
  125. Text(
  126. title,
  127. style: TextStyle(
  128. fontWeight: FontWeight.bold, fontSize: fontSize, color: Colors.grey),
  129. ),
  130. Text(
  131. content ?? '',
  132. style: TextStyle(fontWeight: FontWeight.bold, fontSize: fontSize),
  133. )
  134. ],
  135. ),
  136. )
  137. ],
  138. ),
  139. ),
  140. Flexible(
  141. flex: 4,
  142. child: Row(
  143. children: [
  144. Image.asset(
  145. imageR,
  146. width: 32,
  147. height: 32,
  148. ),
  149. const SizedBox(
  150. width: 6,
  151. ),
  152. Expanded(
  153. child: Column(
  154. crossAxisAlignment: CrossAxisAlignment.start,
  155. children: [
  156. Text(
  157. titleR,
  158. style: TextStyle(
  159. fontWeight: FontWeight.bold, fontSize: fontSize, color: Colors.grey),
  160. ),
  161. Text(
  162. contentR ?? '',
  163. style: TextStyle(fontWeight: FontWeight.bold, fontSize: fontSize),
  164. )
  165. ],
  166. ),
  167. )
  168. ],
  169. ),
  170. )
  171. ],
  172. ),
  173. );
  174. }
  175. }
  176. // const Color(0xFFE0F2F1) const Color(0xFF4DB6AC)
  177. // Text(right ?? '',style:const TextStyle(fontSize: 15,color: Color(0xFF4DB6AC