mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
33 lines
739 B
Dart
33 lines
739 B
Dart
|
import 'package:flutter/material.dart';
|
||
|
import 'package:flutter/services.dart';
|
||
|
|
||
|
class HapticCheckbox extends StatelessWidget {
|
||
|
const HapticCheckbox({
|
||
|
super.key,
|
||
|
required this.value,
|
||
|
required this.onChanged,
|
||
|
this.activeColor,
|
||
|
this.checkColor,
|
||
|
this.side,
|
||
|
});
|
||
|
final bool value;
|
||
|
final Function(bool?)? onChanged;
|
||
|
final Color? activeColor;
|
||
|
final Color? checkColor;
|
||
|
final BorderSide? side;
|
||
|
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
return Checkbox(
|
||
|
value: value,
|
||
|
onChanged: (value) => {
|
||
|
HapticFeedback.selectionClick(),
|
||
|
if (onChanged != null) onChanged!(value),
|
||
|
},
|
||
|
activeColor: activeColor,
|
||
|
checkColor: checkColor,
|
||
|
side: side,
|
||
|
);
|
||
|
}
|
||
|
}
|