feat:增加待办排序UI功能

This commit is contained in:
2025-11-20 11:47:35 +08:00
parent 565b04e65d
commit b2260d139b
4 changed files with 101 additions and 10 deletions

View File

@@ -213,6 +213,41 @@ Widget buildToggleSwitch<T extends Enum>({
);
}
ButtonStyle buildSegmentStyle(ColorScheme colors) {
return ButtonStyle(
side: WidgetStateProperty.all<BorderSide>(
const BorderSide(color: Colors.transparent, width: 0),
),
iconColor: WidgetStateProperty.resolveWith<Color>(
(Set<WidgetState> states) {
if (states.contains(WidgetState.selected)) {
return colors.onPrimary;
}
return Colors.grey;
},
),
backgroundColor: WidgetStateProperty.resolveWith<Color>((
Set<WidgetState> states,
) {
if (states.contains(WidgetState.selected)) {
return colors.primary;
}
return Colors.grey.shade200;
}),
foregroundColor: WidgetStateProperty.resolveWith<Color>((
Set<WidgetState> states,
) {
if (states.contains(WidgetState.selected)) {
return colors.onPrimary;
}
return colors.onSurface;
}),
shape: WidgetStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
),
);
}
Widget circleIconButton({
required IconData icon,
required VoidCallback onPressed,