|
@@ -1,5 +1,6 @@
|
|
|
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/cupertino.dart';
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
|
+import '../../../data/bean/widget_location.dart';
|
|
|
import '../../../resource/colors.gen.dart';
|
|
import '../../../resource/colors.gen.dart';
|
|
|
import '../../../widget/gradient_text.dart';
|
|
import '../../../widget/gradient_text.dart';
|
|
|
import '../intimacy_analyse_upload/widget/step_label_widget.dart';
|
|
import '../intimacy_analyse_upload/widget/step_label_widget.dart';
|
|
@@ -18,16 +19,22 @@ class StepCard extends StatelessWidget {
|
|
|
/// 内容组件
|
|
/// 内容组件
|
|
|
final Widget contentWidget;
|
|
final Widget contentWidget;
|
|
|
|
|
|
|
|
|
|
+ /// 顶部图标组件的位置信息
|
|
|
|
|
+ final WidgetLocation? topIconWidgetLocation;
|
|
|
|
|
+
|
|
|
const StepCard({
|
|
const StepCard({
|
|
|
super.key,
|
|
super.key,
|
|
|
required this.bgImageProvider,
|
|
required this.bgImageProvider,
|
|
|
this.topTitleWidget,
|
|
this.topTitleWidget,
|
|
|
required this.contentWidget,
|
|
required this.contentWidget,
|
|
|
this.topIconWidget,
|
|
this.topIconWidget,
|
|
|
|
|
+ this.topIconWidgetLocation,
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
@override
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
Widget build(BuildContext context) {
|
|
|
|
|
+ var topIconWidgetLocation =
|
|
|
|
|
+ this.topIconWidgetLocation ?? WidgetLocation(null, -11.h, 0, null);
|
|
|
return Container(
|
|
return Container(
|
|
|
margin: EdgeInsets.only(left: 12.w, top: 10.h, right: 12.w),
|
|
margin: EdgeInsets.only(left: 12.w, top: 10.h, right: 12.w),
|
|
|
child: Stack(
|
|
child: Stack(
|
|
@@ -37,7 +44,13 @@ class StepCard extends StatelessWidget {
|
|
|
// 顶部的图标
|
|
// 顶部的图标
|
|
|
topIconWidget == null
|
|
topIconWidget == null
|
|
|
? SizedBox()
|
|
? SizedBox()
|
|
|
- : Positioned(top: -11.h, right: 0, child: topIconWidget!),
|
|
|
|
|
|
|
+ : Positioned(
|
|
|
|
|
+ left: topIconWidgetLocation.left,
|
|
|
|
|
+ top: topIconWidgetLocation.top,
|
|
|
|
|
+ right: topIconWidgetLocation.right,
|
|
|
|
|
+ bottom: topIconWidgetLocation.bottom,
|
|
|
|
|
+ child: topIconWidget!,
|
|
|
|
|
+ ),
|
|
|
// 卡片背景
|
|
// 卡片背景
|
|
|
Container(
|
|
Container(
|
|
|
// 渐变背景
|
|
// 渐变背景
|
|
@@ -55,6 +68,9 @@ class StepCard extends StatelessWidget {
|
|
|
decoration: BoxDecoration(
|
|
decoration: BoxDecoration(
|
|
|
image: DecorationImage(image: bgImageProvider, fit: BoxFit.fill),
|
|
image: DecorationImage(image: bgImageProvider, fit: BoxFit.fill),
|
|
|
),
|
|
),
|
|
|
|
|
+ constraints: BoxConstraints(
|
|
|
|
|
+ minHeight: 260.h
|
|
|
|
|
+ ),
|
|
|
child: Column(
|
|
child: Column(
|
|
|
// 左对齐
|
|
// 左对齐
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|