setting_page.dart 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import 'package:cpt_auth/modules/setting/setting_state.dart';
  2. import 'package:cs_resources/generated/assets.dart';
  3. import 'package:flutter/material.dart';
  4. import 'package:plugin_basic/base/base_stateless_page.dart';
  5. import 'package:plugin_basic/basic_export.dart';
  6. import 'package:plugin_basic/utils/ext_get_nav.dart';
  7. import 'package:router/path/router_path.dart';
  8. import 'package:shared/utils/screen_util.dart';
  9. import 'package:widgets/ext/ex_widget.dart';
  10. import 'package:widgets/my_appbar.dart';
  11. import 'package:widgets/shatter/setting_item_container.dart';
  12. import 'setting_controller.dart';
  13. class SettingPage extends BaseStatelessPage<SettingController> {
  14. SettingPage({Key? key}) : super(key: key);
  15. //启动当前页面
  16. static void startInstance() {
  17. return Get.start(RouterPath.settings);
  18. }
  19. late SettingState state;
  20. @override
  21. void initState() {
  22. state = controller.state;
  23. }
  24. @override
  25. SettingController createRawController() {
  26. return SettingController();
  27. }
  28. @override
  29. Widget buildWidget(BuildContext context) {
  30. return Scaffold(
  31. extendBodyBehindAppBar: true,
  32. appBar: MyAppBar.appBar(context, "Settings".tr),
  33. body: SafeArea(
  34. bottom: true,
  35. top: false,
  36. child: Container(
  37. width: double.infinity,
  38. height: double.infinity,
  39. padding: EdgeInsets.only(top: kToolbarHeight + ScreenUtil.getStatusBarH(context) + 1),
  40. decoration: const BoxDecoration(
  41. gradient: LinearGradient(
  42. colors: [
  43. Color(0xFF091D44),
  44. Color(0xFF245A8A),
  45. Color(0xFF7F7CEC),
  46. ],
  47. begin: Alignment.topCenter,
  48. end: Alignment.bottomCenter,
  49. ),
  50. ),
  51. child: Column(children: [
  52. SizedBox(height: 10),
  53. // SettingItemContainer(iconPath: Assets.mainSettingSwitchProject, title: "Switch Projects".tr).onTap(() {
  54. // controller.switchProjects();
  55. // }),
  56. SettingItemContainer(iconPath: Assets.mainSettingResetPassword, title: "Reset Password".tr).onTap(() {
  57. controller.gotoResetPasswordPage();
  58. }),
  59. SettingItemContainer(iconPath: Assets.mainSettingAccountDelectivation, title: "Account Deactivation".tr).onTap(() {
  60. controller.doAccountDelete();
  61. }),
  62. SettingItemContainer(iconPath: Assets.mainSettingLogOut, title: "Logout".tr).onTap(() {
  63. controller.doLogout();
  64. }),
  65. ]),
  66. ),
  67. ),
  68. );
  69. }
  70. }