about_page.dart 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  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. Spacer(),
  119. Container(
  120. margin: EdgeInsets.only(bottom: 8.w),
  121. child: Text(
  122. StringName.developerName,
  123. style: TextStyle(
  124. fontSize: 12.sp,
  125. color: Colors.black.withAlpha(102),
  126. fontWeight: FontWeight.w400,
  127. ),
  128. ),
  129. ),
  130. Container(
  131. margin: EdgeInsets.only(bottom: 40.w),
  132. child: Text(
  133. StringName.recordNumber,
  134. style: TextStyle(
  135. fontSize: 12.sp,
  136. color: Colors.black.withAlpha(102),
  137. fontWeight: FontWeight.w400,
  138. ),
  139. ),
  140. ),
  141. ],
  142. ),
  143. ),
  144. ),
  145. IgnorePointer(
  146. child: Assets.images.bgMine.image(
  147. width: 360.w,
  148. height: 206.h,
  149. fit: BoxFit.fill,
  150. ),
  151. ),
  152. ],
  153. );
  154. }
  155. Widget _buildListItem(String title, {required VoidCallback onTap}) {
  156. return InkWell(
  157. // 效果
  158. onTap: onTap,
  159. child: Container(
  160. padding: EdgeInsets.symmetric(horizontal: 20.w, vertical: 12.h),
  161. child: Row(
  162. children: [
  163. Text(
  164. title,
  165. style: TextStyle(
  166. fontSize: 14.sp,
  167. color: Colors.black.withAlpha(204),
  168. ),
  169. ),
  170. const Spacer(),
  171. Assets.images.iconAboutArrowLeft.image(width: 20.w, height: 20.w),
  172. ],
  173. ),
  174. ),
  175. );
  176. }
  177. // 列表的线
  178. Widget _buildDivider() {
  179. return Container(
  180. margin: EdgeInsets.symmetric(horizontal: 20.w),
  181. decoration: ShapeDecoration(
  182. shape: RoundedRectangleBorder(
  183. side: BorderSide(
  184. width: 0.5.w,
  185. strokeAlign: BorderSide.strokeAlignCenter,
  186. color: Color(0xFFF5F4F9),
  187. ),
  188. ),
  189. ),
  190. );
  191. }
  192. }