home_page.dart 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. import 'package:cpt_main/modules/visitor/page/visitor_page.dart';
  2. import 'package:cs_resources/generated/l10n.dart';
  3. import 'package:flutter/material.dart';
  4. import 'package:flutter/src/widgets/framework.dart';
  5. import 'package:hooks_riverpod/hooks_riverpod.dart';
  6. import 'package:auto_route/auto_route.dart';
  7. import 'package:router/componentRouter/component_service_manager.dart';
  8. import 'package:widgets/ext/ex_widget.dart';
  9. @RoutePage()
  10. class HomePage extends HookConsumerWidget {
  11. const HomePage({super.key});
  12. @override
  13. Widget build(BuildContext context, WidgetRef ref) {
  14. return Scaffold(
  15. appBar: AppBar(title: Text("Home")),
  16. body: Center(
  17. child: Column(
  18. children: [
  19. Row(
  20. mainAxisAlignment: MainAxisAlignment.spaceAround,
  21. children: [
  22. ElevatedButton(
  23. onPressed: () {
  24. ComponentServiceManager().paymentService.startPaymentPage();
  25. },
  26. child: Text(S.of(context).payment), //国际化中英文适配
  27. ),
  28. ElevatedButton(
  29. onPressed: () {
  30. ComponentServiceManager().rewardsService.startRewardsPage();
  31. },
  32. child: Text(S.of(context).rewards),
  33. ),
  34. ElevatedButton(
  35. onPressed: () {},
  36. child: Text(S.of(context).notification),
  37. ),
  38. ],
  39. ).marginOnly(top: 10),
  40. Row(
  41. mainAxisAlignment: MainAxisAlignment.spaceAround,
  42. children: [
  43. ElevatedButton(
  44. onPressed: () {
  45. ComponentServiceManager().facilityService.startFacilityPage();
  46. },
  47. child: Text(S.of(context).facility),
  48. ),
  49. ElevatedButton(
  50. onPressed: () {
  51. ComponentServiceManager().formService.startFormPage();
  52. },
  53. child: Text(S.of(context).form),
  54. ),
  55. ElevatedButton(
  56. onPressed: () {
  57. ComponentServiceManager().noticeBoardService.startNoticeBoardPage();
  58. },
  59. child: Text(S.of(context).notice_board),
  60. ),
  61. ],
  62. ).marginOnly(top: 10),
  63. Row(
  64. mainAxisAlignment: MainAxisAlignment.spaceAround,
  65. children: [
  66. ElevatedButton(
  67. onPressed: () {
  68. ComponentServiceManager().propertyService.startPropertyPage();
  69. },
  70. child: Text('Property'),
  71. ),
  72. ElevatedButton(
  73. onPressed: () {
  74. ComponentServiceManager().servicesService.startServicePage();
  75. },
  76. child: Text('Service'),
  77. ),
  78. ElevatedButton(
  79. onPressed: () {
  80. ComponentServiceManager().communityService.startCommunityPage();
  81. },
  82. child: Text('Community'),
  83. ),
  84. ],
  85. ).marginOnly(top: 10),
  86. Row(
  87. mainAxisAlignment: MainAxisAlignment.spaceAround,
  88. children: [
  89. ElevatedButton(
  90. onPressed: () {
  91. ComponentServiceManager().authService.startLoginPage();
  92. },
  93. child: Text('Login'),
  94. ),
  95. ElevatedButton(
  96. onPressed: () {
  97. ComponentServiceManager().authService.startResetPasswordPage();
  98. },
  99. child: Text('Forgot'),
  100. ),
  101. ElevatedButton(
  102. onPressed: () {},
  103. child: Text('Setting'),
  104. ),
  105. ],
  106. ).marginOnly(top: 10),
  107. ],
  108. ),
  109. ),
  110. );
  111. }
  112. }