contact_view.dart 4.5 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. },
  98. ),
  99. ],
  100. ),
  101. SizedBox(
  102. height: 16.h,
  103. ),
  104. Row(
  105. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  106. children: [
  107. _buildContactBtn(
  108. "Incomplete",
  109. Assets.images.iconContactIncomplete.image(
  110. width: 40.w,
  111. height: 40.w,
  112. ),
  113. onTap: () {
  114. },
  115. ),
  116. _buildContactBtn(
  117. "Backup",
  118. Assets.images.iconContactBackup.image(
  119. width: 40.w,
  120. height: 40.w,
  121. ),
  122. onTap: () {
  123. },
  124. ),
  125. ],
  126. ),
  127. ],
  128. ),
  129. ),
  130. );
  131. }
  132. Widget _buildContactBtn(String title, Image image, {required Function() onTap}) {
  133. return GestureDetector(
  134. onTap: onTap,
  135. child: Container(
  136. width: 156.w,
  137. height: 101.h,
  138. decoration: BoxDecoration(
  139. color: Colors.white.withOpacity(0.12),
  140. borderRadius: BorderRadius.all(Radius.circular(14.r)),
  141. ),
  142. child: Column(
  143. mainAxisAlignment: MainAxisAlignment.spaceEvenly,
  144. children: [
  145. image,
  146. Text(
  147. title,
  148. style: TextStyle(
  149. color: Colors.white.withOpacity(0.9),
  150. fontSize: 16.sp,
  151. fontWeight: FontWeight.w500,
  152. ),
  153. ),
  154. ],
  155. ),
  156. ),
  157. );
  158. }
  159. }