Skip to content

Commit 5401bb8

Browse files
domesticmouseblerouxgaaclarke
authored
Flutter 3.7.0 (#1556)
* Update `simplistic_editor` for Flutter 3.4 beta * Re-enable beta and master CI * Disable on master * Added sample code for using plugins and channels from background isolates. * goderbauer feedback 1 * goderbauer feedback2 * goderbauer feedback 3 * Add `background_isolate_channels` to CI * Enable beta CI * Enable all `stable` CI projects * `dart fix --apply` * `print` -> `denugPrint` * Make deps min version not pinned * Drop `_isDebug` * Remove unused import * `dart format` * Fixup `linting_tool` * Fixup `form_app` * Enable all `master` CI * Basic fixes * Patch `simplistic_editor` * Fix nl at eol * Comment out `simplistic_editor` * Incorporating @bleroux's latest changes * Clean up CI scripts * Copy `experimental/material_3_demo` to top level * Update `game_template` * Update `animations` * Update `desktop_photo_search` * Update `flutter_maps_firestore` * Update `form_app` * Update `infinite_list` * Update `isolate_example` * Update `jsonexample` * Update `navigation_and_routing` * Update `place_tracker` * Update `platform_channels` * Update `platform_design` * Update `provider_shopper` * Fixup `context_menus` * `dart format` * Update the main `material_3_demo` * Make `tool/flutter_ci_script_stable.sh` executable again Co-authored-by: Bruno Leroux <[email protected]> Co-authored-by: Aaron Clarke <[email protected]>
1 parent 4ee2002 commit 5401bb8

File tree

337 files changed

+4517
-1483
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

337 files changed

+4517
-1483
lines changed

animations/.metadata

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,35 @@
44
# This file should be version controlled.
55

66
version:
7-
revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
8-
channel: stable
7+
revision: 686fe913dc963954b99e62048569cb9ac8e551c8
8+
channel: beta
99

1010
project_type: app
1111

1212
# Tracks metadata for the flutter migrate command
1313
migration:
1414
platforms:
1515
- platform: root
16-
create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
17-
base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
16+
create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8
17+
base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8
1818
- platform: android
19-
create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
20-
base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
19+
create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8
20+
base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8
2121
- platform: ios
22-
create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
23-
base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
22+
create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8
23+
base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8
2424
- platform: linux
25-
create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
26-
base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
25+
create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8
26+
base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8
2727
- platform: macos
28-
create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
29-
base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
28+
create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8
29+
base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8
3030
- platform: web
31-
create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
32-
base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
31+
create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8
32+
base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8
3333
- platform: windows
34-
create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
35-
base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543
34+
create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8
35+
base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8
3636

3737
# User provided section
3838

animations/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ android {
4646
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
4747
applicationId "dev.flutter.animations"
4848
// You can update the following values to match your application needs.
49-
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
49+
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
5050
minSdkVersion flutter.minSdkVersion
5151
targetSdkVersion flutter.targetSdkVersion
5252
versionCode flutterVersionCode.toInteger()

animations/android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
buildscript {
2-
ext.kotlin_version = '1.6.10'
2+
ext.kotlin_version = '1.7.10'
33
repositories {
44
google()
55
mavenCentral()
66
}
77

88
dependencies {
9-
classpath 'com.android.tools.build:gradle:7.1.2'
9+
classpath 'com.android.tools.build:gradle:7.2.0'
1010
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1111
}
1212
}

animations/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip

animations/codelab_rebuild.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ steps:
1111
- windows
1212
- name: Flutter recreate
1313
flutter: create --org dev.flutter .
14+
- name: Strip DEVELOPMENT_TEAM
15+
strip-lines-containing: DEVELOPMENT_TEAM =
16+
path: ios/Runner.xcodeproj/project.pbxproj

animations/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 50;
6+
objectVersion = 54;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -171,6 +171,7 @@
171171
/* Begin PBXShellScriptBuildPhase section */
172172
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
173173
isa = PBXShellScriptBuildPhase;
174+
alwaysOutOfDate = 1;
174175
buildActionMask = 2147483647;
175176
files = (
176177
);
@@ -185,6 +186,7 @@
185186
};
186187
9740EEB61CF901F6004384FC /* Run Script */ = {
187188
isa = PBXShellScriptBuildPhase;
189+
alwaysOutOfDate = 1;
188190
buildActionMask = 2147483647;
189191
files = (
190192
);
@@ -478,4 +480,4 @@
478480
/* End XCConfigurationList section */
479481
};
480482
rootObject = 97C146E61CF9000F007C117D /* Project object */;
481-
}
483+
}
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

animations/macos/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
platform :osx, '10.11'
1+
platform :osx, '10.14'
22

33
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
44
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

animations/macos/Runner.xcodeproj/project.pbxproj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 51;
6+
objectVersion = 54;
77
objects = {
88

99
/* Begin PBXAggregateTarget section */
@@ -235,6 +235,7 @@
235235
/* Begin PBXShellScriptBuildPhase section */
236236
3399D490228B24CF009A79C7 /* ShellScript */ = {
237237
isa = PBXShellScriptBuildPhase;
238+
alwaysOutOfDate = 1;
238239
buildActionMask = 2147483647;
239240
files = (
240241
);
@@ -344,7 +345,7 @@
344345
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
345346
GCC_WARN_UNUSED_FUNCTION = YES;
346347
GCC_WARN_UNUSED_VARIABLE = YES;
347-
MACOSX_DEPLOYMENT_TARGET = 10.11;
348+
MACOSX_DEPLOYMENT_TARGET = 10.14;
348349
MTL_ENABLE_DEBUG_INFO = NO;
349350
SDKROOT = macosx;
350351
SWIFT_COMPILATION_MODE = wholemodule;
@@ -423,7 +424,7 @@
423424
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
424425
GCC_WARN_UNUSED_FUNCTION = YES;
425426
GCC_WARN_UNUSED_VARIABLE = YES;
426-
MACOSX_DEPLOYMENT_TARGET = 10.11;
427+
MACOSX_DEPLOYMENT_TARGET = 10.14;
427428
MTL_ENABLE_DEBUG_INFO = YES;
428429
ONLY_ACTIVE_ARCH = YES;
429430
SDKROOT = macosx;
@@ -470,7 +471,7 @@
470471
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
471472
GCC_WARN_UNUSED_FUNCTION = YES;
472473
GCC_WARN_UNUSED_VARIABLE = YES;
473-
MACOSX_DEPLOYMENT_TARGET = 10.11;
474+
MACOSX_DEPLOYMENT_TARGET = 10.14;
474475
MTL_ENABLE_DEBUG_INFO = NO;
475476
SDKROOT = macosx;
476477
SWIFT_COMPILATION_MODE = wholemodule;

animations/macos/Runner/Configs/AppInfo.xcconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ PRODUCT_NAME = animations
1111
PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.animations
1212

1313
// The copyright displayed in application information
14-
PRODUCT_COPYRIGHT = Copyright © 2022 dev.flutter. All rights reserved.
14+
PRODUCT_COPYRIGHT = Copyright © 2023 dev.flutter. All rights reserved.

animations/web/index.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@
4646
_flutter.loader.loadEntrypoint({
4747
serviceWorker: {
4848
serviceWorkerVersion: serviceWorkerVersion,
49+
},
50+
onEntrypointLoaded: function(engineInitializer) {
51+
engineInitializer.initializeEngine().then(function(appRunner) {
52+
appRunner.runApp();
53+
});
4954
}
50-
}).then(function(engineInitializer) {
51-
return engineInitializer.initializeEngine();
52-
}).then(function(appRunner) {
53-
return appRunner.runApp();
5455
});
5556
});
5657
</script>

animations/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.

animations/windows/runner/Runner.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ BEGIN
9393
VALUE "FileDescription", "animations" "\0"
9494
VALUE "FileVersion", VERSION_AS_STRING "\0"
9595
VALUE "InternalName", "animations" "\0"
96-
VALUE "LegalCopyright", "Copyright (C) 2022 dev.flutter. All rights reserved." "\0"
96+
VALUE "LegalCopyright", "Copyright (C) 2023 dev.flutter. All rights reserved." "\0"
9797
VALUE "OriginalFilename", "animations.exe" "\0"
9898
VALUE "ProductName", "animations" "\0"
9999
VALUE "ProductVersion", VERSION_AS_STRING "\0"

animations/windows/runner/flutter_window.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ 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+
2934
return true;
3035
}
3136

animations/windows/runner/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
2727
FlutterWindow window(project);
2828
Win32Window::Point origin(10, 10);
2929
Win32Window::Size size(1280, 720);
30-
if (!window.CreateAndShow(L"animations", origin, size)) {
30+
if (!window.Create(L"animations", origin, size)) {
3131
return EXIT_FAILURE;
3232
}
3333
window.SetQuitOnClose(true);

animations/windows/runner/win32_window.cpp

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,31 @@
11
#include "win32_window.h"
22

3+
#include <dwmapi.h>
34
#include <flutter_windows.h>
45

56
#include "resource.h"
67

78
namespace {
89

10+
/// Window attribute that enables dark mode window decorations.
11+
///
12+
/// Redefined in case the developer's machine has a Windows SDK older than
13+
/// version 10.0.22000.0.
14+
/// See: https://docs.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute
15+
#ifndef DWMWA_USE_IMMERSIVE_DARK_MODE
16+
#define DWMWA_USE_IMMERSIVE_DARK_MODE 20
17+
#endif
18+
919
constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW";
1020

21+
/// Registry key for app theme preference.
22+
///
23+
/// A value of 0 indicates apps should use dark mode. A non-zero or missing
24+
/// value indicates apps should use light mode.
25+
constexpr const wchar_t kGetPreferredBrightnessRegKey[] =
26+
L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize";
27+
constexpr const wchar_t kGetPreferredBrightnessRegValue[] = L"AppsUseLightTheme";
28+
1129
// The number of Win32Window objects that currently exist.
1230
static int g_active_window_count = 0;
1331

@@ -31,8 +49,8 @@ void EnableFullDpiSupportIfAvailable(HWND hwnd) {
3149
GetProcAddress(user32_module, "EnableNonClientDpiScaling"));
3250
if (enable_non_client_dpi_scaling != nullptr) {
3351
enable_non_client_dpi_scaling(hwnd);
34-
FreeLibrary(user32_module);
3552
}
53+
FreeLibrary(user32_module);
3654
}
3755

3856
} // namespace
@@ -102,9 +120,9 @@ Win32Window::~Win32Window() {
102120
Destroy();
103121
}
104122

105-
bool Win32Window::CreateAndShow(const std::wstring& title,
106-
const Point& origin,
107-
const Size& size) {
123+
bool Win32Window::Create(const std::wstring& title,
124+
const Point& origin,
125+
const Size& size) {
108126
Destroy();
109127

110128
const wchar_t* window_class =
@@ -117,7 +135,7 @@ bool Win32Window::CreateAndShow(const std::wstring& title,
117135
double scale_factor = dpi / 96.0;
118136

119137
HWND window = CreateWindow(
120-
window_class, title.c_str(), WS_OVERLAPPEDWINDOW | WS_VISIBLE,
138+
window_class, title.c_str(), WS_OVERLAPPEDWINDOW,
121139
Scale(origin.x, scale_factor), Scale(origin.y, scale_factor),
122140
Scale(size.width, scale_factor), Scale(size.height, scale_factor),
123141
nullptr, nullptr, GetModuleHandle(nullptr), this);
@@ -126,9 +144,15 @@ bool Win32Window::CreateAndShow(const std::wstring& title,
126144
return false;
127145
}
128146

147+
UpdateTheme(window);
148+
129149
return OnCreate();
130150
}
131151

152+
bool Win32Window::Show() {
153+
return ShowWindow(window_handle_, SW_SHOWNORMAL);
154+
}
155+
132156
// static
133157
LRESULT CALLBACK Win32Window::WndProc(HWND const window,
134158
UINT const message,
@@ -188,6 +212,10 @@ Win32Window::MessageHandler(HWND hwnd,
188212
SetFocus(child_content_);
189213
}
190214
return 0;
215+
216+
case WM_DWMCOLORIZATIONCOLORCHANGED:
217+
UpdateTheme(hwnd);
218+
return 0;
191219
}
192220

193221
return DefWindowProc(window_handle_, message, wparam, lparam);
@@ -243,3 +271,18 @@ bool Win32Window::OnCreate() {
243271
void Win32Window::OnDestroy() {
244272
// No-op; provided for subclasses.
245273
}
274+
275+
void Win32Window::UpdateTheme(HWND const window) {
276+
DWORD light_mode;
277+
DWORD light_mode_size = sizeof(light_mode);
278+
LSTATUS result = RegGetValue(HKEY_CURRENT_USER, kGetPreferredBrightnessRegKey,
279+
kGetPreferredBrightnessRegValue,
280+
RRF_RT_REG_DWORD, nullptr, &light_mode,
281+
&light_mode_size);
282+
283+
if (result == ERROR_SUCCESS) {
284+
BOOL enable_dark_mode = light_mode == 0;
285+
DwmSetWindowAttribute(window, DWMWA_USE_IMMERSIVE_DARK_MODE,
286+
&enable_dark_mode, sizeof(enable_dark_mode));
287+
}
288+
}

animations/windows/runner/win32_window.h

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,16 @@ class Win32Window {
2828
Win32Window();
2929
virtual ~Win32Window();
3030

31-
// Creates and shows a win32 window with |title| and position and size using
31+
// Creates a win32 window with |title| that is positioned and sized using
3232
// |origin| and |size|. New windows are created on the default monitor. Window
3333
// sizes are specified to the OS in physical pixels, hence to ensure a
34-
// consistent size to will treat the width height passed in to this function
35-
// as logical pixels and scale to appropriate for the default monitor. Returns
36-
// true if the window was created successfully.
37-
bool CreateAndShow(const std::wstring& title,
38-
const Point& origin,
39-
const Size& size);
34+
// consistent size this function will scale the inputted width and height as
35+
// as appropriate for the default monitor. The window is invisible until
36+
// |Show| is called. Returns true if the window was created successfully.
37+
bool Create(const std::wstring& title, const Point& origin, const Size& size);
38+
39+
// Show the current window. Returns true if the window was successfully shown.
40+
bool Show();
4041

4142
// Release OS resources associated with window.
4243
void Destroy();
@@ -86,6 +87,9 @@ class Win32Window {
8687
// Retrieves a class instance pointer for |window|
8788
static Win32Window* GetThisFromHandle(HWND const window) noexcept;
8889

90+
// Update the window frame's theme to match the system theme.
91+
static void UpdateTheme(HWND const window);
92+
8993
bool quit_on_close_ = false;
9094

9195
// window handle for top level window.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include: ../analysis_options.yaml

0 commit comments

Comments
 (0)