mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2026-01-26 12:31:02 +00:00
fix: Rename DashboardChip to CustomChip and make its styling md3 compliant
This commit is contained in:
42
lib/ui/widgets/shared/custom_chip.dart
Normal file
42
lib/ui/widgets/shared/custom_chip.dart
Normal file
@@ -0,0 +1,42 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class DashboardChip extends StatelessWidget {
|
||||
final Widget label;
|
||||
final bool isSelected;
|
||||
final Function(bool)? onSelected;
|
||||
|
||||
const DashboardChip({
|
||||
Key? key,
|
||||
required this.label,
|
||||
required this.isSelected,
|
||||
this.onSelected,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return RawChip(
|
||||
showCheckmark: false,
|
||||
label: label,
|
||||
selected: isSelected,
|
||||
labelStyle: Theme.of(context).textTheme.subtitle2!.copyWith(
|
||||
color: isSelected
|
||||
? Theme.of(context).colorScheme.primary
|
||||
: Theme.of(context).colorScheme.secondary,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
backgroundColor: Colors.transparent,
|
||||
selectedColor: Theme.of(context).colorScheme.secondaryContainer,
|
||||
padding: const EdgeInsets.all(10),
|
||||
onSelected: onSelected,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
side: isSelected
|
||||
? BorderSide.none
|
||||
: BorderSide(
|
||||
width: 0.2,
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user