view.dart 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. import 'package:electronic_assistant/base/base_page.dart';
  2. import 'package:electronic_assistant/module/chat/start/controller.dart';
  3. import 'package:electronic_assistant/resource/assets.gen.dart';
  4. import 'package:electronic_assistant/resource/colors.gen.dart';
  5. import 'package:electronic_assistant/utils/expand.dart';
  6. import 'package:flutter/material.dart';
  7. import 'package:flutter_screenutil/flutter_screenutil.dart';
  8. class ChatStartPage extends BasePage<ChatStartController> {
  9. const ChatStartPage({super.key});
  10. @override
  11. bool immersive() {
  12. return true;
  13. }
  14. @override
  15. Color backgroundColor() {
  16. // TODO: implement backgroundColor
  17. return ColorName.transparent;
  18. }
  19. @override
  20. Widget buildBody(BuildContext context) {
  21. return Container(
  22. height: ScreenUtil().screenHeight - 80.h,
  23. decoration: const BoxDecoration(
  24. borderRadius: BorderRadius.only(
  25. topLeft: Radius.circular(16),
  26. topRight: Radius.circular(16),
  27. ),
  28. color: Colors.white,
  29. ),
  30. child: Stack(
  31. children: [
  32. SizedBox(
  33. width: double.infinity,
  34. child: Assets.images.bgTalkStart.image(),
  35. ),
  36. Column(
  37. children: [
  38. buildTopBar(),
  39. Container(
  40. margin: EdgeInsets.only(top: 40.h),
  41. width: 84.w,
  42. child: Assets.images.iconTalkStartLogo.image(),
  43. ),
  44. Container(
  45. margin: EdgeInsets.only(top: 6.h),
  46. width: 328.w,
  47. height: 99.h,
  48. padding: const EdgeInsets.all(1),
  49. decoration: BoxDecoration(
  50. gradient: const LinearGradient(
  51. colors: [
  52. Color.fromRGBO(226, 165, 255, 0.14),
  53. Color.fromRGBO(99, 122, 255, 0.14)
  54. ],
  55. begin: Alignment.topCenter,
  56. end: Alignment.bottomCenter,
  57. stops: [0, 1.0],
  58. ),
  59. borderRadius: BorderRadius.only(
  60. topLeft: Radius.circular(0.w),
  61. topRight: Radius.circular(16.w),
  62. bottomLeft: Radius.circular(16.w),
  63. bottomRight: Radius.circular(16.w),
  64. ),
  65. ),
  66. child: Container(
  67. decoration: BoxDecoration(
  68. gradient: LinearGradient(
  69. colors: ['#FFF5FD'.toColor(), '#EEF9FF'.toColor()],
  70. begin: Alignment.topCenter,
  71. end: Alignment.bottomCenter,
  72. stops: const [0, 1.0],
  73. ),
  74. borderRadius: BorderRadius.only(
  75. topLeft: Radius.circular(0.w),
  76. topRight: Radius.circular(16.w),
  77. bottomLeft: Radius.circular(16.w),
  78. bottomRight: Radius.circular(16.w),
  79. ),
  80. ),
  81. child: Container(
  82. padding: const EdgeInsets.only(
  83. left: 12, top: 14, right: 12, bottom: 16),
  84. child: Column(
  85. mainAxisAlignment: MainAxisAlignment.start,
  86. crossAxisAlignment: CrossAxisAlignment.start,
  87. children: [
  88. const Text(
  89. "👋 Hi,你好呀",
  90. style: TextStyle(
  91. color: ColorName.primaryTextColor,
  92. fontSize: 17,
  93. fontWeight: FontWeight.w500,
  94. ),
  95. ),
  96. Text(
  97. "作为专属秘书,告诉小听以下信息吧~",
  98. style: TextStyle(
  99. color: ColorName.primaryTextColor.withOpacity(0.8),
  100. fontSize: 14,
  101. ),
  102. ),
  103. Text(
  104. "您填写的内容,会影响我回答的准确度哦~",
  105. style: TextStyle(
  106. color: ColorName.primaryTextColor.withOpacity(0.8),
  107. fontSize: 14,
  108. ),
  109. ),
  110. ],
  111. ),
  112. ),
  113. ),
  114. ),
  115. ],
  116. ),
  117. ],
  118. ),
  119. );
  120. }
  121. Widget buildTopBar() {
  122. return Container(
  123. height: 28.w,
  124. margin: EdgeInsets.only(left: 16.w, top: 16.h, right: 16.w),
  125. child: Row(
  126. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  127. crossAxisAlignment: CrossAxisAlignment.center,
  128. children: [
  129. GestureDetector(
  130. child: SizedBox(
  131. width: 28.w,
  132. height: 28.w,
  133. child: Assets.images.iconTalkStartClose.image(),
  134. ),
  135. ),
  136. SizedBox(
  137. child: Text(
  138. "定制你的秘书",
  139. textAlign: TextAlign.center,
  140. style: TextStyle(
  141. fontSize: 16.w,
  142. color: ColorName.primaryTextColor,
  143. fontWeight: FontWeight.w500,
  144. ),
  145. ),
  146. ),
  147. SizedBox(
  148. width: 28.w,
  149. height: 28.w,
  150. ),
  151. ],
  152. ),
  153. );
  154. }
  155. }