upgrade flutter to 3.16.9 (#7099)

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2024-02-11 00:15:11 +08:00
committed by GitHub
parent 633076ddd4
commit a19d4d6686
7 changed files with 26 additions and 17 deletions

View File

@@ -326,6 +326,8 @@ class MyTheme {
);
static ThemeData lightTheme = ThemeData(
// https://stackoverflow.com/questions/77537315/after-upgrading-to-flutter-3-16-the-app-bar-background-color-button-size-and
useMaterial3: false,
brightness: Brightness.light,
hoverColor: Color.fromARGB(255, 224, 224, 224),
scaffoldBackgroundColor: Colors.white,
@@ -418,6 +420,7 @@ class MyTheme {
],
);
static ThemeData darkTheme = ThemeData(
useMaterial3: false,
brightness: Brightness.dark,
hoverColor: Color.fromARGB(255, 45, 46, 53),
scaffoldBackgroundColor: Color(0xFF18191E),

View File

@@ -1327,7 +1327,8 @@ class _ResolutionsMenuState extends State<_ResolutionsMenu> {
}
}
_onChanged(BuildContext context, String? value) async {
// This widget has been unmounted, so the State no longer has a context
_onChanged(String? value) async {
if (pi.currentDisplay == kAllDisplayValue) {
return;
}
@@ -1350,12 +1351,12 @@ class _ResolutionsMenuState extends State<_ResolutionsMenu> {
if (w != null && h != null) {
if (w != rect?.width.toInt() || h != rect?.height.toInt()) {
await _changeResolution(context, w, h);
await _changeResolution(w, h);
}
}
}
_changeResolution(BuildContext context, int w, int h) async {
_changeResolution(int w, int h) async {
if (pi.currentDisplay == kAllDisplayValue) {
return;
}
@@ -1387,8 +1388,8 @@ class _ResolutionsMenuState extends State<_ResolutionsMenu> {
return Offstage(
offstage: !showOriginalBtn,
child: MenuButton(
onPressed: () => _changeResolution(
context, display.originalWidth, display.originalHeight),
onPressed: () =>
_changeResolution(display.originalWidth, display.originalHeight),
ffi: widget.ffi,
child: Text(
'${translate('resolution_original_tip')} ${display.originalWidth}x${display.originalHeight}'),
@@ -1404,7 +1405,7 @@ class _ResolutionsMenuState extends State<_ResolutionsMenu> {
onPressed: () {
final resolution = _getBestFitResolution();
if (resolution != null) {
_changeResolution(context, resolution.width, resolution.height);
_changeResolution(resolution.width, resolution.height);
}
},
ffi: widget.ffi,
@@ -1420,7 +1421,7 @@ class _ResolutionsMenuState extends State<_ResolutionsMenu> {
child: RdoMenuButton(
value: _kCustomResolutionValue,
groupValue: _groupValue,
onChanged: (String? value) => _onChanged(context, value),
onChanged: (String? value) => _onChanged(value),
ffi: widget.ffi,
child: Row(
children: [
@@ -1461,7 +1462,7 @@ class _ResolutionsMenuState extends State<_ResolutionsMenu> {
.map((e) => RdoMenuButton(
value: '${e.width}x${e.height}',
groupValue: _groupValue,
onChanged: (String? value) => _onChanged(context, value),
onChanged: (String? value) => _onChanged(value),
ffi: widget.ffi,
child: Text('${e.width}x${e.height}')))
.toList();

View File

@@ -10,6 +10,11 @@ include(${EPHEMERAL_DIR}/generated_config.cmake)
# https://github.com/flutter/flutter/issues/57146.
set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper")
# Set fallback configurations for older versions of the flutter tool.
if (NOT DEFINED FLUTTER_TARGET_PLATFORM)
set(FLUTTER_TARGET_PLATFORM "windows-x64")
endif()
# === Flutter Library ===
set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll")
@@ -92,7 +97,7 @@ add_custom_command(
COMMAND ${CMAKE_COMMAND} -E env
${FLUTTER_TOOL_ENVIRONMENT}
"${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat"
windows-x64 $<CONFIG>
${FLUTTER_TARGET_PLATFORM} $<CONFIG>
VERBATIM
)
add_custom_target(flutter_assemble DEPENDS