refactor: Enhance chat input interaction with state-based overlay colors

- Implemented state-based overlay color changes for the chat input's InkWell widget to improve user feedback during interactions.
- Adjusted the color of the chat input icon to align with the primary button text color, enhancing visual consistency and usability.
This commit is contained in:
cogwheel0
2025-10-19 23:07:36 +05:30
parent 27bfde8f95
commit 810b44975d

View File

@@ -1339,6 +1339,21 @@ class _ModernChatInputState extends ConsumerState<ModernChatInput>
),
child: InkWell(
borderRadius: BorderRadius.circular(radius),
overlayColor: WidgetStateProperty.resolveWith<Color>((
Set<WidgetState> states,
) {
if (states.contains(WidgetState.pressed)) {
return context.conduitTheme.error.withValues(
alpha: Alpha.buttonPressed,
);
}
if (states.contains(WidgetState.hovered)) {
return context.conduitTheme.error.withValues(
alpha: Alpha.hover,
);
}
return Colors.transparent;
}),
onTap: () {
HapticFeedback.lightImpact();
stopGeneration();
@@ -1357,7 +1372,7 @@ class _ModernChatInputState extends ConsumerState<ModernChatInput>
child: Icon(
Platform.isIOS ? CupertinoIcons.stop_fill : Icons.stop,
size: IconSize.large,
color: context.conduitTheme.error,
color: context.conduitTheme.buttonPrimaryText,
),
),
),