Files
eatvio_app/lib/features/feed/presentation/widgets/choice_chip_widget.dart
2024-11-20 14:30:48 +03:00

33 lines
1.1 KiB
Dart

import 'package:eatvio_app/core/theme/theme_helper.dart';
import 'package:flutter/material.dart';
class ChoiceChipWidget extends StatelessWidget {
const ChoiceChipWidget({super.key, required this.chipsLabelList, required this.index, required this.selectedChipIndex, required this.onSelected});
final List<String> chipsLabelList;
final int index;
final int selectedChipIndex;
final void Function(bool) onSelected;
@override
Widget build(BuildContext context) {
return ChoiceChip(
selectedColor: appTheme.blueA400,
pressElevation: 0,
showCheckmark: false,
side: BorderSide.none,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16),
),
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
label: Text(chipsLabelList[index]),
labelStyle: TextStyle(
color: index == selectedChipIndex ? Colors.white : appTheme.gray600,
fontWeight: FontWeight.w500,
fontSize: 12,
),
selected: selectedChipIndex == index,
backgroundColor: appTheme.gray100,
onSelected: onSelected,
);
}
}