2024-06-15 15:42:18 +00:00
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:mnemo_cards/theme/themes.dart';
|
|
|
|
|
|
|
|
|
|
class SwitchButton extends StatelessWidget {
|
|
|
|
|
final bool value;
|
|
|
|
|
final void Function(bool)? onChanged;
|
|
|
|
|
|
|
|
|
|
SwitchButton({
|
|
|
|
|
required this.value,
|
|
|
|
|
required this.onChanged,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Switch(
|
|
|
|
|
value: value,
|
|
|
|
|
onChanged: onChanged,
|
|
|
|
|
activeColor: progressBlue,
|
2024-06-22 12:29:18 +00:00
|
|
|
activeTrackColor: Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
|
inactiveTrackColor: Theme.of(context).scaffoldBackgroundColor,
|
2024-06-15 15:42:18 +00:00
|
|
|
trackOutlineColor: WidgetStatePropertyAll(borderGray),
|
|
|
|
|
inactiveThumbColor: borderGray,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|