Skip to content

Commit 833aeb2

Browse files
committed
button [nfc]: Make a color in Toggle transparent, not matched to background
The point of setting this at all is to suppress the outline, instead of painting it with a Material default. Now we're suppressing it in a way that will work if activeColor or inactiveColor is translucent -- the outline is painted over the track -- and we'd like to make those translucent for a disabled state, which we'll implement soon.
1 parent ec6715b commit 833aeb2

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lib/widgets/button.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -526,10 +526,7 @@ class Toggle extends StatelessWidget {
526526

527527
activeTrackColor: activeColor,
528528
inactiveTrackColor: inactiveColor,
529-
trackOutlineColor: WidgetStateColor.fromMap({
530-
WidgetState.selected: activeColor,
531-
~WidgetState.selected: inactiveColor,
532-
}),
529+
trackOutlineColor: WidgetStatePropertyAll(Colors.transparent),
533530
trackOutlineWidth: WidgetStateProperty<double>.fromMap({
534531
// The outline is effectively painted with strokeAlignCenter:
535532
// https://api.flutter.dev/flutter/painting/BorderSide/strokeAlignCenter-constant.html

0 commit comments

Comments
 (0)