Skip to content

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tilucasoli committed Oct 14, 2024
1 parent 5a27a7a commit 2a15100
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 19 deletions.
26 changes: 8 additions & 18 deletions packages/remix/lib/src/components/chip/chip_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,22 @@ part of 'chip.dart';
class FortalezaChipStyle extends ChipStyle {
static const ghost = Variant('for.chip.ghost');

static List<Variant> get variants => [ghost];

const FortalezaChipStyle();

static List<Variant> get variants => [ghost];

@override
Style makeStyle(SpecConfiguration<ChipSpecUtility> spec) {
final $ = spec.utilities;

final flexStyle = [$.flex.gap.$space(2)];

final iconStyle = [
$.icon.color.$accent(),
];
final iconStyle = [$.icon.color.$accent()];

final labelStyle = [
$.label.chain
..style.$text(2)
..style.color.$accent()
..style.color.$accent(),
];

final containerStyle = [
Expand All @@ -30,12 +28,8 @@ class FortalezaChipStyle extends ChipStyle {
..border.color.$accent(6)
..padding.vertical(8)
..padding.horizontal(12),
(spec.on.hover & spec.on.unselected)(
$.container.color.$accent(3),
),
spec.on.selected(
$.container.color.$accent(4),
),
(spec.on.hover & spec.on.unselected)($.container.color.$accent(3)),
spec.on.selected($.container.color.$accent(4)),
];

final disabledStyle = [
Expand All @@ -45,9 +39,7 @@ class FortalezaChipStyle extends ChipStyle {
$.label.style.color.$neutral(8),
$.icon.color.$neutral(8),
),
(spec.on.disabled & spec.on.selected)(
$.container.color.$neutral(4),
),
(spec.on.disabled & spec.on.selected)($.container.color.$neutral(4)),
];

final ghostStyle = Style.create([
Expand All @@ -63,9 +55,7 @@ class FortalezaChipStyle extends ChipStyle {
$.container.color.$neutral(2),
$.icon.color.$neutral(8),
),
(spec.on.disabled & spec.on.selected)(
$.container.color.$neutral(4),
),
(spec.on.disabled & spec.on.selected)($.container.color.$neutral(4)),
]);

return Style.create([
Expand Down
2 changes: 1 addition & 1 deletion packages/remix/lib/src/components/chip/chip_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ class _ChipState extends State<Chip> {

return Pressable(
enabled: !widget.disabled,
controller: _controller,
onPress:
widget.disabled ? null : () => widget.onChanged?.call(!widget.value),
controller: _controller,
child: SpecBuilder(
style: style.makeStyle(configuration).applyVariants(widget.variants),
builder: (context) {
Expand Down

0 comments on commit 2a15100

Please sign in to comment.