|
|
@@ -2,11 +2,14 @@ import 'package:cached_network_image/cached_network_image.dart';
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
-import 'package:keyboard/base/base_view.dart';
|
|
|
import 'package:get/get.dart';
|
|
|
+import 'package:keyboard/base/base_view.dart';
|
|
|
+import 'package:keyboard/data/bean/character_info.dart';
|
|
|
import 'package:keyboard/resource/string.gen.dart';
|
|
|
+
|
|
|
import '../../resource/assets.gen.dart';
|
|
|
import '../../utils/styles.dart';
|
|
|
+import '../../widget/pargress_bar.dart';
|
|
|
import 'keyboard_controller.dart';
|
|
|
|
|
|
class KeyBoardView extends BaseView<KeyBoardController> {
|
|
|
@@ -23,12 +26,31 @@ class KeyBoardView extends BaseView<KeyBoardController> {
|
|
|
_buildTitle(),
|
|
|
Expanded(
|
|
|
child: SingleChildScrollView(
|
|
|
+ physics: NeverScrollableScrollPhysics(),
|
|
|
child: Column(
|
|
|
children: [
|
|
|
_buildAvatarCard(),
|
|
|
+ SizedBox(height: 10.h),
|
|
|
_buildLoveIndexCard(),
|
|
|
- _buildPopularFeatures(),
|
|
|
- _buildKeyboardSettings(),
|
|
|
+ SizedBox(height: 10.h),
|
|
|
+ Container(
|
|
|
+ padding: EdgeInsets.only(top: 16.h),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: Colors.white,
|
|
|
+ borderRadius: BorderRadius.only(
|
|
|
+ topLeft: Radius.circular(16.r),
|
|
|
+ topRight: Radius.circular(16.r),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ child: Column(
|
|
|
+ children: [
|
|
|
+ _buildHitCard(),
|
|
|
+ SizedBox(height: 10.h),
|
|
|
+ _buildKeyboardSettings(),
|
|
|
+ _buildBanner(),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ),
|
|
|
],
|
|
|
),
|
|
|
),
|
|
|
@@ -43,7 +65,7 @@ class KeyBoardView extends BaseView<KeyBoardController> {
|
|
|
// 顶部标题栏
|
|
|
Widget _buildTitle() {
|
|
|
return Container(
|
|
|
- padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 12.h),
|
|
|
+ padding: EdgeInsets.only(left: 16.w, right: 16.w, bottom: 12.h),
|
|
|
color: Colors.transparent,
|
|
|
child: Row(
|
|
|
children: [
|
|
|
@@ -53,32 +75,39 @@ class KeyBoardView extends BaseView<KeyBoardController> {
|
|
|
fit: BoxFit.cover,
|
|
|
),
|
|
|
const Spacer(),
|
|
|
- Container(
|
|
|
- padding: EdgeInsets.symmetric(horizontal: 6.w, vertical: 6.w),
|
|
|
- decoration: ShapeDecoration(
|
|
|
- color: Colors.white.withAlpha(204),
|
|
|
- shape: RoundedRectangleBorder(
|
|
|
- side: BorderSide(width: 1, color: Colors.white),
|
|
|
- borderRadius: BorderRadius.circular(13.r),
|
|
|
- ),
|
|
|
- ),
|
|
|
- child: Row(
|
|
|
- children: [
|
|
|
- Assets.images.iconKeyboardVipLogo.image(
|
|
|
- width: 12.w,
|
|
|
- height: 12.w,
|
|
|
+ GestureDetector(
|
|
|
+ onTap: controller.clickVip,
|
|
|
+ child: Container(
|
|
|
+ padding: EdgeInsets.symmetric(horizontal: 6.w, vertical: 6.w),
|
|
|
+ decoration: ShapeDecoration(
|
|
|
+ color: Colors.white.withAlpha(204),
|
|
|
+ shape: RoundedRectangleBorder(
|
|
|
+ side: BorderSide(width: 1, color: Colors.white),
|
|
|
+ borderRadius: BorderRadius.circular(13.r),
|
|
|
),
|
|
|
- const SizedBox(width: 2),
|
|
|
- Text(
|
|
|
- StringName.keyboardMemberOpen,
|
|
|
- style: TextStyle(
|
|
|
+ ),
|
|
|
+ child: Row(
|
|
|
+ children: [
|
|
|
+ Assets.images.iconKeyboardVipLogo.image(
|
|
|
+ width: 12.w,
|
|
|
+ height: 12.w,
|
|
|
+ ),
|
|
|
+ const SizedBox(width: 2),
|
|
|
+ Text(
|
|
|
+ StringName.keyboardMemberOpen,
|
|
|
+ style: TextStyle(
|
|
|
+ color: Color(0xFFA85600),
|
|
|
+ fontSize: 12,
|
|
|
+ fontWeight: FontWeight.w400,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ Icon(
|
|
|
+ Icons.chevron_right,
|
|
|
color: Color(0xFFA85600),
|
|
|
- fontSize: 12,
|
|
|
- fontWeight: FontWeight.w400,
|
|
|
+ size: 11.r,
|
|
|
),
|
|
|
- ),
|
|
|
- Icon(Icons.chevron_right, color: Color(0xFFA85600), size: 11.r),
|
|
|
- ],
|
|
|
+ ],
|
|
|
+ ),
|
|
|
),
|
|
|
),
|
|
|
],
|
|
|
@@ -102,12 +131,9 @@ class KeyBoardView extends BaseView<KeyBoardController> {
|
|
|
const SizedBox(width: 16),
|
|
|
_buildLovePercentage(),
|
|
|
const SizedBox(width: 16),
|
|
|
- controller.hasPartner.value
|
|
|
- ? _buildUserAvatar(false)
|
|
|
- : _buildAddPartnerButton(),
|
|
|
+ _buildUserAvatar(false),
|
|
|
],
|
|
|
),
|
|
|
- SizedBox(height: 10.h),
|
|
|
],
|
|
|
),
|
|
|
);
|
|
|
@@ -116,66 +142,88 @@ class KeyBoardView extends BaseView<KeyBoardController> {
|
|
|
|
|
|
// 爱情指数卡片
|
|
|
Widget _buildLoveIndexCard() {
|
|
|
- return Container(
|
|
|
- margin: EdgeInsets.symmetric(horizontal: 16.w),
|
|
|
- padding: EdgeInsets.symmetric(vertical: 5.h, horizontal: 11.w),
|
|
|
- decoration: BoxDecoration(
|
|
|
- color: Colors.white,
|
|
|
- borderRadius: BorderRadius.circular(12.r),
|
|
|
- ),
|
|
|
- child: Row(
|
|
|
- children: [
|
|
|
- Assets.images.iconKeyboardLoveIndex.image(width: 72.w, height: 23.h),
|
|
|
- Container(
|
|
|
- height: 42.w,
|
|
|
- width: 215.h,
|
|
|
- decoration: BoxDecoration(
|
|
|
- color: Color(0xFFFAFAFC),
|
|
|
- borderRadius: BorderRadius.circular(12.r),
|
|
|
- ),
|
|
|
- child: Column(
|
|
|
- children: [
|
|
|
- Row(
|
|
|
- children: [
|
|
|
- Expanded(
|
|
|
- child: ProgressBar(
|
|
|
- title: "爱情",
|
|
|
- value: controller.appearancePercentage,
|
|
|
- color: Colors.pink.shade100,
|
|
|
- ),
|
|
|
- ),
|
|
|
- Expanded(
|
|
|
- child: ProgressBar(
|
|
|
- title: "爱情",
|
|
|
- value: controller.appearancePercentage,
|
|
|
- color: Colors.pink.shade100,
|
|
|
- ),
|
|
|
- ),
|
|
|
- ],
|
|
|
- ),
|
|
|
- Row(
|
|
|
- children: [
|
|
|
- Expanded(
|
|
|
- child: ProgressBar(
|
|
|
- title: "爱情",
|
|
|
- value: controller.appearancePercentage,
|
|
|
- color: Colors.pink.shade100,
|
|
|
+ return Stack(
|
|
|
+ clipBehavior: Clip.none,
|
|
|
+ children: [
|
|
|
+ Positioned(
|
|
|
+ left: 0,
|
|
|
+ right: 0,
|
|
|
+ top: -12.h,
|
|
|
+ child: Assets.images.iconKeyboardTriangle.image(
|
|
|
+ color: Colors.white,
|
|
|
+ width: 20.w,
|
|
|
+ height: 16.h,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ margin: EdgeInsets.symmetric(horizontal: 22.w),
|
|
|
+ padding: EdgeInsets.symmetric(vertical: 5.h, horizontal: 5.w),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: Colors.white,
|
|
|
+ borderRadius: BorderRadius.circular(12.r),
|
|
|
+ ),
|
|
|
+ child: Row(
|
|
|
+ children: [
|
|
|
+ Assets.images.iconKeyboardLoveIndex.image(
|
|
|
+ width: 72.w,
|
|
|
+ height: 23.h,
|
|
|
+ ),
|
|
|
+ SizedBox(width: 10.w),
|
|
|
+ Expanded(
|
|
|
+ child: Container(
|
|
|
+ padding: EdgeInsets.symmetric(
|
|
|
+ horizontal: 10.w,
|
|
|
+ vertical: 8.h,
|
|
|
+ ),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: Color(0xFFFAFAFC),
|
|
|
+ borderRadius: BorderRadius.circular(12.r),
|
|
|
+ ),
|
|
|
+ child: Row(
|
|
|
+ children: [
|
|
|
+ Expanded(
|
|
|
+ child: Column(
|
|
|
+ children: [
|
|
|
+ ProgressBar(
|
|
|
+ title: "激情",
|
|
|
+ value: controller.appearancePercentage,
|
|
|
+ color: Color(0xFFFF637D),
|
|
|
+ ),
|
|
|
+ SizedBox(height: 6.h),
|
|
|
+ ProgressBar(
|
|
|
+ title: "默契",
|
|
|
+ value: controller.appearancePercentage,
|
|
|
+ color: Color(0xFFF5E8FC),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
),
|
|
|
- ),
|
|
|
- Expanded(
|
|
|
- child: ProgressBar(
|
|
|
- title: "爱情",
|
|
|
- value: controller.appearancePercentage,
|
|
|
- color: Colors.pink.shade100,
|
|
|
+ SizedBox(width: 21.w),
|
|
|
+ Expanded(
|
|
|
+ child: Column(
|
|
|
+ children: [
|
|
|
+ ProgressBar(
|
|
|
+ title: "羁绊",
|
|
|
+ value: controller.appearancePercentage,
|
|
|
+ color: Color(0xFFFFC954),
|
|
|
+ ),
|
|
|
+ SizedBox(height: 6.h),
|
|
|
+ ProgressBar(
|
|
|
+ title: "承诺",
|
|
|
+ value: controller.appearancePercentage,
|
|
|
+ color: Color(0xFF6382FF),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
),
|
|
|
- ),
|
|
|
- ],
|
|
|
+ ],
|
|
|
+ ),
|
|
|
),
|
|
|
- ],
|
|
|
- ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
),
|
|
|
- ],
|
|
|
- ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
);
|
|
|
}
|
|
|
|
|
|
@@ -199,9 +247,8 @@ class KeyBoardView extends BaseView<KeyBoardController> {
|
|
|
child: CachedNetworkImage(
|
|
|
imageUrl:
|
|
|
isUser
|
|
|
- ? controller.userInfo.value?.imageUrl ?? ""
|
|
|
- : controller.currentChooseKeyboard.value.avatar ??
|
|
|
- "",
|
|
|
+ ? controller.homeInfo?.imageUrl ?? ""
|
|
|
+ : controller.homeInfo?.targetImageUrl ?? "",
|
|
|
placeholder: (_, __) => const CupertinoActivityIndicator(),
|
|
|
errorWidget:
|
|
|
(context, url, error) => CircleAvatar(
|
|
|
@@ -230,12 +277,24 @@ class KeyBoardView extends BaseView<KeyBoardController> {
|
|
|
color: Colors.white,
|
|
|
borderRadius: BorderRadius.circular(22.r),
|
|
|
),
|
|
|
- child: Text(
|
|
|
- isUser
|
|
|
- ? controller.userInfo.value?.name ?? ""
|
|
|
- : controller.currentChooseKeyboard.value.name ?? "",
|
|
|
- style: Styles.getTextStyleBlack204W400(14.sp),
|
|
|
- ),
|
|
|
+ child:
|
|
|
+ isUser
|
|
|
+ ? Text(
|
|
|
+ controller.homeInfo?.name ?? StringName.keyboardNoLogin,
|
|
|
+ style: Styles.getTextStyleBlack204W400(14.sp),
|
|
|
+ )
|
|
|
+ : Text(
|
|
|
+ controller.homeInfo?.targetName ??
|
|
|
+ StringName.keyboardAdd,
|
|
|
+ style:
|
|
|
+ controller.homeInfo?.targetName != null
|
|
|
+ ? Styles.getTextStyleBlack204W400(14.sp)
|
|
|
+ : TextStyle(
|
|
|
+ color: const Color(0xFF8651FF),
|
|
|
+ fontSize: 14.sp,
|
|
|
+ fontWeight: FontWeight.w500,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
),
|
|
|
],
|
|
|
),
|
|
|
@@ -268,7 +327,7 @@ class KeyBoardView extends BaseView<KeyBoardController> {
|
|
|
height: 18.w,
|
|
|
),
|
|
|
Text(
|
|
|
- '追爱ing',
|
|
|
+ controller.homeInfo?.intimacyName ?? "",
|
|
|
textAlign: TextAlign.center,
|
|
|
style: Styles.getTextStyleBlack153W400(14.sp),
|
|
|
),
|
|
|
@@ -290,16 +349,8 @@ class KeyBoardView extends BaseView<KeyBoardController> {
|
|
|
children: [
|
|
|
TextSpan(
|
|
|
text:
|
|
|
- controller.hasPartner.value &&
|
|
|
- controller
|
|
|
- .currentChooseKeyboard
|
|
|
- .value
|
|
|
- .intimacy !=
|
|
|
- null
|
|
|
- ? controller
|
|
|
- .currentChooseKeyboard
|
|
|
- .value
|
|
|
- .intimacy
|
|
|
+ controller.homeInfo?.intimacy != null
|
|
|
+ ? controller.homeInfo?.intimacy
|
|
|
.toString()
|
|
|
: "?",
|
|
|
style: TextStyle(
|
|
|
@@ -349,285 +400,276 @@ class KeyBoardView extends BaseView<KeyBoardController> {
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- // 添加伴侣按钮
|
|
|
- Widget _buildAddPartnerButton() {
|
|
|
+ // 爆款玩法区域
|
|
|
+ Widget _buildHitCard() {
|
|
|
return Column(
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
|
- Container(
|
|
|
- width: 60,
|
|
|
- height: 60,
|
|
|
- decoration: BoxDecoration(
|
|
|
- shape: BoxShape.circle,
|
|
|
- color: Colors.grey.shade200,
|
|
|
+ Padding(
|
|
|
+ padding: EdgeInsets.symmetric(horizontal: 16.r),
|
|
|
+ child: Assets.images.iconKeyboardHitPlay.image(
|
|
|
+ width: 83.w,
|
|
|
+ height: 22.h,
|
|
|
+ fit: BoxFit.cover,
|
|
|
),
|
|
|
- child: const Icon(Icons.mail_outline, color: Colors.grey),
|
|
|
),
|
|
|
- const SizedBox(height: 4),
|
|
|
- const Text('添加', style: TextStyle(fontSize: 12)),
|
|
|
- ],
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
- // 爱情指数项目
|
|
|
- Widget _buildLoveIndexItems() {
|
|
|
- return Obx(() {
|
|
|
- return Row(
|
|
|
- children: [
|
|
|
- _buildIndexItem(
|
|
|
- '心情',
|
|
|
- controller.moodPercentage.value,
|
|
|
- Colors.pink.shade100,
|
|
|
- ),
|
|
|
- _buildIndexItem(
|
|
|
- '颜值',
|
|
|
- controller.appearancePercentage.value,
|
|
|
- Colors.purple.shade100,
|
|
|
- ),
|
|
|
- _buildIndexItem(
|
|
|
- '财富',
|
|
|
- controller.wealthPercentage.value,
|
|
|
- Colors.amber.shade100,
|
|
|
- ),
|
|
|
- _buildIndexItem(
|
|
|
- '洁净',
|
|
|
- controller.cleanlinessPercentage.value,
|
|
|
- Colors.blue.shade100,
|
|
|
- ),
|
|
|
- ],
|
|
|
- );
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- // 单个指数项
|
|
|
- Widget _buildIndexItem(String title, int percentage, Color color) {
|
|
|
- return Expanded(
|
|
|
- child: Column(
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
- children: [
|
|
|
- Text(title, style: const TextStyle(fontSize: 12)),
|
|
|
- const SizedBox(height: 4),
|
|
|
- Stack(
|
|
|
+ const SizedBox(height: 5),
|
|
|
+ Padding(
|
|
|
+ padding: EdgeInsets.only(left: 12.w, right: 12.w),
|
|
|
+ child: Row(
|
|
|
children: [
|
|
|
- Container(
|
|
|
- height: 6,
|
|
|
- decoration: BoxDecoration(
|
|
|
- color: Colors.grey.shade200,
|
|
|
- borderRadius: BorderRadius.circular(3),
|
|
|
- ),
|
|
|
- ),
|
|
|
- FractionallySizedBox(
|
|
|
- widthFactor: percentage / 100,
|
|
|
+ GestureDetector(
|
|
|
+ onTap: controller.clickEasyReply,
|
|
|
child: Container(
|
|
|
- height: 6,
|
|
|
+ width: 166.w,
|
|
|
+ height: 155.h,
|
|
|
decoration: BoxDecoration(
|
|
|
- color: color,
|
|
|
- borderRadius: BorderRadius.circular(3),
|
|
|
+ boxShadow: [
|
|
|
+ BoxShadow(
|
|
|
+ color: Colors.black.withValues(alpha: 0.10),
|
|
|
+ offset: Offset(0, 6),
|
|
|
+ blurRadius: 20,
|
|
|
+ spreadRadius: 0,
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ child: Assets.images.bgKeyboardEasyReply.image(
|
|
|
+ fit: BoxFit.fill,
|
|
|
),
|
|
|
),
|
|
|
),
|
|
|
+ SizedBox(width: 11.w),
|
|
|
+ Column(
|
|
|
+ children: [
|
|
|
+ _buildFeatureCard(
|
|
|
+ bg: Assets.images.bgKeyboardIntimacyAnalyze.image(),
|
|
|
+ title: Assets.images.iconKeyboardInitmacyTitle.image(
|
|
|
+ width: 80.w,
|
|
|
+ height: 19.h,
|
|
|
+ ),
|
|
|
+ subtitle: StringName.keyboardIntimacySubtitle,
|
|
|
+ logo: Assets.images.iconKeyboardIntimacyLogo.image(
|
|
|
+ width: 69.w,
|
|
|
+ height: 68.w,
|
|
|
+ fit: BoxFit.cover,
|
|
|
+ ),
|
|
|
+ onTap: controller.clickIntimacyAnalyze,
|
|
|
+ ),
|
|
|
+ SizedBox(height: 10.h),
|
|
|
+ _buildFeatureCard(
|
|
|
+ bg: Assets.images.bgKeyboardScreenshotReply.image(),
|
|
|
+ title: Assets.images.iconKeyboardScreenshotTitle.image(
|
|
|
+ width: 72.w,
|
|
|
+ height: 22.h,
|
|
|
+ ),
|
|
|
+ subtitle: StringName.keyboardScreenshotSubtitle,
|
|
|
+ logo: Assets.images.iconKeyboardScreenshotLogo.image(
|
|
|
+ width: 67.w,
|
|
|
+ height: 59.w,
|
|
|
+ fit: BoxFit.cover,
|
|
|
+ ),
|
|
|
+ onTap: controller.clickScreenshotReply,
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
],
|
|
|
),
|
|
|
- const SizedBox(height: 2),
|
|
|
- Text(
|
|
|
- '$percentage%',
|
|
|
- style: TextStyle(fontSize: 10, color: Colors.grey.shade600),
|
|
|
- ),
|
|
|
- ],
|
|
|
- ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- // 爆款玩法区域
|
|
|
- Widget _buildPopularFeatures() {
|
|
|
- return Container(
|
|
|
- margin: const EdgeInsets.symmetric(horizontal: 16),
|
|
|
- padding: const EdgeInsets.all(16),
|
|
|
- decoration: BoxDecoration(
|
|
|
- color: Colors.white,
|
|
|
- borderRadius: BorderRadius.circular(16),
|
|
|
- ),
|
|
|
- child: Column(
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
- children: [
|
|
|
- Row(
|
|
|
- children: [
|
|
|
- Container(
|
|
|
- width: 8,
|
|
|
- height: 8,
|
|
|
+ // 功能卡片
|
|
|
+ Widget _buildFeatureCard({
|
|
|
+ required Widget bg,
|
|
|
+ required Widget title,
|
|
|
+ required String subtitle,
|
|
|
+ required Widget logo,
|
|
|
+ required VoidCallback onTap,
|
|
|
+ }) {
|
|
|
+ return GestureDetector(
|
|
|
+ onTap: onTap,
|
|
|
+ child: SizedBox(
|
|
|
+ height: 73.h,
|
|
|
+ width: 159.w,
|
|
|
+ child: Stack(
|
|
|
+ clipBehavior: Clip.none,
|
|
|
+ children: [
|
|
|
+ Positioned(
|
|
|
+ child: Container(
|
|
|
decoration: BoxDecoration(
|
|
|
- shape: BoxShape.circle,
|
|
|
- color: Colors.purple.shade200,
|
|
|
+ boxShadow: [
|
|
|
+ BoxShadow(
|
|
|
+ color: Colors.black.withValues(alpha: 0.10),
|
|
|
+ offset: Offset(0, 6),
|
|
|
+ blurRadius: 20,
|
|
|
+ spreadRadius: 0,
|
|
|
+ ),
|
|
|
+ ],
|
|
|
),
|
|
|
+ child: bg,
|
|
|
),
|
|
|
- const SizedBox(width: 8),
|
|
|
- const Text(
|
|
|
- '爆款玩法',
|
|
|
- style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
|
|
|
- ),
|
|
|
- ],
|
|
|
- ),
|
|
|
- const SizedBox(height: 16),
|
|
|
- Row(
|
|
|
- children: [
|
|
|
- _buildFeatureCard(
|
|
|
- '追爱小键盘',
|
|
|
- '轻松回复TA',
|
|
|
- Colors.purple.shade50,
|
|
|
- Icons.keyboard,
|
|
|
- Colors.purple.shade200,
|
|
|
- ),
|
|
|
- const SizedBox(width: 12),
|
|
|
- _buildFeatureCard(
|
|
|
- '亲密度分析',
|
|
|
- '探索人格密码',
|
|
|
- Colors.orange.shade50,
|
|
|
- Icons.favorite_border,
|
|
|
- Colors.orange.shade200,
|
|
|
- ),
|
|
|
- ],
|
|
|
- ),
|
|
|
- const SizedBox(height: 12),
|
|
|
- Row(
|
|
|
- children: [
|
|
|
- _buildFeatureCard(
|
|
|
- '截图回复',
|
|
|
- '上下文义分析',
|
|
|
- Colors.blue.shade50,
|
|
|
- Icons.screenshot_monitor,
|
|
|
- Colors.blue.shade200,
|
|
|
- ),
|
|
|
- const SizedBox(width: 12),
|
|
|
- _buildFeatureCard(
|
|
|
- '截图回复',
|
|
|
- '上下文义分析',
|
|
|
- Colors.green.shade50,
|
|
|
- Icons.message,
|
|
|
- Colors.green.shade200,
|
|
|
- ),
|
|
|
- ],
|
|
|
- ),
|
|
|
- ],
|
|
|
+ ),
|
|
|
+ Row(
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ Container(
|
|
|
+ padding: EdgeInsets.only(top: 12.h, left: 8.w),
|
|
|
+ child: Column(
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ title,
|
|
|
+ Padding(
|
|
|
+ padding: EdgeInsets.only(left: 2.w),
|
|
|
+ child: Text(
|
|
|
+ subtitle,
|
|
|
+ style: TextStyle(
|
|
|
+ color: Colors.black.withAlpha(128),
|
|
|
+ fontSize: 10.sp,
|
|
|
+ fontWeight: FontWeight.w400,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ Positioned(top: -5.h, right: 5.w, child: logo),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
),
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- // 功能卡片
|
|
|
- Widget _buildFeatureCard(
|
|
|
- String title,
|
|
|
- String subtitle,
|
|
|
- Color bgColor,
|
|
|
- IconData icon,
|
|
|
- Color iconColor,
|
|
|
- ) {
|
|
|
- return Expanded(
|
|
|
+ // 当前键盘人设信息
|
|
|
+ Widget _buildKeyboardSettings() {
|
|
|
+ return GestureDetector(
|
|
|
+ onTap: controller.clickGoKeyboardManage,
|
|
|
child: Container(
|
|
|
- padding: const EdgeInsets.all(12),
|
|
|
- decoration: BoxDecoration(
|
|
|
- color: bgColor,
|
|
|
- borderRadius: BorderRadius.circular(12),
|
|
|
+ margin: EdgeInsets.symmetric(horizontal: 16.w),
|
|
|
+ padding: EdgeInsets.only(
|
|
|
+ left: 11.w,
|
|
|
+ right: 11.w,
|
|
|
+ top: 15.h,
|
|
|
+ bottom: 15.h,
|
|
|
+ ),
|
|
|
+ decoration: ShapeDecoration(
|
|
|
+ color: Colors.white,
|
|
|
+ shape: RoundedRectangleBorder(
|
|
|
+ side: BorderSide(width: 2, color: const Color(0xFFF5F4F9)),
|
|
|
+ borderRadius: BorderRadius.only(
|
|
|
+ topLeft: Radius.circular(16.r),
|
|
|
+ topRight: Radius.circular(16.r),
|
|
|
+ bottomLeft: Radius.circular(16.r),
|
|
|
+ bottomRight: Radius.circular(16.r),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
),
|
|
|
- child: Row(
|
|
|
+ child: Column(
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
|
- Expanded(
|
|
|
- child: Column(
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
- children: [
|
|
|
- Text(
|
|
|
- title,
|
|
|
- style: const TextStyle(
|
|
|
- fontSize: 14,
|
|
|
- fontWeight: FontWeight.bold,
|
|
|
+ Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
+ children: [
|
|
|
+ Assets.images.iconKeyboardCurrentCharacterTitle.image(
|
|
|
+ width: 90.w,
|
|
|
+ height: 20.h,
|
|
|
+ fit: BoxFit.cover,
|
|
|
+ ),
|
|
|
+ Row(
|
|
|
+ children: [
|
|
|
+ Text(
|
|
|
+ StringName.keyboardGoToManage,
|
|
|
+ style: TextStyle(
|
|
|
+ color: Colors.black.withAlpha(102),
|
|
|
+ fontSize: 12.sp,
|
|
|
+ fontWeight: FontWeight.w500,
|
|
|
+ ),
|
|
|
),
|
|
|
- ),
|
|
|
- const SizedBox(height: 4),
|
|
|
- Text(
|
|
|
- subtitle,
|
|
|
- style: TextStyle(fontSize: 12, color: Colors.grey.shade700),
|
|
|
- ),
|
|
|
- ],
|
|
|
- ),
|
|
|
- ),
|
|
|
- Container(
|
|
|
- width: 40,
|
|
|
- height: 40,
|
|
|
- decoration: BoxDecoration(
|
|
|
- color: Colors.white,
|
|
|
- borderRadius: BorderRadius.circular(8),
|
|
|
- ),
|
|
|
- child: Icon(icon, color: iconColor),
|
|
|
+ Assets.images.iconKeyboardCurrentGo.image(
|
|
|
+ width: 7.w,
|
|
|
+ height: 7.w,
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ],
|
|
|
),
|
|
|
+ const SizedBox(height: 16),
|
|
|
+ Obx(() {
|
|
|
+ final list = controller.homeInfo?.characterInfos;
|
|
|
+ if (list == null) {
|
|
|
+ return const Center(child: CircularProgressIndicator());
|
|
|
+ }
|
|
|
+ final showList = list.take(9).toList();
|
|
|
+
|
|
|
+ return SizedBox(
|
|
|
+ height: 32.h * 3 + 8.h * 2, // 三行高度 + 两个间距
|
|
|
+ child: GridView.builder(
|
|
|
+ padding: EdgeInsets.zero,
|
|
|
+ physics: const NeverScrollableScrollPhysics(),
|
|
|
+ // 禁止滑动
|
|
|
+ itemCount: showList.length,
|
|
|
+ gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
|
|
+ crossAxisCount: 3, // 每行3个
|
|
|
+ mainAxisSpacing: 8.h,
|
|
|
+ crossAxisSpacing: 8.w,
|
|
|
+ childAspectRatio: 96.w / 32.h, // 控制宽高比
|
|
|
+ ),
|
|
|
+ itemBuilder: (context, index) {
|
|
|
+ return _buildCharacterItem(showList[index]);
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ }),
|
|
|
],
|
|
|
),
|
|
|
),
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- // 键盘设置区域
|
|
|
- Widget _buildKeyboardSettings() {
|
|
|
+ // 人设标签
|
|
|
+ Widget _buildCharacterItem(CharacterInfo character) {
|
|
|
return Container(
|
|
|
- margin: const EdgeInsets.all(16),
|
|
|
- padding: const EdgeInsets.all(16),
|
|
|
- decoration: BoxDecoration(
|
|
|
- color: Colors.white,
|
|
|
- borderRadius: BorderRadius.circular(16),
|
|
|
+ alignment: Alignment.center,
|
|
|
+ decoration: ShapeDecoration(
|
|
|
+ color: const Color(0xFFF5F4F9),
|
|
|
+ shape: RoundedRectangleBorder(
|
|
|
+ borderRadius: BorderRadius.circular(31.r),
|
|
|
+ ),
|
|
|
),
|
|
|
- child: Column(
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
- children: [
|
|
|
- Row(
|
|
|
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
- children: [
|
|
|
- const Text(
|
|
|
- '当前键盘人设',
|
|
|
- style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold),
|
|
|
- ),
|
|
|
- Row(
|
|
|
- children: [
|
|
|
- const Text(
|
|
|
- '去管理',
|
|
|
- style: TextStyle(fontSize: 12, color: Colors.grey),
|
|
|
- ),
|
|
|
- Icon(
|
|
|
- Icons.chevron_right,
|
|
|
- size: 16,
|
|
|
- color: Colors.grey.shade400,
|
|
|
- ),
|
|
|
- ],
|
|
|
- ),
|
|
|
- ],
|
|
|
- ),
|
|
|
- const SizedBox(height: 16),
|
|
|
- Wrap(
|
|
|
- spacing: 8,
|
|
|
- runSpacing: 8,
|
|
|
- children: [
|
|
|
- _buildPersonaTag('高冷'),
|
|
|
- _buildPersonaTag('幽默搞笑'),
|
|
|
- _buildPersonaTag('粘心暖男'),
|
|
|
- _buildPersonaTag('温柔体贴'),
|
|
|
- _buildPersonaTag('阳光大男孩'),
|
|
|
- _buildPersonaTag('都市精英'),
|
|
|
- ],
|
|
|
- ),
|
|
|
- ],
|
|
|
+ child: Text(
|
|
|
+ '${character.emoji}${character.name}',
|
|
|
+ style: Styles.getTextStyleBlack204W400(12.sp),
|
|
|
+ maxLines: 1,
|
|
|
+ overflow: TextOverflow.fade,
|
|
|
),
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- // 人设标签
|
|
|
- Widget _buildPersonaTag(String text) {
|
|
|
+ // 活动banner
|
|
|
+ Widget _buildBanner() {
|
|
|
return Container(
|
|
|
- padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
|
|
|
- decoration: BoxDecoration(
|
|
|
- color: Colors.grey.shade100,
|
|
|
- borderRadius: BorderRadius.circular(16),
|
|
|
- ),
|
|
|
- child: Row(
|
|
|
- mainAxisSize: MainAxisSize.min,
|
|
|
+ width: 328.w,
|
|
|
+ height: 64.h,
|
|
|
+ child: Stack(
|
|
|
children: [
|
|
|
- const Icon(Icons.emoji_emotions, size: 16, color: Colors.amber),
|
|
|
- const SizedBox(width: 4),
|
|
|
- Text(text, style: const TextStyle(fontSize: 12)),
|
|
|
+ Assets.images.iconKeyboardBanner.image(width: 328.w, height: 64.h),
|
|
|
+
|
|
|
+ Positioned(
|
|
|
+ right: 53.w,
|
|
|
+ bottom: 18.h,
|
|
|
+ child: Obx(
|
|
|
+ () => Text(
|
|
|
+ controller.formattedTime,
|
|
|
+ style: TextStyle(
|
|
|
+ color: Colors.white,
|
|
|
+ fontSize: 12.sp,
|
|
|
+ fontWeight: FontWeight.w500,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
],
|
|
|
),
|
|
|
);
|
|
|
@@ -638,65 +680,3 @@ class KeyBoardView extends BaseView<KeyBoardController> {
|
|
|
return const Color(0xFFF5F5F5);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-class ProgressBar extends StatelessWidget {
|
|
|
- final String title;
|
|
|
- final RxInt value; // 例如传入 50,代表 50%
|
|
|
- final Color color;
|
|
|
-
|
|
|
- const ProgressBar({
|
|
|
- super.key,
|
|
|
- required this.title,
|
|
|
- required this.value,
|
|
|
- required this.color,
|
|
|
- });
|
|
|
-
|
|
|
- @override
|
|
|
- Widget build(BuildContext context) {
|
|
|
- return Obx(() {
|
|
|
- final double progress = (value.value / 100).clamp(0.0, 1.0); // 保证 0~1 范围
|
|
|
- return Container(
|
|
|
- child: Row(
|
|
|
- children: [
|
|
|
- SizedBox(width: 40, child: Text(title)),
|
|
|
- const SizedBox(width: 8),
|
|
|
- Expanded(
|
|
|
- child: Stack(
|
|
|
- children: [
|
|
|
- Container(
|
|
|
- height: 20,
|
|
|
- decoration: BoxDecoration(
|
|
|
- color: color.withOpacity(0.15), // 修正:用 withOpacity
|
|
|
- borderRadius: BorderRadius.circular(20.r),
|
|
|
- ),
|
|
|
- ),
|
|
|
- FractionallySizedBox(
|
|
|
- widthFactor: progress,
|
|
|
- child: Container(
|
|
|
- height: 20.h,
|
|
|
- decoration: BoxDecoration(
|
|
|
- color: color,
|
|
|
- borderRadius: BorderRadius.circular(20.r),
|
|
|
- ),
|
|
|
- ),
|
|
|
- ),
|
|
|
- Positioned.fill(
|
|
|
- child: Center(
|
|
|
- child: Text(
|
|
|
- "${value.value}%",
|
|
|
- style: const TextStyle(
|
|
|
- color: Colors.white,
|
|
|
- fontSize: 12,
|
|
|
- ),
|
|
|
- ),
|
|
|
- ),
|
|
|
- ),
|
|
|
- ],
|
|
|
- ),
|
|
|
- ),
|
|
|
- ],
|
|
|
- ),
|
|
|
- );
|
|
|
- });
|
|
|
- }
|
|
|
-}
|