view.dart 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. import 'dart:ffi';
  2. import 'package:electronic_assistant/base/base_page.dart';
  3. import 'package:electronic_assistant/module/chat/start/controller.dart';
  4. import 'package:electronic_assistant/resource/assets.gen.dart';
  5. import 'package:electronic_assistant/resource/colors.gen.dart';
  6. import 'package:electronic_assistant/utils/expand.dart';
  7. import 'package:flutter/material.dart';
  8. import 'package:flutter_screenutil/flutter_screenutil.dart';
  9. class ChatStartPage extends BasePage<ChatStartController> {
  10. const ChatStartPage({super.key});
  11. @override
  12. bool immersive() {
  13. return true;
  14. }
  15. @override
  16. Color backgroundColor() {
  17. // TODO: implement backgroundColor
  18. return ColorName.transparent;
  19. }
  20. @override
  21. Widget buildBody(BuildContext context) {
  22. return Container(
  23. height: ScreenUtil().screenHeight - 80.h,
  24. decoration: const BoxDecoration(
  25. borderRadius: BorderRadius.only(
  26. topLeft: Radius.circular(16),
  27. topRight: Radius.circular(16),
  28. ),
  29. color: Colors.white,
  30. ),
  31. child: Stack(
  32. children: [
  33. SizedBox(
  34. width: double.infinity,
  35. child: Assets.images.bgTalkStart.image(),
  36. ),
  37. Column(
  38. children: [
  39. buildTopBar(),
  40. buildDescripe(),
  41. buildInputTF(),
  42. Expanded(child: SizedBox()),
  43. TextButton(
  44. onPressed: () {
  45. print(ScreenUtil().bottomBarHeight);
  46. },
  47. child: Container(
  48. margin: EdgeInsets.only(
  49. left: 16.w,
  50. right: 16.w,
  51. bottom: ScreenUtil().bottomBarHeight + 6.h),
  52. height: 48.h,
  53. width: double.infinity,
  54. alignment: Alignment.center,
  55. decoration: BoxDecoration(
  56. gradient: LinearGradient(
  57. colors: ['#6177F2'.toColor(), '#8B9DFF'.toColor()],
  58. stops: const [0, 1.0],
  59. ),
  60. borderRadius: BorderRadius.circular(8),
  61. ),
  62. child: Text(
  63. "下一步",
  64. style: TextStyle(
  65. color: ColorName.white,
  66. fontSize: 16,
  67. fontWeight: FontWeight.w500,
  68. ),
  69. ),
  70. ),
  71. )
  72. ],
  73. ),
  74. ],
  75. ),
  76. );
  77. }
  78. Widget buildTopBar() {
  79. return Container(
  80. height: 28.w,
  81. margin: EdgeInsets.only(left: 16.w, top: 16.h, right: 16.w),
  82. child: Row(
  83. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  84. crossAxisAlignment: CrossAxisAlignment.center,
  85. children: [
  86. GestureDetector(
  87. child: SizedBox(
  88. width: 28.w,
  89. height: 28.w,
  90. child: Assets.images.iconTalkStartClose.image(),
  91. ),
  92. ),
  93. SizedBox(
  94. child: Text(
  95. "定制你的秘书",
  96. textAlign: TextAlign.center,
  97. style: TextStyle(
  98. fontSize: 16.w,
  99. color: ColorName.primaryTextColor,
  100. fontWeight: FontWeight.w500,
  101. ),
  102. ),
  103. ),
  104. SizedBox(
  105. width: 28.w,
  106. height: 28.w,
  107. ),
  108. ],
  109. ),
  110. );
  111. }
  112. Widget buildDescripe() {
  113. return Column(
  114. children: [
  115. Container(
  116. margin: EdgeInsets.only(top: 40.h),
  117. width: 84.w,
  118. child: Assets.images.iconTalkStartLogo.image(),
  119. ),
  120. Container(
  121. margin: EdgeInsets.only(top: 6.h),
  122. width: 328.w,
  123. height: 99.h,
  124. padding: const EdgeInsets.all(1),
  125. decoration: BoxDecoration(
  126. gradient: const LinearGradient(
  127. colors: [
  128. Color.fromRGBO(226, 165, 255, 0.14),
  129. Color.fromRGBO(99, 122, 255, 0.14)
  130. ],
  131. begin: Alignment.topCenter,
  132. end: Alignment.bottomCenter,
  133. stops: [0, 1.0],
  134. ),
  135. borderRadius: BorderRadius.only(
  136. topLeft: Radius.circular(0.w),
  137. topRight: Radius.circular(16.w),
  138. bottomLeft: Radius.circular(16.w),
  139. bottomRight: Radius.circular(16.w),
  140. ),
  141. ),
  142. child: Container(
  143. decoration: BoxDecoration(
  144. gradient: LinearGradient(
  145. colors: ['#FFF5FD'.toColor(), '#EEF9FF'.toColor()],
  146. begin: Alignment.topCenter,
  147. end: Alignment.bottomCenter,
  148. stops: const [0, 1.0],
  149. ),
  150. borderRadius: BorderRadius.only(
  151. topLeft: Radius.circular(0.w),
  152. topRight: Radius.circular(16.w),
  153. bottomLeft: Radius.circular(16.w),
  154. bottomRight: Radius.circular(16.w),
  155. ),
  156. ),
  157. child: Container(
  158. padding: const EdgeInsets.only(
  159. left: 12, top: 14, right: 12, bottom: 16),
  160. child: Column(
  161. mainAxisAlignment: MainAxisAlignment.start,
  162. crossAxisAlignment: CrossAxisAlignment.start,
  163. children: [
  164. const Text(
  165. "👋 Hi,你好呀",
  166. style: TextStyle(
  167. color: ColorName.primaryTextColor,
  168. fontSize: 17,
  169. fontWeight: FontWeight.w500,
  170. ),
  171. ),
  172. Text(
  173. "作为专属秘书,告诉小听以下信息吧~",
  174. style: TextStyle(
  175. color: ColorName.primaryTextColor.withOpacity(0.8),
  176. fontSize: 14,
  177. ),
  178. ),
  179. Text(
  180. "您填写的内容,会影响我回答的准确度哦~",
  181. style: TextStyle(
  182. color: ColorName.primaryTextColor.withOpacity(0.8),
  183. fontSize: 14,
  184. ),
  185. ),
  186. ],
  187. ),
  188. ),
  189. ),
  190. ),
  191. ],
  192. );
  193. }
  194. Widget buildInputTF() {
  195. return Container(
  196. padding: const EdgeInsets.only(left: 16, right: 16, top: 24),
  197. child: Column(
  198. children: [
  199. Row(
  200. children: [
  201. const Text(
  202. "行业",
  203. style: TextStyle(
  204. color: ColorName.primaryTextColor,
  205. fontSize: 15,
  206. fontWeight: FontWeight.w500,
  207. ),
  208. ),
  209. Text(
  210. "*",
  211. style: TextStyle(
  212. color: "#F5574E".toColor(),
  213. fontSize: 15,
  214. fontWeight: FontWeight.w500,
  215. ),
  216. ),
  217. ],
  218. ),
  219. Container(
  220. margin: const EdgeInsets.only(top: 8, bottom: 18),
  221. alignment: Alignment.center,
  222. height: 44.h,
  223. decoration: BoxDecoration(
  224. borderRadius: BorderRadius.circular(8.w),
  225. border: Border.all(color: '#ECECEC'.toColor(), width: 1),
  226. ),
  227. child: TextField(
  228. maxLines: 1,
  229. textAlignVertical: TextAlignVertical.center,
  230. textInputAction: TextInputAction.search,
  231. decoration: InputDecoration(
  232. hintText: '如:房地产、金融、电子设备出口、教培',
  233. hintStyle: TextStyle(fontSize: 14, color: "#AFAFAF".toColor()),
  234. labelStyle:
  235. TextStyle(fontSize: 14, color: ColorName.primaryTextColor),
  236. contentPadding: EdgeInsets.only(left: 12),
  237. border: OutlineInputBorder(borderSide: BorderSide.none),
  238. enabled: true,
  239. ),
  240. style: TextStyle(fontSize: 14.sp),
  241. ),
  242. ),
  243. Row(
  244. children: [
  245. const Text(
  246. "岗位",
  247. style: TextStyle(
  248. color: ColorName.primaryTextColor,
  249. fontSize: 15,
  250. fontWeight: FontWeight.w500,
  251. ),
  252. ),
  253. Text(
  254. "*",
  255. style: TextStyle(
  256. color: "#F5574E".toColor(),
  257. fontSize: 15,
  258. fontWeight: FontWeight.w500,
  259. ),
  260. ),
  261. ],
  262. ),
  263. Container(
  264. margin: const EdgeInsets.only(top: 8, bottom: 18),
  265. alignment: Alignment.center,
  266. height: 44.h,
  267. decoration: BoxDecoration(
  268. borderRadius: BorderRadius.circular(8.w),
  269. border: Border.all(color: '#ECECEC'.toColor(), width: 1),
  270. ),
  271. child: TextField(
  272. maxLines: 1,
  273. textAlignVertical: TextAlignVertical.center,
  274. textInputAction: TextInputAction.search,
  275. decoration: InputDecoration(
  276. hintText: '如:行政、助理、销售、总经理、创业者',
  277. hintStyle: TextStyle(fontSize: 14, color: "#AFAFAF".toColor()),
  278. labelStyle:
  279. TextStyle(fontSize: 14, color: ColorName.primaryTextColor),
  280. contentPadding: EdgeInsets.only(left: 12),
  281. border: OutlineInputBorder(borderSide: BorderSide.none),
  282. enabled: true,
  283. ),
  284. style: TextStyle(fontSize: 14.sp),
  285. ),
  286. ),
  287. ],
  288. ),
  289. );
  290. }
  291. }