Skip to content

Commit f0da4b9

Browse files
feat(package_info_plus)!: Bump win32 from 5.15.0 to 6.0.0 (#3760)
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Volodymyr <v.buberenko@gmail.com>
1 parent ba6e6b9 commit f0da4b9

26 files changed

+360
-279
lines changed

packages/device_info_plus/device_info_plus/example/lib/main.dart

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -237,44 +237,42 @@ class _MyAppState extends State<MyApp> {
237237
home: Scaffold(
238238
appBar: AppBar(title: Text(_getAppBarTitle()), elevation: 4),
239239
body: ListView(
240-
children:
241-
_deviceData.keys.map((String property) {
242-
return Row(
243-
children: <Widget>[
244-
Container(
245-
padding: const EdgeInsets.all(10),
246-
child: Text(
247-
property,
248-
style: const TextStyle(fontWeight: FontWeight.bold),
249-
),
240+
children: _deviceData.keys.map((String property) {
241+
return Row(
242+
children: <Widget>[
243+
Container(
244+
padding: const EdgeInsets.all(10),
245+
child: Text(
246+
property,
247+
style: const TextStyle(fontWeight: FontWeight.bold),
248+
),
249+
),
250+
Expanded(
251+
child: Container(
252+
padding: const EdgeInsets.symmetric(vertical: 10),
253+
child: Text(
254+
'${_deviceData[property]}',
255+
maxLines: 10,
256+
overflow: TextOverflow.ellipsis,
250257
),
251-
Expanded(
252-
child: Container(
253-
padding: const EdgeInsets.symmetric(vertical: 10),
254-
child: Text(
255-
'${_deviceData[property]}',
256-
maxLines: 10,
257-
overflow: TextOverflow.ellipsis,
258-
),
259-
),
260-
),
261-
],
262-
);
263-
}).toList(),
258+
),
259+
),
260+
],
261+
);
262+
}).toList(),
264263
),
265264
),
266265
);
267266
}
268267

269-
String _getAppBarTitle() =>
270-
kIsWeb
271-
? 'Web Browser info'
272-
: switch (defaultTargetPlatform) {
273-
TargetPlatform.android => 'Android Device Info',
274-
TargetPlatform.iOS => 'iOS Device Info',
275-
TargetPlatform.linux => 'Linux Device Info',
276-
TargetPlatform.windows => 'Windows Device Info',
277-
TargetPlatform.macOS => 'MacOS Device Info',
278-
TargetPlatform.fuchsia => 'Fuchsia Device Info',
279-
};
268+
String _getAppBarTitle() => kIsWeb
269+
? 'Web Browser info'
270+
: switch (defaultTargetPlatform) {
271+
TargetPlatform.android => 'Android Device Info',
272+
TargetPlatform.iOS => 'iOS Device Info',
273+
TargetPlatform.linux => 'Linux Device Info',
274+
TargetPlatform.windows => 'Windows Device Info',
275+
TargetPlatform.macOS => 'MacOS Device Info',
276+
TargetPlatform.fuchsia => 'Fuchsia Device Info',
277+
};
280278
}

packages/package_info_plus/package_info_plus/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ This Flutter plugin provides an API for querying information about an applicatio
1616

1717
## Requirements
1818

19-
- Flutter >=3.19.0
20-
- Dart >=3.3.0 <4.0.0
21-
- iOS >=12.0
22-
- macOS >=10.14
19+
- Flutter >=3.41.0
20+
- Dart >=3.11.0 <4.0.0
21+
- iOS >=13.0
22+
- macOS >=10.15
2323
- Java 17
2424
- Kotlin 2.2.0
2525
- Android Gradle Plugin >=8.12.1

packages/package_info_plus/package_info_plus/example/integration_test/package_info_plus_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,10 @@ void main() {
130130
),
131131
);
132132
} else if (Platform.isWindows) {
133-
expect(info.appName, 'example');
133+
expect(info.appName, 'package_info_plus_example');
134134
expect(info.buildNumber, '4');
135135
expect(info.buildSignature, isEmpty);
136-
expect(info.packageName, 'example');
136+
expect(info.packageName, 'package_info_plus_example');
137137
expect(info.version, '1.2.3');
138138
expect(info.installerStore, null);
139139
expect(
@@ -221,7 +221,7 @@ void main() {
221221
expect(find.text('Not set'), findsOneWidget);
222222
expect(find.textContaining(installTimeRegex), findsNWidgets(2));
223223
} else if (Platform.isWindows) {
224-
expect(find.text('example'), findsNWidgets(2));
224+
expect(find.text('package_info_plus_example'), findsNWidgets(2));
225225
expect(find.text('1.2.3'), findsOneWidget);
226226
expect(find.text('4'), findsOneWidget);
227227
expect(find.text('Not set'), findsOneWidget);

packages/package_info_plus/package_info_plus/example/windows/CMakeLists.txt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Project-level configuration.
22
cmake_minimum_required(VERSION 3.14)
3-
project(example LANGUAGES CXX)
3+
project(package_info_plus_example LANGUAGES CXX)
44

55
# The name of the executable created for the application. Change this to change
66
# the on-disk name of your application.
7-
set(BINARY_NAME "example")
7+
set(BINARY_NAME "package_info_plus_example")
88

99
# Explicitly opt in to modern CMake behaviors to avoid warnings with recent
1010
# versions of CMake.
11-
cmake_policy(SET CMP0063 NEW)
11+
cmake_policy(VERSION 3.14...3.25)
1212

1313
# Define build configuration option.
1414
get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
@@ -52,6 +52,7 @@ add_subdirectory(${FLUTTER_MANAGED_DIR})
5252
# Application build; see runner/CMakeLists.txt.
5353
add_subdirectory("runner")
5454

55+
5556
# Generated plugin build rules, which manage building the plugins and adding
5657
# them to the application.
5758
include(flutter/generated_plugins.cmake)
@@ -86,6 +87,12 @@ if(PLUGIN_BUNDLED_LIBRARIES)
8687
COMPONENT Runtime)
8788
endif()
8889

90+
# Copy the native assets provided by the build.dart from all packages.
91+
set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/windows/")
92+
install(DIRECTORY "${NATIVE_ASSETS_DIR}"
93+
DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
94+
COMPONENT Runtime)
95+
8996
# Fully re-copy the assets directory on each build to avoid having stale files
9097
# from a previous install.
9198
set(FLUTTER_ASSET_DIR_NAME "flutter_assets")

packages/package_info_plus/package_info_plus/example/windows/flutter/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ include(${EPHEMERAL_DIR}/generated_config.cmake)
1010
# https://github.com/flutter/flutter/issues/57146.
1111
set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper")
1212

13+
# Set fallback configurations for older versions of the flutter tool.
14+
if (NOT DEFINED FLUTTER_TARGET_PLATFORM)
15+
set(FLUTTER_TARGET_PLATFORM "windows-x64")
16+
endif()
17+
1318
# === Flutter Library ===
1419
set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll")
1520

@@ -92,7 +97,7 @@ add_custom_command(
9297
COMMAND ${CMAKE_COMMAND} -E env
9398
${FLUTTER_TOOL_ENVIRONMENT}
9499
"${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat"
95-
windows-x64 $<CONFIG>
100+
${FLUTTER_TARGET_PLATFORM} $<CONFIG>
96101
VERBATIM
97102
)
98103
add_custom_target(flutter_assemble DEPENDS

packages/package_info_plus/package_info_plus/example/windows/runner/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX")
3333
# Add dependency libraries and include directories. Add any application-specific
3434
# dependencies here.
3535
target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app)
36+
target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib")
3637
target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
3738

3839
# Run the Flutter tool portions of the build. This must not be removed.

packages/package_info_plus/package_info_plus/example/windows/runner/Runner.rc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@ BEGIN
8989
BEGIN
9090
BLOCK "040904e4"
9191
BEGIN
92-
VALUE "CompanyName", "io.flutter.plugins" "\0"
93-
VALUE "FileDescription", "example" "\0"
92+
VALUE "CompanyName", "io.flutter.plugins.packageinfoplusexample" "\0"
93+
VALUE "FileDescription", "package_info_plus_example" "\0"
9494
VALUE "FileVersion", VERSION_AS_STRING "\0"
95-
VALUE "InternalName", "example" "\0"
96-
VALUE "LegalCopyright", "Copyright (C) 2022 io.flutter.plugins. All rights reserved." "\0"
97-
VALUE "OriginalFilename", "example.exe" "\0"
98-
VALUE "ProductName", "example" "\0"
95+
VALUE "InternalName", "package_info_plus_example" "\0"
96+
VALUE "LegalCopyright", "Copyright (C) 2026 io.flutter.plugins.packageinfoplusexample. All rights reserved." "\0"
97+
VALUE "OriginalFilename", "package_info_plus_example.exe" "\0"
98+
VALUE "ProductName", "package_info_plus_example" "\0"
9999
VALUE "ProductVersion", VERSION_AS_STRING "\0"
100100
END
101101
END

packages/package_info_plus/package_info_plus/example/windows/runner/flutter_window.cpp

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#include "flutter/generated_plugin_registrant.h"
66

7-
FlutterWindow::FlutterWindow(const flutter::DartProject &project)
7+
FlutterWindow::FlutterWindow(const flutter::DartProject& project)
88
: project_(project) {}
99

1010
FlutterWindow::~FlutterWindow() {}
@@ -26,6 +26,16 @@ bool FlutterWindow::OnCreate() {
2626
}
2727
RegisterPlugins(flutter_controller_->engine());
2828
SetChildContent(flutter_controller_->view()->GetNativeWindow());
29+
30+
flutter_controller_->engine()->SetNextFrameCallback([&]() {
31+
this->Show();
32+
});
33+
34+
// Flutter can complete the first frame before the "show window" callback is
35+
// registered. The following call ensures a frame is pending to ensure the
36+
// window is shown. It is a no-op if the first frame hasn't completed yet.
37+
flutter_controller_->ForceRedraw();
38+
2939
return true;
3040
}
3141

@@ -52,9 +62,9 @@ FlutterWindow::MessageHandler(HWND hwnd, UINT const message,
5262
}
5363

5464
switch (message) {
55-
case WM_FONTCHANGE:
56-
flutter_controller_->engine()->ReloadSystemFonts();
57-
break;
65+
case WM_FONTCHANGE:
66+
flutter_controller_->engine()->ReloadSystemFonts();
67+
break;
5868
}
5969

6070
return Win32Window::MessageHandler(hwnd, message, wparam, lparam);

packages/package_info_plus/package_info_plus/example/windows/runner/flutter_window.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,24 @@
1010

1111
// A window that does nothing but host a Flutter view.
1212
class FlutterWindow : public Win32Window {
13-
public:
13+
public:
1414
// Creates a new FlutterWindow hosting a Flutter view running |project|.
15-
explicit FlutterWindow(const flutter::DartProject &project);
15+
explicit FlutterWindow(const flutter::DartProject& project);
1616
virtual ~FlutterWindow();
1717

18-
protected:
18+
protected:
1919
// Win32Window:
2020
bool OnCreate() override;
2121
void OnDestroy() override;
2222
LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam,
2323
LPARAM const lparam) noexcept override;
2424

25-
private:
25+
private:
2626
// The project to run.
2727
flutter::DartProject project_;
2828

2929
// The Flutter instance hosted by this window.
3030
std::unique_ptr<flutter::FlutterViewController> flutter_controller_;
3131
};
3232

33-
#endif // RUNNER_FLUTTER_WINDOW_H_
33+
#endif // RUNNER_FLUTTER_WINDOW_H_

packages/package_info_plus/package_info_plus/example/windows/runner/main.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
1919

2020
flutter::DartProject project(L"data");
2121

22-
std::vector<std::string> command_line_arguments = GetCommandLineArguments();
22+
std::vector<std::string> command_line_arguments =
23+
GetCommandLineArguments();
2324

2425
project.set_dart_entrypoint_arguments(std::move(command_line_arguments));
2526

2627
FlutterWindow window(project);
2728
Win32Window::Point origin(10, 10);
2829
Win32Window::Size size(1280, 720);
29-
if (!window.CreateAndShow(L"example", origin, size)) {
30+
if (!window.Create(L"package_info_plus_example", origin, size)) {
3031
return EXIT_FAILURE;
3132
}
3233
window.SetQuitOnClose(true);

0 commit comments

Comments
 (0)