|
@@ -0,0 +1,334 @@
|
|
|
|
|
+import 'package:flutter/material.dart';
|
|
|
|
|
+import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
|
+import 'package:get/get.dart';
|
|
|
|
|
+import 'package:keyboard/base/base_page.dart';
|
|
|
|
|
+import 'package:keyboard/module/intimacy_analyse/intimacy_analyse_upload/widget/step_label_widget.dart';
|
|
|
|
|
+import 'package:keyboard/module/intimacy_analyse/intimacy_analyse_upload/widget/upload_add_widget.dart';
|
|
|
|
|
+import 'package:keyboard/module/intimacy_analyse/intimacy_analyse_upload/widget/upload_item_widget.dart';
|
|
|
|
|
+import 'package:keyboard/module/intimacy_analyse/intimacy_analyse_upload/widget/upload_nine_grid.dart';
|
|
|
|
|
+import 'package:keyboard/resource/colors.gen.dart';
|
|
|
|
|
+import 'package:keyboard/resource/string.gen.dart';
|
|
|
|
|
+import 'package:sprintf/sprintf.dart';
|
|
|
|
|
+import 'package:wechat_assets_picker/wechat_assets_picker.dart';
|
|
|
|
|
+
|
|
|
|
|
+import '../../../resource/assets.gen.dart';
|
|
|
|
|
+import '../../../router/app_page_arguments.dart';
|
|
|
|
|
+import '../../../router/app_pages.dart';
|
|
|
|
|
+import '../../../utils/string_format_util.dart';
|
|
|
|
|
+import '../../../widget/gradient_text.dart';
|
|
|
|
|
+import '../widget/intimacy_user_widget.dart';
|
|
|
|
|
+import 'intimacy_analyse_upload_controller.dart';
|
|
|
|
|
+
|
|
|
|
|
+/// 亲密度分析上传页
|
|
|
|
|
+class IntimacyAnalyseUploadPage
|
|
|
|
|
+ extends BasePage<IntimacyAnalyseUploadController> {
|
|
|
|
|
+ const IntimacyAnalyseUploadPage({super.key});
|
|
|
|
|
+
|
|
|
|
|
+ @override
|
|
|
|
|
+ bool immersive() {
|
|
|
|
|
+ // 开启沉浸式
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @override
|
|
|
|
|
+ backgroundColor() {
|
|
|
|
|
+ return Colors.transparent;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /// 页面跳转
|
|
|
|
|
+ static start(List<AssetEntity> selectedAssetList) {
|
|
|
|
|
+ Get.toNamed(
|
|
|
|
|
+ RoutePath.intimacyAnalyseUpload,
|
|
|
|
|
+ arguments: {AppPageArguments.selectedAssetList: selectedAssetList},
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @override
|
|
|
|
|
+ Widget buildBody(BuildContext context) {
|
|
|
|
|
+ return Scaffold(
|
|
|
|
|
+ backgroundColor: backgroundColor(),
|
|
|
|
|
+ body: Container(
|
|
|
|
|
+ decoration: BoxDecoration(
|
|
|
|
|
+ image: DecorationImage(
|
|
|
|
|
+ image: Assets.images.bgIntimacyAnalyse.provider(),
|
|
|
|
|
+ fit: BoxFit.fill,
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ child: Column(
|
|
|
|
|
+ children: [_buildStatusBar(), _buildTopBar(), _buildContent()],
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /// 导航栏占位
|
|
|
|
|
+ Widget _buildStatusBar() {
|
|
|
|
|
+ double statusBarHeight = MediaQuery.of(Get.context!).padding.top;
|
|
|
|
|
+ return Container(
|
|
|
|
|
+ // 导航栏高度
|
|
|
|
|
+ height: statusBarHeight,
|
|
|
|
|
+ color: backgroundColor(),
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /// 顶部栏
|
|
|
|
|
+ Widget _buildTopBar() {
|
|
|
|
|
+ return Container(
|
|
|
|
|
+ // 宽度撑满父组件
|
|
|
|
|
+ width: double.infinity,
|
|
|
|
|
+ // 高度为标准导航栏高度
|
|
|
|
|
+ height: kToolbarHeight,
|
|
|
|
|
+ // 背景颜色
|
|
|
|
|
+ color: Colors.transparent,
|
|
|
|
|
+ child: ConstrainedBox(
|
|
|
|
|
+ // 设置宽度为无限大,撑满父组件,否则Stack获取不到高度,会报错
|
|
|
|
|
+ constraints: BoxConstraints(minWidth: double.infinity),
|
|
|
|
|
+ child: Stack(
|
|
|
|
|
+ alignment: Alignment.center,
|
|
|
|
|
+ children: [
|
|
|
|
|
+ // 返回按钮
|
|
|
|
|
+ Positioned(
|
|
|
|
|
+ left: 16.0,
|
|
|
|
|
+ child: GestureDetector(
|
|
|
|
|
+ onTap: controller.clickBack,
|
|
|
|
|
+ child: Assets.images.iconWhiteBackArrow.image(
|
|
|
|
|
+ width: 24.w,
|
|
|
|
|
+ height: 24.h,
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ // TabBar
|
|
|
|
|
+ Positioned(
|
|
|
|
|
+ child: Text(
|
|
|
|
|
+ StringName.intimacyAnalyse,
|
|
|
|
|
+ style: TextStyle(
|
|
|
|
|
+ color: ColorName.white,
|
|
|
|
|
+ fontSize: 17.sp,
|
|
|
|
|
+ fontWeight: FontWeight.w500,
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ ],
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /// 步骤标题
|
|
|
|
|
+ Widget _buildStepTitle(int step, String title) {
|
|
|
|
|
+ return Row(
|
|
|
|
|
+ children: [
|
|
|
|
|
+ // 步骤标签
|
|
|
|
|
+ StepLabelWidget(
|
|
|
|
|
+ label: StringFormatUtil.formatStr(
|
|
|
|
|
+ StringName.intimacyAnalyseStep,
|
|
|
|
|
+ step.toString(),
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ SizedBox(width: 10.w),
|
|
|
|
|
+ // 标题
|
|
|
|
|
+ GradientText(
|
|
|
|
|
+ // 渐变颜色
|
|
|
|
|
+ colors: [ColorName.stepTitleColor1, ColorName.stepTitleColor2],
|
|
|
|
|
+ child: Text(
|
|
|
|
|
+ title,
|
|
|
|
|
+ style: TextStyle(fontSize: 20.sp, fontWeight: FontWeight.w700),
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ ],
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /// 构建上传卡片
|
|
|
|
|
+ Widget _buildUploadCard() {
|
|
|
|
|
+ return Container(
|
|
|
|
|
+ margin: EdgeInsets.only(left: 12.w, top: 10.h, right: 12.w),
|
|
|
|
|
+ child: Stack(
|
|
|
|
|
+ // 不裁切超出区域的子组件,例如下面的顶部的图标
|
|
|
|
|
+ clipBehavior: Clip.none,
|
|
|
|
|
+ children: [
|
|
|
|
|
+ // 顶部的图标
|
|
|
|
|
+ Positioned(
|
|
|
|
|
+ top: -11.h,
|
|
|
|
|
+ right: 0,
|
|
|
|
|
+ child: Assets.images.iconIntimacyAnalyseUploadTop.image(
|
|
|
|
|
+ height: 63.h,
|
|
|
|
|
+ width: 103.w,
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ // 卡片背景
|
|
|
|
|
+ Container(
|
|
|
|
|
+ decoration: BoxDecoration(
|
|
|
|
|
+ image: DecorationImage(
|
|
|
|
|
+ image: Assets.images.bgIntimacyAnalyseUploadCard.provider(),
|
|
|
|
|
+ fit: BoxFit.fill,
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ child: Column(
|
|
|
|
|
+ // 左对齐
|
|
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
+ children: [
|
|
|
|
|
+ // 步骤1
|
|
|
|
|
+ Container(
|
|
|
|
|
+ margin: EdgeInsets.only(left: 12.w, top: 16.h),
|
|
|
|
|
+ child: _buildStepTitle(
|
|
|
|
|
+ 1,
|
|
|
|
|
+ StringName.intimacyAnalyseStepTitleSelectImage,
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ SizedBox(height: 4.h),
|
|
|
|
|
+ // 提示文字
|
|
|
|
|
+ Container(
|
|
|
|
|
+ margin: EdgeInsets.only(left: 12.w),
|
|
|
|
|
+ child: Text(
|
|
|
|
|
+ StringName.intimacyAnalyseUploadCardTip,
|
|
|
|
|
+ style: TextStyle(
|
|
|
|
|
+ fontSize: 12.sp,
|
|
|
|
|
+ fontWeight: FontWeight.w400,
|
|
|
|
|
+ color: ColorName.black60,
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ SizedBox(height: 16.h),
|
|
|
|
|
+ // 九宫格
|
|
|
|
|
+ Container(
|
|
|
|
|
+ margin: EdgeInsets.only(left: 12.w, right: 12.w),
|
|
|
|
|
+ padding: EdgeInsets.only(
|
|
|
|
|
+ left: 12.w,
|
|
|
|
|
+ top: 12.h,
|
|
|
|
|
+ right: 12.w,
|
|
|
|
|
+ bottom: 12.h,
|
|
|
|
|
+ ),
|
|
|
|
|
+ decoration: BoxDecoration(
|
|
|
|
|
+ color: ColorName.white,
|
|
|
|
|
+ borderRadius: BorderRadius.circular(16.r),
|
|
|
|
|
+ ),
|
|
|
|
|
+ child: UploadNineGrid(
|
|
|
|
|
+ imageUrls: ["", "", "", "", "", "", ""],
|
|
|
|
|
+ maxCount: 9,
|
|
|
|
|
+ spacing: 8.0,
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ SizedBox(height: 10.h),
|
|
|
|
|
+ // 当前的亲密关系
|
|
|
|
|
+ _buildRecommendIntimacy(),
|
|
|
|
|
+ SizedBox(height: 18.h),
|
|
|
|
|
+ ],
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ ],
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /// 推荐的亲密关系
|
|
|
|
|
+ Widget _buildRecommendIntimacy() {
|
|
|
|
|
+ return Container(
|
|
|
|
|
+ width: double.maxFinite,
|
|
|
|
|
+ margin: EdgeInsets.only(left: 14.w, right: 14.w),
|
|
|
|
|
+ // 圆角背景
|
|
|
|
|
+ decoration: BoxDecoration(
|
|
|
|
|
+ // 渐变背景
|
|
|
|
|
+ gradient: LinearGradient(
|
|
|
|
|
+ colors: [
|
|
|
|
|
+ ColorName.bgIntimacyRelationColor1,
|
|
|
|
|
+ ColorName.bgIntimacyRelationColor2,
|
|
|
|
|
+ ],
|
|
|
|
|
+ begin: Alignment.centerLeft,
|
|
|
|
|
+ end: Alignment.centerRight,
|
|
|
|
|
+ ),
|
|
|
|
|
+ shape: BoxShape.rectangle,
|
|
|
|
|
+ border: Border.all(color: ColorName.white80, width: 1.w),
|
|
|
|
|
+ borderRadius: BorderRadius.all(Radius.circular(23.r)),
|
|
|
|
|
+ ),
|
|
|
|
|
+ child: Row(
|
|
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
+ children: [
|
|
|
|
|
+ Row(
|
|
|
|
|
+ children: [
|
|
|
|
|
+ SizedBox(width: 6.w),
|
|
|
|
|
+ // 用户亲密头像
|
|
|
|
|
+ IntimacyUserWidget(
|
|
|
|
|
+ width: 68.w,
|
|
|
|
|
+ height: 34.h,
|
|
|
|
|
+ avatarSize: 34.0,
|
|
|
|
|
+ avatarUrl1: '',
|
|
|
|
|
+ avatarUrl2: '',
|
|
|
|
|
+ avatarBorderWidth: 1.w,
|
|
|
|
|
+ loveSize: 19.w,
|
|
|
|
|
+ ),
|
|
|
|
|
+ SizedBox(width: 4.w),
|
|
|
|
|
+ Text(
|
|
|
|
|
+ StringName.mySelf,
|
|
|
|
|
+ style: TextStyle(
|
|
|
|
|
+ color: ColorName.black80,
|
|
|
|
|
+ fontSize: 11.sp,
|
|
|
|
|
+ fontWeight: FontWeight.w500,
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ SizedBox(width: 4.w),
|
|
|
|
|
+ Text(
|
|
|
|
|
+ StringName.and,
|
|
|
|
|
+ style: TextStyle(
|
|
|
|
|
+ color: ColorName.black41,
|
|
|
|
|
+ fontSize: 11.sp,
|
|
|
|
|
+ fontWeight: FontWeight.w500,
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ SizedBox(width: 4.w),
|
|
|
|
|
+ Text(
|
|
|
|
|
+ "小瑞",
|
|
|
|
|
+ style: TextStyle(
|
|
|
|
|
+ color: ColorName.black80,
|
|
|
|
|
+ fontSize: 11.sp,
|
|
|
|
|
+ fontWeight: FontWeight.w500,
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ SizedBox(width: 5.w),
|
|
|
|
|
+ GradientText(
|
|
|
|
|
+ // 渐变颜色
|
|
|
|
|
+ colors: [
|
|
|
|
|
+ ColorName.intimacyRelationColor1,
|
|
|
|
|
+ ColorName.intimacyRelationColor2,
|
|
|
|
|
+ ],
|
|
|
|
|
+ child: Text(
|
|
|
|
|
+ StringName.intimacyRelation,
|
|
|
|
|
+ style: TextStyle(
|
|
|
|
|
+ fontSize: 11.sp,
|
|
|
|
|
+ fontWeight: FontWeight.w500,
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ ],
|
|
|
|
|
+ ),
|
|
|
|
|
+ // 切换按钮
|
|
|
|
|
+ Container(
|
|
|
|
|
+ padding: EdgeInsets.symmetric(horizontal: 9.w, vertical: 6.h),
|
|
|
|
|
+ margin: EdgeInsets.only(right: 8.w, top: 8.h, bottom: 8.h),
|
|
|
|
|
+ decoration: BoxDecoration(
|
|
|
|
|
+ color: ColorName.white,
|
|
|
|
|
+ borderRadius: BorderRadius.circular(22.r),
|
|
|
|
|
+ ),
|
|
|
|
|
+ child: Text(
|
|
|
|
|
+ StringName.intimacyAnalyseSwitchTaTest,
|
|
|
|
|
+ style: TextStyle(
|
|
|
|
|
+ color: ColorName.black80,
|
|
|
|
|
+ fontSize: 12.sp,
|
|
|
|
|
+ fontWeight: FontWeight.w400,
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ ],
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /// 内容
|
|
|
|
|
+ Widget _buildContent() {
|
|
|
|
|
+ return Expanded(
|
|
|
|
|
+ child: SingleChildScrollView(
|
|
|
|
|
+ child: Column(children: [_buildUploadCard()]),
|
|
|
|
|
+ ),
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+}
|