contact_view.dart 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. import 'package:clean/base/base_page.dart';
  2. import 'package:clean/data/consts/event_report_id.dart';
  3. import 'package:clean/handler/event_handler.dart';
  4. import 'package:clean/module/contact/contact_controller.dart';
  5. import 'package:clean/module/more/more_controller.dart';
  6. import 'package:clean/resource/assets.gen.dart';
  7. import 'package:clean/router/app_pages.dart';
  8. import 'package:flutter/Material.dart';
  9. import 'package:flutter_screenutil/flutter_screenutil.dart';
  10. import 'package:get/get.dart';
  11. class ContactPage extends BasePage<ContactController> {
  12. const ContactPage({super.key});
  13. @override
  14. bool immersive() {
  15. return true;
  16. }
  17. @override
  18. bool statusBarDarkFont() => false;
  19. @override
  20. Widget buildBody(BuildContext context) {
  21. controller.init();
  22. return Stack(
  23. children: [
  24. buildMain(context),
  25. IgnorePointer(
  26. child: Assets.images.bgHome.image(
  27. width: 360.w,
  28. ),
  29. ),
  30. ],
  31. );
  32. }
  33. Widget buildMain(BuildContext context) {
  34. return SafeArea(
  35. child: Container(
  36. padding: EdgeInsets.only(left: 16.w, top: 14.h, right: 16.w),
  37. child: Column(
  38. mainAxisAlignment: MainAxisAlignment.start,
  39. crossAxisAlignment: CrossAxisAlignment.start,
  40. children: [
  41. Row(
  42. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  43. children: [
  44. GestureDetector(
  45. onTap: () {
  46. Get.back();
  47. },
  48. child: Assets.images.iconCommonBack
  49. .image(width: 28.w, height: 28.w),
  50. ),
  51. ],
  52. ),
  53. SizedBox(
  54. height: 12.h,
  55. ),
  56. Row(
  57. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  58. children: [
  59. Text(
  60. "Manage Contacts",
  61. style: TextStyle(
  62. color: Colors.white,
  63. fontWeight: FontWeight.w700,
  64. fontSize: 24.sp,
  65. ),
  66. ),
  67. ],
  68. ),
  69. SizedBox(
  70. height: 25.h,
  71. ),
  72. Center(
  73. child: Assets.images.iconContactMain
  74. .image(width: 138.w, height: 138.w),
  75. ),
  76. SizedBox(
  77. height: 33.h,
  78. ),
  79. Row(
  80. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  81. children: [
  82. _buildContactBtn(
  83. "All Contacts",
  84. Assets.images.iconContactAll.image(
  85. width: 40.w,
  86. height: 40.w,
  87. ),
  88. onTap: () {
  89. EventHandler.report(EventId.event_08001);
  90. Get.toNamed(RoutePath.contactAll);
  91. },
  92. ),
  93. _buildContactBtn(
  94. "Duplicate",
  95. Assets.images.iconContactDuplicate.image(
  96. width: 40.w,
  97. height: 40.w,
  98. ),
  99. onTap: () {
  100. EventHandler.report(EventId.event_08004);
  101. Get.toNamed(RoutePath.contactDuplicate);
  102. },
  103. ),
  104. ],
  105. ),
  106. SizedBox(
  107. height: 16.h,
  108. ),
  109. Row(
  110. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  111. children: [
  112. _buildContactBtn(
  113. "Incomplete",
  114. Assets.images.iconContactIncomplete.image(
  115. width: 40.w,
  116. height: 40.w,
  117. ),
  118. onTap: () {
  119. EventHandler.report(EventId.event_08007);
  120. Get.toNamed(RoutePath.contactIncomplete);
  121. },
  122. ),
  123. _buildContactBtn(
  124. "Backup",
  125. Assets.images.iconContactBackup.image(
  126. width: 40.w,
  127. height: 40.w,
  128. ),
  129. onTap: () {
  130. EventHandler.report(EventId.event_08010);
  131. Get.toNamed(RoutePath.contactBackup);
  132. },
  133. ),
  134. ],
  135. ),
  136. ],
  137. ),
  138. ),
  139. );
  140. }
  141. Widget _buildContactBtn(String title, Image image, {required Function() onTap}) {
  142. return GestureDetector(
  143. onTap: onTap,
  144. child: Container(
  145. width: 156.w,
  146. height: 101.h,
  147. decoration: BoxDecoration(
  148. color: Colors.white.withOpacity(0.12),
  149. borderRadius: BorderRadius.all(Radius.circular(14.r)),
  150. ),
  151. child: Column(
  152. mainAxisAlignment: MainAxisAlignment.spaceEvenly,
  153. children: [
  154. image,
  155. Text(
  156. title,
  157. style: TextStyle(
  158. color: Colors.white.withOpacity(0.9),
  159. fontSize: 16.sp,
  160. fontWeight: FontWeight.w500,
  161. ),
  162. ),
  163. ],
  164. ),
  165. ),
  166. );
  167. }
  168. }