tenant_doc_page.dart 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. import 'package:cs_resources/generated/l10n.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:widgets/ext/ex_widget.dart';
  8. import 'package:widgets/my_appbar.dart';
  9. import 'package:widgets/my_button.dart';
  10. import 'package:widgets/my_text_view.dart';
  11. import 'package:plugin_platform/platform_export.dart';
  12. import '../../router/page/auth_page_router.dart';
  13. import 'tenant_doc_view_model.dart';
  14. @RoutePage()
  15. class TenantDocPage extends HookConsumerWidget {
  16. TenantDocPage({Key? key}) : super(key: key);
  17. //启动当前页面
  18. static void startInstance({BuildContext? context}) {
  19. if (context != null) {
  20. context.router.push(TenantDocPageRoute());
  21. } else {
  22. appRouter.push(TenantDocPageRoute());
  23. }
  24. }
  25. @override
  26. Widget build(BuildContext context, WidgetRef ref) {
  27. final viewModel = ref.read(tenantDocViewModelProvider.notifier);
  28. final state = ref.watch(tenantDocViewModelProvider);
  29. return Scaffold(
  30. appBar: MyAppBar.appBar(
  31. context,
  32. "",
  33. ),
  34. backgroundColor: context.appColors.backgroundDefault,
  35. body: Container(
  36. padding: const EdgeInsets.symmetric(horizontal: 15),
  37. width: double.infinity,
  38. child: Column(
  39. mainAxisSize: MainAxisSize.max,
  40. crossAxisAlignment: CrossAxisAlignment.start,
  41. children: [
  42. SingleChildScrollView(
  43. scrollDirection: Axis.vertical,
  44. physics: const BouncingScrollPhysics(),
  45. child: Column(
  46. crossAxisAlignment: CrossAxisAlignment.start,
  47. children: [
  48. MyTextView(
  49. S.current.upload_documents,
  50. fontSize: 23.5,
  51. marginTop: 23,
  52. marginBottom: 21,
  53. textAlign: TextAlign.center,
  54. isFontMedium: true,
  55. textColor: context.appColors.textBlack,
  56. ),
  57. MyTextView(
  58. S.current.upload_doc_desc,
  59. fontSize: 15,
  60. isFontMedium: true,
  61. textColor: context.appColors.textBlack,
  62. ),
  63. MyTextView(
  64. S.current.upload_doc_desc1,
  65. fontSize: 15,
  66. marginTop: 22,
  67. isFontMedium: true,
  68. textColor: context.appColors.textBlack,
  69. ),
  70. MyTextView(
  71. S.current.upload_doc_desc2,
  72. fontSize: 15,
  73. marginTop: 22,
  74. marginBottom: 24,
  75. isFontMedium: true,
  76. textColor: context.appColors.textBlack,
  77. ),
  78. ImageNineGrid(
  79. isSelectEnable: true,
  80. maxImages: 3,
  81. spacing: 10,
  82. aspectRatio: 108 / 80,
  83. initialImages: [],
  84. onImagesChanged: (list) {
  85. viewModel.setDocList(list);
  86. },
  87. ),
  88. ],
  89. )).expanded(),
  90. //底部的按钮
  91. MyButton(
  92. onPressed: viewModel.submitDoc,
  93. text: S.current.next,
  94. textColor: Colors.white,
  95. backgroundColor: context.appColors.btnBgDefault,
  96. fontWeight: FontWeight.w500,
  97. type: ClickType.throttle,
  98. fontSize: 16,
  99. minHeight: 50,
  100. radius: 5,
  101. ).marginOnly(top: 50, bottom: 50, left: 18, right: 18),
  102. ],
  103. ),
  104. ),
  105. );
  106. }
  107. }