select_country_page.dart 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  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: EdgeInsets.only(top: 48, left: 20, right: 20),
  92. padding: EdgeInsets.symmetric(vertical: 13, horizontal: 17),
  93. decoration: BoxDecoration(
  94. color: Color(0xFF4DCFF6).withOpacity(0.2), // 设置背景颜色和不透明度
  95. borderRadius: BorderRadius.circular(5.0), // 设置圆角
  96. ),
  97. child: Row(
  98. children: [
  99. 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.curSelectCountry.value == 1,
  110. child: MyAssetImage(Assets.cptAuthCheckedIcon, width: 22, height: 22),
  111. );
  112. }),
  113. ],
  114. ),
  115. ).onTap(() {
  116. ConfigService.to.curSelectCountry.value = 1;
  117. }),
  118. //越南的选项
  119. Container(
  120. width: double.infinity,
  121. margin: EdgeInsets.only(top: 13.5, left: 20, right: 20),
  122. padding: EdgeInsets.symmetric(vertical: 13, horizontal: 17),
  123. decoration: BoxDecoration(
  124. color: Color(0xFF4DCFF6).withOpacity(0.2), // 设置背景颜色和不透明度
  125. borderRadius: BorderRadius.circular(5.0), // 设置圆角
  126. ),
  127. child: Row(
  128. children: [
  129. 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.curSelectCountry.value == 0,
  140. child: MyAssetImage(Assets.cptAuthCheckedIcon, width: 22, height: 22),
  141. );
  142. }),
  143. ],
  144. ),
  145. ).onTap(() {
  146. ConfigService.to.curSelectCountry.value = 0;
  147. }),
  148. //Next按钮
  149. Stack(
  150. children: [
  151. MyButton(
  152. type: ClickType.throttle,
  153. milliseconds: 500,
  154. onPressed: () {
  155. controller.setupNext();
  156. },
  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. }