match_magic/lib/widgets/toggle_switch.dart

27 lines
746 B
Dart
Raw Permalink Normal View History

import 'package:flutter/material.dart';
import 'package:match_magic/styles/styles.dart';
class ToggleSwitch extends StatelessWidget {
final ValueChanged<bool>? onChanged;
final bool value;
const ToggleSwitch({
Key? key,
required this.onChanged,
required this.value,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Switch(
value: value,
onChanged: onChanged,
activeColor: AppStyles.toggleSwitchTextActive,
activeTrackColor: AppStyles.toggleSwitchActiveBg,
inactiveThumbColor: AppStyles.toggleSwitchTextInactive,
inactiveTrackColor: AppStyles.toggleSwitchBg,
trackOutlineColor: MaterialStateProperty.all(Colors.white.withOpacity(0)),
);
}
}