| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344 |
- import 'package:electronic_assistant/base/base_page.dart';
- import 'package:electronic_assistant/module/chat/start/controller.dart';
- import 'package:electronic_assistant/resource/assets.gen.dart';
- import 'package:electronic_assistant/resource/colors.gen.dart';
- import 'package:electronic_assistant/utils/expand.dart';
- import 'package:flutter/material.dart';
- import 'package:flutter_screenutil/flutter_screenutil.dart';
- import 'package:get/get.dart';
- class ChatStartPage extends BasePage<ChatStartController> {
- const ChatStartPage({super.key});
- @override
- bool immersive() {
- return true;
- }
- @override
- Color backgroundColor() {
- return ColorName.transparent;
- }
- // 点击空白处收起键盘
- @override
- void backgroundOnTapEvent() {
- super.backgroundOnTapEvent();
- FocusScope.of(Get.context!).requestFocus(FocusNode());
- }
- @override
- Widget buildBody(BuildContext context) {
- return Container(
- height: ScreenUtil().screenHeight - 80.h,
- decoration: const BoxDecoration(
- borderRadius: BorderRadius.only(
- topLeft: Radius.circular(16),
- topRight: Radius.circular(16),
- ),
- color: Colors.white,
- ),
- child: Stack(
- children: [
- SizedBox(
- width: double.infinity,
- child: Assets.images.bgTalkStart.image(),
- ),
- Scaffold(
- resizeToAvoidBottomInset: false,
- // resizeToAvoidBottomInset: false,
- backgroundColor: Colors.transparent,
- appBar: AppBar(
- scrolledUnderElevation: 0,
- leading: IconButton(
- onPressed: () {
- Get.back();
- },
- icon: UnconstrainedBox(
- child: SizedBox(
- width: 28.w,
- height: 28.w,
- child: Assets.images.iconTalkStartClose.image(),
- ),
- ),
- ),
- backgroundColor: Colors.transparent,
- title: Text(
- "定制你的秘书",
- textAlign: TextAlign.center,
- style: TextStyle(
- fontSize: 16.w,
- color: ColorName.primaryTextColor,
- fontWeight: FontWeight.w500,
- ),
- ),
- ),
- body: SingleChildScrollView(
- physics: const ClampingScrollPhysics(),
- child: SizedBox(
- width: double.infinity,
- height: ScreenUtil().screenHeight -
- 80.h -
- AppBar().preferredSize.height,
- child: Column(
- children: [
- buildDescripe(),
- buildInputTF(),
- const Expanded(child: SizedBox()),
- GestureDetector(
- onTap: () {
- controller.onNextStep();
- },
- child: Container(
- margin: EdgeInsets.only(
- left: 16.w,
- right: 16.w,
- bottom: ScreenUtil().bottomBarHeight + 6.h),
- height: 48.h,
- width: double.infinity,
- alignment: Alignment.center,
- decoration: BoxDecoration(
- gradient: LinearGradient(
- colors: ['#6177F2'.toColor(), '#8B9DFF'.toColor()],
- stops: const [0, 1.0],
- ),
- borderRadius: BorderRadius.circular(8),
- ),
- child: const Text(
- "下一步",
- style: TextStyle(
- color: ColorName.white,
- fontSize: 16,
- fontWeight: FontWeight.w500,
- ),
- ),
- ),
- )
- ],
- ),
- ),
- ),
- ),
- ],
- ),
- );
- }
- Widget buildTopBar() {
- return Container(
- height: 28.w,
- margin: EdgeInsets.only(left: 16.w, top: 16.h, right: 16.w),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- GestureDetector(
- child: SizedBox(
- width: 28.w,
- height: 28.w,
- child: Assets.images.iconTalkStartClose.image(),
- ),
- ),
- SizedBox(
- child: Text(
- "定制你的秘书",
- textAlign: TextAlign.center,
- style: TextStyle(
- fontSize: 16.w,
- color: ColorName.primaryTextColor,
- fontWeight: FontWeight.w500,
- ),
- ),
- ),
- SizedBox(
- width: 28.w,
- height: 28.w,
- ),
- ],
- ),
- );
- }
- Widget buildDescripe() {
- return Column(
- children: [
- Container(
- margin: EdgeInsets.only(top: 40.h),
- width: 84.w,
- child: Assets.images.iconTalkStartLogo.image(),
- ),
- Container(
- margin: EdgeInsets.only(top: 6.h),
- width: 328.w,
- height: 99.h,
- padding: const EdgeInsets.all(1),
- decoration: BoxDecoration(
- gradient: const LinearGradient(
- colors: [
- Color.fromRGBO(226, 165, 255, 0.14),
- Color.fromRGBO(99, 122, 255, 0.14)
- ],
- begin: Alignment.topCenter,
- end: Alignment.bottomCenter,
- stops: [0, 1.0],
- ),
- borderRadius: BorderRadius.only(
- topLeft: Radius.circular(0.w),
- topRight: Radius.circular(16.w),
- bottomLeft: Radius.circular(16.w),
- bottomRight: Radius.circular(16.w),
- ),
- ),
- child: Container(
- decoration: BoxDecoration(
- gradient: LinearGradient(
- colors: ['#FFF5FD'.toColor(), '#EEF9FF'.toColor()],
- begin: Alignment.topCenter,
- end: Alignment.bottomCenter,
- stops: const [0, 1.0],
- ),
- borderRadius: BorderRadius.only(
- topLeft: Radius.circular(0.w),
- topRight: Radius.circular(16.w),
- bottomLeft: Radius.circular(16.w),
- bottomRight: Radius.circular(16.w),
- ),
- ),
- child: Container(
- padding: const EdgeInsets.only(
- left: 12, top: 14, right: 12, bottom: 16),
- child: Column(
- mainAxisAlignment: MainAxisAlignment.start,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- const Text(
- "👋 Hi,你好呀",
- style: TextStyle(
- color: ColorName.primaryTextColor,
- fontSize: 17,
- fontWeight: FontWeight.w500,
- ),
- ),
- Text(
- "作为专属秘书,告诉小听以下信息吧~",
- style: TextStyle(
- color: ColorName.primaryTextColor.withOpacity(0.8),
- fontSize: 14,
- ),
- ),
- Text(
- "您填写的内容,会影响我回答的准确度哦~",
- style: TextStyle(
- color: ColorName.primaryTextColor.withOpacity(0.8),
- fontSize: 14,
- ),
- ),
- ],
- ),
- ),
- ),
- ),
- ],
- );
- }
- Widget buildInputTF() {
- return Container(
- padding: const EdgeInsets.only(left: 16, right: 16, top: 24),
- child: Column(
- children: [
- Row(
- children: [
- const Text(
- "行业",
- style: TextStyle(
- color: ColorName.primaryTextColor,
- fontSize: 15,
- fontWeight: FontWeight.w500,
- ),
- ),
- Text(
- "*",
- style: TextStyle(
- color: "#F5574E".toColor(),
- fontSize: 15,
- fontWeight: FontWeight.w500,
- ),
- ),
- ],
- ),
- Container(
- margin: const EdgeInsets.only(top: 8, bottom: 18),
- alignment: Alignment.center,
- height: 44.h,
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(8.w),
- border: Border.all(color: '#ECECEC'.toColor(), width: 1),
- ),
- child: TextField(
- maxLines: 1,
- controller: controller.professionController,
- textAlignVertical: TextAlignVertical.center,
- textInputAction: TextInputAction.search,
- decoration: InputDecoration(
- hintText: '如:房地产、金融、电子设备出口、教培',
- hintStyle: TextStyle(fontSize: 14, color: "#AFAFAF".toColor()),
- labelStyle: const TextStyle(
- fontSize: 14, color: ColorName.primaryTextColor),
- contentPadding: const EdgeInsets.only(left: 12),
- border: const OutlineInputBorder(borderSide: BorderSide.none),
- enabled: true,
- ),
- style: TextStyle(fontSize: 14.sp),
- ),
- ),
- Row(
- children: [
- const Text(
- "岗位",
- style: TextStyle(
- color: ColorName.primaryTextColor,
- fontSize: 15,
- fontWeight: FontWeight.w500,
- ),
- ),
- Text(
- "*",
- style: TextStyle(
- color: "#F5574E".toColor(),
- fontSize: 15,
- fontWeight: FontWeight.w500,
- ),
- ),
- ],
- ),
- Container(
- margin: const EdgeInsets.only(top: 8, bottom: 18),
- alignment: Alignment.center,
- height: 44.h,
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(8.w),
- border: Border.all(color: '#ECECEC'.toColor(), width: 1),
- ),
- child: TextField(
- maxLines: 1,
- controller: controller.postController,
- textAlignVertical: TextAlignVertical.center,
- textInputAction: TextInputAction.search,
- decoration: InputDecoration(
- hintText: '如:行政、助理、销售、总经理、创业者',
- hintStyle: TextStyle(fontSize: 14, color: "#AFAFAF".toColor()),
- labelStyle:
- TextStyle(fontSize: 14, color: ColorName.primaryTextColor),
- contentPadding: EdgeInsets.only(left: 12),
- border: OutlineInputBorder(borderSide: BorderSide.none),
- enabled: true,
- ),
- style: TextStyle(fontSize: 14.sp),
- ),
- ),
- ],
- ),
- );
- }
- }
|