about_page.dart 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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. color: Colors.grey[200],
  51. borderRadius: BorderRadius.circular(16),
  52. ),
  53. ),
  54. SizedBox(height: 21.h),
  55. Text(
  56. StringName.appName,
  57. style: TextStyle(
  58. color: Colors.black.withAlpha(204),
  59. fontSize: 26.sp,
  60. fontWeight: FontWeight.w500,
  61. ),
  62. ),
  63. SizedBox(height: 6.h),
  64. // 版本号
  65. Text(
  66. '${StringName.currentVersion} ${appInfoUtil.appVersionName}',
  67. style: TextStyle(
  68. fontSize: 12.sp,
  69. color: Colors.black.withAlpha(102),
  70. fontWeight: FontWeight.w400,
  71. ),
  72. ),
  73. ],
  74. ),
  75. ),
  76. Container(
  77. margin: EdgeInsets.symmetric(
  78. horizontal: 16.w,
  79. vertical: 28.h,
  80. ),
  81. padding: EdgeInsets.symmetric(vertical: 8.h),
  82. decoration: BoxDecoration(
  83. color: Colors.white,
  84. borderRadius: BorderRadius.circular(12.r),
  85. ),
  86. child: Column(
  87. children: [
  88. _buildListItem(
  89. StringName.privacyPolicy,
  90. onTap: controller.clickPrivacyPolicy,
  91. ),
  92. _buildDivider(),
  93. _buildListItem(
  94. StringName.serviceTerms,
  95. onTap: controller.clickServiceAgreement,
  96. ),
  97. _buildDivider(),
  98. _buildListItem(
  99. StringName.childPrivacyPolicy,
  100. onTap: controller.clickChildPrivacyPolicy,
  101. ),
  102. ],
  103. ),
  104. ),
  105. ],
  106. ),
  107. ),
  108. ),
  109. IgnorePointer(
  110. child: Assets.images.bgMine.image(
  111. width: 360.w,
  112. height: 206.h,
  113. fit: BoxFit.fill,
  114. ),
  115. ),
  116. ],
  117. );
  118. }
  119. Widget _buildListItem(String title, {required VoidCallback onTap}) {
  120. return InkWell(
  121. // 效果
  122. onTap: onTap,
  123. child: Container(
  124. padding: EdgeInsets.symmetric(horizontal: 20.w, vertical: 12.h),
  125. child: Row(
  126. children: [
  127. Text(
  128. title,
  129. style: TextStyle(
  130. fontSize: 14.sp,
  131. color: Colors.black.withAlpha(204),
  132. ),
  133. ),
  134. const Spacer(),
  135. Assets.images.iconAboutArrowLeft.image(width: 20.w, height: 20.w),
  136. ],
  137. ),
  138. ),
  139. );
  140. }
  141. // 列表的线
  142. Widget _buildDivider() {
  143. return Container(
  144. margin: EdgeInsets.symmetric(horizontal: 20.w),
  145. decoration: ShapeDecoration(
  146. shape: RoundedRectangleBorder(
  147. side: BorderSide(
  148. width: 1,
  149. strokeAlign: BorderSide.strokeAlignCenter,
  150. color: Color(0xFFF5F4F9),
  151. ),
  152. ),
  153. ),
  154. );
  155. }
  156. }