mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
a54ca799b9
* update rules of analysis_options.yaml. and solved all problems * refactor: fix remaining problems --------- Co-authored-by: Ushie <ushiekane@gmail.com>
42 lines
1.2 KiB
Dart
42 lines
1.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class CustomChip extends StatelessWidget {
|
|
const CustomChip({
|
|
Key? key,
|
|
required this.label,
|
|
this.isSelected = false,
|
|
this.onSelected,
|
|
}) : super(key: key);
|
|
final Widget label;
|
|
final bool isSelected;
|
|
final Function(bool)? onSelected;
|
|
|
|
@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.w500,
|
|
),
|
|
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,
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|