Skip to content

Commit

Permalink
disabledTextColor and final types
Browse files Browse the repository at this point in the history
Fix disabled color for icons
Add ContextMenuTheme type for final variables
  • Loading branch information
chesnoksatan committed Jul 14, 2022
1 parent 55259a6 commit 726decb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion lib/widgets/context_menu/context_menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ void openContextMenu(
Offset position,
List<BaseContextMenuEntry> entries,
) {
final menuTheme = Theme.of(context).extension<ContextMenuTheme>()!;
final ContextMenuTheme menuTheme =
Theme.of(context).extension<ContextMenuTheme>()!;

showMenu(
context: context,
Expand Down
5 changes: 3 additions & 2 deletions lib/widgets/context_menu/context_menu_entry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ class ContextMenuEntry extends BaseContextMenuEntry {
class _ContextMenuEntryState extends State<ContextMenuEntry> {
@override
Widget build(BuildContext context) {
final menuTheme = Theme.of(context).extension<ContextMenuTheme>()!;
final ContextMenuTheme menuTheme =
Theme.of(context).extension<ContextMenuTheme>()!;

return InkWell(
onTap: widget.enabled
Expand All @@ -84,7 +85,7 @@ class _ContextMenuEntryState extends State<ContextMenuEntry> {
size: menuTheme.iconSize,
color: widget.enabled
? menuTheme.iconColor
: menuTheme.disabledTextColor,
: menuTheme.disabledIconColor,
),
child: widget.leading!,
),
Expand Down
7 changes: 4 additions & 3 deletions lib/widgets/context_menu/context_sub_menu_entry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ class ContextSubMenuEntry extends BaseContextMenuEntry {
class _ContextSubMenuEntryState extends State<ContextSubMenuEntry> {
@override
Widget build(BuildContext context) {
final menuTheme = Theme.of(context).extension<ContextMenuTheme>()!;
final ContextMenuTheme menuTheme =
Theme.of(context).extension<ContextMenuTheme>()!;

return InkWell(
onTap: widget.enabled
Expand All @@ -63,7 +64,7 @@ class _ContextSubMenuEntryState extends State<ContextSubMenuEntry> {
size: menuTheme.iconSize,
color: widget.enabled
? menuTheme.iconColor
: menuTheme.disabledTextColor,
: menuTheme.disabledIconColor,
),
child: widget.leading!,
),
Expand All @@ -86,7 +87,7 @@ class _ContextSubMenuEntryState extends State<ContextSubMenuEntry> {
size: menuTheme.iconSize,
color: widget.enabled
? menuTheme.iconColor
: menuTheme.disabledTextColor,
: menuTheme.disabledIconColor,
),
child: const Icon(Icons.chevron_right),
)
Expand Down

0 comments on commit 726decb

Please sign in to comment.