dreampad/lib/app/modules/home/widgets/goal_dialog.dart

94 lines
2.9 KiB
Dart
Raw Permalink Normal View History

2023-11-28 10:44:58 +08:00
import 'package:dreampad/app/models/models.dart';
import 'package:dreampad/app/shared/shared.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
/// 目标dialog的模板
class GoalDialog extends StatelessWidget {
const GoalDialog({
super.key,
required this.goal,
});
final Goal goal;
@override
Widget build(BuildContext context) {
return Container(
height: 430.h,
width: 479.w,
decoration: const BoxDecoration(
image: DecorationImage(
image: Images.homeWindows,
fit: BoxFit.fill,
),
),
child: Stack(
children: [
Container(
padding: REdgeInsets.only(top: 25.0, bottom: 20.0),
width: double.infinity,
child: Text(
goal.title!,
style: TextStyles.mediumWhiteShadow26_100,
textAlign: TextAlign.center,
),
),
GestureDetector(
onTap: () {
SmartDialog.dismiss();
},
child: Container(
width: 107.w,
height: 57.h,
margin: REdgeInsets.only(left: 369.0),
child: Images.homeDelete,
),
),
Container(
width: double.infinity,
height: 300.h,
margin: REdgeInsets.only(top: 90.0, left: 40.0, right: 40.0),
child: Center(
child: Wrap(
runSpacing: 5.h,
children: goal.contents!.map((e) {
return Text.rich(
TextSpan(
children: [
WidgetSpan(
alignment: PlaceholderAlignment.middle,
child: Images.homeCircle,
),
const WidgetSpan(child: RSizedBox(width: 10.0)),
WidgetSpan(
alignment: PlaceholderAlignment.middle,
child: Container(
padding: REdgeInsets.symmetric(horizontal: 6.0),
height: 30.h,
color: const Color(0xFF00FCF0),
child: Text(
'${e.title!}:',
style: TextStyles.boldColor22,
),
),
),
const WidgetSpan(child: RSizedBox(width: 4.0)),
TextSpan(
text: e.content!,
style: TextStyles.boldWhite22,
),
],
),
);
}).toList(),
),
),
)
],
),
);
}
}