27 lines
641 B
Dart
27 lines
641 B
Dart
|
|
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,
|
||
|
|
activeTrackColor: white,
|
||
|
|
inactiveTrackColor: white,
|
||
|
|
trackOutlineColor: WidgetStatePropertyAll(borderGray),
|
||
|
|
inactiveThumbColor: borderGray,
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|