contact_view.dart 4.7 KB

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