auto_renewal_page.dart 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. import 'package:flutter/Material.dart';
  2. import 'package:flutter/src/widgets/framework.dart';
  3. import 'package:flutter_screenutil/flutter_screenutil.dart';
  4. import 'package:keyboard/base/base_controller.dart';
  5. import 'package:keyboard/base/base_page.dart';
  6. import 'package:get/get.dart';
  7. import 'package:keyboard/module/auto_renewal/auto_renewal_controller.dart';
  8. import 'package:keyboard/resource/assets.gen.dart';
  9. import '../../resource/string.gen.dart';
  10. import '../../router/app_pages.dart';
  11. import '../../utils/styles.dart';
  12. import '../../widget/commonAppBar.dart';
  13. class AutoRenewalPage extends BasePage<AutoRenewalController> {
  14. const AutoRenewalPage({super.key});
  15. static start() {
  16. Get.toNamed(RoutePath.autoRenewal);
  17. }
  18. @override
  19. Color backgroundColor() {
  20. return const Color(0xFFF6F5FA);
  21. }
  22. @override
  23. bool immersive() {
  24. return true;
  25. }
  26. @override
  27. Widget buildBody(BuildContext context) {
  28. return Scaffold(
  29. backgroundColor: backgroundColor(),
  30. appBar: CommonAppBar(
  31. title: StringName.autoRenewalManagement,
  32. backgroundColor: () {
  33. return Colors.transparent;
  34. },
  35. onBack: () {
  36. controller.clickBack();
  37. },
  38. ),
  39. body: Obx(() {
  40. return SizedBox(
  41. width: double.infinity,
  42. child:
  43. controller.hasAutoRenewal.value
  44. ? _hasAutoRenewal()
  45. : _notAutoRenewal(),
  46. );
  47. }),
  48. );
  49. }
  50. Widget _notAutoRenewal() {
  51. return Column(
  52. crossAxisAlignment: CrossAxisAlignment.center,
  53. children: [
  54. SizedBox(height: 200.h),
  55. Assets.images.iconAutoRenewalNotSign.image(width: 96.w, height: 96.w),
  56. Text(
  57. StringName.autoRenewalNoService,
  58. style: Styles.getTextStyleBlack204W400(14.sp),
  59. ),
  60. ],
  61. );
  62. }
  63. Widget _hasAutoRenewal() {
  64. return Container(
  65. margin: EdgeInsets.only(left: 16.w, right: 16.w),
  66. padding: EdgeInsets.only(left: 16.w, right: 10.w, top: 8.h, bottom: 8.h),
  67. decoration: ShapeDecoration(
  68. color: Colors.white,
  69. shape: RoundedRectangleBorder(
  70. borderRadius: BorderRadius.circular(12.r),
  71. ),
  72. ),
  73. child: Row(
  74. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  75. children: [
  76. Text(
  77. StringName.autoRenewalService,
  78. style: Styles.getTextStyleBlack204W400(14.sp),
  79. ),
  80. Material(
  81. color: Colors.transparent,
  82. child: InkWell(
  83. borderRadius: BorderRadius.circular(12.r),
  84. onTap: () {
  85. controller.clickUnSignAutoRenewal();
  86. },
  87. child: Container(
  88. padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 8.h),
  89. decoration: ShapeDecoration(
  90. shape: RoundedRectangleBorder(
  91. side: BorderSide(
  92. width: 1.w, color: const Color(0xFFD0D1D6)),
  93. borderRadius: BorderRadius.circular(12.r),
  94. ),
  95. ),
  96. child: Text(
  97. StringName.autoRenewalItemButtonDesc,
  98. style: Styles.getTextStyleBlack204W400(14.sp),
  99. textAlign: TextAlign.center,
  100. ),
  101. ),
  102. ),
  103. )
  104. ],
  105. ),
  106. );
  107. }
  108. }