services_detail_page.dart 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. import 'package:cpt_services/modules/services_contact/services_contact_page.dart';
  2. import 'package:cs_resources/theme/app_colors_theme.dart';
  3. import 'package:flutter/material.dart';
  4. import 'package:auto_route/auto_route.dart';
  5. import 'package:hooks_riverpod/hooks_riverpod.dart';
  6. import 'package:router/ext/auto_router_extensions.dart';
  7. import 'package:shared/utils/log_utils.dart';
  8. import 'package:shared/utils/color_utils.dart';
  9. import 'package:widgets/ext/ex_widget.dart';
  10. import 'package:widgets/my_appbar.dart';
  11. import 'package:widgets/my_load_image.dart';
  12. import 'package:widgets/my_text_view.dart';
  13. import 'package:widgets/widget_export.dart';
  14. import 'package:cs_resources/generated/assets.dart';
  15. import '../../../router/page/services_page_router.dart';
  16. import './services_detail_vm.dart';
  17. @RoutePage()
  18. class ServicesDetailPage extends HookConsumerWidget {
  19. const ServicesDetailPage({Key? key}) : super(key: key);
  20. //启动当前页面
  21. static void startInstance({BuildContext? context}) {
  22. if (context != null) {
  23. context.router.push(const ServicesDetailPageRoute());
  24. } else {
  25. appRouter.push(const ServicesDetailPageRoute());
  26. }
  27. }
  28. Widget _buildDetailTop(BuildContext context, WidgetRef ref, _vm) {
  29. // List itemsList = _vm.state.list.toList();
  30. return Column(
  31. children: [
  32. const Column(children: [
  33. MyAssetImage(
  34. Assets.propertyHomeLoanBg,
  35. // width: 15,
  36. // height: 15,
  37. ),
  38. ]),
  39. Column(
  40. crossAxisAlignment: CrossAxisAlignment.start,
  41. mainAxisAlignment: MainAxisAlignment.start,
  42. children: [
  43. const Text(
  44. 'IMPORTANT',
  45. style: TextStyle(
  46. fontSize: 18.0,
  47. color: Colors.black,
  48. fontWeight: FontWeight.w700), // 设置字体大小
  49. ).marginOnly(bottom: 15),
  50. Row(children: [
  51. SizedBox(
  52. width: 100,
  53. height: 16,
  54. child: ListView.builder(
  55. scrollDirection: Axis.horizontal,
  56. itemCount: 5,
  57. itemBuilder: (context, index) {
  58. return MyAssetImage(
  59. 4.1 >= index + 1
  60. ? Assets.serviceServiceScoreYes
  61. : Assets.serviceServiceScoreNo,
  62. width: 16.5,
  63. height: 15.5,
  64. ).marginOnly(right: 4);
  65. }),
  66. ),
  67. const Text(
  68. "4.1",
  69. style: TextStyle(
  70. fontSize: 16.0,
  71. color: Colors.black,
  72. fontWeight: FontWeight.w500), // 设置字体大小
  73. ).marginOnly(left: 5),
  74. ]).marginOnly(bottom: 25),
  75. const Text(
  76. 'Dear Residents,STANDARD OPERATING PROCEDURE FORREPLACEMENT VEHICLES ANDOVERNICHT PARKING VEHICLES',
  77. style: TextStyle(
  78. fontSize: 15.0,
  79. color: Colors.black,
  80. fontWeight: FontWeight.w400), // 设置字体大小
  81. ),
  82. ],
  83. ).paddingOnly(top: 15, bottom: 50, left: 15, right: 15),
  84. ],
  85. );
  86. }
  87. @override
  88. Widget build(BuildContext context, WidgetRef ref) {
  89. final _vm = ref.read(servicesDetailVmProvider.notifier);
  90. return Scaffold(
  91. appBar: MyAppBar.appBar(
  92. context,
  93. "Lift Padding",
  94. backgroundColor: context.appColors.whiteBG,
  95. ),
  96. body: Column(children: [
  97. Expanded(
  98. child: SingleChildScrollView(
  99. scrollDirection: Axis.vertical,
  100. physics: const BouncingScrollPhysics(),
  101. clipBehavior: Clip.none,
  102. child: _buildDetailTop(context, ref, _vm)),
  103. ),
  104. Container(
  105. height: 50,
  106. color: ColorUtils.string2Color('#4161D0'),
  107. child: Flex(
  108. direction: Axis.horizontal,
  109. children: [
  110. Expanded(
  111. flex: 1,
  112. child: Container(
  113. color: ColorUtils.string2Color('#4161D0'),
  114. height: 100,
  115. child: Row(
  116. mainAxisAlignment: MainAxisAlignment.center,
  117. crossAxisAlignment: CrossAxisAlignment.center,
  118. children: [
  119. MyTextView(
  120. "About",
  121. fontSize: 16,
  122. textColor: Colors.white,
  123. isFontMedium: true,
  124. ),
  125. ],
  126. ),
  127. ).onTap(() {
  128. // 去详情
  129. Navigator.push(
  130. context,
  131. MaterialPageRoute(
  132. builder: (context) => const ServicesContactPage()),
  133. );
  134. }),
  135. ),
  136. Expanded(
  137. flex: 1,
  138. child: Container(
  139. color: ColorUtils.string2Color('#FE6C00'),
  140. height: 100,
  141. child: Row(
  142. mainAxisAlignment: MainAxisAlignment.center,
  143. crossAxisAlignment: CrossAxisAlignment.center,
  144. children: [
  145. MyTextView(
  146. "Content",
  147. fontSize: 16,
  148. textColor: Colors.white,
  149. isFontMedium: true,
  150. ),
  151. ],
  152. ),
  153. ),
  154. ),
  155. ],
  156. ),
  157. )
  158. ]),
  159. );
  160. }
  161. }