about_page.dart 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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/resource/string.gen.dart';
  5. import '../../base/base_page.dart';
  6. import '../../resource/assets.gen.dart';
  7. import '../../router/app_pages.dart';
  8. import '../../utils/app_info_util.dart';
  9. import '../../widget/commonAppBar.dart';
  10. import 'about_controller.dart';
  11. import 'package:get/get.dart';
  12. class AboutPage extends BasePage<AboutController> {
  13. const AboutPage({super.key});
  14. static start() {
  15. Get.toNamed(RoutePath.about);
  16. }
  17. @override
  18. Color backgroundColor() {
  19. return const Color(0xFFF6F5FA);
  20. }
  21. @override
  22. bool immersive() {
  23. return true;
  24. }
  25. @override
  26. Widget buildBody(BuildContext context) {
  27. return Stack(
  28. children: [
  29. Scaffold(
  30. appBar: CommonAppBar(
  31. title: StringName.aboutUs,
  32. backgroundColor: backgroundColor,
  33. onBack: () {
  34. controller.clickBack();
  35. },
  36. ),
  37. body: Container(
  38. color: backgroundColor(),
  39. child: Column(
  40. children: [
  41. Container(
  42. margin: EdgeInsets.only(top: 40.w),
  43. child: Column(
  44. children: [
  45. // icon
  46. Container(
  47. width: 72.w,
  48. height: 72.w,
  49. decoration: BoxDecoration(
  50. borderRadius: BorderRadius.circular(16.r),
  51. ),
  52. child: Assets.images.iconAppLogo.image(
  53. width: 72.w,
  54. height: 72.w,
  55. ),
  56. ),
  57. SizedBox(height: 21.h),
  58. Text(
  59. StringName.appName,
  60. style: TextStyle(
  61. color: Colors.black.withAlpha(204),
  62. fontSize: 26.sp,
  63. fontWeight: FontWeight.w500,
  64. ),
  65. ),
  66. SizedBox(height: 6.h),
  67. // 版本号
  68. Text(
  69. '${StringName.currentVersion} ${appInfoUtil.appVersionName}',
  70. style: TextStyle(
  71. fontSize: 12.sp,
  72. color: Colors.black.withAlpha(102),
  73. fontWeight: FontWeight.w400,
  74. ),
  75. ),
  76. ],
  77. ),
  78. ),
  79. Container(
  80. margin: EdgeInsets.symmetric(
  81. horizontal: 16.w,
  82. vertical: 28.h,
  83. ),
  84. padding: EdgeInsets.symmetric(vertical: 8.h),
  85. decoration: BoxDecoration(
  86. color: Colors.white,
  87. borderRadius: BorderRadius.circular(12.r),
  88. ),
  89. child: Column(
  90. children: [
  91. _buildListItem(
  92. StringName.privacyPolicy,
  93. onTap: controller.clickPrivacyPolicy,
  94. ),
  95. _buildDivider(),
  96. _buildListItem(
  97. StringName.serviceTerms,
  98. onTap: controller.clickServiceAgreement,
  99. ),
  100. _buildDivider(),
  101. _buildListItem(
  102. StringName.childPrivacyPolicy,
  103. onTap: controller.clickChildPrivacyPolicy,
  104. ),
  105. _buildDivider(),
  106. _buildListItem(
  107. StringName.thirdPartyList,
  108. onTap: controller.clickThirdParty,
  109. ),
  110. _buildDivider(),
  111. _buildListItem(
  112. StringName.personalInfo,
  113. onTap: controller.clickPersonalInformation,
  114. ),
  115. ],
  116. ),
  117. ),
  118. ],
  119. ),
  120. ),
  121. ),
  122. IgnorePointer(
  123. child: Assets.images.bgMine.image(
  124. width: 360.w,
  125. height: 206.h,
  126. fit: BoxFit.fill,
  127. ),
  128. ),
  129. ],
  130. );
  131. }
  132. Widget _buildListItem(String title, {required VoidCallback onTap}) {
  133. return InkWell(
  134. // 效果
  135. onTap: onTap,
  136. child: Container(
  137. padding: EdgeInsets.symmetric(horizontal: 20.w, vertical: 12.h),
  138. child: Row(
  139. children: [
  140. Text(
  141. title,
  142. style: TextStyle(
  143. fontSize: 14.sp,
  144. color: Colors.black.withAlpha(204),
  145. ),
  146. ),
  147. const Spacer(),
  148. Assets.images.iconAboutArrowLeft.image(width: 20.w, height: 20.w),
  149. ],
  150. ),
  151. ),
  152. );
  153. }
  154. // 列表的线
  155. Widget _buildDivider() {
  156. return Container(
  157. margin: EdgeInsets.symmetric(horizontal: 20.w),
  158. decoration: ShapeDecoration(
  159. shape: RoundedRectangleBorder(
  160. side: BorderSide(
  161. width: 0.5.w,
  162. strokeAlign: BorderSide.strokeAlignCenter,
  163. color: Color(0xFFF5F4F9),
  164. ),
  165. ),
  166. ),
  167. );
  168. }
  169. }