select_country_page.dart 9.3 KB

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