You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

156 lines
3.8KB

  1. import 'package:flutter/material.dart';
  2. import '../../../../themes/app_colors.dart';
  3. import '../../../../themes/styles_text.dart';
  4. class ItemCodeTimeline extends StatelessWidget {
  5. final Function onPressed;
  6. const ItemCodeTimeline({
  7. super.key,
  8. required this.onPressed,
  9. });
  10. @override
  11. Widget build(BuildContext context) {
  12. return Container(
  13. child: Stack(
  14. children: [
  15. Row(
  16. children: [
  17. const SizedBox(
  18. width: 16,
  19. height: 20,
  20. ),
  21. Expanded(child: _widgetTimeLine()),
  22. ],
  23. ),
  24. Positioned(
  25. top: 0,
  26. left: 8,
  27. child: Container(
  28. color: Colors.white,
  29. width: 16,
  30. height: 24,
  31. child: Column(
  32. children: [
  33. Container(
  34. width: 16,
  35. height: 16,
  36. decoration: BoxDecoration(
  37. borderRadius: BorderRadius.circular(
  38. 16,
  39. ),
  40. color: Colors.green,
  41. ),
  42. ),
  43. ],
  44. ),
  45. ),
  46. ),
  47. ],
  48. ),
  49. );
  50. }
  51. Widget _widgetTimeLine() {
  52. return Container(
  53. width: double.infinity,
  54. padding: const EdgeInsets.only(
  55. left: 12,
  56. right: 8,
  57. ),
  58. margin: const EdgeInsets.only(
  59. bottom: 8,
  60. ),
  61. decoration: BoxDecoration(
  62. border: Border(
  63. left: BorderSide(color: Colors.blue),
  64. ),
  65. ),
  66. child: Column(
  67. children: [
  68. Row(
  69. mainAxisAlignment: MainAxisAlignment.start,
  70. children: [
  71. Text(
  72. 'ss - ',
  73. style: StylesText.body5,
  74. ),
  75. Text(
  76. '20/22/2202',
  77. style: StylesText.caption3.copyWith(),
  78. )
  79. ],
  80. ),
  81. const SizedBox(
  82. height: 8,
  83. ),
  84. _widgetItemInfoCompleted(
  85. title: 'title',
  86. actionDate: '2/2/2023',
  87. nguoiThucHiens: 'nguoi thuc hien',
  88. ),
  89. ],
  90. ),
  91. );
  92. }
  93. Widget _widgetItemInfoCompleted({
  94. required String title,
  95. required String actionDate,
  96. String? nguoiThucHiens,
  97. }) {
  98. return Container(
  99. padding: const EdgeInsets.all(8),
  100. decoration: BoxDecoration(
  101. borderRadius: BorderRadius.circular(8),
  102. color: AppColors.background1,
  103. ),
  104. child: Column(
  105. mainAxisAlignment: MainAxisAlignment.start,
  106. children: [
  107. Row(
  108. children: [
  109. Expanded(
  110. child: Text(
  111. title,
  112. style: StylesText.caption2.copyWith(
  113. color: AppColors.neutral1,
  114. ),
  115. ),
  116. ),
  117. Text(
  118. actionDate,
  119. style: StylesText.caption3.copyWith(
  120. color: AppColors.neutral1,
  121. ),
  122. ),
  123. ],
  124. ),
  125. Padding(
  126. padding: const EdgeInsets.symmetric(vertical: 8.0),
  127. child: Row(
  128. children: [
  129. Expanded(
  130. child: Text(
  131. 'Người thực hiện',
  132. style: StylesText.caption2.copyWith(
  133. color: AppColors.neutral1,
  134. ),
  135. ),
  136. ),
  137. Text(
  138. nguoiThucHiens ?? '',
  139. style: StylesText.caption3.copyWith(
  140. color: AppColors.neutral1,
  141. ),
  142. ),
  143. ],
  144. ),
  145. ),
  146. ],
  147. ),
  148. );
  149. }
  150. }