|
|
|
@ -179,6 +179,7 @@ class _TemplateViewState extends State<TemplateView> { |
|
|
|
} |
|
|
|
|
|
|
|
Widget _item(Map data, bool isLast) { |
|
|
|
final isDarkMode = Theme.of(context).brightness == Brightness.dark; |
|
|
|
return Column( |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
children: [ |
|
|
|
@ -200,13 +201,13 @@ class _TemplateViewState extends State<TemplateView> { |
|
|
|
data['name'], |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 18.sp, |
|
|
|
color: Colors.black87, |
|
|
|
color: isDarkMode ? Colors.white : Colors.black87, |
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
), |
|
|
|
), |
|
|
|
const Icon( |
|
|
|
Icon( |
|
|
|
Icons.keyboard_arrow_right, |
|
|
|
color: Colors.grey, |
|
|
|
color: isDarkMode ? Colors.grey[400] : Colors.grey, |
|
|
|
) |
|
|
|
], |
|
|
|
), |
|
|
|
@ -242,6 +243,7 @@ class _TemplateViewState extends State<TemplateView> { |
|
|
|
} |
|
|
|
|
|
|
|
Widget _template(Map template, bool isEdit) { |
|
|
|
final isDarkMode = Theme.of(context).brightness == Brightness.dark; |
|
|
|
return Container( |
|
|
|
width: 200.w, |
|
|
|
margin: EdgeInsets.symmetric(horizontal: 4.w), |
|
|
|
@ -260,7 +262,7 @@ class _TemplateViewState extends State<TemplateView> { |
|
|
|
Container( |
|
|
|
padding: EdgeInsets.all(5.w), |
|
|
|
decoration: BoxDecoration( |
|
|
|
color: Colors.white, |
|
|
|
color: isDarkMode ? const Color(0xFF2D2D2D) : Colors.white, |
|
|
|
gradient: _templateData['id'] == template['id'] |
|
|
|
? const LinearGradient( |
|
|
|
colors: [Colors.blue, Colors.pinkAccent], |
|
|
|
@ -274,7 +276,7 @@ class _TemplateViewState extends State<TemplateView> { |
|
|
|
padding: EdgeInsets.all(10.w), |
|
|
|
decoration: BoxDecoration( |
|
|
|
borderRadius: BorderRadius.circular(10.w), |
|
|
|
color: Colors.white, |
|
|
|
color: isDarkMode ? const Color(0xFF2D2D2D) : Colors.white, |
|
|
|
), |
|
|
|
child: Column( |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
@ -293,7 +295,7 @@ class _TemplateViewState extends State<TemplateView> { |
|
|
|
template['name'], |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 16.sp, |
|
|
|
color: Colors.black87, |
|
|
|
color: isDarkMode ? Colors.white : Colors.black87, |
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
), |
|
|
|
), |
|
|
|
@ -308,14 +310,18 @@ class _TemplateViewState extends State<TemplateView> { |
|
|
|
padding: EdgeInsets.symmetric( |
|
|
|
horizontal: 5.w, vertical: 2.w), |
|
|
|
decoration: BoxDecoration( |
|
|
|
color: Colors.grey[200], |
|
|
|
color: isDarkMode |
|
|
|
? Colors.grey[700] |
|
|
|
: Colors.grey[200], |
|
|
|
borderRadius: BorderRadius.circular(4.r), |
|
|
|
), |
|
|
|
child: Text( |
|
|
|
template['tag'][idx], |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 10.sp, |
|
|
|
color: Colors.grey[600], |
|
|
|
color: isDarkMode |
|
|
|
? Colors.grey[300] |
|
|
|
: Colors.grey[600], |
|
|
|
), |
|
|
|
), |
|
|
|
); |
|
|
|
@ -327,7 +333,9 @@ class _TemplateViewState extends State<TemplateView> { |
|
|
|
overflow: TextOverflow.ellipsis, |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12.sp, |
|
|
|
color: Colors.grey[600], |
|
|
|
color: isDarkMode |
|
|
|
? Colors.grey[400] |
|
|
|
: Colors.grey[600], |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
@ -347,7 +355,7 @@ class _TemplateViewState extends State<TemplateView> { |
|
|
|
padding: EdgeInsets.all(10.w), |
|
|
|
child: Icon( |
|
|
|
Icons.fullscreen, |
|
|
|
color: Colors.grey[600], |
|
|
|
color: isDarkMode ? Colors.grey[400] : Colors.grey[600], |
|
|
|
size: 26.w, |
|
|
|
), |
|
|
|
), |
|
|
|
@ -403,6 +411,7 @@ class _TemplateViewState extends State<TemplateView> { |
|
|
|
} |
|
|
|
|
|
|
|
Widget _createTemplate(int categoryid) { |
|
|
|
final isDarkMode = Theme.of(context).brightness == Brightness.dark; |
|
|
|
return GestureDetector( |
|
|
|
onTap: () async { |
|
|
|
await Get.to(() => TemplateEditView(categoryid: categoryid)); |
|
|
|
@ -418,7 +427,7 @@ class _TemplateViewState extends State<TemplateView> { |
|
|
|
borderRadius: BorderRadius.circular(14.w), |
|
|
|
), |
|
|
|
child: Container( |
|
|
|
color: Colors.white, |
|
|
|
color: isDarkMode ? const Color(0xFF2D2D2D) : Colors.white, |
|
|
|
child: Column( |
|
|
|
mainAxisAlignment: MainAxisAlignment.center, |
|
|
|
children: [ |
|
|
|
@ -436,7 +445,7 @@ class _TemplateViewState extends State<TemplateView> { |
|
|
|
'创建', |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 16.sp, |
|
|
|
color: Colors.black87, |
|
|
|
color: isDarkMode ? Colors.white : Colors.black87, |
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
), |
|
|
|
), |
|
|
|
|