-
Justin McCandless authored
Fixes https://github.com/flutter/flutter/issues/89939 and updates the look of the Android context menu to match API 34. ## The problem Before this PR, setting `surface` in the color scheme caused the background color of the Android context menu to change, but it wasn't possible to change the text color. ```dart MaterialApp( theme: ThemeData( // Using a dark theme made the context menu text color be white. colorScheme: ThemeData.dark().colorScheme.copyWith( // Setting the surface here worked. surface: Colors.white, // But there was no way to set the text color. This didn't work. onSurface: Colors.black, ), ), ), ``` | Expected (after PR) | Actual (before PR) | | --- | --- | | <img width="239" alt="Screenshot 2023-08-07 at 11 45 37 AM" src="https://github.com/flutter/flutter/assets/389558/a9fb75e5-b6c3-4f8e-8c59-2021780c44a7"> | <img width="250" alt="Screenshot 2023-08-07 at 11 51 10 AM" src="https://github.com/flutter/flutter/assets/389558/a5abd2d2-49bb-47a0-836f-864d56af2f58"> | ## Other examples <table> <tr> <th>Scenario</th> <th>Result</th> </tr> <tr> <td> ```dart MaterialApp( theme: ThemeData( colorScheme: ThemeData.light(), ), ... ), ``` </td> <td> <img width="244" alt="Screenshot 2023-08-07 at 11 42 05 AM" src="https://github.com/flutter/flutter/assets/389558/74c6870b-5ff7-4b1a-9e0c-b2bb4809ef1e"> </td> </tr> <tr> <td> ```dart MaterialApp( theme: ThemeData( colorScheme: ThemeData.dark(), ), ... ), ``` </td> <td> <img width="239" alt="Screenshot 2023-08-07 at 11 42 23 AM" src="https://github.com/flutter/flutter/assets/389558/91fe32f8-bd62-4d9b-96e8-ae5a9a769745"> </td> </tr> <tr> <td> ```dart MaterialApp( theme: ThemeData( colorScheme: ThemeData.light().colorScheme.copyWith( surface: Colors.blue, onSurface: Colors.red, ), ), ... ), ``` </td> <td> <img width="240" alt="Screenshot 2023-08-07 at 11 43 06 AM" src="https://github.com/flutter/flutter/assets/389558/e5752f8b-3738-4391-9055-15c38bd4af21"> </td> </tr> <tr> <td> ```dart MaterialApp( theme: ThemeData( colorScheme: ThemeData.light().colorScheme.copyWith( surface: Colors.blue, onSurface: Colors.red, ), ), ... ), ``` </td> <td> <img width="244" alt="Screenshot 2023-08-07 at 11 42 47 AM" src="https://github.com/flutter/flutter/assets/389558/68cc68f0-b338-4d94-8810-d8e46fb1e48e"> </td> </tr> </table>