select_country_page.dart 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. import 'package:cpt_auth/modules/select_country/select_country_state.dart';
  2. import 'package:cs_resources/constants/color_constants.dart';
  3. import 'package:cs_resources/generated/assets.dart';
  4. import 'package:flutter/cupertino.dart';
  5. import 'package:flutter/material.dart';
  6. import 'package:flutter/widgets.dart';
  7. import 'package:get/get.dart';
  8. import 'package:plugin_basic/base/base_stateless_page.dart';
  9. import 'package:plugin_basic/utils/ext_get_nav.dart';
  10. import 'package:router/path/router_path.dart';
  11. import 'package:shared/utils/screen_util.dart';
  12. import 'package:widgets/ext/ex_widget.dart';
  13. import 'package:widgets/my_button.dart';
  14. import 'package:widgets/my_load_image.dart';
  15. import 'package:widgets/my_text_view.dart';
  16. import 'select_country_controller.dart';
  17. class SelectCountryPage extends BaseStatelessPage<SelectCountryController> {
  18. SelectCountryPage({Key? key}) : super(key: key);
  19. //启动当前页面
  20. static void startInstance() {
  21. return Get.start(RouterPath.AUTH_SELECT_COUNTRY);
  22. }
  23. late SelectCountryState state;
  24. @override
  25. void initState() {
  26. state = controller.state;
  27. }
  28. @override
  29. SelectCountryController createRawController() {
  30. return SelectCountryController();
  31. }
  32. @override
  33. Widget buildWidget(BuildContext context) {
  34. return Scaffold(
  35. body: SafeArea(
  36. bottom: true,
  37. top: false,
  38. child: Container(
  39. width: double.infinity,
  40. height: double.infinity,
  41. padding: EdgeInsets.only(top: ScreenUtil.getStatusBarH(context)),
  42. decoration: const BoxDecoration(
  43. gradient: LinearGradient(
  44. colors: [
  45. Color(0xFF091D44),
  46. Color(0xFF245A8A),
  47. Color(0xFF7F7CEC),
  48. ],
  49. begin: Alignment.topCenter,
  50. end: Alignment.bottomCenter,
  51. ),
  52. ),
  53. child: Column(
  54. mainAxisSize: MainAxisSize.max,
  55. crossAxisAlignment: CrossAxisAlignment.center,
  56. children: [
  57. // 底部滚动的布局
  58. SingleChildScrollView(
  59. scrollDirection: Axis.vertical,
  60. physics: const BouncingScrollPhysics(),
  61. child: Column(
  62. mainAxisSize: MainAxisSize.max,
  63. crossAxisAlignment: CrossAxisAlignment.center,
  64. children: [
  65. MyTextView(
  66. "Casual Labour System",
  67. textColor: ColorConstants.white,
  68. isFontBold: true,
  69. fontSize: 35,
  70. marginTop: 20,
  71. fontStyle: FontStyle.italic,
  72. textAlign: TextAlign.center,
  73. marginLeft: 50,
  74. marginRight: 50,
  75. ),
  76. MyTextView(
  77. "Select Country".tr,
  78. textColor: ColorConstants.white,
  79. isFontMedium: true,
  80. fontSize: 21,
  81. marginTop: 18,
  82. ),
  83. MyTextView(
  84. "Browse jobs available in your selected country.".tr,
  85. textColor: ColorConstants.white,
  86. isFontMedium: true,
  87. fontSize: 14,
  88. marginTop: 9,
  89. ),
  90. //新加坡的选项
  91. Container(
  92. width: double.infinity,
  93. margin: EdgeInsets.only(top: 48, left: 20, right: 20),
  94. padding: EdgeInsets.symmetric(vertical: 13, horizontal: 17),
  95. decoration: BoxDecoration(
  96. color: Color(0xFF4DCFF6).withOpacity(0.2), // 设置背景颜色和不透明度
  97. borderRadius: BorderRadius.circular(5.0), // 设置圆角
  98. ),
  99. child: Row(
  100. children: [
  101. MyAssetImage(Assets.cptAuthSgIcon, width: 50, height: 33),
  102. MyTextView(
  103. "Singapore".tr,
  104. marginLeft: 17,
  105. textColor: ColorConstants.white,
  106. isFontMedium: true,
  107. fontSize: 18,
  108. ).expanded(),
  109. Obx(() {
  110. return Visibility(
  111. visible: state.curSelectCountry.value == 1,
  112. child: MyAssetImage(Assets.cptAuthCheckedIcon, width: 22, height: 22),
  113. );
  114. }),
  115. ],
  116. ),
  117. ).onTap(() {
  118. state.curSelectCountry.value = 1;
  119. }),
  120. //越南的选项
  121. Container(
  122. width: double.infinity,
  123. margin: EdgeInsets.only(top: 13.5, left: 20, right: 20),
  124. padding: EdgeInsets.symmetric(vertical: 13, horizontal: 17),
  125. decoration: BoxDecoration(
  126. color: Color(0xFF4DCFF6).withOpacity(0.2), // 设置背景颜色和不透明度
  127. borderRadius: BorderRadius.circular(5.0), // 设置圆角
  128. ),
  129. child: Row(
  130. children: [
  131. MyAssetImage(Assets.cptAuthVnIcon, width: 50, height: 33),
  132. MyTextView(
  133. "Vietnam".tr,
  134. marginLeft: 17,
  135. textColor: ColorConstants.white,
  136. isFontMedium: true,
  137. fontSize: 18,
  138. ).expanded(),
  139. Obx(() {
  140. return Visibility(
  141. visible: state.curSelectCountry.value == 0,
  142. child: MyAssetImage(Assets.cptAuthCheckedIcon, width: 22, height: 22),
  143. );
  144. }),
  145. ],
  146. ),
  147. ).onTap(() {
  148. state.curSelectCountry.value = 0;
  149. }),
  150. //Next按钮
  151. Stack(
  152. children: [
  153. MyButton(
  154. type: ClickType.throttle,
  155. milliseconds: 500,
  156. onPressed: () {},
  157. text: "Next".tr,
  158. textColor: ColorConstants.white,
  159. fontSize: 18,
  160. minHeight: 50,
  161. radius: 22.5,
  162. backgroundColor: hexToColor("#FFBB1B"),
  163. fontWeight: FontWeight.w500,
  164. ),
  165. Positioned(
  166. right: 28,
  167. top: 0,
  168. bottom: 0,
  169. child: MyAssetImage(Assets.cptAuthNextIcon, width: 20, height: 14.5),
  170. ),
  171. ],
  172. ).marginSymmetric(horizontal: 20, vertical: 36)
  173. ],
  174. )).expanded(),
  175. ],
  176. ),
  177. ),
  178. ),
  179. );
  180. }
  181. }