fix colours in new material 3 toggle switch
This commit is contained in:
parent
4c73fb7374
commit
b976d30ab2
1 changed files with 8 additions and 3 deletions
|
@ -25,8 +25,8 @@ class _ToggleSwitchWidgetState extends State<ToggleSwitchWidget> {
|
|||
|
||||
@override
|
||||
void initState() {
|
||||
toggleValue = widget.value.call();
|
||||
super.initState();
|
||||
toggleValue = widget.value.call();
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -50,8 +50,13 @@ class _ToggleSwitchWidgetState extends State<ToggleSwitchWidget> {
|
|||
child: FittedBox(
|
||||
fit: BoxFit.contain,
|
||||
child: Switch.adaptive(
|
||||
activeColor: enteColorScheme.primary400,
|
||||
inactiveTrackColor: enteColorScheme.fillMuted,
|
||||
inactiveTrackColor: Colors.transparent,
|
||||
activeTrackColor: enteColorScheme.primary500,
|
||||
activeColor: Colors.white,
|
||||
inactiveThumbColor: enteColorScheme.primary500,
|
||||
trackOutlineColor: MaterialStateColor.resolveWith(
|
||||
(states) => enteColorScheme.primary500,
|
||||
),
|
||||
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
value: toggleValue ?? false,
|
||||
onChanged: (negationOfToggleValue) async {
|
||||
|
|
Loading…
Add table
Reference in a new issue