|
|
|
@ -1,15 +1,13 @@ |
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
import 'package:flutter_markdown/flutter_markdown.dart'; |
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
import 'package:get/get.dart'; |
|
|
|
|
|
|
|
class TemplateDetailsView extends StatefulWidget { |
|
|
|
const TemplateDetailsView({super.key}); |
|
|
|
class TemplateDetailsView extends StatelessWidget { |
|
|
|
final Map data; |
|
|
|
|
|
|
|
@override |
|
|
|
State<TemplateDetailsView> createState() => _TemplateDetailsViewState(); |
|
|
|
} |
|
|
|
const TemplateDetailsView(this.data, {super.key}); |
|
|
|
|
|
|
|
class _TemplateDetailsViewState extends State<TemplateDetailsView> { |
|
|
|
@override |
|
|
|
Widget build(BuildContext context) { |
|
|
|
final isDarkMode = Theme.of(context).brightness == Brightness.dark; |
|
|
|
@ -53,7 +51,81 @@ class _TemplateDetailsViewState extends State<TemplateDetailsView> { |
|
|
|
Expanded( |
|
|
|
child: ListView( |
|
|
|
padding: EdgeInsets.symmetric(horizontal: 12.w), |
|
|
|
children: [], |
|
|
|
children: [ |
|
|
|
Padding( |
|
|
|
padding: EdgeInsets.only(top: 20.w), |
|
|
|
child: Text( |
|
|
|
data['name'], |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 20.sp, |
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
Padding( |
|
|
|
padding: EdgeInsets.only(top: 20.w, bottom: 5.w), |
|
|
|
child: Text( |
|
|
|
'标签', |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12.sp, |
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
Wrap( |
|
|
|
spacing: 5.w, |
|
|
|
children: List.generate( |
|
|
|
data['tag'].length, |
|
|
|
(int idx) { |
|
|
|
return Container( |
|
|
|
padding: |
|
|
|
EdgeInsets.symmetric(horizontal: 5.w, vertical: 2.w), |
|
|
|
decoration: BoxDecoration( |
|
|
|
color: Colors.grey[200], |
|
|
|
borderRadius: BorderRadius.circular(4.r), |
|
|
|
), |
|
|
|
child: Text( |
|
|
|
data['tag'][idx], |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 10.sp, |
|
|
|
color: Colors.grey[600], |
|
|
|
), |
|
|
|
), |
|
|
|
); |
|
|
|
}, |
|
|
|
), |
|
|
|
), |
|
|
|
Padding( |
|
|
|
padding: EdgeInsets.only(top: 20.w, bottom: 5.w), |
|
|
|
child: Text( |
|
|
|
'描述', |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12.sp, |
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
Text( |
|
|
|
data['desc'], |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 14.sp, |
|
|
|
color: Colors.grey[600], |
|
|
|
), |
|
|
|
), |
|
|
|
Padding( |
|
|
|
padding: EdgeInsets.only(top: 20.w, bottom: 5.w), |
|
|
|
child: Text( |
|
|
|
'模版', |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12.sp, |
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
MarkdownBody( |
|
|
|
data: data['prompt'], |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
Padding( |
|
|
|
|