home_page.dart 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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:widgets/ext/ex_widget.dart';
  8. @RoutePage()
  9. class HomePage extends HookConsumerWidget {
  10. const HomePage({super.key});
  11. @override
  12. Widget build(BuildContext context, WidgetRef ref) {
  13. return Scaffold(
  14. appBar: AppBar(title: Text("Home")),
  15. body: Center(
  16. child: Column(
  17. children: [
  18. Row(
  19. mainAxisAlignment: MainAxisAlignment.spaceAround,
  20. children: [
  21. ElevatedButton(
  22. onPressed: () {},
  23. child: Text(S.of(context).payment), //国际化中英文适配
  24. ),
  25. ElevatedButton(
  26. onPressed: () {},
  27. child: Text(S.of(context).rewards),
  28. ),
  29. ElevatedButton(
  30. onPressed: () {},
  31. child: Text(S.of(context).notification),
  32. ),
  33. ],
  34. ).marginOnly(top: 10),
  35. Row(
  36. mainAxisAlignment: MainAxisAlignment.spaceAround,
  37. children: [
  38. ElevatedButton(
  39. onPressed: () {},
  40. child: Text(S.of(context).facility),
  41. ),
  42. ElevatedButton(
  43. onPressed: () {},
  44. child: Text(S.of(context).form),
  45. ),
  46. ElevatedButton(
  47. onPressed: () {},
  48. child: Text(S.of(context).notice_board),
  49. ),
  50. ],
  51. ).marginOnly(top: 10),
  52. Row(
  53. mainAxisAlignment: MainAxisAlignment.spaceAround,
  54. children: [
  55. ElevatedButton(
  56. onPressed: () {},
  57. child: Text('Property'),
  58. ),
  59. ElevatedButton(
  60. onPressed: () {},
  61. child: Text('Service'),
  62. ),
  63. ElevatedButton(
  64. onPressed: () {},
  65. child: Text('Community'),
  66. ),
  67. ],
  68. ).marginOnly(top: 10),
  69. ],
  70. ),
  71. ),
  72. );
  73. }
  74. }