@@ -138,26 +138,34 @@ class _WrapWithOverflowButton extends StatelessWidget {
138138
139139 @override
140140 Widget build (BuildContext context) {
141+ final theme = Theme .of (context);
141142 return DevToolsTooltip (
142143 message: 'More widgets...' ,
143144 child: ContextMenuButton (
144- color: WrapWithRefactors .buttonColor (Theme . of (context) ),
145+ color: WrapWithRefactors .buttonColor (theme ),
145146 icon: Icons .arrow_drop_down,
146147 iconSize: WrapWithRefactors .buttonIconSize,
147148 buttonWidth: buttonMinWidth,
148149 style: _wrapWithButtonStyle,
149- menuChildren: _refactorOptions (),
150+ menuChildren: _refactorOptions (theme ),
150151 ),
151152 );
152153 }
153154
154- List <Widget > _refactorOptions () {
155+ List <Widget > _refactorOptions (ThemeData theme) {
156+ final colorScheme = theme.colorScheme;
155157 return refactors.map ((refactor) {
156158 return MenuItemButton (
157- child: Text (refactor.label),
159+ style: MenuItemButton .styleFrom (
160+ foregroundColor: colorScheme.onSurface,
161+ backgroundColor: theme.isDarkTheme
162+ ? colorScheme.surface.brighten ()
163+ : colorScheme.surface.darken (),
164+ ),
158165 onPressed: () async {
159166 await applyRefactor (refactor);
160167 },
168+ child: Text (refactor.label),
161169 );
162170 }).toList ();
163171 }
0 commit comments