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:
@@ -1339,6 +1339,21 @@ class _ModernChatInputState extends ConsumerState<ModernChatInput>
|
|||||||
),
|
),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
borderRadius: BorderRadius.circular(radius),
|
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: () {
|
onTap: () {
|
||||||
HapticFeedback.lightImpact();
|
HapticFeedback.lightImpact();
|
||||||
stopGeneration();
|
stopGeneration();
|
||||||
@@ -1357,7 +1372,7 @@ class _ModernChatInputState extends ConsumerState<ModernChatInput>
|
|||||||
child: Icon(
|
child: Icon(
|
||||||
Platform.isIOS ? CupertinoIcons.stop_fill : Icons.stop,
|
Platform.isIOS ? CupertinoIcons.stop_fill : Icons.stop,
|
||||||
size: IconSize.large,
|
size: IconSize.large,
|
||||||
color: context.conduitTheme.error,
|
color: context.conduitTheme.buttonPrimaryText,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user