Skip to content

Commit

Permalink
Fix RadioTile background and border colors
Browse files Browse the repository at this point in the history
  • Loading branch information
ashuntu committed Dec 10, 2024
1 parent c5bcd68 commit d067975
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class _LandscapeSkipPageState extends State<LandscapeSkipPage> {
groupValue = v!;
}),
),
const SizedBox(height: 16),
RadioTile(
value: SkipEnum.register,
title: lang.landscapeSkipRegister,
Expand Down
43 changes: 31 additions & 12 deletions gui/packages/ubuntupro/lib/pages/widgets/radio_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,37 @@ class RadioTile<T> extends StatelessWidget {
@override
Widget build(BuildContext context) {
// Adds a nice visual clue that the tile is selected.
return YaruSelectableContainer(
selected: groupValue == value,
selectionColor: Theme.of(context).colorScheme.tertiaryContainer,
child: YaruRadioListTile(
contentPadding: EdgeInsets.zero,
visualDensity: VisualDensity.comfortable,
dense: true,
title: Text(title),
subtitle: subtitle != null ? Text(subtitle!) : null,
value: value,
groupValue: groupValue,
onChanged: onChanged,
return YaruBorderContainer(
border: groupValue == value
? Border.all(
color: Theme.of(context).colorScheme.primary,
)
: null,
// we specify this here since [YaruSelectableContainer] doesn't support a
// non-selected color
color: groupValue != value
? Theme.of(context).colorScheme.onInverseSurface
: null,
child: YaruSelectableContainer(
selected: groupValue == value,
selectionColor:
Theme.of(context).colorScheme.tertiaryContainer.withOpacity(0.8),
padding: EdgeInsets.zero,
child: YaruRadioListTile(
contentPadding: const EdgeInsets.all(6),
visualDensity: VisualDensity.standard,
dense: true,
title: Text(
title,
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w500,
),
),
subtitle: subtitle != null ? Text(subtitle!) : null,
value: value,
groupValue: groupValue,
onChanged: onChanged,
),
),
);
}
Expand Down

0 comments on commit d067975

Please sign in to comment.