feat: 添加自动化任务(automation_jobs)功能模块

This commit is contained in:
qzl
2026-03-24 12:38:11 +08:00
parent f4b7eb7e09
commit 23359c2d01
43 changed files with 4266 additions and 1139 deletions
+29 -26
View File
@@ -6,7 +6,7 @@ class AppToggleSwitch extends StatelessWidget {
const AppToggleSwitch({
super.key,
required this.value,
required this.onChanged,
this.onChanged,
this.activeBackgroundColor,
this.inactiveBackgroundColor,
this.activeBorderColor,
@@ -14,7 +14,7 @@ class AppToggleSwitch extends StatelessWidget {
});
final bool value;
final ValueChanged<bool> onChanged;
final ValueChanged<bool>? onChanged;
final Color? activeBackgroundColor;
final Color? inactiveBackgroundColor;
final Color? activeBorderColor;
@@ -23,32 +23,35 @@ class AppToggleSwitch extends StatelessWidget {
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () => onChanged(!value),
child: Container(
width: AppSpacing.xxl + AppSpacing.xl,
height: AppSpacing.xl + AppSpacing.xs,
padding: const EdgeInsets.all(AppSpacing.xs / 2),
decoration: BoxDecoration(
color: value
? (activeBackgroundColor ?? AppColors.blue100)
: (inactiveBackgroundColor ?? AppColors.surfaceTertiary),
borderRadius: BorderRadius.circular(AppRadius.full),
border: Border.all(
onTap: onChanged == null ? null : () => onChanged!(!value),
child: Opacity(
opacity: onChanged == null ? 0.55 : 1,
child: Container(
width: AppSpacing.xxl + AppSpacing.xl,
height: AppSpacing.xl + AppSpacing.xs,
padding: const EdgeInsets.all(AppSpacing.xs / 2),
decoration: BoxDecoration(
color: value
? (activeBorderColor ?? AppColors.blue300)
: (inactiveBorderColor ?? AppColors.borderSecondary),
? (activeBackgroundColor ?? AppColors.blue100)
: (inactiveBackgroundColor ?? AppColors.surfaceTertiary),
borderRadius: BorderRadius.circular(AppRadius.full),
border: Border.all(
color: value
? (activeBorderColor ?? AppColors.blue300)
: (inactiveBorderColor ?? AppColors.borderSecondary),
),
),
),
child: AnimatedAlign(
duration: const Duration(milliseconds: 150),
alignment: value ? Alignment.centerRight : Alignment.centerLeft,
child: Container(
width: AppSpacing.lg + AppSpacing.xs,
height: AppSpacing.lg + AppSpacing.xs,
decoration: BoxDecoration(
color: AppColors.white,
borderRadius: BorderRadius.circular(AppRadius.full),
border: Border.all(color: AppColors.borderSecondary),
child: AnimatedAlign(
duration: const Duration(milliseconds: 150),
alignment: value ? Alignment.centerRight : Alignment.centerLeft,
child: Container(
width: AppSpacing.lg + AppSpacing.xs,
height: AppSpacing.lg + AppSpacing.xs,
decoration: BoxDecoration(
color: AppColors.white,
borderRadius: BorderRadius.circular(AppRadius.full),
border: Border.all(color: AppColors.borderSecondary),
),
),
),
),