4 changed files with 134 additions and 15 deletions
@ -0,0 +1,37 @@ |
|||
import 'package:flutter/material.dart'; |
|||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|||
|
|||
class RowGradeWidget extends StatefulWidget { |
|||
final Map templateData; |
|||
|
|||
const RowGradeWidget(this.templateData, {super.key}); |
|||
|
|||
@override |
|||
State<RowGradeWidget> createState() => _RowGradeWidgetState(); |
|||
} |
|||
|
|||
class _RowGradeWidgetState extends State<RowGradeWidget> { |
|||
Map get _templateData => widget.templateData; |
|||
|
|||
@override |
|||
Widget build(BuildContext context) { |
|||
final isDarkMode = Theme.of(context).brightness == Brightness.dark; |
|||
|
|||
return Padding( |
|||
padding: EdgeInsets.fromLTRB(10.w, 10.w, 0, 10.w), |
|||
child: Row( |
|||
children: [ |
|||
Expanded( |
|||
child: Text( |
|||
_templateData['name'], |
|||
style: TextStyle( |
|||
fontSize: 14.sp, |
|||
color: isDarkMode ? Colors.white : Colors.black, |
|||
), |
|||
), |
|||
), |
|||
], |
|||
), |
|||
); |
|||
} |
|||
} |
|||
@ -0,0 +1,56 @@ |
|||
import 'package:flutter/material.dart'; |
|||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|||
|
|||
class RowTimerWidget extends StatefulWidget { |
|||
final Map templateData; |
|||
|
|||
const RowTimerWidget(this.templateData, {super.key}); |
|||
|
|||
@override |
|||
State<RowTimerWidget> createState() => _RowTimerWidgetState(); |
|||
} |
|||
|
|||
class _RowTimerWidgetState extends State<RowTimerWidget> { |
|||
Map get _templateData => widget.templateData; |
|||
|
|||
@override |
|||
Widget build(BuildContext context) { |
|||
final isDarkMode = Theme.of(context).brightness == Brightness.dark; |
|||
|
|||
return GestureDetector( |
|||
onTap: () => _timerBottomSheet(isDarkMode), |
|||
behavior: HitTestBehavior.translucent, |
|||
child: Padding( |
|||
padding: EdgeInsets.fromLTRB(10.w, 10.w, 0, 10.w), |
|||
child: Row( |
|||
children: [ |
|||
Expanded( |
|||
child: Text( |
|||
_templateData['name'], |
|||
style: TextStyle( |
|||
fontSize: 14.sp, |
|||
color: isDarkMode ? Colors.white : Colors.black, |
|||
), |
|||
), |
|||
), |
|||
if (_templateData['value'] > 0) |
|||
Text( |
|||
'${_templateData['value']}分钟', |
|||
style: TextStyle( |
|||
fontSize: 12.sp, |
|||
color: isDarkMode ? Colors.white : Colors.grey, |
|||
), |
|||
), |
|||
Icon( |
|||
Icons.chevron_right, |
|||
size: 26.w, |
|||
color: Colors.blue, |
|||
), |
|||
], |
|||
), |
|||
), |
|||
); |
|||
} |
|||
|
|||
void _timerBottomSheet(bool isDarkMode) {} |
|||
} |
|||
Loading…
Reference in new issue