Skip to content

Commit

Permalink
feat: [DX-989] Update clear all button (#521)
Browse files Browse the repository at this point in the history
  • Loading branch information
witwash authored Jan 23, 2024
1 parent 8e3f63e commit c6934ca
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 20 deletions.
24 changes: 9 additions & 15 deletions optimus/lib/src/dropdown/dropdown_select.dart
Original file line number Diff line number Diff line change
Expand Up @@ -384,18 +384,14 @@ class _ClearAllButton extends StatelessWidget {
final GestureTapCallback? onTap;

@override
Widget build(BuildContext context) {
final theme = OptimusTheme.of(context);

return _CustomRawGestureDetector(
onTap: onTap,
child: Icon(
OptimusIcons.clear_selection,
size: 24,
color: theme.colors.neutral100,
),
);
}
Widget build(BuildContext context) => _CustomRawGestureDetector(
onTap: onTap,
child: Icon(
OptimusIcons.cross_close,
size: context.tokens.sizing200,
color: context.tokens.textStaticPrimary,
),
);
}

class _CustomRawGestureDetector extends RawGestureDetector {
Expand All @@ -418,7 +414,5 @@ class _CustomRawGestureDetector extends RawGestureDetector {

class _AllowMultipleGestureRecognizer extends TapGestureRecognizer {
@override
void rejectGesture(int pointer) {
acceptGesture(pointer);
}
void rejectGesture(int pointer) => acceptGesture(pointer);
}
8 changes: 3 additions & 5 deletions optimus/lib/src/form/input_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,9 @@ class _ClearAllButton extends StatelessWidget {
Widget build(BuildContext context) => GestureDetector(
onTap: onTap,
child: Icon(
OptimusIcons.clear_selection,
size: _iconSize,
color: OptimusTheme.of(context).tokens.textStaticPrimary,
OptimusIcons.cross_close,
size: context.tokens.sizing200,
color: context.tokens.textStaticPrimary,
),
);
}

const double _iconSize = 24;

0 comments on commit c6934ca

Please sign in to comment.