diff --git a/animations/.metadata b/animations/.metadata index 31b763f97f2..d680382e18c 100644 --- a/animations/.metadata +++ b/animations/.metadata @@ -4,8 +4,8 @@ # This file should be version controlled. version: - revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - channel: stable + revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + channel: beta project_type: app @@ -13,26 +13,26 @@ project_type: app migration: platforms: - platform: root - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: android - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: ios - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: linux - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: macos - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: web - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: windows - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 # User provided section diff --git a/animations/android/app/build.gradle b/animations/android/app/build.gradle index e0360df2de4..6e18b3074a9 100644 --- a/animations/android/app/build.gradle +++ b/animations/android/app/build.gradle @@ -46,7 +46,7 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "dev.flutter.animations" // You can update the following values to match your application needs. - // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. + // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. minSdkVersion flutter.minSdkVersion targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() diff --git a/animations/android/build.gradle b/animations/android/build.gradle index 83ae220041c..58a8c74b147 100644 --- a/animations/android/build.gradle +++ b/animations/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.6.10' + ext.kotlin_version = '1.7.10' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.1.2' + classpath 'com.android.tools.build:gradle:7.2.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/animations/android/gradle/wrapper/gradle-wrapper.properties b/animations/android/gradle/wrapper/gradle-wrapper.properties index cb24abda10a..3c472b99c6f 100644 --- a/animations/android/gradle/wrapper/gradle-wrapper.properties +++ b/animations/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip diff --git a/animations/codelab_rebuild.yaml b/animations/codelab_rebuild.yaml index 8a843bab389..dc45ce80204 100644 --- a/animations/codelab_rebuild.yaml +++ b/animations/codelab_rebuild.yaml @@ -11,3 +11,6 @@ steps: - windows - name: Flutter recreate flutter: create --org dev.flutter . + - name: Strip DEVELOPMENT_TEAM + strip-lines-containing: DEVELOPMENT_TEAM = + path: ios/Runner.xcodeproj/project.pbxproj diff --git a/animations/ios/Runner.xcodeproj/project.pbxproj b/animations/ios/Runner.xcodeproj/project.pbxproj index 00729aa7140..ff7d252682f 100644 --- a/animations/ios/Runner.xcodeproj/project.pbxproj +++ b/animations/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -171,6 +171,7 @@ /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -185,6 +186,7 @@ }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -478,4 +480,4 @@ /* End XCConfigurationList section */ }; rootObject = 97C146E61CF9000F007C117D /* Project object */; -} +} \ No newline at end of file diff --git a/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png index 28c6bf03016..7353c41ecf9 100644 Binary files a/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and b/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png index 2ccbfd967d9..797d452e458 100644 Binary files a/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and b/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png index f091b6b0bca..6ed2d933e11 100644 Binary files a/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and b/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png index 4cde12118dd..4cd7b0099ca 100644 Binary files a/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and b/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png index d0ef06e7edb..fe730945a01 100644 Binary files a/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and b/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png index dcdc2306c28..321773cd857 100644 Binary files a/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and b/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png index 2ccbfd967d9..797d452e458 100644 Binary files a/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and b/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png index c8f9ed8f5ce..502f463a9bc 100644 Binary files a/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and b/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png index a6d6b8609df..0ec30343922 100644 Binary files a/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and b/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png index a6d6b8609df..0ec30343922 100644 Binary files a/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and b/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png index 75b2d164a5a..e9f5fea27c7 100644 Binary files a/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and b/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png index c4df70d39da..84ac32ae7d9 100644 Binary files a/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and b/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png index 6a84f41e14e..8953cba0906 100644 Binary files a/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and b/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png index d0e1f585360..0467bf12aa4 100644 Binary files a/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and b/animations/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/animations/macos/Podfile b/animations/macos/Podfile index dade8dfad0d..049abe29542 100644 --- a/animations/macos/Podfile +++ b/animations/macos/Podfile @@ -1,4 +1,4 @@ -platform :osx, '10.11' +platform :osx, '10.14' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/animations/macos/Runner.xcodeproj/project.pbxproj b/animations/macos/Runner.xcodeproj/project.pbxproj index f21bfdb8e5b..5b2ad2ae6c0 100644 --- a/animations/macos/Runner.xcodeproj/project.pbxproj +++ b/animations/macos/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 54; objects = { /* Begin PBXAggregateTarget section */ @@ -235,6 +235,7 @@ /* Begin PBXShellScriptBuildPhase section */ 3399D490228B24CF009A79C7 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -344,7 +345,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; @@ -423,7 +424,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; @@ -470,7 +471,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; diff --git a/animations/macos/Runner/Configs/AppInfo.xcconfig b/animations/macos/Runner/Configs/AppInfo.xcconfig index 93000107448..20d004f2b0d 100644 --- a/animations/macos/Runner/Configs/AppInfo.xcconfig +++ b/animations/macos/Runner/Configs/AppInfo.xcconfig @@ -11,4 +11,4 @@ PRODUCT_NAME = animations PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.animations // The copyright displayed in application information -PRODUCT_COPYRIGHT = Copyright © 2022 dev.flutter. All rights reserved. +PRODUCT_COPYRIGHT = Copyright © 2023 dev.flutter. All rights reserved. diff --git a/animations/web/index.html b/animations/web/index.html index 86c3c60b59d..c9c4c3c761d 100644 --- a/animations/web/index.html +++ b/animations/web/index.html @@ -46,11 +46,12 @@ _flutter.loader.loadEntrypoint({ serviceWorker: { serviceWorkerVersion: serviceWorkerVersion, + }, + onEntrypointLoaded: function(engineInitializer) { + engineInitializer.initializeEngine().then(function(appRunner) { + appRunner.runApp(); + }); } - }).then(function(engineInitializer) { - return engineInitializer.initializeEngine(); - }).then(function(appRunner) { - return appRunner.runApp(); }); }); diff --git a/animations/windows/runner/CMakeLists.txt b/animations/windows/runner/CMakeLists.txt index 17411a8ab8e..394917c053a 100644 --- a/animations/windows/runner/CMakeLists.txt +++ b/animations/windows/runner/CMakeLists.txt @@ -33,6 +33,7 @@ target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") # Add dependency libraries and include directories. Add any application-specific # dependencies here. target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) +target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") # Run the Flutter tool portions of the build. This must not be removed. diff --git a/animations/windows/runner/Runner.rc b/animations/windows/runner/Runner.rc index 8bd0309ccef..31697adb0a4 100644 --- a/animations/windows/runner/Runner.rc +++ b/animations/windows/runner/Runner.rc @@ -93,7 +93,7 @@ BEGIN VALUE "FileDescription", "animations" "\0" VALUE "FileVersion", VERSION_AS_STRING "\0" VALUE "InternalName", "animations" "\0" - VALUE "LegalCopyright", "Copyright (C) 2022 dev.flutter. All rights reserved." "\0" + VALUE "LegalCopyright", "Copyright (C) 2023 dev.flutter. All rights reserved." "\0" VALUE "OriginalFilename", "animations.exe" "\0" VALUE "ProductName", "animations" "\0" VALUE "ProductVersion", VERSION_AS_STRING "\0" diff --git a/animations/windows/runner/flutter_window.cpp b/animations/windows/runner/flutter_window.cpp index b43b9095ea3..b25e363efa4 100644 --- a/animations/windows/runner/flutter_window.cpp +++ b/animations/windows/runner/flutter_window.cpp @@ -26,6 +26,11 @@ bool FlutterWindow::OnCreate() { } RegisterPlugins(flutter_controller_->engine()); SetChildContent(flutter_controller_->view()->GetNativeWindow()); + + flutter_controller_->engine()->SetNextFrameCallback([&]() { + this->Show(); + }); + return true; } diff --git a/animations/windows/runner/main.cpp b/animations/windows/runner/main.cpp index 0fb9660d662..ea6c4c248f8 100644 --- a/animations/windows/runner/main.cpp +++ b/animations/windows/runner/main.cpp @@ -27,7 +27,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, FlutterWindow window(project); Win32Window::Point origin(10, 10); Win32Window::Size size(1280, 720); - if (!window.CreateAndShow(L"animations", origin, size)) { + if (!window.Create(L"animations", origin, size)) { return EXIT_FAILURE; } window.SetQuitOnClose(true); diff --git a/animations/windows/runner/win32_window.cpp b/animations/windows/runner/win32_window.cpp index c10f08dc7da..041a3855474 100644 --- a/animations/windows/runner/win32_window.cpp +++ b/animations/windows/runner/win32_window.cpp @@ -1,13 +1,31 @@ #include "win32_window.h" +#include #include #include "resource.h" namespace { +/// Window attribute that enables dark mode window decorations. +/// +/// Redefined in case the developer's machine has a Windows SDK older than +/// version 10.0.22000.0. +/// See: https://docs.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute +#ifndef DWMWA_USE_IMMERSIVE_DARK_MODE +#define DWMWA_USE_IMMERSIVE_DARK_MODE 20 +#endif + constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; +/// Registry key for app theme preference. +/// +/// A value of 0 indicates apps should use dark mode. A non-zero or missing +/// value indicates apps should use light mode. +constexpr const wchar_t kGetPreferredBrightnessRegKey[] = + L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; +constexpr const wchar_t kGetPreferredBrightnessRegValue[] = L"AppsUseLightTheme"; + // The number of Win32Window objects that currently exist. static int g_active_window_count = 0; @@ -31,8 +49,8 @@ void EnableFullDpiSupportIfAvailable(HWND hwnd) { GetProcAddress(user32_module, "EnableNonClientDpiScaling")); if (enable_non_client_dpi_scaling != nullptr) { enable_non_client_dpi_scaling(hwnd); - FreeLibrary(user32_module); } + FreeLibrary(user32_module); } } // namespace @@ -102,9 +120,9 @@ Win32Window::~Win32Window() { Destroy(); } -bool Win32Window::CreateAndShow(const std::wstring& title, - const Point& origin, - const Size& size) { +bool Win32Window::Create(const std::wstring& title, + const Point& origin, + const Size& size) { Destroy(); const wchar_t* window_class = @@ -117,7 +135,7 @@ bool Win32Window::CreateAndShow(const std::wstring& title, double scale_factor = dpi / 96.0; HWND window = CreateWindow( - window_class, title.c_str(), WS_OVERLAPPEDWINDOW | WS_VISIBLE, + window_class, title.c_str(), WS_OVERLAPPEDWINDOW, Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), Scale(size.width, scale_factor), Scale(size.height, scale_factor), nullptr, nullptr, GetModuleHandle(nullptr), this); @@ -126,9 +144,15 @@ bool Win32Window::CreateAndShow(const std::wstring& title, return false; } + UpdateTheme(window); + return OnCreate(); } +bool Win32Window::Show() { + return ShowWindow(window_handle_, SW_SHOWNORMAL); +} + // static LRESULT CALLBACK Win32Window::WndProc(HWND const window, UINT const message, @@ -188,6 +212,10 @@ Win32Window::MessageHandler(HWND hwnd, SetFocus(child_content_); } return 0; + + case WM_DWMCOLORIZATIONCOLORCHANGED: + UpdateTheme(hwnd); + return 0; } return DefWindowProc(window_handle_, message, wparam, lparam); @@ -243,3 +271,18 @@ bool Win32Window::OnCreate() { void Win32Window::OnDestroy() { // No-op; provided for subclasses. } + +void Win32Window::UpdateTheme(HWND const window) { + DWORD light_mode; + DWORD light_mode_size = sizeof(light_mode); + LSTATUS result = RegGetValue(HKEY_CURRENT_USER, kGetPreferredBrightnessRegKey, + kGetPreferredBrightnessRegValue, + RRF_RT_REG_DWORD, nullptr, &light_mode, + &light_mode_size); + + if (result == ERROR_SUCCESS) { + BOOL enable_dark_mode = light_mode == 0; + DwmSetWindowAttribute(window, DWMWA_USE_IMMERSIVE_DARK_MODE, + &enable_dark_mode, sizeof(enable_dark_mode)); + } +} diff --git a/animations/windows/runner/win32_window.h b/animations/windows/runner/win32_window.h index 17ba431125b..c86632d8a6b 100644 --- a/animations/windows/runner/win32_window.h +++ b/animations/windows/runner/win32_window.h @@ -28,15 +28,16 @@ class Win32Window { Win32Window(); virtual ~Win32Window(); - // Creates and shows a win32 window with |title| and position and size using + // Creates a win32 window with |title| that is positioned and sized using // |origin| and |size|. New windows are created on the default monitor. Window // sizes are specified to the OS in physical pixels, hence to ensure a - // consistent size to will treat the width height passed in to this function - // as logical pixels and scale to appropriate for the default monitor. Returns - // true if the window was created successfully. - bool CreateAndShow(const std::wstring& title, - const Point& origin, - const Size& size); + // consistent size this function will scale the inputted width and height as + // as appropriate for the default monitor. The window is invisible until + // |Show| is called. Returns true if the window was created successfully. + bool Create(const std::wstring& title, const Point& origin, const Size& size); + + // Show the current window. Returns true if the window was successfully shown. + bool Show(); // Release OS resources associated with window. void Destroy(); @@ -86,6 +87,9 @@ class Win32Window { // Retrieves a class instance pointer for |window| static Win32Window* GetThisFromHandle(HWND const window) noexcept; + // Update the window frame's theme to match the system theme. + static void UpdateTheme(HWND const window); + bool quit_on_close_ = false; // window handle for top level window. diff --git a/background_isolate_channels/analysis_options.yaml b/background_isolate_channels/analysis_options.yaml new file mode 100644 index 00000000000..5e2133eb696 --- /dev/null +++ b/background_isolate_channels/analysis_options.yaml @@ -0,0 +1 @@ +include: ../analysis_options.yaml diff --git a/background_isolate_channels/lib/main.dart b/background_isolate_channels/lib/main.dart new file mode 100644 index 00000000000..49f9c19e180 --- /dev/null +++ b/background_isolate_channels/lib/main.dart @@ -0,0 +1,155 @@ +// Copyright 2022 The Flutter team. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'dart:io' show Directory; + +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; +import 'package:path/path.dart' as path; +import 'package:path_provider/path_provider.dart' as path_provider; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:uuid/uuid.dart' as uuid; + +import 'simple_database.dart'; + +/////////////////////////////////////////////////////////////////////////////// +// This is the UI which will present the contents of the [SimpleDatabase]. To +// see where Background Isolate Channels are used see simple_database.dart. +/////////////////////////////////////////////////////////////////////////////// + +void main() { + runApp(const MyApp()); +} + +class MyApp extends StatelessWidget { + const MyApp({super.key}); + + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Background Isolate Channels', + theme: ThemeData( + primarySwatch: Colors.blue, + ), + home: const MyHomePage(title: 'Background Isolate Channels'), + ); + } +} + +class MyHomePage extends StatefulWidget { + const MyHomePage({super.key, required this.title}); + + final String title; + + @override + State createState() { + return _MyHomePageState(); + } +} + +class _MyHomePageState extends State { + /// The database that is running on a background [Isolate]. This is nullable + /// because acquiring a [SimpleDatabase] is an asynchronous operation. This + /// value is `null` until the database is initialized. + SimpleDatabase? _database; + + /// Local cache of the query results returned by the [SimpleDatabase] for the + /// UI to render from. It is nullable since querying the results is + /// asynchronous. The value is `null` before any result has been received. + List? _entries; + + /// What is searched for in the [SimpleDatabase]. + String _query = ''; + + @override + void initState() { + // Write the value to [SharedPreferences] which will get read on the + // [SimpleDatabase]'s isolate. For this example the value is always true + // just for demonstration purposes. + final Future sharedPreferencesSet = SharedPreferences.getInstance() + .then( + (sharedPreferences) => sharedPreferences.setBool('isDebug', true)); + final Future tempDirFuture = + path_provider.getTemporaryDirectory(); + + // Wait until the [SharedPreferences] value is set and the temporary + // directory is received before opening the database. If + // [sharedPreferencesSet] does not happen before opening the + // [SimpleDatabase] there has to be a way to refresh + // [_SimpleDatabaseServer]'s [SharedPreferences] cached values. + Future.wait([sharedPreferencesSet, tempDirFuture]).then((values) { + final Directory? tempDir = values[1] as Directory?; + final String dbPath = path.join(tempDir!.path, 'database.db'); + SimpleDatabase.open(dbPath).then((database) { + setState(() { + _database = database; + }); + _refresh(); + }); + }); + super.initState(); + } + + @override + void dispose() { + _database?.stop(); + super.dispose(); + } + + /// Performs a find on [SimpleDatabase] with [query] and updates the listed + /// contents. + void _refresh({String? query}) { + if (query != null) { + _query = query; + } + _database!.find(_query).toList().then((entries) { + setState(() { + _entries = entries; + }); + }); + } + + /// Adds a UUID and a timestamp to the [SimpleDatabase]. + void _addDate() { + final DateTime now = DateTime.now(); + final DateFormat formatter = + DateFormat('EEEE MMMM d, HH:mm:ss\n${const uuid.Uuid().v4()}'); + final String formatted = formatter.format(now); + _database!.addEntry(formatted).then((_) => _refresh()); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text(widget.title), + ), + body: Column( + children: [ + TextField( + onChanged: + _database == null ? null : (query) => _refresh(query: query), + decoration: const InputDecoration( + labelText: 'Search', + suffixIcon: Icon(Icons.search), + ), + ), + Expanded( + child: ListView.builder( + itemBuilder: (context, index) { + return ListTile(title: Text(_entries![index])); + }, + itemCount: _entries?.length ?? 0, + ), + ), + ], + ), + floatingActionButton: FloatingActionButton( + onPressed: _database == null ? null : _addDate, + tooltip: 'Add', + child: const Icon(Icons.add), + ), + ); + } +} diff --git a/background_isolate_channels/lib/simple_database.dart b/background_isolate_channels/lib/simple_database.dart new file mode 100644 index 00000000000..baac65a1359 --- /dev/null +++ b/background_isolate_channels/lib/simple_database.dart @@ -0,0 +1,255 @@ +// Copyright 2022 The Flutter team. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'dart:async'; +import 'dart:collection'; +import 'dart:convert'; +import 'dart:io'; +import 'dart:isolate'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/services.dart'; + +/////////////////////////////////////////////////////////////////////////////// +// **WARNING:** This is not production code and is only intended to be used for +// demonstration purposes. +// +// The following database works by spawning a background isolate and +// communicating with it over Dart's SendPort API. It is presented below as a +// demonstration of the feature "Background Isolate Channels" and shows using +// plugins from a background isolate. The [SimpleDatabase] operates on the root +// isolate and the [_SimpleDatabaseServer] operates on a background isolate. +// +// Here is an example of the protocol they use to communicate: +// +// _________________ ________________________ +// [:SimpleDatabase] [:_SimpleDatabaseServer] +// ----------------- ------------------------ +// | | +// |<---------------(init)------------------------| +// |----------------(init)----------------------->| +// |<---------------(ack)------------------------>| +// | | +// |----------------(add)------------------------>| +// |<---------------(ack)-------------------------| +// | | +// |----------------(query)---------------------->| +// |<---------------(result)----------------------| +// |<---------------(result)----------------------| +// |<---------------(done)------------------------| +// +/////////////////////////////////////////////////////////////////////////////// + +/// The size of the database entries in bytes. +const int _entrySize = 256; + +/// All the command codes that can be sent and received between [SimpleDatabase] and +/// [_SimpleDatabaseServer]. +enum _Codes { + init, + add, + query, + ack, + result, + done, +} + +/// A command sent between [SimpleDatabase] and [_SimpleDatabaseServer]. +class _Command { + const _Command(this.code, {this.arg0, this.arg1}); + + final _Codes code; + final Object? arg0; + final Object? arg1; +} + +/// A SimpleDatabase that stores entries of strings to disk where they can be +/// queried. +/// +/// All the disk operations and queries are executed in a background isolate +/// operating. This class just sends and receives messages to the isolate. +class SimpleDatabase { + SimpleDatabase._(this._isolate, this._path); + + final Isolate _isolate; + final String _path; + late final SendPort _sendPort; + // Completers are stored in a queue so multiple commands can be queued up and + // handled serially. + final Queue> _completers = Queue>(); + // Similarly, StreamControllers are stored in a queue so they can be handled + // asynchronously and serially. + final Queue> _resultsStream = + Queue>(); + + /// Open the database at [path] and launch the server on a background isolate.. + static Future open(String path) async { + final ReceivePort receivePort = ReceivePort(); + final Isolate isolate = + await Isolate.spawn(_SimpleDatabaseServer._run, receivePort.sendPort); + final SimpleDatabase result = SimpleDatabase._(isolate, path); + Completer completer = Completer(); + result._completers.addFirst(completer); + receivePort.listen((message) { + result._handleCommand(message as _Command); + }); + await completer.future; + return result; + } + + /// Writes [value] to the database. + Future addEntry(String value) { + // No processing happens on the calling isolate, it gets delegated to the + // background isolate, see [__SimpleDatabaseServer._doAddEntry]. + Completer completer = Completer(); + _completers.addFirst(completer); + _sendPort.send(_Command(_Codes.add, arg0: value)); + return completer.future; + } + + /// Returns all the strings in the database that contain [query]. + Stream find(String query) { + // No processing happens on the calling isolate, it gets delegated to the + // background isolate, see [__SimpleDatabaseServer._doFind]. + StreamController resultsStream = StreamController(); + _resultsStream.addFirst(resultsStream); + _sendPort.send(_Command(_Codes.query, arg0: query)); + return resultsStream.stream; + } + + /// Handler invoked when a message is received from the port communicating + /// with the database server. + void _handleCommand(_Command command) { + switch (command.code) { + case _Codes.init: + _sendPort = command.arg0 as SendPort; + // ---------------------------------------------------------------------- + // Before using platform channels and plugins from background isolates we + // need to register it with its root isolate. This is achieved by + // acquiring a [RootIsolateToken] which the background isolate uses to + // invoke [BackgroundIsolateBinaryMessenger.ensureInitialized]. + // ---------------------------------------------------------------------- + RootIsolateToken rootIsolateToken = RootIsolateToken.instance!; + _sendPort + .send(_Command(_Codes.init, arg0: _path, arg1: rootIsolateToken)); + break; + case _Codes.ack: + _completers.removeLast().complete(); + break; + case _Codes.result: + _resultsStream.last.add(command.arg0 as String); + break; + case _Codes.done: + _resultsStream.removeLast().close(); + break; + default: + debugPrint('SimpleDatabase unrecognized command: ${command.code}'); + } + } + + /// Kills the background isolate and its database server. + void stop() { + _isolate.kill(); + } +} + +/// The portion of the [SimpleDatabase] that runs on the background isolate. +/// +/// This is where we use the new feature Background Isolate Channels, which +/// allows us to use plugins from background isolates. +class _SimpleDatabaseServer { + _SimpleDatabaseServer(this._sendPort); + + final SendPort _sendPort; + late final String _path; + + // ---------------------------------------------------------------------- + // Here the plugin is used from the background isolate. + // ---------------------------------------------------------------------- + + /// The main entrypoint for the background isolate sent to [Isolate.spawn]. + static void _run(SendPort sendPort) { + ReceivePort receivePort = ReceivePort(); + sendPort.send(_Command(_Codes.init, arg0: receivePort.sendPort)); + final _SimpleDatabaseServer server = _SimpleDatabaseServer(sendPort); + receivePort.listen((message) async { + final _Command command = message as _Command; + await server._handleCommand(command); + }); + } + + /// Handle the [command] received from the [ReceivePort]. + Future _handleCommand(_Command command) async { + switch (command.code) { + case _Codes.init: + _path = command.arg0 as String; + // ---------------------------------------------------------------------- + // The [RootIsolateToken] is required for + // [BackgroundIsolateBinaryMessenger.ensureInitialized] and must be + // obtained on the root isolate and passed into the background isolate via + // a [SendPort]. + // ---------------------------------------------------------------------- + RootIsolateToken rootIsolateToken = command.arg1 as RootIsolateToken; + // ---------------------------------------------------------------------- + // [BackgroundIsolateBinaryMessenger.ensureInitialized] for each + // background isolate that will use plugins. This sets up the + // [BinaryMessenger] that the Platform Channels will communicate with on + // the background isolate. + // ---------------------------------------------------------------------- + BackgroundIsolateBinaryMessenger.ensureInitialized(rootIsolateToken); + _sendPort.send(const _Command(_Codes.ack, arg0: null)); + break; + case _Codes.add: + _doAddEntry(command.arg0 as String); + break; + case _Codes.query: + _doFind(command.arg0 as String); + break; + default: + debugPrint( + '_SimpleDatabaseServer unrecognized command ${command.code}'); + } + } + + /// Perform the add entry operation. + void _doAddEntry(String value) { + debugPrint('Performing add: $value'); + File file = File(_path); + if (!file.existsSync()) { + file.createSync(); + } + RandomAccessFile writer = file.openSync(mode: FileMode.append); + List bytes = utf8.encode(value); + if (bytes.length > _entrySize) { + bytes = bytes.sublist(0, _entrySize); + } else if (bytes.length < _entrySize) { + List newBytes = List.filled(_entrySize, 0); + for (int i = 0; i < bytes.length; ++i) { + newBytes[i] = bytes[i]; + } + bytes = newBytes; + } + writer.writeFromSync(bytes); + writer.closeSync(); + _sendPort.send(const _Command(_Codes.ack, arg0: null)); + } + + /// Perform the find entry operation. + void _doFind(String query) { + debugPrint('Performing find: $query'); + File file = File(_path); + if (file.existsSync()) { + RandomAccessFile reader = file.openSync(); + List buffer = List.filled(_entrySize, 0); + while (reader.readIntoSync(buffer) == _entrySize) { + List foo = buffer.takeWhile((value) => value != 0).toList(); + String string = utf8.decode(foo); + if (string.contains(query)) { + _sendPort.send(_Command(_Codes.result, arg0: string)); + } + } + reader.closeSync(); + } + _sendPort.send(const _Command(_Codes.done, arg0: null)); + } +} diff --git a/background_isolate_channels/pubspec.yaml b/background_isolate_channels/pubspec.yaml new file mode 100644 index 00000000000..9c301f5428b --- /dev/null +++ b/background_isolate_channels/pubspec.yaml @@ -0,0 +1,27 @@ +name: background_isolate_channels +description: A new Flutter project. + +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +version: 1.0.0+1 + +environment: + sdk: '>=2.19.0-224.0.dev <3.0.0' + +dependencies: + cupertino_icons: ^1.0.2 + flutter: + sdk: flutter + intl: ^0.18.0 + path: ^1.8.2 + path_provider: ^2.0.11 + shared_preferences: ^2.0.15 + uuid: ^3.0.6 + +dev_dependencies: + flutter_lints: ^2.0.1 + flutter_test: + sdk: flutter + +flutter: + uses-material-design: true diff --git a/desktop_photo_search/fluent_ui/.metadata b/desktop_photo_search/fluent_ui/.metadata index 21064dafa7c..a9275976676 100644 --- a/desktop_photo_search/fluent_ui/.metadata +++ b/desktop_photo_search/fluent_ui/.metadata @@ -4,8 +4,8 @@ # This file should be version controlled. version: - revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - channel: stable + revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + channel: beta project_type: app @@ -13,17 +13,17 @@ project_type: app migration: platforms: - platform: root - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: linux - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: macos - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: windows - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 # User provided section diff --git a/desktop_photo_search/fluent_ui/macos/Podfile b/desktop_photo_search/fluent_ui/macos/Podfile index dade8dfad0d..049abe29542 100644 --- a/desktop_photo_search/fluent_ui/macos/Podfile +++ b/desktop_photo_search/fluent_ui/macos/Podfile @@ -1,4 +1,4 @@ -platform :osx, '10.11' +platform :osx, '10.14' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/desktop_photo_search/fluent_ui/macos/Runner.xcodeproj/project.pbxproj b/desktop_photo_search/fluent_ui/macos/Runner.xcodeproj/project.pbxproj index baa045c4c09..ef34e95e7ea 100644 --- a/desktop_photo_search/fluent_ui/macos/Runner.xcodeproj/project.pbxproj +++ b/desktop_photo_search/fluent_ui/macos/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 54; objects = { /* Begin PBXAggregateTarget section */ @@ -26,7 +26,6 @@ 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; - 7673FDB661ADFD2C35306121 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6833E8937A37A1F115F743FE /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -53,10 +52,9 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 32C17CF456FA01211B439433 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; - 33CC10ED2044A3C60003C045 /* desktop_photo_search.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = desktop_photo_search.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10ED2044A3C60003C045 /* desktop_photo_search.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "desktop_photo_search.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; @@ -68,11 +66,8 @@ 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; - 599D52A0E16EABE549161D49 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; - 6833E8937A37A1F115F743FE /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; - BEB9965F4AE1BA304D5D3C01 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -80,7 +75,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 7673FDB661ADFD2C35306121 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -105,7 +99,6 @@ 33CEB47122A05771004F2AC0 /* Flutter */, 33CC10EE2044A3C60003C045 /* Products */, D73912EC22F37F3D000D13A0 /* Frameworks */, - BAF2CB65062ACABE2C155E8A /* Pods */, ); sourceTree = ""; }; @@ -152,21 +145,9 @@ path = Runner; sourceTree = ""; }; - BAF2CB65062ACABE2C155E8A /* Pods */ = { - isa = PBXGroup; - children = ( - 599D52A0E16EABE549161D49 /* Pods-Runner.debug.xcconfig */, - BEB9965F4AE1BA304D5D3C01 /* Pods-Runner.release.xcconfig */, - 32C17CF456FA01211B439433 /* Pods-Runner.profile.xcconfig */, - ); - name = Pods; - path = Pods; - sourceTree = ""; - }; D73912EC22F37F3D000D13A0 /* Frameworks */ = { isa = PBXGroup; children = ( - 6833E8937A37A1F115F743FE /* Pods_Runner.framework */, ); name = Frameworks; sourceTree = ""; @@ -178,13 +159,11 @@ isa = PBXNativeTarget; buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - E652BF6B00D81FB654A74210 /* [CP] Check Pods Manifest.lock */, 33CC10E92044A3C60003C045 /* Sources */, 33CC10EA2044A3C60003C045 /* Frameworks */, 33CC10EB2044A3C60003C045 /* Resources */, 33CC110E2044A8840003C045 /* Bundle Framework */, 3399D490228B24CF009A79C7 /* ShellScript */, - 8F5FF20051C1504DAEBF14FC /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -256,6 +235,7 @@ /* Begin PBXShellScriptBuildPhase section */ 3399D490228B24CF009A79C7 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -291,45 +271,6 @@ shellPath = /bin/sh; shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; }; - 8F5FF20051C1504DAEBF14FC /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - E652BF6B00D81FB654A74210 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -404,7 +345,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; @@ -483,7 +424,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; @@ -530,7 +471,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; diff --git a/desktop_photo_search/fluent_ui/macos/Runner/Configs/AppInfo.xcconfig b/desktop_photo_search/fluent_ui/macos/Runner/Configs/AppInfo.xcconfig index da89cc7025b..59146e6eb23 100644 --- a/desktop_photo_search/fluent_ui/macos/Runner/Configs/AppInfo.xcconfig +++ b/desktop_photo_search/fluent_ui/macos/Runner/Configs/AppInfo.xcconfig @@ -11,4 +11,4 @@ PRODUCT_NAME = desktop_photo_search PRODUCT_BUNDLE_IDENTIFIER = com.example.desktopPhotoSearch // The copyright displayed in application information -PRODUCT_COPYRIGHT = Copyright © 2022 com.example. All rights reserved. +PRODUCT_COPYRIGHT = Copyright © 2023 com.example. All rights reserved. diff --git a/desktop_photo_search/fluent_ui/windows/runner/CMakeLists.txt b/desktop_photo_search/fluent_ui/windows/runner/CMakeLists.txt index 17411a8ab8e..394917c053a 100644 --- a/desktop_photo_search/fluent_ui/windows/runner/CMakeLists.txt +++ b/desktop_photo_search/fluent_ui/windows/runner/CMakeLists.txt @@ -33,6 +33,7 @@ target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") # Add dependency libraries and include directories. Add any application-specific # dependencies here. target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) +target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") # Run the Flutter tool portions of the build. This must not be removed. diff --git a/desktop_photo_search/fluent_ui/windows/runner/Runner.rc b/desktop_photo_search/fluent_ui/windows/runner/Runner.rc index b719e46f492..fc74684794d 100644 --- a/desktop_photo_search/fluent_ui/windows/runner/Runner.rc +++ b/desktop_photo_search/fluent_ui/windows/runner/Runner.rc @@ -93,7 +93,7 @@ BEGIN VALUE "FileDescription", "desktop_photo_search" "\0" VALUE "FileVersion", VERSION_AS_STRING "\0" VALUE "InternalName", "desktop_photo_search" "\0" - VALUE "LegalCopyright", "Copyright (C) 2022 com.example. All rights reserved." "\0" + VALUE "LegalCopyright", "Copyright (C) 2023 com.example. All rights reserved." "\0" VALUE "OriginalFilename", "desktop_photo_search.exe" "\0" VALUE "ProductName", "desktop_photo_search" "\0" VALUE "ProductVersion", VERSION_AS_STRING "\0" diff --git a/desktop_photo_search/fluent_ui/windows/runner/flutter_window.cpp b/desktop_photo_search/fluent_ui/windows/runner/flutter_window.cpp index b43b9095ea3..b25e363efa4 100644 --- a/desktop_photo_search/fluent_ui/windows/runner/flutter_window.cpp +++ b/desktop_photo_search/fluent_ui/windows/runner/flutter_window.cpp @@ -26,6 +26,11 @@ bool FlutterWindow::OnCreate() { } RegisterPlugins(flutter_controller_->engine()); SetChildContent(flutter_controller_->view()->GetNativeWindow()); + + flutter_controller_->engine()->SetNextFrameCallback([&]() { + this->Show(); + }); + return true; } diff --git a/desktop_photo_search/fluent_ui/windows/runner/main.cpp b/desktop_photo_search/fluent_ui/windows/runner/main.cpp index f25ead05bc5..23aadea2134 100644 --- a/desktop_photo_search/fluent_ui/windows/runner/main.cpp +++ b/desktop_photo_search/fluent_ui/windows/runner/main.cpp @@ -27,7 +27,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, FlutterWindow window(project); Win32Window::Point origin(10, 10); Win32Window::Size size(1280, 720); - if (!window.CreateAndShow(L"desktop_photo_search", origin, size)) { + if (!window.Create(L"desktop_photo_search", origin, size)) { return EXIT_FAILURE; } window.SetQuitOnClose(true); diff --git a/desktop_photo_search/fluent_ui/windows/runner/win32_window.cpp b/desktop_photo_search/fluent_ui/windows/runner/win32_window.cpp index c10f08dc7da..041a3855474 100644 --- a/desktop_photo_search/fluent_ui/windows/runner/win32_window.cpp +++ b/desktop_photo_search/fluent_ui/windows/runner/win32_window.cpp @@ -1,13 +1,31 @@ #include "win32_window.h" +#include #include #include "resource.h" namespace { +/// Window attribute that enables dark mode window decorations. +/// +/// Redefined in case the developer's machine has a Windows SDK older than +/// version 10.0.22000.0. +/// See: https://docs.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute +#ifndef DWMWA_USE_IMMERSIVE_DARK_MODE +#define DWMWA_USE_IMMERSIVE_DARK_MODE 20 +#endif + constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; +/// Registry key for app theme preference. +/// +/// A value of 0 indicates apps should use dark mode. A non-zero or missing +/// value indicates apps should use light mode. +constexpr const wchar_t kGetPreferredBrightnessRegKey[] = + L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; +constexpr const wchar_t kGetPreferredBrightnessRegValue[] = L"AppsUseLightTheme"; + // The number of Win32Window objects that currently exist. static int g_active_window_count = 0; @@ -31,8 +49,8 @@ void EnableFullDpiSupportIfAvailable(HWND hwnd) { GetProcAddress(user32_module, "EnableNonClientDpiScaling")); if (enable_non_client_dpi_scaling != nullptr) { enable_non_client_dpi_scaling(hwnd); - FreeLibrary(user32_module); } + FreeLibrary(user32_module); } } // namespace @@ -102,9 +120,9 @@ Win32Window::~Win32Window() { Destroy(); } -bool Win32Window::CreateAndShow(const std::wstring& title, - const Point& origin, - const Size& size) { +bool Win32Window::Create(const std::wstring& title, + const Point& origin, + const Size& size) { Destroy(); const wchar_t* window_class = @@ -117,7 +135,7 @@ bool Win32Window::CreateAndShow(const std::wstring& title, double scale_factor = dpi / 96.0; HWND window = CreateWindow( - window_class, title.c_str(), WS_OVERLAPPEDWINDOW | WS_VISIBLE, + window_class, title.c_str(), WS_OVERLAPPEDWINDOW, Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), Scale(size.width, scale_factor), Scale(size.height, scale_factor), nullptr, nullptr, GetModuleHandle(nullptr), this); @@ -126,9 +144,15 @@ bool Win32Window::CreateAndShow(const std::wstring& title, return false; } + UpdateTheme(window); + return OnCreate(); } +bool Win32Window::Show() { + return ShowWindow(window_handle_, SW_SHOWNORMAL); +} + // static LRESULT CALLBACK Win32Window::WndProc(HWND const window, UINT const message, @@ -188,6 +212,10 @@ Win32Window::MessageHandler(HWND hwnd, SetFocus(child_content_); } return 0; + + case WM_DWMCOLORIZATIONCOLORCHANGED: + UpdateTheme(hwnd); + return 0; } return DefWindowProc(window_handle_, message, wparam, lparam); @@ -243,3 +271,18 @@ bool Win32Window::OnCreate() { void Win32Window::OnDestroy() { // No-op; provided for subclasses. } + +void Win32Window::UpdateTheme(HWND const window) { + DWORD light_mode; + DWORD light_mode_size = sizeof(light_mode); + LSTATUS result = RegGetValue(HKEY_CURRENT_USER, kGetPreferredBrightnessRegKey, + kGetPreferredBrightnessRegValue, + RRF_RT_REG_DWORD, nullptr, &light_mode, + &light_mode_size); + + if (result == ERROR_SUCCESS) { + BOOL enable_dark_mode = light_mode == 0; + DwmSetWindowAttribute(window, DWMWA_USE_IMMERSIVE_DARK_MODE, + &enable_dark_mode, sizeof(enable_dark_mode)); + } +} diff --git a/desktop_photo_search/fluent_ui/windows/runner/win32_window.h b/desktop_photo_search/fluent_ui/windows/runner/win32_window.h index 17ba431125b..c86632d8a6b 100644 --- a/desktop_photo_search/fluent_ui/windows/runner/win32_window.h +++ b/desktop_photo_search/fluent_ui/windows/runner/win32_window.h @@ -28,15 +28,16 @@ class Win32Window { Win32Window(); virtual ~Win32Window(); - // Creates and shows a win32 window with |title| and position and size using + // Creates a win32 window with |title| that is positioned and sized using // |origin| and |size|. New windows are created on the default monitor. Window // sizes are specified to the OS in physical pixels, hence to ensure a - // consistent size to will treat the width height passed in to this function - // as logical pixels and scale to appropriate for the default monitor. Returns - // true if the window was created successfully. - bool CreateAndShow(const std::wstring& title, - const Point& origin, - const Size& size); + // consistent size this function will scale the inputted width and height as + // as appropriate for the default monitor. The window is invisible until + // |Show| is called. Returns true if the window was created successfully. + bool Create(const std::wstring& title, const Point& origin, const Size& size); + + // Show the current window. Returns true if the window was successfully shown. + bool Show(); // Release OS resources associated with window. void Destroy(); @@ -86,6 +87,9 @@ class Win32Window { // Retrieves a class instance pointer for |window| static Win32Window* GetThisFromHandle(HWND const window) noexcept; + // Update the window frame's theme to match the system theme. + static void UpdateTheme(HWND const window); + bool quit_on_close_ = false; // window handle for top level window. diff --git a/desktop_photo_search/material/.metadata b/desktop_photo_search/material/.metadata index 21064dafa7c..a9275976676 100644 --- a/desktop_photo_search/material/.metadata +++ b/desktop_photo_search/material/.metadata @@ -4,8 +4,8 @@ # This file should be version controlled. version: - revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - channel: stable + revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + channel: beta project_type: app @@ -13,17 +13,17 @@ project_type: app migration: platforms: - platform: root - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: linux - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: macos - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: windows - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 # User provided section diff --git a/desktop_photo_search/material/macos/Podfile b/desktop_photo_search/material/macos/Podfile index dade8dfad0d..049abe29542 100644 --- a/desktop_photo_search/material/macos/Podfile +++ b/desktop_photo_search/material/macos/Podfile @@ -1,4 +1,4 @@ -platform :osx, '10.11' +platform :osx, '10.14' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/desktop_photo_search/material/macos/Runner.xcodeproj/project.pbxproj b/desktop_photo_search/material/macos/Runner.xcodeproj/project.pbxproj index ba5de86cc99..ef34e95e7ea 100644 --- a/desktop_photo_search/material/macos/Runner.xcodeproj/project.pbxproj +++ b/desktop_photo_search/material/macos/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 54; objects = { /* Begin PBXAggregateTarget section */ @@ -26,7 +26,6 @@ 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; - 528B573A6E81026EA11AEB8D /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5782356BA8E4B0057FE9A963 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -55,7 +54,7 @@ /* Begin PBXFileReference section */ 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; - 33CC10ED2044A3C60003C045 /* desktop_photo_search.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = desktop_photo_search.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10ED2044A3C60003C045 /* desktop_photo_search.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "desktop_photo_search.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; @@ -67,11 +66,7 @@ 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; - 3AD026BABE349D185A4D93B7 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; - 5782356BA8E4B0057FE9A963 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 64501C6F5F2839B91ADA3180 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; - 8529115BD75AB77C82E4867B /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; /* End PBXFileReference section */ @@ -80,7 +75,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 528B573A6E81026EA11AEB8D /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -105,7 +99,6 @@ 33CEB47122A05771004F2AC0 /* Flutter */, 33CC10EE2044A3C60003C045 /* Products */, D73912EC22F37F3D000D13A0 /* Frameworks */, - A91AE06AFDB4D62F44D069E0 /* Pods */, ); sourceTree = ""; }; @@ -152,21 +145,9 @@ path = Runner; sourceTree = ""; }; - A91AE06AFDB4D62F44D069E0 /* Pods */ = { - isa = PBXGroup; - children = ( - 8529115BD75AB77C82E4867B /* Pods-Runner.debug.xcconfig */, - 3AD026BABE349D185A4D93B7 /* Pods-Runner.release.xcconfig */, - 64501C6F5F2839B91ADA3180 /* Pods-Runner.profile.xcconfig */, - ); - name = Pods; - path = Pods; - sourceTree = ""; - }; D73912EC22F37F3D000D13A0 /* Frameworks */ = { isa = PBXGroup; children = ( - 5782356BA8E4B0057FE9A963 /* Pods_Runner.framework */, ); name = Frameworks; sourceTree = ""; @@ -178,13 +159,11 @@ isa = PBXNativeTarget; buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - 44FB96AE2ECE225B570F214F /* [CP] Check Pods Manifest.lock */, 33CC10E92044A3C60003C045 /* Sources */, 33CC10EA2044A3C60003C045 /* Frameworks */, 33CC10EB2044A3C60003C045 /* Resources */, 33CC110E2044A8840003C045 /* Bundle Framework */, 3399D490228B24CF009A79C7 /* ShellScript */, - 0836B9381C5D9C235B9BEB93 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -254,25 +233,9 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 0836B9381C5D9C235B9BEB93 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; 3399D490228B24CF009A79C7 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -308,28 +271,6 @@ shellPath = /bin/sh; shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; }; - 44FB96AE2ECE225B570F214F /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -404,7 +345,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; @@ -483,7 +424,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; @@ -530,7 +471,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; diff --git a/desktop_photo_search/material/macos/Runner/Configs/AppInfo.xcconfig b/desktop_photo_search/material/macos/Runner/Configs/AppInfo.xcconfig index da89cc7025b..59146e6eb23 100644 --- a/desktop_photo_search/material/macos/Runner/Configs/AppInfo.xcconfig +++ b/desktop_photo_search/material/macos/Runner/Configs/AppInfo.xcconfig @@ -11,4 +11,4 @@ PRODUCT_NAME = desktop_photo_search PRODUCT_BUNDLE_IDENTIFIER = com.example.desktopPhotoSearch // The copyright displayed in application information -PRODUCT_COPYRIGHT = Copyright © 2022 com.example. All rights reserved. +PRODUCT_COPYRIGHT = Copyright © 2023 com.example. All rights reserved. diff --git a/desktop_photo_search/material/windows/runner/CMakeLists.txt b/desktop_photo_search/material/windows/runner/CMakeLists.txt index 17411a8ab8e..394917c053a 100644 --- a/desktop_photo_search/material/windows/runner/CMakeLists.txt +++ b/desktop_photo_search/material/windows/runner/CMakeLists.txt @@ -33,6 +33,7 @@ target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") # Add dependency libraries and include directories. Add any application-specific # dependencies here. target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) +target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") # Run the Flutter tool portions of the build. This must not be removed. diff --git a/desktop_photo_search/material/windows/runner/Runner.rc b/desktop_photo_search/material/windows/runner/Runner.rc index b719e46f492..fc74684794d 100644 --- a/desktop_photo_search/material/windows/runner/Runner.rc +++ b/desktop_photo_search/material/windows/runner/Runner.rc @@ -93,7 +93,7 @@ BEGIN VALUE "FileDescription", "desktop_photo_search" "\0" VALUE "FileVersion", VERSION_AS_STRING "\0" VALUE "InternalName", "desktop_photo_search" "\0" - VALUE "LegalCopyright", "Copyright (C) 2022 com.example. All rights reserved." "\0" + VALUE "LegalCopyright", "Copyright (C) 2023 com.example. All rights reserved." "\0" VALUE "OriginalFilename", "desktop_photo_search.exe" "\0" VALUE "ProductName", "desktop_photo_search" "\0" VALUE "ProductVersion", VERSION_AS_STRING "\0" diff --git a/desktop_photo_search/material/windows/runner/flutter_window.cpp b/desktop_photo_search/material/windows/runner/flutter_window.cpp index b43b9095ea3..b25e363efa4 100644 --- a/desktop_photo_search/material/windows/runner/flutter_window.cpp +++ b/desktop_photo_search/material/windows/runner/flutter_window.cpp @@ -26,6 +26,11 @@ bool FlutterWindow::OnCreate() { } RegisterPlugins(flutter_controller_->engine()); SetChildContent(flutter_controller_->view()->GetNativeWindow()); + + flutter_controller_->engine()->SetNextFrameCallback([&]() { + this->Show(); + }); + return true; } diff --git a/desktop_photo_search/material/windows/runner/main.cpp b/desktop_photo_search/material/windows/runner/main.cpp index f25ead05bc5..23aadea2134 100644 --- a/desktop_photo_search/material/windows/runner/main.cpp +++ b/desktop_photo_search/material/windows/runner/main.cpp @@ -27,7 +27,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, FlutterWindow window(project); Win32Window::Point origin(10, 10); Win32Window::Size size(1280, 720); - if (!window.CreateAndShow(L"desktop_photo_search", origin, size)) { + if (!window.Create(L"desktop_photo_search", origin, size)) { return EXIT_FAILURE; } window.SetQuitOnClose(true); diff --git a/desktop_photo_search/material/windows/runner/win32_window.cpp b/desktop_photo_search/material/windows/runner/win32_window.cpp index c10f08dc7da..041a3855474 100644 --- a/desktop_photo_search/material/windows/runner/win32_window.cpp +++ b/desktop_photo_search/material/windows/runner/win32_window.cpp @@ -1,13 +1,31 @@ #include "win32_window.h" +#include #include #include "resource.h" namespace { +/// Window attribute that enables dark mode window decorations. +/// +/// Redefined in case the developer's machine has a Windows SDK older than +/// version 10.0.22000.0. +/// See: https://docs.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute +#ifndef DWMWA_USE_IMMERSIVE_DARK_MODE +#define DWMWA_USE_IMMERSIVE_DARK_MODE 20 +#endif + constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; +/// Registry key for app theme preference. +/// +/// A value of 0 indicates apps should use dark mode. A non-zero or missing +/// value indicates apps should use light mode. +constexpr const wchar_t kGetPreferredBrightnessRegKey[] = + L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; +constexpr const wchar_t kGetPreferredBrightnessRegValue[] = L"AppsUseLightTheme"; + // The number of Win32Window objects that currently exist. static int g_active_window_count = 0; @@ -31,8 +49,8 @@ void EnableFullDpiSupportIfAvailable(HWND hwnd) { GetProcAddress(user32_module, "EnableNonClientDpiScaling")); if (enable_non_client_dpi_scaling != nullptr) { enable_non_client_dpi_scaling(hwnd); - FreeLibrary(user32_module); } + FreeLibrary(user32_module); } } // namespace @@ -102,9 +120,9 @@ Win32Window::~Win32Window() { Destroy(); } -bool Win32Window::CreateAndShow(const std::wstring& title, - const Point& origin, - const Size& size) { +bool Win32Window::Create(const std::wstring& title, + const Point& origin, + const Size& size) { Destroy(); const wchar_t* window_class = @@ -117,7 +135,7 @@ bool Win32Window::CreateAndShow(const std::wstring& title, double scale_factor = dpi / 96.0; HWND window = CreateWindow( - window_class, title.c_str(), WS_OVERLAPPEDWINDOW | WS_VISIBLE, + window_class, title.c_str(), WS_OVERLAPPEDWINDOW, Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), Scale(size.width, scale_factor), Scale(size.height, scale_factor), nullptr, nullptr, GetModuleHandle(nullptr), this); @@ -126,9 +144,15 @@ bool Win32Window::CreateAndShow(const std::wstring& title, return false; } + UpdateTheme(window); + return OnCreate(); } +bool Win32Window::Show() { + return ShowWindow(window_handle_, SW_SHOWNORMAL); +} + // static LRESULT CALLBACK Win32Window::WndProc(HWND const window, UINT const message, @@ -188,6 +212,10 @@ Win32Window::MessageHandler(HWND hwnd, SetFocus(child_content_); } return 0; + + case WM_DWMCOLORIZATIONCOLORCHANGED: + UpdateTheme(hwnd); + return 0; } return DefWindowProc(window_handle_, message, wparam, lparam); @@ -243,3 +271,18 @@ bool Win32Window::OnCreate() { void Win32Window::OnDestroy() { // No-op; provided for subclasses. } + +void Win32Window::UpdateTheme(HWND const window) { + DWORD light_mode; + DWORD light_mode_size = sizeof(light_mode); + LSTATUS result = RegGetValue(HKEY_CURRENT_USER, kGetPreferredBrightnessRegKey, + kGetPreferredBrightnessRegValue, + RRF_RT_REG_DWORD, nullptr, &light_mode, + &light_mode_size); + + if (result == ERROR_SUCCESS) { + BOOL enable_dark_mode = light_mode == 0; + DwmSetWindowAttribute(window, DWMWA_USE_IMMERSIVE_DARK_MODE, + &enable_dark_mode, sizeof(enable_dark_mode)); + } +} diff --git a/desktop_photo_search/material/windows/runner/win32_window.h b/desktop_photo_search/material/windows/runner/win32_window.h index 17ba431125b..c86632d8a6b 100644 --- a/desktop_photo_search/material/windows/runner/win32_window.h +++ b/desktop_photo_search/material/windows/runner/win32_window.h @@ -28,15 +28,16 @@ class Win32Window { Win32Window(); virtual ~Win32Window(); - // Creates and shows a win32 window with |title| and position and size using + // Creates a win32 window with |title| that is positioned and sized using // |origin| and |size|. New windows are created on the default monitor. Window // sizes are specified to the OS in physical pixels, hence to ensure a - // consistent size to will treat the width height passed in to this function - // as logical pixels and scale to appropriate for the default monitor. Returns - // true if the window was created successfully. - bool CreateAndShow(const std::wstring& title, - const Point& origin, - const Size& size); + // consistent size this function will scale the inputted width and height as + // as appropriate for the default monitor. The window is invisible until + // |Show| is called. Returns true if the window was created successfully. + bool Create(const std::wstring& title, const Point& origin, const Size& size); + + // Show the current window. Returns true if the window was successfully shown. + bool Show(); // Release OS resources associated with window. void Destroy(); @@ -86,6 +87,9 @@ class Win32Window { // Retrieves a class instance pointer for |window| static Win32Window* GetThisFromHandle(HWND const window) noexcept; + // Update the window frame's theme to match the system theme. + static void UpdateTheme(HWND const window); + bool quit_on_close_ = false; // window handle for top level window. diff --git a/experimental/linting_tool/lib/theme/app_theme.dart b/experimental/linting_tool/lib/theme/app_theme.dart index 30ecb77b1b8..8fd8e704d24 100644 --- a/experimental/linting_tool/lib/theme/app_theme.dart +++ b/experimental/linting_tool/lib/theme/app_theme.dart @@ -11,7 +11,6 @@ abstract class AppTheme { static ThemeData buildReplyLightTheme(BuildContext context) { final base = ThemeData.light(); return base.copyWith( - bottomAppBarColor: AppColors.blue700, bottomSheetTheme: BottomSheetThemeData( backgroundColor: AppColors.blue700, modalBackgroundColor: Colors.white.withOpacity(0.7), @@ -45,13 +44,13 @@ abstract class AppTheme { ), textTheme: _buildReplyLightTextTheme(base.textTheme), scaffoldBackgroundColor: AppColors.blue50, + bottomAppBarTheme: const BottomAppBarTheme(color: AppColors.blue700), ); } static ThemeData buildReplyDarkTheme(BuildContext context) { final base = ThemeData.dark(); return base.copyWith( - bottomAppBarColor: AppColors.darkBottomAppBarBackground, bottomSheetTheme: BottomSheetThemeData( backgroundColor: AppColors.darkDrawerBackground, modalBackgroundColor: Colors.black.withOpacity(0.7), @@ -94,6 +93,8 @@ abstract class AppTheme { ), textTheme: _buildReplyDarkTextTheme(base.textTheme), scaffoldBackgroundColor: AppColors.black900, + bottomAppBarTheme: + const BottomAppBarTheme(color: AppColors.darkBottomAppBarBackground), ); } diff --git a/experimental/linting_tool/lib/widgets/lint_expansion_tile.dart b/experimental/linting_tool/lib/widgets/lint_expansion_tile.dart index 94836f3fbb1..001156d56e4 100644 --- a/experimental/linting_tool/lib/widgets/lint_expansion_tile.dart +++ b/experimental/linting_tool/lib/widgets/lint_expansion_tile.dart @@ -140,6 +140,7 @@ class _LintExpansionTileState extends State { return const _ProfileTypeDialog(); }, ); + if (!mounted) return; if (destinationProfileType == ProfileType.newProfile) { await showDialog( context: context, diff --git a/experimental/linting_tool/test/widget_test.mocks.dart b/experimental/linting_tool/test/widget_test.mocks.dart index 5f976d67826..4e4b435c948 100644 --- a/experimental/linting_tool/test/widget_test.mocks.dart +++ b/experimental/linting_tool/test/widget_test.mocks.dart @@ -24,8 +24,8 @@ import 'package:mockito/mockito.dart' as _i1; class _FakeResponse_0 extends _i1.Fake implements _i2.Response {} -class _FakeStreamedResponse_1 extends _i1.Fake implements _i3.StreamedResponse { -} +class _FakeStreamedResponse_1 extends _i1.Fake + implements _i3.StreamedResponse {} /// A class which mocks [Client]. /// diff --git a/flutter_maps_firestore/.metadata b/flutter_maps_firestore/.metadata index df924690faf..9509da45c7a 100644 --- a/flutter_maps_firestore/.metadata +++ b/flutter_maps_firestore/.metadata @@ -4,8 +4,8 @@ # This file should be version controlled. version: - revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - channel: stable + revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + channel: beta project_type: app @@ -13,11 +13,11 @@ project_type: app migration: platforms: - platform: root - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: ios - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 # User provided section diff --git a/flutter_maps_firestore/codelab_rebuild.yaml b/flutter_maps_firestore/codelab_rebuild.yaml index 2cdc2badbbe..90d3c882713 100644 --- a/flutter_maps_firestore/codelab_rebuild.yaml +++ b/flutter_maps_firestore/codelab_rebuild.yaml @@ -6,6 +6,9 @@ steps: - ios - name: Recreate runner flutter: create --platforms ios . + - name: Strip DEVELOPMENT_TEAM + strip-lines-containing: DEVELOPMENT_TEAM = + path: ios/Runner.xcodeproj/project.pbxproj - name: Create GoogleService-Info.plist path: ios/GoogleService-Info.plist replace-contents: | diff --git a/flutter_maps_firestore/ios/Runner.xcodeproj/project.pbxproj b/flutter_maps_firestore/ios/Runner.xcodeproj/project.pbxproj index 8b5758e7276..0d26bb69544 100644 --- a/flutter_maps_firestore/ios/Runner.xcodeproj/project.pbxproj +++ b/flutter_maps_firestore/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -171,6 +171,7 @@ /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -185,6 +186,7 @@ }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -478,4 +480,4 @@ /* End XCConfigurationList section */ }; rootObject = 97C146E61CF9000F007C117D /* Project object */; -} +} \ No newline at end of file diff --git a/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png index 28c6bf03016..7353c41ecf9 100644 Binary files a/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and b/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png index 2ccbfd967d9..797d452e458 100644 Binary files a/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and b/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png index f091b6b0bca..6ed2d933e11 100644 Binary files a/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and b/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png index 4cde12118dd..4cd7b0099ca 100644 Binary files a/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and b/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png index d0ef06e7edb..fe730945a01 100644 Binary files a/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and b/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png index dcdc2306c28..321773cd857 100644 Binary files a/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and b/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png index 2ccbfd967d9..797d452e458 100644 Binary files a/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and b/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png index c8f9ed8f5ce..502f463a9bc 100644 Binary files a/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and b/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png index a6d6b8609df..0ec30343922 100644 Binary files a/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and b/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png index a6d6b8609df..0ec30343922 100644 Binary files a/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and b/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png index 75b2d164a5a..e9f5fea27c7 100644 Binary files a/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and b/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png index c4df70d39da..84ac32ae7d9 100644 Binary files a/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and b/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png index 6a84f41e14e..8953cba0906 100644 Binary files a/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and b/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png index d0e1f585360..0467bf12aa4 100644 Binary files a/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and b/flutter_maps_firestore/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/form_app/.metadata b/form_app/.metadata index 31b763f97f2..d680382e18c 100644 --- a/form_app/.metadata +++ b/form_app/.metadata @@ -4,8 +4,8 @@ # This file should be version controlled. version: - revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - channel: stable + revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + channel: beta project_type: app @@ -13,26 +13,26 @@ project_type: app migration: platforms: - platform: root - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: android - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: ios - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: linux - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: macos - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: web - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: windows - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 # User provided section diff --git a/form_app/android/app/build.gradle b/form_app/android/app/build.gradle index c8f9c7936eb..40d2f79badb 100644 --- a/form_app/android/app/build.gradle +++ b/form_app/android/app/build.gradle @@ -46,7 +46,7 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "dev.flutter.formApp.form_app" // You can update the following values to match your application needs. - // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. + // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. minSdkVersion flutter.minSdkVersion targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() diff --git a/form_app/android/build.gradle b/form_app/android/build.gradle index 83ae220041c..58a8c74b147 100644 --- a/form_app/android/build.gradle +++ b/form_app/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.6.10' + ext.kotlin_version = '1.7.10' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.1.2' + classpath 'com.android.tools.build:gradle:7.2.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/form_app/android/gradle/wrapper/gradle-wrapper.properties b/form_app/android/gradle/wrapper/gradle-wrapper.properties index cb24abda10a..3c472b99c6f 100644 --- a/form_app/android/gradle/wrapper/gradle-wrapper.properties +++ b/form_app/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip diff --git a/form_app/codelab_rebuild.yaml b/form_app/codelab_rebuild.yaml index 367305d439d..8c0143ea2f9 100644 --- a/form_app/codelab_rebuild.yaml +++ b/form_app/codelab_rebuild.yaml @@ -1,7 +1,7 @@ # Run with tooling from https://github.com/flutter/codelabs/tree/main/tooling/codelab_rebuild name: Form App rebuild script steps: - - name: Remove fluent_ui runners + - name: Remove runners rmdirs: - android - ios @@ -11,6 +11,9 @@ steps: - web - name: Flutter recreate flutter: create --platforms android,ios,windows,linux,macos,web --org dev.flutter.formApp . + - name: Strip DEVELOPMENT_TEAM + strip-lines-containing: DEVELOPMENT_TEAM = + path: ios/Runner.xcodeproj/project.pbxproj - name: Drop widget_test.dart rm: test/widget_test.dart - name: Flutter upgrade diff --git a/form_app/ios/Runner.xcodeproj/project.pbxproj b/form_app/ios/Runner.xcodeproj/project.pbxproj index 47c04ae6283..9bb274d7306 100644 --- a/form_app/ios/Runner.xcodeproj/project.pbxproj +++ b/form_app/ios/Runner.xcodeproj/project.pbxproj @@ -3,17 +3,17 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; - 9309D80CD50D14B12B3D5661 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CBB02F6700D6F522964B2F8E /* Pods_Runner.framework */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; + EA14A64E165D1ECB76EE10A8 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FD7B7DE4FDD7E559734636CF /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -30,13 +30,13 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 0CD8748F1FC26B89CEEEEF95 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 7DF4AE70F222DD0D20BF7DFD /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -44,9 +44,9 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - A6B1EA81047BB0E40C5F2E92 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; - CBB02F6700D6F522964B2F8E /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - D12D113EB771D9D773656456 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + B749306A6AD397CD346C8439 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + BDB229B3BBA4DEDC1D01CC73 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + FD7B7DE4FDD7E559734636CF /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -54,7 +54,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 9309D80CD50D14B12B3D5661 /* Pods_Runner.framework in Frameworks */, + EA14A64E165D1ECB76EE10A8 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -78,8 +78,8 @@ 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, - E0E3BF2EC2B3A6752223662D /* Pods */, - B2F3943E576ACDC6CB8912D7 /* Frameworks */, + BFF1BF2A44C98E8CC0C24D52 /* Pods */, + D392ABF55961E5DF565E5654 /* Frameworks */, ); sourceTree = ""; }; @@ -106,23 +106,23 @@ path = Runner; sourceTree = ""; }; - B2F3943E576ACDC6CB8912D7 /* Frameworks */ = { + BFF1BF2A44C98E8CC0C24D52 /* Pods */ = { isa = PBXGroup; children = ( - CBB02F6700D6F522964B2F8E /* Pods_Runner.framework */, + BDB229B3BBA4DEDC1D01CC73 /* Pods-Runner.debug.xcconfig */, + B749306A6AD397CD346C8439 /* Pods-Runner.release.xcconfig */, + 0CD8748F1FC26B89CEEEEF95 /* Pods-Runner.profile.xcconfig */, ); - name = Frameworks; + name = Pods; + path = Pods; sourceTree = ""; }; - E0E3BF2EC2B3A6752223662D /* Pods */ = { + D392ABF55961E5DF565E5654 /* Frameworks */ = { isa = PBXGroup; children = ( - D12D113EB771D9D773656456 /* Pods-Runner.debug.xcconfig */, - 7DF4AE70F222DD0D20BF7DFD /* Pods-Runner.release.xcconfig */, - A6B1EA81047BB0E40C5F2E92 /* Pods-Runner.profile.xcconfig */, + FD7B7DE4FDD7E559734636CF /* Pods_Runner.framework */, ); - name = Pods; - path = Pods; + name = Frameworks; sourceTree = ""; }; /* End PBXGroup section */ @@ -132,7 +132,7 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - 846C56F022D8A4454E9D24A7 /* [CP] Check Pods Manifest.lock */, + 14AA61E34C4C5D02F9EF12C6 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, @@ -197,44 +197,46 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + 14AA61E34C4C5D02F9EF12C6 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); + inputFileListPaths = ( + ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( ); - name = "Thin Binary"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; }; - 846C56F022D8A4454E9D24A7 /* [CP] Check Pods Manifest.lock */ = { + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); - inputFileListPaths = ( - ); inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( ); + name = "Thin Binary"; outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); diff --git a/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png index 28c6bf03016..7353c41ecf9 100644 Binary files a/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and b/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png index 2ccbfd967d9..797d452e458 100644 Binary files a/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and b/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png index f091b6b0bca..6ed2d933e11 100644 Binary files a/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and b/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png index 4cde12118dd..4cd7b0099ca 100644 Binary files a/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and b/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png index d0ef06e7edb..fe730945a01 100644 Binary files a/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and b/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png index dcdc2306c28..321773cd857 100644 Binary files a/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and b/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png index 2ccbfd967d9..797d452e458 100644 Binary files a/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and b/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png index c8f9ed8f5ce..502f463a9bc 100644 Binary files a/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and b/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png index a6d6b8609df..0ec30343922 100644 Binary files a/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and b/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png index a6d6b8609df..0ec30343922 100644 Binary files a/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and b/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png index 75b2d164a5a..e9f5fea27c7 100644 Binary files a/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and b/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png index c4df70d39da..84ac32ae7d9 100644 Binary files a/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and b/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png index 6a84f41e14e..8953cba0906 100644 Binary files a/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and b/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png index d0e1f585360..0467bf12aa4 100644 Binary files a/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and b/form_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/form_app/lib/src/validation.dart b/form_app/lib/src/validation.dart index 5b3a1d35eaa..04b2aa522c3 100644 --- a/form_app/lib/src/validation.dart +++ b/form_app/lib/src/validation.dart @@ -152,7 +152,8 @@ class _FormValidationDemoState extends State { style: Theme.of(context) .textTheme .bodySmall! - .copyWith(color: Theme.of(context).errorColor), + .copyWith( + color: Theme.of(context).colorScheme.error), ), ], ); diff --git a/form_app/macos/Podfile b/form_app/macos/Podfile index dade8dfad0d..049abe29542 100644 --- a/form_app/macos/Podfile +++ b/form_app/macos/Podfile @@ -1,4 +1,4 @@ -platform :osx, '10.11' +platform :osx, '10.14' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/form_app/macos/Runner.xcodeproj/project.pbxproj b/form_app/macos/Runner.xcodeproj/project.pbxproj index c0acfdf9bd6..b8406847675 100644 --- a/form_app/macos/Runner.xcodeproj/project.pbxproj +++ b/form_app/macos/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 54; objects = { /* Begin PBXAggregateTarget section */ @@ -21,12 +21,12 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ + 1BCE2C88E3BD2B7045E693AE /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52066804CB1320B66746DA5A /* Pods_Runner.framework */; }; 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; - A1A440F5C7D402943BD176C2 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D1182B28AB63982A2B698B9F /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -53,7 +53,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 16A054A9244A371E3C92CC62 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 240B6E418D8800432E1FB602 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; 33CC10ED2044A3C60003C045 /* form_app.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = form_app.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -68,11 +68,11 @@ 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; + 52066804CB1320B66746DA5A /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; + 7E815B624143334A87DFE6D9 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; - BEC4A415B7EFDC4F01A3444C /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; - D1182B28AB63982A2B698B9F /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - DD5507146441B996C58A6BEB /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + B4426B8D50DDB61E99A81103 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -80,7 +80,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - A1A440F5C7D402943BD176C2 /* Pods_Runner.framework in Frameworks */, + 1BCE2C88E3BD2B7045E693AE /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -105,7 +105,7 @@ 33CEB47122A05771004F2AC0 /* Flutter */, 33CC10EE2044A3C60003C045 /* Products */, D73912EC22F37F3D000D13A0 /* Frameworks */, - BEDA6D5CABD7E8684DDC3EE9 /* Pods */, + ACFBEA58956E46CC13F8120B /* Pods */, ); sourceTree = ""; }; @@ -152,12 +152,12 @@ path = Runner; sourceTree = ""; }; - BEDA6D5CABD7E8684DDC3EE9 /* Pods */ = { + ACFBEA58956E46CC13F8120B /* Pods */ = { isa = PBXGroup; children = ( - 16A054A9244A371E3C92CC62 /* Pods-Runner.debug.xcconfig */, - BEC4A415B7EFDC4F01A3444C /* Pods-Runner.release.xcconfig */, - DD5507146441B996C58A6BEB /* Pods-Runner.profile.xcconfig */, + 7E815B624143334A87DFE6D9 /* Pods-Runner.debug.xcconfig */, + B4426B8D50DDB61E99A81103 /* Pods-Runner.release.xcconfig */, + 240B6E418D8800432E1FB602 /* Pods-Runner.profile.xcconfig */, ); name = Pods; path = Pods; @@ -166,7 +166,7 @@ D73912EC22F37F3D000D13A0 /* Frameworks */ = { isa = PBXGroup; children = ( - D1182B28AB63982A2B698B9F /* Pods_Runner.framework */, + 52066804CB1320B66746DA5A /* Pods_Runner.framework */, ); name = Frameworks; sourceTree = ""; @@ -178,13 +178,13 @@ isa = PBXNativeTarget; buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - 2B0CC5BC0627E3F13363B344 /* [CP] Check Pods Manifest.lock */, + B0D9AF7C1AB2BAC0B255F52E /* [CP] Check Pods Manifest.lock */, 33CC10E92044A3C60003C045 /* Sources */, 33CC10EA2044A3C60003C045 /* Frameworks */, 33CC10EB2044A3C60003C045 /* Resources */, 33CC110E2044A8840003C045 /* Bundle Framework */, 3399D490228B24CF009A79C7 /* ShellScript */, - 1E3430AC2670871C983C239E /* [CP] Embed Pods Frameworks */, + 9BFE12CD834E63A64B7FE3A5 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -254,81 +254,82 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 1E3430AC2670871C983C239E /* [CP] Embed Pods Frameworks */ = { + 3399D490228B24CF009A79C7 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - name = "[CP] Embed Pods Frameworks"; + inputPaths = ( + ); outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; + shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; }; - 2B0CC5BC0627E3F13363B344 /* [CP] Check Pods Manifest.lock */ = { + 33CC111E2044C6BF0003C045 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( + Flutter/ephemeral/FlutterInputs.xcfilelist, ); inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", + Flutter/ephemeral/tripwire, ); - name = "[CP] Check Pods Manifest.lock"; outputFileListPaths = ( + Flutter/ephemeral/FlutterOutputs.xcfilelist, ); outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; + shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; }; - 3399D490228B24CF009A79C7 /* ShellScript */ = { + 9BFE12CD834E63A64B7FE3A5 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - inputPaths = ( - ); + name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( - ); - outputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; }; - 33CC111E2044C6BF0003C045 /* ShellScript */ = { + B0D9AF7C1AB2BAC0B255F52E /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - Flutter/ephemeral/FlutterInputs.xcfilelist, ); inputPaths = ( - Flutter/ephemeral/tripwire, + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); + name = "[CP] Check Pods Manifest.lock"; outputFileListPaths = ( - Flutter/ephemeral/FlutterOutputs.xcfilelist, ); outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -404,7 +405,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; @@ -483,7 +484,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; @@ -530,7 +531,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; diff --git a/form_app/macos/Runner/Configs/AppInfo.xcconfig b/form_app/macos/Runner/Configs/AppInfo.xcconfig index 6e6982fb998..c38e5cebff9 100644 --- a/form_app/macos/Runner/Configs/AppInfo.xcconfig +++ b/form_app/macos/Runner/Configs/AppInfo.xcconfig @@ -11,4 +11,4 @@ PRODUCT_NAME = form_app PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.formApp.formApp // The copyright displayed in application information -PRODUCT_COPYRIGHT = Copyright © 2022 dev.flutter.formApp. All rights reserved. +PRODUCT_COPYRIGHT = Copyright © 2023 dev.flutter.formApp. All rights reserved. diff --git a/form_app/web/index.html b/form_app/web/index.html index 1b38bd2cfd6..f8502c7c95e 100644 --- a/form_app/web/index.html +++ b/form_app/web/index.html @@ -46,11 +46,12 @@ _flutter.loader.loadEntrypoint({ serviceWorker: { serviceWorkerVersion: serviceWorkerVersion, + }, + onEntrypointLoaded: function(engineInitializer) { + engineInitializer.initializeEngine().then(function(appRunner) { + appRunner.runApp(); + }); } - }).then(function(engineInitializer) { - return engineInitializer.initializeEngine(); - }).then(function(appRunner) { - return appRunner.runApp(); }); }); diff --git a/form_app/windows/runner/CMakeLists.txt b/form_app/windows/runner/CMakeLists.txt index 17411a8ab8e..394917c053a 100644 --- a/form_app/windows/runner/CMakeLists.txt +++ b/form_app/windows/runner/CMakeLists.txt @@ -33,6 +33,7 @@ target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") # Add dependency libraries and include directories. Add any application-specific # dependencies here. target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) +target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") # Run the Flutter tool portions of the build. This must not be removed. diff --git a/form_app/windows/runner/Runner.rc b/form_app/windows/runner/Runner.rc index 7154c24afc8..46685ba7b12 100644 --- a/form_app/windows/runner/Runner.rc +++ b/form_app/windows/runner/Runner.rc @@ -93,7 +93,7 @@ BEGIN VALUE "FileDescription", "form_app" "\0" VALUE "FileVersion", VERSION_AS_STRING "\0" VALUE "InternalName", "form_app" "\0" - VALUE "LegalCopyright", "Copyright (C) 2022 dev.flutter.formApp. All rights reserved." "\0" + VALUE "LegalCopyright", "Copyright (C) 2023 dev.flutter.formApp. All rights reserved." "\0" VALUE "OriginalFilename", "form_app.exe" "\0" VALUE "ProductName", "form_app" "\0" VALUE "ProductVersion", VERSION_AS_STRING "\0" diff --git a/form_app/windows/runner/flutter_window.cpp b/form_app/windows/runner/flutter_window.cpp index b43b9095ea3..b25e363efa4 100644 --- a/form_app/windows/runner/flutter_window.cpp +++ b/form_app/windows/runner/flutter_window.cpp @@ -26,6 +26,11 @@ bool FlutterWindow::OnCreate() { } RegisterPlugins(flutter_controller_->engine()); SetChildContent(flutter_controller_->view()->GetNativeWindow()); + + flutter_controller_->engine()->SetNextFrameCallback([&]() { + this->Show(); + }); + return true; } diff --git a/form_app/windows/runner/main.cpp b/form_app/windows/runner/main.cpp index 44b720a5e47..14ec2e200e2 100644 --- a/form_app/windows/runner/main.cpp +++ b/form_app/windows/runner/main.cpp @@ -27,7 +27,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, FlutterWindow window(project); Win32Window::Point origin(10, 10); Win32Window::Size size(1280, 720); - if (!window.CreateAndShow(L"form_app", origin, size)) { + if (!window.Create(L"form_app", origin, size)) { return EXIT_FAILURE; } window.SetQuitOnClose(true); diff --git a/form_app/windows/runner/win32_window.cpp b/form_app/windows/runner/win32_window.cpp index c10f08dc7da..041a3855474 100644 --- a/form_app/windows/runner/win32_window.cpp +++ b/form_app/windows/runner/win32_window.cpp @@ -1,13 +1,31 @@ #include "win32_window.h" +#include #include #include "resource.h" namespace { +/// Window attribute that enables dark mode window decorations. +/// +/// Redefined in case the developer's machine has a Windows SDK older than +/// version 10.0.22000.0. +/// See: https://docs.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute +#ifndef DWMWA_USE_IMMERSIVE_DARK_MODE +#define DWMWA_USE_IMMERSIVE_DARK_MODE 20 +#endif + constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; +/// Registry key for app theme preference. +/// +/// A value of 0 indicates apps should use dark mode. A non-zero or missing +/// value indicates apps should use light mode. +constexpr const wchar_t kGetPreferredBrightnessRegKey[] = + L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; +constexpr const wchar_t kGetPreferredBrightnessRegValue[] = L"AppsUseLightTheme"; + // The number of Win32Window objects that currently exist. static int g_active_window_count = 0; @@ -31,8 +49,8 @@ void EnableFullDpiSupportIfAvailable(HWND hwnd) { GetProcAddress(user32_module, "EnableNonClientDpiScaling")); if (enable_non_client_dpi_scaling != nullptr) { enable_non_client_dpi_scaling(hwnd); - FreeLibrary(user32_module); } + FreeLibrary(user32_module); } } // namespace @@ -102,9 +120,9 @@ Win32Window::~Win32Window() { Destroy(); } -bool Win32Window::CreateAndShow(const std::wstring& title, - const Point& origin, - const Size& size) { +bool Win32Window::Create(const std::wstring& title, + const Point& origin, + const Size& size) { Destroy(); const wchar_t* window_class = @@ -117,7 +135,7 @@ bool Win32Window::CreateAndShow(const std::wstring& title, double scale_factor = dpi / 96.0; HWND window = CreateWindow( - window_class, title.c_str(), WS_OVERLAPPEDWINDOW | WS_VISIBLE, + window_class, title.c_str(), WS_OVERLAPPEDWINDOW, Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), Scale(size.width, scale_factor), Scale(size.height, scale_factor), nullptr, nullptr, GetModuleHandle(nullptr), this); @@ -126,9 +144,15 @@ bool Win32Window::CreateAndShow(const std::wstring& title, return false; } + UpdateTheme(window); + return OnCreate(); } +bool Win32Window::Show() { + return ShowWindow(window_handle_, SW_SHOWNORMAL); +} + // static LRESULT CALLBACK Win32Window::WndProc(HWND const window, UINT const message, @@ -188,6 +212,10 @@ Win32Window::MessageHandler(HWND hwnd, SetFocus(child_content_); } return 0; + + case WM_DWMCOLORIZATIONCOLORCHANGED: + UpdateTheme(hwnd); + return 0; } return DefWindowProc(window_handle_, message, wparam, lparam); @@ -243,3 +271,18 @@ bool Win32Window::OnCreate() { void Win32Window::OnDestroy() { // No-op; provided for subclasses. } + +void Win32Window::UpdateTheme(HWND const window) { + DWORD light_mode; + DWORD light_mode_size = sizeof(light_mode); + LSTATUS result = RegGetValue(HKEY_CURRENT_USER, kGetPreferredBrightnessRegKey, + kGetPreferredBrightnessRegValue, + RRF_RT_REG_DWORD, nullptr, &light_mode, + &light_mode_size); + + if (result == ERROR_SUCCESS) { + BOOL enable_dark_mode = light_mode == 0; + DwmSetWindowAttribute(window, DWMWA_USE_IMMERSIVE_DARK_MODE, + &enable_dark_mode, sizeof(enable_dark_mode)); + } +} diff --git a/form_app/windows/runner/win32_window.h b/form_app/windows/runner/win32_window.h index 17ba431125b..c86632d8a6b 100644 --- a/form_app/windows/runner/win32_window.h +++ b/form_app/windows/runner/win32_window.h @@ -28,15 +28,16 @@ class Win32Window { Win32Window(); virtual ~Win32Window(); - // Creates and shows a win32 window with |title| and position and size using + // Creates a win32 window with |title| that is positioned and sized using // |origin| and |size|. New windows are created on the default monitor. Window // sizes are specified to the OS in physical pixels, hence to ensure a - // consistent size to will treat the width height passed in to this function - // as logical pixels and scale to appropriate for the default monitor. Returns - // true if the window was created successfully. - bool CreateAndShow(const std::wstring& title, - const Point& origin, - const Size& size); + // consistent size this function will scale the inputted width and height as + // as appropriate for the default monitor. The window is invisible until + // |Show| is called. Returns true if the window was created successfully. + bool Create(const std::wstring& title, const Point& origin, const Size& size); + + // Show the current window. Returns true if the window was successfully shown. + bool Show(); // Release OS resources associated with window. void Destroy(); @@ -86,6 +87,9 @@ class Win32Window { // Retrieves a class instance pointer for |window| static Win32Window* GetThisFromHandle(HWND const window) noexcept; + // Update the window frame's theme to match the system theme. + static void UpdateTheme(HWND const window); + bool quit_on_close_ = false; // window handle for top level window. diff --git a/game_template/macos/Flutter/GeneratedPluginRegistrant.swift b/game_template/macos/Flutter/GeneratedPluginRegistrant.swift index 273d30bc913..029ad363fdc 100644 --- a/game_template/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/game_template/macos/Flutter/GeneratedPluginRegistrant.swift @@ -9,14 +9,16 @@ import audioplayers_darwin import firebase_core import firebase_crashlytics import games_services +import in_app_purchase_storekit import path_provider_macos -import shared_preferences_macos +import shared_preferences_foundation func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { AudioplayersDarwinPlugin.register(with: registry.registrar(forPlugin: "AudioplayersDarwinPlugin")) FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) FLTFirebaseCrashlyticsPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCrashlyticsPlugin")) GamesServicesPlugin.register(with: registry.registrar(forPlugin: "GamesServicesPlugin")) + InAppPurchasePlugin.register(with: registry.registrar(forPlugin: "InAppPurchasePlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) } diff --git a/infinite_list/.metadata b/infinite_list/.metadata index 31b763f97f2..d680382e18c 100644 --- a/infinite_list/.metadata +++ b/infinite_list/.metadata @@ -4,8 +4,8 @@ # This file should be version controlled. version: - revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - channel: stable + revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + channel: beta project_type: app @@ -13,26 +13,26 @@ project_type: app migration: platforms: - platform: root - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: android - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: ios - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: linux - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: macos - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: web - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: windows - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 # User provided section diff --git a/infinite_list/android/app/build.gradle b/infinite_list/android/app/build.gradle index 3b98760d132..248a1330bb0 100644 --- a/infinite_list/android/app/build.gradle +++ b/infinite_list/android/app/build.gradle @@ -46,7 +46,7 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "dev.flutter.infinite_list" // You can update the following values to match your application needs. - // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. + // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. minSdkVersion flutter.minSdkVersion targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() diff --git a/infinite_list/android/build.gradle b/infinite_list/android/build.gradle index 83ae220041c..58a8c74b147 100644 --- a/infinite_list/android/build.gradle +++ b/infinite_list/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.6.10' + ext.kotlin_version = '1.7.10' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.1.2' + classpath 'com.android.tools.build:gradle:7.2.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/infinite_list/android/gradle/wrapper/gradle-wrapper.properties b/infinite_list/android/gradle/wrapper/gradle-wrapper.properties index cb24abda10a..3c472b99c6f 100644 --- a/infinite_list/android/gradle/wrapper/gradle-wrapper.properties +++ b/infinite_list/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip diff --git a/infinite_list/codelab_rebuild.yaml b/infinite_list/codelab_rebuild.yaml index b89d08a724e..5971a609484 100644 --- a/infinite_list/codelab_rebuild.yaml +++ b/infinite_list/codelab_rebuild.yaml @@ -11,6 +11,9 @@ steps: - web - name: Recreate runners flutter: create --org dev.flutter . + - name: Strip DEVELOPMENT_TEAM + strip-lines-containing: DEVELOPMENT_TEAM = + path: ios/Runner.xcodeproj/project.pbxproj - name: Patch macos/Runner/DebugProfile.entitlements path: macos/Runner/DebugProfile.entitlements patch-u: | diff --git a/infinite_list/ios/Runner.xcodeproj/project.pbxproj b/infinite_list/ios/Runner.xcodeproj/project.pbxproj index cb3e7d2beca..d72515c106e 100644 --- a/infinite_list/ios/Runner.xcodeproj/project.pbxproj +++ b/infinite_list/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -13,7 +13,7 @@ 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - C71D9A61228B6B41CE6FE2C3 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE54738E98F1823E94841BE6 /* Pods_Runner.framework */; }; + B033CF029939638640758CC6 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 90E8D8091C1D53E2DD305713 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -30,15 +30,15 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 0DCE0234E48E2E444500A40F /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 315BBCBD918A363E83E8D98F /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 3E65ACBD081D53FF6433024A /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; - 717F2EEC09BE7FD5192FB899 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 697D5305ECE9B130C6DF44BB /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 90E8D8091C1D53E2DD305713 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -46,7 +46,7 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - CE54738E98F1823E94841BE6 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + B8AC97B417DCA9D4C75DFD7C /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -54,19 +54,27 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C71D9A61228B6B41CE6FE2C3 /* Pods_Runner.framework in Frameworks */, + B033CF029939638640758CC6 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 4FC4453B6F1E51736E90892D /* Pods */ = { + 650131E077B7CECAAAA7D0C2 /* Frameworks */ = { isa = PBXGroup; children = ( - 717F2EEC09BE7FD5192FB899 /* Pods-Runner.debug.xcconfig */, - 3E65ACBD081D53FF6433024A /* Pods-Runner.release.xcconfig */, - 0DCE0234E48E2E444500A40F /* Pods-Runner.profile.xcconfig */, + 90E8D8091C1D53E2DD305713 /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 8F66C158B34B63E21828446C /* Pods */ = { + isa = PBXGroup; + children = ( + B8AC97B417DCA9D4C75DFD7C /* Pods-Runner.debug.xcconfig */, + 315BBCBD918A363E83E8D98F /* Pods-Runner.release.xcconfig */, + 697D5305ECE9B130C6DF44BB /* Pods-Runner.profile.xcconfig */, ); name = Pods; path = Pods; @@ -89,8 +97,8 @@ 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, - 4FC4453B6F1E51736E90892D /* Pods */, - CD7D804D9918CA13D2A294C8 /* Frameworks */, + 8F66C158B34B63E21828446C /* Pods */, + 650131E077B7CECAAAA7D0C2 /* Frameworks */, ); sourceTree = ""; }; @@ -117,14 +125,6 @@ path = Runner; sourceTree = ""; }; - CD7D804D9918CA13D2A294C8 /* Frameworks */ = { - isa = PBXGroup; - children = ( - CE54738E98F1823E94841BE6 /* Pods_Runner.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -132,7 +132,7 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - E89B0FCFB1800CB14D0BE217 /* [CP] Check Pods Manifest.lock */, + DD8A17D54A4E521F5C33E4F3 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, @@ -199,6 +199,7 @@ /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -213,6 +214,7 @@ }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -225,7 +227,7 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; - E89B0FCFB1800CB14D0BE217 /* [CP] Check Pods Manifest.lock */ = { + DD8A17D54A4E521F5C33E4F3 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( diff --git a/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png index 28c6bf03016..7353c41ecf9 100644 Binary files a/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and b/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png index 2ccbfd967d9..797d452e458 100644 Binary files a/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and b/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png index f091b6b0bca..6ed2d933e11 100644 Binary files a/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and b/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png index 4cde12118dd..4cd7b0099ca 100644 Binary files a/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and b/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png index d0ef06e7edb..fe730945a01 100644 Binary files a/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and b/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png index dcdc2306c28..321773cd857 100644 Binary files a/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and b/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png index 2ccbfd967d9..797d452e458 100644 Binary files a/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and b/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png index c8f9ed8f5ce..502f463a9bc 100644 Binary files a/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and b/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png index a6d6b8609df..0ec30343922 100644 Binary files a/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and b/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png index a6d6b8609df..0ec30343922 100644 Binary files a/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and b/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png index 75b2d164a5a..e9f5fea27c7 100644 Binary files a/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and b/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png index c4df70d39da..84ac32ae7d9 100644 Binary files a/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and b/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png index 6a84f41e14e..8953cba0906 100644 Binary files a/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and b/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png index d0e1f585360..0467bf12aa4 100644 Binary files a/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and b/infinite_list/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/infinite_list/macos/Podfile b/infinite_list/macos/Podfile index dade8dfad0d..049abe29542 100644 --- a/infinite_list/macos/Podfile +++ b/infinite_list/macos/Podfile @@ -1,4 +1,4 @@ -platform :osx, '10.11' +platform :osx, '10.14' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/infinite_list/macos/Runner.xcodeproj/project.pbxproj b/infinite_list/macos/Runner.xcodeproj/project.pbxproj index 8f1d1cd6c8f..fae0835c2a6 100644 --- a/infinite_list/macos/Runner.xcodeproj/project.pbxproj +++ b/infinite_list/macos/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 54; objects = { /* Begin PBXAggregateTarget section */ @@ -21,12 +21,12 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ - 2A0DECCD063130CBA4CB790D /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7D58235BF2A8BE54A268190C /* Pods_Runner.framework */; }; 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; + EA133B5E05568773D184FD66 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 66604CA5FC8F52AEA6FCF271 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -53,8 +53,6 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 0E885C260FB1468F8FC81D23 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; - 1E43FFAD1537435A9FE1F753 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; 33CC10ED2044A3C60003C045 /* infinite_list.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = infinite_list.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -69,9 +67,11 @@ 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; - 49257F3C06F85C9E77C2BC31 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 368C165F689C6910791D1E6B /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + 5975B54656CD91410B818F8D /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 66604CA5FC8F52AEA6FCF271 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; - 7D58235BF2A8BE54A268190C /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 8BB48CFB9DEEC21F1286C433 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; /* End PBXFileReference section */ @@ -80,7 +80,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 2A0DECCD063130CBA4CB790D /* Pods_Runner.framework in Frameworks */, + EA133B5E05568773D184FD66 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -105,7 +105,7 @@ 33CEB47122A05771004F2AC0 /* Flutter */, 33CC10EE2044A3C60003C045 /* Products */, D73912EC22F37F3D000D13A0 /* Frameworks */, - AB7BB8D642D49CFDD34228CC /* Pods */, + 9F9B61C15F5380A78988BF35 /* Pods */, ); sourceTree = ""; }; @@ -152,12 +152,12 @@ path = Runner; sourceTree = ""; }; - AB7BB8D642D49CFDD34228CC /* Pods */ = { + 9F9B61C15F5380A78988BF35 /* Pods */ = { isa = PBXGroup; children = ( - 49257F3C06F85C9E77C2BC31 /* Pods-Runner.debug.xcconfig */, - 1E43FFAD1537435A9FE1F753 /* Pods-Runner.release.xcconfig */, - 0E885C260FB1468F8FC81D23 /* Pods-Runner.profile.xcconfig */, + 5975B54656CD91410B818F8D /* Pods-Runner.debug.xcconfig */, + 8BB48CFB9DEEC21F1286C433 /* Pods-Runner.release.xcconfig */, + 368C165F689C6910791D1E6B /* Pods-Runner.profile.xcconfig */, ); name = Pods; path = Pods; @@ -166,7 +166,7 @@ D73912EC22F37F3D000D13A0 /* Frameworks */ = { isa = PBXGroup; children = ( - 7D58235BF2A8BE54A268190C /* Pods_Runner.framework */, + 66604CA5FC8F52AEA6FCF271 /* Pods_Runner.framework */, ); name = Frameworks; sourceTree = ""; @@ -178,13 +178,13 @@ isa = PBXNativeTarget; buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - 4528C24D64EECF396000D69C /* [CP] Check Pods Manifest.lock */, + 606BE1E08EC685D31F9C65ED /* [CP] Check Pods Manifest.lock */, 33CC10E92044A3C60003C045 /* Sources */, 33CC10EA2044A3C60003C045 /* Frameworks */, 33CC10EB2044A3C60003C045 /* Resources */, 33CC110E2044A8840003C045 /* Bundle Framework */, 3399D490228B24CF009A79C7 /* ShellScript */, - 1FD5401A6507EF597DF07B6B /* [CP] Embed Pods Frameworks */, + D7F4BD6CE44F1D2E0AAB46E6 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -254,25 +254,9 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 1FD5401A6507EF597DF07B6B /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; 3399D490228B24CF009A79C7 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -308,7 +292,7 @@ shellPath = /bin/sh; shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; }; - 4528C24D64EECF396000D69C /* [CP] Check Pods Manifest.lock */ = { + 606BE1E08EC685D31F9C65ED /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -330,6 +314,23 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; + D7F4BD6CE44F1D2E0AAB46E6 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -404,7 +405,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; @@ -483,7 +484,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; @@ -530,7 +531,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; diff --git a/infinite_list/macos/Runner/Configs/AppInfo.xcconfig b/infinite_list/macos/Runner/Configs/AppInfo.xcconfig index 90a804ca274..aa9000b8954 100644 --- a/infinite_list/macos/Runner/Configs/AppInfo.xcconfig +++ b/infinite_list/macos/Runner/Configs/AppInfo.xcconfig @@ -11,4 +11,4 @@ PRODUCT_NAME = infinite_list PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.infiniteList // The copyright displayed in application information -PRODUCT_COPYRIGHT = Copyright © 2022 dev.flutter. All rights reserved. +PRODUCT_COPYRIGHT = Copyright © 2023 dev.flutter. All rights reserved. diff --git a/infinite_list/web/index.html b/infinite_list/web/index.html index cdab1aded49..f4f5b3519c5 100644 --- a/infinite_list/web/index.html +++ b/infinite_list/web/index.html @@ -46,11 +46,12 @@ _flutter.loader.loadEntrypoint({ serviceWorker: { serviceWorkerVersion: serviceWorkerVersion, + }, + onEntrypointLoaded: function(engineInitializer) { + engineInitializer.initializeEngine().then(function(appRunner) { + appRunner.runApp(); + }); } - }).then(function(engineInitializer) { - return engineInitializer.initializeEngine(); - }).then(function(appRunner) { - return appRunner.runApp(); }); }); diff --git a/infinite_list/windows/runner/CMakeLists.txt b/infinite_list/windows/runner/CMakeLists.txt index 17411a8ab8e..394917c053a 100644 --- a/infinite_list/windows/runner/CMakeLists.txt +++ b/infinite_list/windows/runner/CMakeLists.txt @@ -33,6 +33,7 @@ target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") # Add dependency libraries and include directories. Add any application-specific # dependencies here. target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) +target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") # Run the Flutter tool portions of the build. This must not be removed. diff --git a/infinite_list/windows/runner/Runner.rc b/infinite_list/windows/runner/Runner.rc index 1d49704ed86..a33db81f98e 100644 --- a/infinite_list/windows/runner/Runner.rc +++ b/infinite_list/windows/runner/Runner.rc @@ -93,7 +93,7 @@ BEGIN VALUE "FileDescription", "infinite_list" "\0" VALUE "FileVersion", VERSION_AS_STRING "\0" VALUE "InternalName", "infinite_list" "\0" - VALUE "LegalCopyright", "Copyright (C) 2022 dev.flutter. All rights reserved." "\0" + VALUE "LegalCopyright", "Copyright (C) 2023 dev.flutter. All rights reserved." "\0" VALUE "OriginalFilename", "infinite_list.exe" "\0" VALUE "ProductName", "infinite_list" "\0" VALUE "ProductVersion", VERSION_AS_STRING "\0" diff --git a/infinite_list/windows/runner/flutter_window.cpp b/infinite_list/windows/runner/flutter_window.cpp index b43b9095ea3..b25e363efa4 100644 --- a/infinite_list/windows/runner/flutter_window.cpp +++ b/infinite_list/windows/runner/flutter_window.cpp @@ -26,6 +26,11 @@ bool FlutterWindow::OnCreate() { } RegisterPlugins(flutter_controller_->engine()); SetChildContent(flutter_controller_->view()->GetNativeWindow()); + + flutter_controller_->engine()->SetNextFrameCallback([&]() { + this->Show(); + }); + return true; } diff --git a/infinite_list/windows/runner/main.cpp b/infinite_list/windows/runner/main.cpp index 86d85cfa0cd..89671825ba1 100644 --- a/infinite_list/windows/runner/main.cpp +++ b/infinite_list/windows/runner/main.cpp @@ -27,7 +27,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, FlutterWindow window(project); Win32Window::Point origin(10, 10); Win32Window::Size size(1280, 720); - if (!window.CreateAndShow(L"infinite_list", origin, size)) { + if (!window.Create(L"infinite_list", origin, size)) { return EXIT_FAILURE; } window.SetQuitOnClose(true); diff --git a/infinite_list/windows/runner/win32_window.cpp b/infinite_list/windows/runner/win32_window.cpp index c10f08dc7da..041a3855474 100644 --- a/infinite_list/windows/runner/win32_window.cpp +++ b/infinite_list/windows/runner/win32_window.cpp @@ -1,13 +1,31 @@ #include "win32_window.h" +#include #include #include "resource.h" namespace { +/// Window attribute that enables dark mode window decorations. +/// +/// Redefined in case the developer's machine has a Windows SDK older than +/// version 10.0.22000.0. +/// See: https://docs.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute +#ifndef DWMWA_USE_IMMERSIVE_DARK_MODE +#define DWMWA_USE_IMMERSIVE_DARK_MODE 20 +#endif + constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; +/// Registry key for app theme preference. +/// +/// A value of 0 indicates apps should use dark mode. A non-zero or missing +/// value indicates apps should use light mode. +constexpr const wchar_t kGetPreferredBrightnessRegKey[] = + L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; +constexpr const wchar_t kGetPreferredBrightnessRegValue[] = L"AppsUseLightTheme"; + // The number of Win32Window objects that currently exist. static int g_active_window_count = 0; @@ -31,8 +49,8 @@ void EnableFullDpiSupportIfAvailable(HWND hwnd) { GetProcAddress(user32_module, "EnableNonClientDpiScaling")); if (enable_non_client_dpi_scaling != nullptr) { enable_non_client_dpi_scaling(hwnd); - FreeLibrary(user32_module); } + FreeLibrary(user32_module); } } // namespace @@ -102,9 +120,9 @@ Win32Window::~Win32Window() { Destroy(); } -bool Win32Window::CreateAndShow(const std::wstring& title, - const Point& origin, - const Size& size) { +bool Win32Window::Create(const std::wstring& title, + const Point& origin, + const Size& size) { Destroy(); const wchar_t* window_class = @@ -117,7 +135,7 @@ bool Win32Window::CreateAndShow(const std::wstring& title, double scale_factor = dpi / 96.0; HWND window = CreateWindow( - window_class, title.c_str(), WS_OVERLAPPEDWINDOW | WS_VISIBLE, + window_class, title.c_str(), WS_OVERLAPPEDWINDOW, Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), Scale(size.width, scale_factor), Scale(size.height, scale_factor), nullptr, nullptr, GetModuleHandle(nullptr), this); @@ -126,9 +144,15 @@ bool Win32Window::CreateAndShow(const std::wstring& title, return false; } + UpdateTheme(window); + return OnCreate(); } +bool Win32Window::Show() { + return ShowWindow(window_handle_, SW_SHOWNORMAL); +} + // static LRESULT CALLBACK Win32Window::WndProc(HWND const window, UINT const message, @@ -188,6 +212,10 @@ Win32Window::MessageHandler(HWND hwnd, SetFocus(child_content_); } return 0; + + case WM_DWMCOLORIZATIONCOLORCHANGED: + UpdateTheme(hwnd); + return 0; } return DefWindowProc(window_handle_, message, wparam, lparam); @@ -243,3 +271,18 @@ bool Win32Window::OnCreate() { void Win32Window::OnDestroy() { // No-op; provided for subclasses. } + +void Win32Window::UpdateTheme(HWND const window) { + DWORD light_mode; + DWORD light_mode_size = sizeof(light_mode); + LSTATUS result = RegGetValue(HKEY_CURRENT_USER, kGetPreferredBrightnessRegKey, + kGetPreferredBrightnessRegValue, + RRF_RT_REG_DWORD, nullptr, &light_mode, + &light_mode_size); + + if (result == ERROR_SUCCESS) { + BOOL enable_dark_mode = light_mode == 0; + DwmSetWindowAttribute(window, DWMWA_USE_IMMERSIVE_DARK_MODE, + &enable_dark_mode, sizeof(enable_dark_mode)); + } +} diff --git a/infinite_list/windows/runner/win32_window.h b/infinite_list/windows/runner/win32_window.h index 17ba431125b..c86632d8a6b 100644 --- a/infinite_list/windows/runner/win32_window.h +++ b/infinite_list/windows/runner/win32_window.h @@ -28,15 +28,16 @@ class Win32Window { Win32Window(); virtual ~Win32Window(); - // Creates and shows a win32 window with |title| and position and size using + // Creates a win32 window with |title| that is positioned and sized using // |origin| and |size|. New windows are created on the default monitor. Window // sizes are specified to the OS in physical pixels, hence to ensure a - // consistent size to will treat the width height passed in to this function - // as logical pixels and scale to appropriate for the default monitor. Returns - // true if the window was created successfully. - bool CreateAndShow(const std::wstring& title, - const Point& origin, - const Size& size); + // consistent size this function will scale the inputted width and height as + // as appropriate for the default monitor. The window is invisible until + // |Show| is called. Returns true if the window was created successfully. + bool Create(const std::wstring& title, const Point& origin, const Size& size); + + // Show the current window. Returns true if the window was successfully shown. + bool Show(); // Release OS resources associated with window. void Destroy(); @@ -86,6 +87,9 @@ class Win32Window { // Retrieves a class instance pointer for |window| static Win32Window* GetThisFromHandle(HWND const window) noexcept; + // Update the window frame's theme to match the system theme. + static void UpdateTheme(HWND const window); + bool quit_on_close_ = false; // window handle for top level window. diff --git a/isolate_example/.metadata b/isolate_example/.metadata index 49936cf1f72..2ea1bd36797 100644 --- a/isolate_example/.metadata +++ b/isolate_example/.metadata @@ -4,8 +4,8 @@ # This file should be version controlled. version: - revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - channel: stable + revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + channel: beta project_type: app @@ -13,23 +13,23 @@ project_type: app migration: platforms: - platform: root - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: android - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: ios - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: linux - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: macos - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: windows - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 # User provided section diff --git a/isolate_example/android/app/build.gradle b/isolate_example/android/app/build.gradle index 3570593ceb0..7189d2b9d3b 100644 --- a/isolate_example/android/app/build.gradle +++ b/isolate_example/android/app/build.gradle @@ -46,7 +46,7 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "dev.flutter.isolate_example" // You can update the following values to match your application needs. - // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. + // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. minSdkVersion flutter.minSdkVersion targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() diff --git a/isolate_example/android/build.gradle b/isolate_example/android/build.gradle index 83ae220041c..58a8c74b147 100644 --- a/isolate_example/android/build.gradle +++ b/isolate_example/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.6.10' + ext.kotlin_version = '1.7.10' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.1.2' + classpath 'com.android.tools.build:gradle:7.2.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/isolate_example/android/gradle/wrapper/gradle-wrapper.properties b/isolate_example/android/gradle/wrapper/gradle-wrapper.properties index cb24abda10a..3c472b99c6f 100644 --- a/isolate_example/android/gradle/wrapper/gradle-wrapper.properties +++ b/isolate_example/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip diff --git a/isolate_example/codelab_rebuild.yaml b/isolate_example/codelab_rebuild.yaml index cc7d5313460..cad5c66e6fc 100644 --- a/isolate_example/codelab_rebuild.yaml +++ b/isolate_example/codelab_rebuild.yaml @@ -10,6 +10,9 @@ steps: - windows - name: Recreate runners flutter: create --org dev.flutter --platforms android,ios,macos,linux,windows . + - name: Strip DEVELOPMENT_TEAM + strip-lines-containing: DEVELOPMENT_TEAM = + path: ios/Runner.xcodeproj/project.pbxproj - name: Flutter upgrade flutter: pub upgrade --major-versions - name: Flutter build macOS diff --git a/isolate_example/ios/Runner.xcodeproj/project.pbxproj b/isolate_example/ios/Runner.xcodeproj/project.pbxproj index 068b96bc987..ae3f2d3b52c 100644 --- a/isolate_example/ios/Runner.xcodeproj/project.pbxproj +++ b/isolate_example/ios/Runner.xcodeproj/project.pbxproj @@ -3,17 +3,17 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 6B77D82B84B87C81CD50B227 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EDA99BC2AB82371A95FD5323 /* Pods_Runner.framework */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; + C0EBE03E5DCAA711D69A5E86 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 89E36CF2748516114DD4DAA0 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -30,14 +30,15 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 0A9ADFA6DBD18E2D26D9B1E5 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 235262584023E15F3AA8FE80 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 1E3266F5C02A9D0473BEC313 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 7B9D3CACBF0EBA46A469B3AD /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + 89E36CF2748516114DD4DAA0 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -45,8 +46,7 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 9E8C1395E9F6F51C305D4152 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; - EDA99BC2AB82371A95FD5323 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A6AD5B15693DE110B667CDE9 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -54,28 +54,28 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 6B77D82B84B87C81CD50B227 /* Pods_Runner.framework in Frameworks */, + C0EBE03E5DCAA711D69A5E86 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 0613C8A5252A93C033B43D50 /* Pods */ = { + 3A62F5639A81173E6893AF05 /* Pods */ = { isa = PBXGroup; children = ( - 235262584023E15F3AA8FE80 /* Pods-Runner.debug.xcconfig */, - 9E8C1395E9F6F51C305D4152 /* Pods-Runner.release.xcconfig */, - 7B9D3CACBF0EBA46A469B3AD /* Pods-Runner.profile.xcconfig */, + 0A9ADFA6DBD18E2D26D9B1E5 /* Pods-Runner.debug.xcconfig */, + 1E3266F5C02A9D0473BEC313 /* Pods-Runner.release.xcconfig */, + A6AD5B15693DE110B667CDE9 /* Pods-Runner.profile.xcconfig */, ); name = Pods; path = Pods; sourceTree = ""; }; - 45C39602FFF8D511C02669EF /* Frameworks */ = { + 7EF23AEB0C039574E7AF5B7F /* Frameworks */ = { isa = PBXGroup; children = ( - EDA99BC2AB82371A95FD5323 /* Pods_Runner.framework */, + 89E36CF2748516114DD4DAA0 /* Pods_Runner.framework */, ); name = Frameworks; sourceTree = ""; @@ -97,8 +97,8 @@ 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, - 0613C8A5252A93C033B43D50 /* Pods */, - 45C39602FFF8D511C02669EF /* Frameworks */, + 3A62F5639A81173E6893AF05 /* Pods */, + 7EF23AEB0C039574E7AF5B7F /* Frameworks */, ); sourceTree = ""; }; @@ -132,7 +132,7 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - B68A5A4B07195593A0564512 /* [CP] Check Pods Manifest.lock */, + 7202FDE2D8347FA5ABC024D8 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, @@ -199,6 +199,7 @@ /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -211,41 +212,42 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; - 9740EEB61CF901F6004384FC /* Run Script */ = { + 7202FDE2D8347FA5ABC024D8 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); + inputFileListPaths = ( + ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( ); - name = "Run Script"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; }; - B68A5A4B07195593A0564512 /* [CP] Check Pods Manifest.lock */ = { + 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); - inputFileListPaths = ( - ); inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( ); + name = "Run Script"; outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; /* End PBXShellScriptBuildPhase section */ diff --git a/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png index 28c6bf03016..7353c41ecf9 100644 Binary files a/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and b/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png index 2ccbfd967d9..797d452e458 100644 Binary files a/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and b/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png index f091b6b0bca..6ed2d933e11 100644 Binary files a/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and b/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png index 4cde12118dd..4cd7b0099ca 100644 Binary files a/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and b/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png index d0ef06e7edb..fe730945a01 100644 Binary files a/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and b/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png index dcdc2306c28..321773cd857 100644 Binary files a/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and b/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png index 2ccbfd967d9..797d452e458 100644 Binary files a/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and b/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png index c8f9ed8f5ce..502f463a9bc 100644 Binary files a/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and b/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png index a6d6b8609df..0ec30343922 100644 Binary files a/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and b/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png index a6d6b8609df..0ec30343922 100644 Binary files a/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and b/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png index 75b2d164a5a..e9f5fea27c7 100644 Binary files a/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and b/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png index c4df70d39da..84ac32ae7d9 100644 Binary files a/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and b/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png index 6a84f41e14e..8953cba0906 100644 Binary files a/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and b/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png index d0e1f585360..0467bf12aa4 100644 Binary files a/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and b/isolate_example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/isolate_example/macos/Podfile b/isolate_example/macos/Podfile index dade8dfad0d..049abe29542 100644 --- a/isolate_example/macos/Podfile +++ b/isolate_example/macos/Podfile @@ -1,4 +1,4 @@ -platform :osx, '10.11' +platform :osx, '10.14' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/isolate_example/macos/Runner.xcodeproj/project.pbxproj b/isolate_example/macos/Runner.xcodeproj/project.pbxproj index 95f75e3553f..db4e6b39183 100644 --- a/isolate_example/macos/Runner.xcodeproj/project.pbxproj +++ b/isolate_example/macos/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 54; objects = { /* Begin PBXAggregateTarget section */ @@ -21,12 +21,12 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ + 2EFBFDC15EA930D038647062 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BD76DE536B7A46E99AA51BDF /* Pods_Runner.framework */; }; 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; - D054C4456AC002524D901653 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EE37C73142E48B01AEF9FA72 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -53,7 +53,8 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 0C0C64BCA8B5D0F0584798F8 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + 0BB3457CBC9AA005108CD83E /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + 323E9B694CFB3DC1BB10D472 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; 33CC10ED2044A3C60003C045 /* isolate_example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = isolate_example.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -68,11 +69,10 @@ 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; - 6B189514E66497B47658B142 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; + 7EB2CB130105495C835E7F63 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; - E75627659E56C0883773050B /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; - EE37C73142E48B01AEF9FA72 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + BD76DE536B7A46E99AA51BDF /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -80,7 +80,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - D054C4456AC002524D901653 /* Pods_Runner.framework in Frameworks */, + 2EFBFDC15EA930D038647062 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -105,7 +105,7 @@ 33CEB47122A05771004F2AC0 /* Flutter */, 33CC10EE2044A3C60003C045 /* Products */, D73912EC22F37F3D000D13A0 /* Frameworks */, - 6CDA68428E4468DEAFFA309D /* Pods */, + 4DCDFBF71F281C2FFB315F47 /* Pods */, ); sourceTree = ""; }; @@ -152,12 +152,12 @@ path = Runner; sourceTree = ""; }; - 6CDA68428E4468DEAFFA309D /* Pods */ = { + 4DCDFBF71F281C2FFB315F47 /* Pods */ = { isa = PBXGroup; children = ( - 6B189514E66497B47658B142 /* Pods-Runner.debug.xcconfig */, - 0C0C64BCA8B5D0F0584798F8 /* Pods-Runner.release.xcconfig */, - E75627659E56C0883773050B /* Pods-Runner.profile.xcconfig */, + 323E9B694CFB3DC1BB10D472 /* Pods-Runner.debug.xcconfig */, + 7EB2CB130105495C835E7F63 /* Pods-Runner.release.xcconfig */, + 0BB3457CBC9AA005108CD83E /* Pods-Runner.profile.xcconfig */, ); name = Pods; path = Pods; @@ -166,7 +166,7 @@ D73912EC22F37F3D000D13A0 /* Frameworks */ = { isa = PBXGroup; children = ( - EE37C73142E48B01AEF9FA72 /* Pods_Runner.framework */, + BD76DE536B7A46E99AA51BDF /* Pods_Runner.framework */, ); name = Frameworks; sourceTree = ""; @@ -178,13 +178,13 @@ isa = PBXNativeTarget; buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - 3DF6D78EEB19B36EAA03F1C9 /* [CP] Check Pods Manifest.lock */, + 8A42EF316CC735DEC42976C7 /* [CP] Check Pods Manifest.lock */, 33CC10E92044A3C60003C045 /* Sources */, 33CC10EA2044A3C60003C045 /* Frameworks */, 33CC10EB2044A3C60003C045 /* Resources */, 33CC110E2044A8840003C045 /* Bundle Framework */, 3399D490228B24CF009A79C7 /* ShellScript */, - F245889618B0AAAB1BBF419E /* [CP] Embed Pods Frameworks */, + 60CB5F1584F843985E51A66E /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -256,6 +256,7 @@ /* Begin PBXShellScriptBuildPhase section */ 3399D490228B24CF009A79C7 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -291,43 +292,43 @@ shellPath = /bin/sh; shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; }; - 3DF6D78EEB19B36EAA03F1C9 /* [CP] Check Pods Manifest.lock */ = { + 60CB5F1584F843985E51A66E /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; + name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - F245889618B0AAAB1BBF419E /* [CP] Embed Pods Frameworks */ = { + 8A42EF316CC735DEC42976C7 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - name = "[CP] Embed Pods Frameworks"; + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -404,7 +405,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; @@ -483,7 +484,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; @@ -530,7 +531,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; diff --git a/isolate_example/macos/Runner/Configs/AppInfo.xcconfig b/isolate_example/macos/Runner/Configs/AppInfo.xcconfig index 25efffa72fb..2056c2f1eee 100644 --- a/isolate_example/macos/Runner/Configs/AppInfo.xcconfig +++ b/isolate_example/macos/Runner/Configs/AppInfo.xcconfig @@ -11,4 +11,4 @@ PRODUCT_NAME = isolate_example PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.isolateExample // The copyright displayed in application information -PRODUCT_COPYRIGHT = Copyright © 2022 dev.flutter. All rights reserved. +PRODUCT_COPYRIGHT = Copyright © 2023 dev.flutter. All rights reserved. diff --git a/isolate_example/windows/runner/CMakeLists.txt b/isolate_example/windows/runner/CMakeLists.txt index 17411a8ab8e..394917c053a 100644 --- a/isolate_example/windows/runner/CMakeLists.txt +++ b/isolate_example/windows/runner/CMakeLists.txt @@ -33,6 +33,7 @@ target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") # Add dependency libraries and include directories. Add any application-specific # dependencies here. target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) +target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") # Run the Flutter tool portions of the build. This must not be removed. diff --git a/isolate_example/windows/runner/Runner.rc b/isolate_example/windows/runner/Runner.rc index 42c4b7004f6..fe2de5616fe 100644 --- a/isolate_example/windows/runner/Runner.rc +++ b/isolate_example/windows/runner/Runner.rc @@ -93,7 +93,7 @@ BEGIN VALUE "FileDescription", "isolate_example" "\0" VALUE "FileVersion", VERSION_AS_STRING "\0" VALUE "InternalName", "isolate_example" "\0" - VALUE "LegalCopyright", "Copyright (C) 2022 dev.flutter. All rights reserved." "\0" + VALUE "LegalCopyright", "Copyright (C) 2023 dev.flutter. All rights reserved." "\0" VALUE "OriginalFilename", "isolate_example.exe" "\0" VALUE "ProductName", "isolate_example" "\0" VALUE "ProductVersion", VERSION_AS_STRING "\0" diff --git a/isolate_example/windows/runner/flutter_window.cpp b/isolate_example/windows/runner/flutter_window.cpp index b43b9095ea3..b25e363efa4 100644 --- a/isolate_example/windows/runner/flutter_window.cpp +++ b/isolate_example/windows/runner/flutter_window.cpp @@ -26,6 +26,11 @@ bool FlutterWindow::OnCreate() { } RegisterPlugins(flutter_controller_->engine()); SetChildContent(flutter_controller_->view()->GetNativeWindow()); + + flutter_controller_->engine()->SetNextFrameCallback([&]() { + this->Show(); + }); + return true; } diff --git a/isolate_example/windows/runner/main.cpp b/isolate_example/windows/runner/main.cpp index 4779464ff62..f92114459ed 100644 --- a/isolate_example/windows/runner/main.cpp +++ b/isolate_example/windows/runner/main.cpp @@ -27,7 +27,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, FlutterWindow window(project); Win32Window::Point origin(10, 10); Win32Window::Size size(1280, 720); - if (!window.CreateAndShow(L"isolate_example", origin, size)) { + if (!window.Create(L"isolate_example", origin, size)) { return EXIT_FAILURE; } window.SetQuitOnClose(true); diff --git a/isolate_example/windows/runner/win32_window.cpp b/isolate_example/windows/runner/win32_window.cpp index c10f08dc7da..041a3855474 100644 --- a/isolate_example/windows/runner/win32_window.cpp +++ b/isolate_example/windows/runner/win32_window.cpp @@ -1,13 +1,31 @@ #include "win32_window.h" +#include #include #include "resource.h" namespace { +/// Window attribute that enables dark mode window decorations. +/// +/// Redefined in case the developer's machine has a Windows SDK older than +/// version 10.0.22000.0. +/// See: https://docs.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute +#ifndef DWMWA_USE_IMMERSIVE_DARK_MODE +#define DWMWA_USE_IMMERSIVE_DARK_MODE 20 +#endif + constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; +/// Registry key for app theme preference. +/// +/// A value of 0 indicates apps should use dark mode. A non-zero or missing +/// value indicates apps should use light mode. +constexpr const wchar_t kGetPreferredBrightnessRegKey[] = + L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; +constexpr const wchar_t kGetPreferredBrightnessRegValue[] = L"AppsUseLightTheme"; + // The number of Win32Window objects that currently exist. static int g_active_window_count = 0; @@ -31,8 +49,8 @@ void EnableFullDpiSupportIfAvailable(HWND hwnd) { GetProcAddress(user32_module, "EnableNonClientDpiScaling")); if (enable_non_client_dpi_scaling != nullptr) { enable_non_client_dpi_scaling(hwnd); - FreeLibrary(user32_module); } + FreeLibrary(user32_module); } } // namespace @@ -102,9 +120,9 @@ Win32Window::~Win32Window() { Destroy(); } -bool Win32Window::CreateAndShow(const std::wstring& title, - const Point& origin, - const Size& size) { +bool Win32Window::Create(const std::wstring& title, + const Point& origin, + const Size& size) { Destroy(); const wchar_t* window_class = @@ -117,7 +135,7 @@ bool Win32Window::CreateAndShow(const std::wstring& title, double scale_factor = dpi / 96.0; HWND window = CreateWindow( - window_class, title.c_str(), WS_OVERLAPPEDWINDOW | WS_VISIBLE, + window_class, title.c_str(), WS_OVERLAPPEDWINDOW, Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), Scale(size.width, scale_factor), Scale(size.height, scale_factor), nullptr, nullptr, GetModuleHandle(nullptr), this); @@ -126,9 +144,15 @@ bool Win32Window::CreateAndShow(const std::wstring& title, return false; } + UpdateTheme(window); + return OnCreate(); } +bool Win32Window::Show() { + return ShowWindow(window_handle_, SW_SHOWNORMAL); +} + // static LRESULT CALLBACK Win32Window::WndProc(HWND const window, UINT const message, @@ -188,6 +212,10 @@ Win32Window::MessageHandler(HWND hwnd, SetFocus(child_content_); } return 0; + + case WM_DWMCOLORIZATIONCOLORCHANGED: + UpdateTheme(hwnd); + return 0; } return DefWindowProc(window_handle_, message, wparam, lparam); @@ -243,3 +271,18 @@ bool Win32Window::OnCreate() { void Win32Window::OnDestroy() { // No-op; provided for subclasses. } + +void Win32Window::UpdateTheme(HWND const window) { + DWORD light_mode; + DWORD light_mode_size = sizeof(light_mode); + LSTATUS result = RegGetValue(HKEY_CURRENT_USER, kGetPreferredBrightnessRegKey, + kGetPreferredBrightnessRegValue, + RRF_RT_REG_DWORD, nullptr, &light_mode, + &light_mode_size); + + if (result == ERROR_SUCCESS) { + BOOL enable_dark_mode = light_mode == 0; + DwmSetWindowAttribute(window, DWMWA_USE_IMMERSIVE_DARK_MODE, + &enable_dark_mode, sizeof(enable_dark_mode)); + } +} diff --git a/isolate_example/windows/runner/win32_window.h b/isolate_example/windows/runner/win32_window.h index 17ba431125b..c86632d8a6b 100644 --- a/isolate_example/windows/runner/win32_window.h +++ b/isolate_example/windows/runner/win32_window.h @@ -28,15 +28,16 @@ class Win32Window { Win32Window(); virtual ~Win32Window(); - // Creates and shows a win32 window with |title| and position and size using + // Creates a win32 window with |title| that is positioned and sized using // |origin| and |size|. New windows are created on the default monitor. Window // sizes are specified to the OS in physical pixels, hence to ensure a - // consistent size to will treat the width height passed in to this function - // as logical pixels and scale to appropriate for the default monitor. Returns - // true if the window was created successfully. - bool CreateAndShow(const std::wstring& title, - const Point& origin, - const Size& size); + // consistent size this function will scale the inputted width and height as + // as appropriate for the default monitor. The window is invisible until + // |Show| is called. Returns true if the window was created successfully. + bool Create(const std::wstring& title, const Point& origin, const Size& size); + + // Show the current window. Returns true if the window was successfully shown. + bool Show(); // Release OS resources associated with window. void Destroy(); @@ -86,6 +87,9 @@ class Win32Window { // Retrieves a class instance pointer for |window| static Win32Window* GetThisFromHandle(HWND const window) noexcept; + // Update the window frame's theme to match the system theme. + static void UpdateTheme(HWND const window); + bool quit_on_close_ = false; // window handle for top level window. diff --git a/jsonexample/.metadata b/jsonexample/.metadata index 31b763f97f2..d680382e18c 100644 --- a/jsonexample/.metadata +++ b/jsonexample/.metadata @@ -4,8 +4,8 @@ # This file should be version controlled. version: - revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - channel: stable + revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + channel: beta project_type: app @@ -13,26 +13,26 @@ project_type: app migration: platforms: - platform: root - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: android - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: ios - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: linux - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: macos - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: web - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: windows - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 # User provided section diff --git a/jsonexample/android/app/build.gradle b/jsonexample/android/app/build.gradle index d784ad8734e..cba7dcee23e 100644 --- a/jsonexample/android/app/build.gradle +++ b/jsonexample/android/app/build.gradle @@ -46,7 +46,7 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "dev.flutter.jsonexample" // You can update the following values to match your application needs. - // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. + // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. minSdkVersion flutter.minSdkVersion targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() diff --git a/jsonexample/android/build.gradle b/jsonexample/android/build.gradle index 83ae220041c..58a8c74b147 100644 --- a/jsonexample/android/build.gradle +++ b/jsonexample/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.6.10' + ext.kotlin_version = '1.7.10' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.1.2' + classpath 'com.android.tools.build:gradle:7.2.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/jsonexample/android/gradle/wrapper/gradle-wrapper.properties b/jsonexample/android/gradle/wrapper/gradle-wrapper.properties index cb24abda10a..3c472b99c6f 100644 --- a/jsonexample/android/gradle/wrapper/gradle-wrapper.properties +++ b/jsonexample/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip diff --git a/jsonexample/codelab_rebuild.yaml b/jsonexample/codelab_rebuild.yaml index d590eac8d92..a0ea4a68856 100644 --- a/jsonexample/codelab_rebuild.yaml +++ b/jsonexample/codelab_rebuild.yaml @@ -11,6 +11,9 @@ steps: - web - name: Recreate runners flutter: create --org dev.flutter . + - name: Strip DEVELOPMENT_TEAM + strip-lines-containing: DEVELOPMENT_TEAM = + path: ios/Runner.xcodeproj/project.pbxproj - name: Remove widget_test.dart rm: test/widget_test.dart - name: Update diff --git a/jsonexample/ios/Runner.xcodeproj/project.pbxproj b/jsonexample/ios/Runner.xcodeproj/project.pbxproj index 9ea6c11f633..19da73705e5 100644 --- a/jsonexample/ios/Runner.xcodeproj/project.pbxproj +++ b/jsonexample/ios/Runner.xcodeproj/project.pbxproj @@ -3,17 +3,17 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 437DE8C4DE9B6079F564147A /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CCA8F1A8F41846E13AC3F12C /* Pods_Runner.framework */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; + A7DDF634EA3BC8E2323A829C /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C859315A755F3A1EBF69C043 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -33,11 +33,10 @@ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 51FA1619E3F8027D449FF99D /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; - 5849AA6BD2F17264903F2230 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 91E2BFF55EDF9BCFCD970AD6 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -45,8 +44,9 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - AEF18767E2FCF3004C46260B /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; - CCA8F1A8F41846E13AC3F12C /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + C859315A755F3A1EBF69C043 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + F1169A06D46B87FD8DAFF6A1 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + FBCC960C7BC1F5DA46FE6DF1 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -54,19 +54,22 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 437DE8C4DE9B6079F564147A /* Pods_Runner.framework in Frameworks */, + A7DDF634EA3BC8E2323A829C /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 11410BCF91B6BEAB7DFA888D /* Frameworks */ = { + 5F649A66DD658DE5B3F3191F /* Pods */ = { isa = PBXGroup; children = ( - CCA8F1A8F41846E13AC3F12C /* Pods_Runner.framework */, + 91E2BFF55EDF9BCFCD970AD6 /* Pods-Runner.debug.xcconfig */, + F1169A06D46B87FD8DAFF6A1 /* Pods-Runner.release.xcconfig */, + FBCC960C7BC1F5DA46FE6DF1 /* Pods-Runner.profile.xcconfig */, ); - name = Frameworks; + name = Pods; + path = Pods; sourceTree = ""; }; 9740EEB11CF90186004384FC /* Flutter */ = { @@ -86,8 +89,8 @@ 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, - BFE6723843BDFB59CB8E67D2 /* Pods */, - 11410BCF91B6BEAB7DFA888D /* Frameworks */, + 5F649A66DD658DE5B3F3191F /* Pods */, + B799CE94AC927EB932272693 /* Frameworks */, ); sourceTree = ""; }; @@ -114,15 +117,12 @@ path = Runner; sourceTree = ""; }; - BFE6723843BDFB59CB8E67D2 /* Pods */ = { + B799CE94AC927EB932272693 /* Frameworks */ = { isa = PBXGroup; children = ( - AEF18767E2FCF3004C46260B /* Pods-Runner.debug.xcconfig */, - 51FA1619E3F8027D449FF99D /* Pods-Runner.release.xcconfig */, - 5849AA6BD2F17264903F2230 /* Pods-Runner.profile.xcconfig */, + C859315A755F3A1EBF69C043 /* Pods_Runner.framework */, ); - name = Pods; - path = Pods; + name = Frameworks; sourceTree = ""; }; /* End PBXGroup section */ @@ -132,7 +132,7 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - AE4C7C9D8863A33D792888CA /* [CP] Check Pods Manifest.lock */, + 3000FC5596B3F2D0A11DECE0 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, @@ -197,55 +197,57 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + 3000FC5596B3F2D0A11DECE0 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); + inputFileListPaths = ( + ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( ); - name = "Thin Binary"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; }; - 9740EEB61CF901F6004384FC /* Run Script */ = { + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Run Script"; + name = "Thin Binary"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; - AE4C7C9D8863A33D792888CA /* [CP] Check Pods Manifest.lock */ = { + 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); - inputFileListPaths = ( - ); inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( ); + name = "Run Script"; outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; /* End PBXShellScriptBuildPhase section */ diff --git a/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png index 28c6bf03016..7353c41ecf9 100644 Binary files a/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and b/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png index 2ccbfd967d9..797d452e458 100644 Binary files a/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and b/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png index f091b6b0bca..6ed2d933e11 100644 Binary files a/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and b/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png index 4cde12118dd..4cd7b0099ca 100644 Binary files a/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and b/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png index d0ef06e7edb..fe730945a01 100644 Binary files a/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and b/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png index dcdc2306c28..321773cd857 100644 Binary files a/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and b/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png index 2ccbfd967d9..797d452e458 100644 Binary files a/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and b/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png index c8f9ed8f5ce..502f463a9bc 100644 Binary files a/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and b/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png index a6d6b8609df..0ec30343922 100644 Binary files a/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and b/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png index a6d6b8609df..0ec30343922 100644 Binary files a/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and b/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png index 75b2d164a5a..e9f5fea27c7 100644 Binary files a/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and b/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png index c4df70d39da..84ac32ae7d9 100644 Binary files a/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and b/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png index 6a84f41e14e..8953cba0906 100644 Binary files a/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and b/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png index d0e1f585360..0467bf12aa4 100644 Binary files a/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and b/jsonexample/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/jsonexample/macos/Podfile b/jsonexample/macos/Podfile index dade8dfad0d..049abe29542 100644 --- a/jsonexample/macos/Podfile +++ b/jsonexample/macos/Podfile @@ -1,4 +1,4 @@ -platform :osx, '10.11' +platform :osx, '10.14' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/jsonexample/macos/Runner.xcodeproj/project.pbxproj b/jsonexample/macos/Runner.xcodeproj/project.pbxproj index aa272c66a1c..cc39437bd6b 100644 --- a/jsonexample/macos/Runner.xcodeproj/project.pbxproj +++ b/jsonexample/macos/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 54; objects = { /* Begin PBXAggregateTarget section */ @@ -26,7 +26,7 @@ 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; - 9E1DF564C6F0C5270B082BAF /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26CF5D4F94952D7C080C386A /* Pods_Runner.framework */; }; + C31F41E0680B5AF657E3BFB2 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DB8545E1057FCC7CEC27035D /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -53,7 +53,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 26CF5D4F94952D7C080C386A /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 1197A5D1787399F7C3C97476 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; 33CC10ED2044A3C60003C045 /* jsonexample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = jsonexample.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -68,11 +68,11 @@ 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; + 4F6C54B02CE0A3C75694FAB1 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; - 961A6C2B83509F4666CFE501 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; - D33C6A8458290B971C1D199D /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; - F6C96B4218737B4BD3D9B388 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + DB8545E1057FCC7CEC27035D /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + F729394A6A58F07BEF482B0B /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -80,7 +80,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 9E1DF564C6F0C5270B082BAF /* Pods_Runner.framework in Frameworks */, + C31F41E0680B5AF657E3BFB2 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -105,7 +105,7 @@ 33CEB47122A05771004F2AC0 /* Flutter */, 33CC10EE2044A3C60003C045 /* Products */, D73912EC22F37F3D000D13A0 /* Frameworks */, - 4585CB5EFC238F7A284A9F6B /* Pods */, + 7503DA8974596BB0C15FF78B /* Pods */, ); sourceTree = ""; }; @@ -152,12 +152,12 @@ path = Runner; sourceTree = ""; }; - 4585CB5EFC238F7A284A9F6B /* Pods */ = { + 7503DA8974596BB0C15FF78B /* Pods */ = { isa = PBXGroup; children = ( - 961A6C2B83509F4666CFE501 /* Pods-Runner.debug.xcconfig */, - F6C96B4218737B4BD3D9B388 /* Pods-Runner.release.xcconfig */, - D33C6A8458290B971C1D199D /* Pods-Runner.profile.xcconfig */, + F729394A6A58F07BEF482B0B /* Pods-Runner.debug.xcconfig */, + 1197A5D1787399F7C3C97476 /* Pods-Runner.release.xcconfig */, + 4F6C54B02CE0A3C75694FAB1 /* Pods-Runner.profile.xcconfig */, ); name = Pods; path = Pods; @@ -166,7 +166,7 @@ D73912EC22F37F3D000D13A0 /* Frameworks */ = { isa = PBXGroup; children = ( - 26CF5D4F94952D7C080C386A /* Pods_Runner.framework */, + DB8545E1057FCC7CEC27035D /* Pods_Runner.framework */, ); name = Frameworks; sourceTree = ""; @@ -178,13 +178,13 @@ isa = PBXNativeTarget; buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - 175877957BDAF3DC51B1CD05 /* [CP] Check Pods Manifest.lock */, + 24A2FCA65D89AB3037F2893A /* [CP] Check Pods Manifest.lock */, 33CC10E92044A3C60003C045 /* Sources */, 33CC10EA2044A3C60003C045 /* Frameworks */, 33CC10EB2044A3C60003C045 /* Resources */, 33CC110E2044A8840003C045 /* Bundle Framework */, 3399D490228B24CF009A79C7 /* ShellScript */, - 36ABC32FCFFF2EA0F12932F2 /* [CP] Embed Pods Frameworks */, + A3121D6DBE6C7C96E15CDC13 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -254,7 +254,7 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 175877957BDAF3DC51B1CD05 /* [CP] Check Pods Manifest.lock */ = { + 24A2FCA65D89AB3037F2893A /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -278,6 +278,7 @@ }; 3399D490228B24CF009A79C7 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -313,7 +314,7 @@ shellPath = /bin/sh; shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; }; - 36ABC32FCFFF2EA0F12932F2 /* [CP] Embed Pods Frameworks */ = { + A3121D6DBE6C7C96E15CDC13 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -404,7 +405,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; @@ -483,7 +484,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; @@ -530,7 +531,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; diff --git a/jsonexample/macos/Runner/Configs/AppInfo.xcconfig b/jsonexample/macos/Runner/Configs/AppInfo.xcconfig index dff1804628c..964217de333 100644 --- a/jsonexample/macos/Runner/Configs/AppInfo.xcconfig +++ b/jsonexample/macos/Runner/Configs/AppInfo.xcconfig @@ -11,4 +11,4 @@ PRODUCT_NAME = jsonexample PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.jsonexample // The copyright displayed in application information -PRODUCT_COPYRIGHT = Copyright © 2022 dev.flutter. All rights reserved. +PRODUCT_COPYRIGHT = Copyright © 2023 dev.flutter. All rights reserved. diff --git a/jsonexample/web/index.html b/jsonexample/web/index.html index c8e96e5be34..878a0775253 100644 --- a/jsonexample/web/index.html +++ b/jsonexample/web/index.html @@ -46,11 +46,12 @@ _flutter.loader.loadEntrypoint({ serviceWorker: { serviceWorkerVersion: serviceWorkerVersion, + }, + onEntrypointLoaded: function(engineInitializer) { + engineInitializer.initializeEngine().then(function(appRunner) { + appRunner.runApp(); + }); } - }).then(function(engineInitializer) { - return engineInitializer.initializeEngine(); - }).then(function(appRunner) { - return appRunner.runApp(); }); }); diff --git a/jsonexample/windows/runner/CMakeLists.txt b/jsonexample/windows/runner/CMakeLists.txt index 17411a8ab8e..394917c053a 100644 --- a/jsonexample/windows/runner/CMakeLists.txt +++ b/jsonexample/windows/runner/CMakeLists.txt @@ -33,6 +33,7 @@ target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") # Add dependency libraries and include directories. Add any application-specific # dependencies here. target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) +target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") # Run the Flutter tool portions of the build. This must not be removed. diff --git a/jsonexample/windows/runner/Runner.rc b/jsonexample/windows/runner/Runner.rc index 9ba2fa75f1b..8c9a97771e8 100644 --- a/jsonexample/windows/runner/Runner.rc +++ b/jsonexample/windows/runner/Runner.rc @@ -93,7 +93,7 @@ BEGIN VALUE "FileDescription", "jsonexample" "\0" VALUE "FileVersion", VERSION_AS_STRING "\0" VALUE "InternalName", "jsonexample" "\0" - VALUE "LegalCopyright", "Copyright (C) 2022 dev.flutter. All rights reserved." "\0" + VALUE "LegalCopyright", "Copyright (C) 2023 dev.flutter. All rights reserved." "\0" VALUE "OriginalFilename", "jsonexample.exe" "\0" VALUE "ProductName", "jsonexample" "\0" VALUE "ProductVersion", VERSION_AS_STRING "\0" diff --git a/jsonexample/windows/runner/flutter_window.cpp b/jsonexample/windows/runner/flutter_window.cpp index b43b9095ea3..b25e363efa4 100644 --- a/jsonexample/windows/runner/flutter_window.cpp +++ b/jsonexample/windows/runner/flutter_window.cpp @@ -26,6 +26,11 @@ bool FlutterWindow::OnCreate() { } RegisterPlugins(flutter_controller_->engine()); SetChildContent(flutter_controller_->view()->GetNativeWindow()); + + flutter_controller_->engine()->SetNextFrameCallback([&]() { + this->Show(); + }); + return true; } diff --git a/jsonexample/windows/runner/main.cpp b/jsonexample/windows/runner/main.cpp index 630f7b4b6ed..ddc902ef725 100644 --- a/jsonexample/windows/runner/main.cpp +++ b/jsonexample/windows/runner/main.cpp @@ -27,7 +27,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, FlutterWindow window(project); Win32Window::Point origin(10, 10); Win32Window::Size size(1280, 720); - if (!window.CreateAndShow(L"jsonexample", origin, size)) { + if (!window.Create(L"jsonexample", origin, size)) { return EXIT_FAILURE; } window.SetQuitOnClose(true); diff --git a/jsonexample/windows/runner/win32_window.cpp b/jsonexample/windows/runner/win32_window.cpp index c10f08dc7da..041a3855474 100644 --- a/jsonexample/windows/runner/win32_window.cpp +++ b/jsonexample/windows/runner/win32_window.cpp @@ -1,13 +1,31 @@ #include "win32_window.h" +#include #include #include "resource.h" namespace { +/// Window attribute that enables dark mode window decorations. +/// +/// Redefined in case the developer's machine has a Windows SDK older than +/// version 10.0.22000.0. +/// See: https://docs.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute +#ifndef DWMWA_USE_IMMERSIVE_DARK_MODE +#define DWMWA_USE_IMMERSIVE_DARK_MODE 20 +#endif + constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; +/// Registry key for app theme preference. +/// +/// A value of 0 indicates apps should use dark mode. A non-zero or missing +/// value indicates apps should use light mode. +constexpr const wchar_t kGetPreferredBrightnessRegKey[] = + L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; +constexpr const wchar_t kGetPreferredBrightnessRegValue[] = L"AppsUseLightTheme"; + // The number of Win32Window objects that currently exist. static int g_active_window_count = 0; @@ -31,8 +49,8 @@ void EnableFullDpiSupportIfAvailable(HWND hwnd) { GetProcAddress(user32_module, "EnableNonClientDpiScaling")); if (enable_non_client_dpi_scaling != nullptr) { enable_non_client_dpi_scaling(hwnd); - FreeLibrary(user32_module); } + FreeLibrary(user32_module); } } // namespace @@ -102,9 +120,9 @@ Win32Window::~Win32Window() { Destroy(); } -bool Win32Window::CreateAndShow(const std::wstring& title, - const Point& origin, - const Size& size) { +bool Win32Window::Create(const std::wstring& title, + const Point& origin, + const Size& size) { Destroy(); const wchar_t* window_class = @@ -117,7 +135,7 @@ bool Win32Window::CreateAndShow(const std::wstring& title, double scale_factor = dpi / 96.0; HWND window = CreateWindow( - window_class, title.c_str(), WS_OVERLAPPEDWINDOW | WS_VISIBLE, + window_class, title.c_str(), WS_OVERLAPPEDWINDOW, Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), Scale(size.width, scale_factor), Scale(size.height, scale_factor), nullptr, nullptr, GetModuleHandle(nullptr), this); @@ -126,9 +144,15 @@ bool Win32Window::CreateAndShow(const std::wstring& title, return false; } + UpdateTheme(window); + return OnCreate(); } +bool Win32Window::Show() { + return ShowWindow(window_handle_, SW_SHOWNORMAL); +} + // static LRESULT CALLBACK Win32Window::WndProc(HWND const window, UINT const message, @@ -188,6 +212,10 @@ Win32Window::MessageHandler(HWND hwnd, SetFocus(child_content_); } return 0; + + case WM_DWMCOLORIZATIONCOLORCHANGED: + UpdateTheme(hwnd); + return 0; } return DefWindowProc(window_handle_, message, wparam, lparam); @@ -243,3 +271,18 @@ bool Win32Window::OnCreate() { void Win32Window::OnDestroy() { // No-op; provided for subclasses. } + +void Win32Window::UpdateTheme(HWND const window) { + DWORD light_mode; + DWORD light_mode_size = sizeof(light_mode); + LSTATUS result = RegGetValue(HKEY_CURRENT_USER, kGetPreferredBrightnessRegKey, + kGetPreferredBrightnessRegValue, + RRF_RT_REG_DWORD, nullptr, &light_mode, + &light_mode_size); + + if (result == ERROR_SUCCESS) { + BOOL enable_dark_mode = light_mode == 0; + DwmSetWindowAttribute(window, DWMWA_USE_IMMERSIVE_DARK_MODE, + &enable_dark_mode, sizeof(enable_dark_mode)); + } +} diff --git a/jsonexample/windows/runner/win32_window.h b/jsonexample/windows/runner/win32_window.h index 17ba431125b..c86632d8a6b 100644 --- a/jsonexample/windows/runner/win32_window.h +++ b/jsonexample/windows/runner/win32_window.h @@ -28,15 +28,16 @@ class Win32Window { Win32Window(); virtual ~Win32Window(); - // Creates and shows a win32 window with |title| and position and size using + // Creates a win32 window with |title| that is positioned and sized using // |origin| and |size|. New windows are created on the default monitor. Window // sizes are specified to the OS in physical pixels, hence to ensure a - // consistent size to will treat the width height passed in to this function - // as logical pixels and scale to appropriate for the default monitor. Returns - // true if the window was created successfully. - bool CreateAndShow(const std::wstring& title, - const Point& origin, - const Size& size); + // consistent size this function will scale the inputted width and height as + // as appropriate for the default monitor. The window is invisible until + // |Show| is called. Returns true if the window was created successfully. + bool Create(const std::wstring& title, const Point& origin, const Size& size); + + // Show the current window. Returns true if the window was successfully shown. + bool Show(); // Release OS resources associated with window. void Destroy(); @@ -86,6 +87,9 @@ class Win32Window { // Retrieves a class instance pointer for |window| static Win32Window* GetThisFromHandle(HWND const window) noexcept; + // Update the window frame's theme to match the system theme. + static void UpdateTheme(HWND const window); + bool quit_on_close_ = false; // window handle for top level window. diff --git a/material_3_demo/README.md b/material_3_demo/README.md index e191da58390..c55eb4c3250 100644 --- a/material_3_demo/README.md +++ b/material_3_demo/README.md @@ -2,9 +2,12 @@ This sample Flutter app showcases Material 3 features in the Flutter Material library. These features include updated components, typography, color system and elevation support. The app supports light and dark themes, different color palettes, as well as the ability to switch between Material 2 and Material 3. For more information about Material 3, the guidance is now live at https://m3.material.io/. +This app also includes new M3 components such as IconButtons, Chips, TextFields, Switches, Checkboxes, Radio buttons and ProgressIndicators. + # Preview -https://user-images.githubusercontent.com/36861262/166358511-43d6a30b-33fe-4680-a4d1-808f087e740e.mp4 +Screen Shot 2022-08-12 at 12 00 28 PMScreen Shot 2022-08-12 at 12 00 38 PM + # Features ## Icon Buttons on the Top App Bar @@ -13,9 +16,9 @@ https://user-images.githubusercontent.com/36861262/166358511-43d6a30b-33fe-4680- Users can switch between Material 2 and Material 3 for the displayed components with this button. This button will bring up a pop-up menu that allows the user to change the base color used for the light and dark themes. This uses a new color seed feature to generate entire color schemes from a single color. - + ## Component Screen -The default screen displays all the updated components in Material 3: AppBar, common Buttons, Floating Action Button(FAB), Card, Dialog, NavigationBar, and NavigationRail. +The default screen displays all the updated components in Material 3: AppBar, common Buttons, Floating Action Button(FAB), Chips, Card, Checkbox, Dialog, NavigationBar, NavigationRail, ProgressIndicators, Radio buttons, TextFields and Switch. ### Adaptive Layout Based on the fact that NavigationRail is not recommended on a small screen, the app changes its layout based on the screen width. If it's played on iOS or Android devices which have a narrow screen, a Navigation Bar will show at the bottom and will be used to navigate. But if it's played as a desktop or a web app, a Navigation Rail will show on the left side and at the same time, a Navigation Bar will show as an example but will not have any functionality. @@ -30,5 +33,3 @@ The Typography Screen displays the text styles used in for the default TextTheme ## Elevation Screen The Elevation screen shows different ways of elevation with a new supported feature "surfaceTintColor" in the Material library. - - diff --git a/material_3_demo/lib/color_palettes_screen.dart b/material_3_demo/lib/color_palettes_screen.dart index df67e6ba1da..5380390e3a3 100644 --- a/material_3_demo/lib/color_palettes_screen.dart +++ b/material_3_demo/lib/color_palettes_screen.dart @@ -17,10 +17,14 @@ class ColorPalettesScreen extends StatelessWidget { @override Widget build(BuildContext context) { Color selectedColor = Theme.of(context).primaryColor; - ThemeData lightTheme = - ThemeData(colorSchemeSeed: selectedColor, brightness: Brightness.light); - ThemeData darkTheme = - ThemeData(colorSchemeSeed: selectedColor, brightness: Brightness.dark); + ThemeData lightTheme = ThemeData( + colorSchemeSeed: selectedColor, + brightness: Brightness.light, + ); + ThemeData darkTheme = ThemeData( + colorSchemeSeed: selectedColor, + brightness: Brightness.dark, + ); Widget schemeLabel(String brightness) { return Padding( @@ -48,12 +52,12 @@ class ColorPalettesScreen extends StatelessWidget { child: Column( children: [ divider, - schemeLabel("Light Theme"), + schemeLabel('Light Theme'), schemeView(lightTheme), divider, divider, - schemeLabel("Dark Theme"), - schemeView(darkTheme) + schemeLabel('Dark Theme'), + schemeView(darkTheme), ], ), ); @@ -66,19 +70,19 @@ class ColorPalettesScreen extends StatelessWidget { Expanded( child: Column( children: [ - schemeLabel("Light Theme"), - schemeView(lightTheme) + schemeLabel('Light Theme'), + schemeView(lightTheme), ], ), ), Expanded( child: Column( children: [ - schemeLabel("Dark Theme"), - schemeView(darkTheme) + schemeLabel('Dark Theme'), + schemeView(darkTheme), ], ), - ) + ), ], ), ), @@ -100,46 +104,46 @@ class ColorSchemeView extends StatelessWidget { children: [ ColorGroup(children: [ ColorChip( - label: "primary", + label: 'primary', color: colorScheme.primary, onColor: colorScheme.onPrimary, ), ColorChip( - label: "onPrimary", + label: 'onPrimary', color: colorScheme.onPrimary, onColor: colorScheme.primary), ColorChip( - label: "primaryContainer", + label: 'primaryContainer', color: colorScheme.primaryContainer, onColor: colorScheme.onPrimaryContainer, ), ColorChip( - label: "onPrimaryContainer", + label: 'onPrimaryContainer', color: colorScheme.onPrimaryContainer, onColor: colorScheme.primaryContainer, - ) + ), ]), divider, ColorGroup(children: [ ColorChip( - label: "secondary", + label: 'secondary', color: colorScheme.secondary, onColor: colorScheme.onSecondary, ), ColorChip( - label: "onSecondary", + label: 'onSecondary', color: colorScheme.onSecondary, onColor: colorScheme.secondary, ), ColorChip( - label: "secondaryContainer", + label: 'secondaryContainer', color: colorScheme.secondaryContainer, onColor: colorScheme.onSecondaryContainer, ), ColorChip( - label: "onSecondaryContainer", + label: 'onSecondaryContainer', color: colorScheme.onSecondaryContainer, - onColor: colorScheme.secondaryContainer) + onColor: colorScheme.secondaryContainer), ]), divider, ColorGroup( @@ -248,10 +252,12 @@ class ColorGroup extends StatelessWidget { @override Widget build(BuildContext context) { - return Card( - clipBehavior: Clip.antiAlias, - child: Column( - children: children, + return RepaintBoundary( + child: Card( + clipBehavior: Clip.antiAlias, + child: Column( + children: children, + ), ), ); } diff --git a/material_3_demo/lib/component_screen.dart b/material_3_demo/lib/component_screen.dart index 32ef5b5c5e4..a1aeb7d7050 100644 --- a/material_3_demo/lib/component_screen.dart +++ b/material_3_demo/lib/component_screen.dart @@ -3,73 +3,164 @@ // found in the LICENSE file. import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; -class ComponentScreen extends StatelessWidget { - const ComponentScreen({super.key, required this.showNavBottomBar}); +const rowDivider = SizedBox(width: 20); +const colDivider = SizedBox(height: 10); +const tinySpacing = 3.0; +const smallSpacing = 10.0; +const double cardWidth = 115; +const double widthConstraint = 450; + +class FirstComponentList extends StatelessWidget { + const FirstComponentList({ + super.key, + required this.showNavBottomBar, + required this.scaffoldKey, + required this.showSecondList, + }); final bool showNavBottomBar; + final GlobalKey scaffoldKey; + final bool showSecondList; @override Widget build(BuildContext context) { - return Expanded( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 10), - child: Align( - alignment: Alignment.topCenter, - child: SizedBox( - width: _maxWidthConstraint, - child: ListView( - shrinkWrap: true, - children: [ - _colDivider, - _colDivider, - const Buttons(), - _colDivider, - const FloatingActionButtons(), - _colDivider, - const Cards(), - _colDivider, - const Dialogs(), - _colDivider, - showNavBottomBar - ? const NavigationBars( - selectedIndex: 0, - isExampleBar: true, - ) - : Container(), - ], - ), - ), - ), - ), + return ListView( + padding: showSecondList + ? const EdgeInsetsDirectional.only(end: smallSpacing) + : EdgeInsets.zero, + children: [ + const Actions(), + colDivider, + const Communication(), + colDivider, + const Containment(), + if (!showSecondList) ...[ + colDivider, + Navigation(scaffoldKey: scaffoldKey), + colDivider, + const Selection(), + colDivider, + const TextInputs() + ], + ], ); } } -const _rowDivider = SizedBox(width: 10); -const _colDivider = SizedBox(height: 10); -const double _cardWidth = 115; -const double _maxWidthConstraint = 400; +class SecondComponentList extends StatelessWidget { + const SecondComponentList({ + super.key, + required this.scaffoldKey, + }); -void Function()? handlePressed( - BuildContext context, bool isDisabled, String buttonName) { - return isDisabled - ? null - : () { - final snackBar = SnackBar( - content: Text( - 'Yay! $buttonName is clicked!', - style: TextStyle(color: Theme.of(context).colorScheme.surface), - ), - action: SnackBarAction( - textColor: Theme.of(context).colorScheme.surface, - label: 'Close', - onPressed: () {}, - ), - ); + final GlobalKey scaffoldKey; - ScaffoldMessenger.of(context).showSnackBar(snackBar); - }; + @override + Widget build(BuildContext context) { + return ListView( + padding: const EdgeInsetsDirectional.only(end: smallSpacing), + children: [ + Navigation(scaffoldKey: scaffoldKey), + colDivider, + const Selection(), + colDivider, + const TextInputs(), + ], + ); + } +} + +class Actions extends StatelessWidget { + const Actions({super.key}); + + @override + Widget build(BuildContext context) { + return const ComponentGroupDecoration(label: 'Actions', children: [ + Buttons(), + FloatingActionButtons(), + IconToggleButtons(), + SegmentedButtons(), + ]); + } +} + +class Communication extends StatelessWidget { + const Communication({super.key}); + + @override + Widget build(BuildContext context) { + return const ComponentGroupDecoration(label: 'Communication', children: [ + NavigationBars( + selectedIndex: 1, + isExampleBar: true, + isBadgeExample: true, + ), + ProgressIndicators(), + SnackBarSection(), + ]); + } +} + +class Containment extends StatelessWidget { + const Containment({super.key}); + + @override + Widget build(BuildContext context) { + return const ComponentGroupDecoration(label: 'Containment', children: [ + BottomSheetSection(), + Cards(), + Dialogs(), + ]); + } +} + +class Navigation extends StatelessWidget { + const Navigation({super.key, required this.scaffoldKey}); + + final GlobalKey scaffoldKey; + + @override + Widget build(BuildContext context) { + return ComponentGroupDecoration(label: 'Navigation', children: [ + const BottomAppBars(), + const NavigationBars( + selectedIndex: 0, + isExampleBar: true, + ), + NavigationDrawers(scaffoldKey: scaffoldKey), + const Tabs(), + ]); + } +} + +class Selection extends StatelessWidget { + const Selection({super.key}); + + @override + Widget build(BuildContext context) { + return const ComponentGroupDecoration(label: 'Selection', children: [ + Chips(), + DropdownMenus(), + Radios(), + Checkboxes(), + Sliders(), + Switches(), + ]); + } +} + +class TextInputs extends StatelessWidget { + const TextInputs({super.key}); + + @override + Widget build(BuildContext context) { + return const ComponentGroupDecoration( + label: 'Text inputs', + children: [TextFields()], + ); + } } class Buttons extends StatefulWidget { @@ -82,15 +173,24 @@ class Buttons extends StatefulWidget { class _ButtonsState extends State { @override Widget build(BuildContext context) { - return Wrap( - alignment: WrapAlignment.spaceEvenly, - children: const [ - ButtonsWithoutIcon(isDisabled: false), - _rowDivider, - ButtonsWithIcon(), - _rowDivider, - ButtonsWithoutIcon(isDisabled: true), - ], + return ComponentDecoration( + label: 'Common buttons', + tooltipMessage: + 'Use ElevatedButton, FilledButton, FilledButton.tonal, OutlinedButton, or TextButton', + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + padding: const EdgeInsets.symmetric(horizontal: tinySpacing), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: const [ + ButtonsWithoutIcon(isDisabled: false), + colDivider, + ButtonsWithIcon(), + colDivider, + ButtonsWithoutIcon(isDisabled: true), + ], + ), + ), ); } } @@ -102,51 +202,33 @@ class ButtonsWithoutIcon extends StatelessWidget { @override Widget build(BuildContext context) { - return IntrinsicWidth( - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - ElevatedButton( - onPressed: handlePressed(context, isDisabled, "ElevatedButton"), - child: const Text("Elevated"), - ), - _colDivider, - ElevatedButton( - style: ElevatedButton.styleFrom( - // Foreground color - // ignore: deprecated_member_use - onPrimary: Theme.of(context).colorScheme.onPrimary, - // Background color - // ignore: deprecated_member_use - primary: Theme.of(context).colorScheme.primary, - ).copyWith(elevation: ButtonStyleButton.allOrNull(0.0)), - onPressed: handlePressed(context, isDisabled, "FilledButton"), - child: const Text('Filled'), - ), - _colDivider, - ElevatedButton( - style: ElevatedButton.styleFrom( - // Foreground color - // ignore: deprecated_member_use - onPrimary: Theme.of(context).colorScheme.onSecondaryContainer, - // Background color - // ignore: deprecated_member_use - primary: Theme.of(context).colorScheme.secondaryContainer, - ).copyWith(elevation: ButtonStyleButton.allOrNull(0.0)), - onPressed: handlePressed(context, isDisabled, "FilledTonalButton"), - child: const Text('Filled Tonal'), - ), - _colDivider, - OutlinedButton( - onPressed: handlePressed(context, isDisabled, "OutlinedButton"), - child: const Text("Outlined"), - ), - _colDivider, - TextButton( - onPressed: handlePressed(context, isDisabled, "TextButton"), - child: const Text("Text")), - ], - ), + return Row( + children: [ + ElevatedButton( + onPressed: isDisabled ? null : () {}, + child: const Text('Elevated'), + ), + const SizedBox(width: tinySpacing), + FilledButton( + onPressed: isDisabled ? null : () {}, + child: const Text('Filled'), + ), + const SizedBox(width: tinySpacing), + FilledButton.tonal( + onPressed: isDisabled ? null : () {}, + child: const Text('Filled tonal'), + ), + const SizedBox(width: tinySpacing), + OutlinedButton( + onPressed: isDisabled ? null : () {}, + child: const Text('Outlined'), + ), + const SizedBox(width: tinySpacing), + TextButton( + onPressed: isDisabled ? null : () {}, + child: const Text('Text'), + ), + ], ); } } @@ -156,60 +238,38 @@ class ButtonsWithIcon extends StatelessWidget { @override Widget build(BuildContext context) { - return IntrinsicWidth( - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - ElevatedButton.icon( - onPressed: - handlePressed(context, false, "ElevatedButton with Icon"), - icon: const Icon(Icons.add), - label: const Text("Icon"), - ), - _colDivider, - ElevatedButton.icon( - style: ElevatedButton.styleFrom( - // Foreground color - // ignore: deprecated_member_use - onPrimary: Theme.of(context).colorScheme.onPrimary, - // Background color - // ignore: deprecated_member_use - primary: Theme.of(context).colorScheme.primary, - ).copyWith(elevation: ButtonStyleButton.allOrNull(0.0)), - onPressed: handlePressed(context, false, "FilledButton with Icon"), - label: const Text('Icon'), - icon: const Icon(Icons.add), - ), - _colDivider, - ElevatedButton.icon( - style: ElevatedButton.styleFrom( - // Foreground color - // ignore: deprecated_member_use - onPrimary: Theme.of(context).colorScheme.onSecondaryContainer, - // Background color - // ignore: deprecated_member_use - primary: Theme.of(context).colorScheme.secondaryContainer, - ).copyWith(elevation: ButtonStyleButton.allOrNull(0.0)), - onPressed: - handlePressed(context, false, "FilledTonalButton with Icon"), - label: const Text('Icon'), - icon: const Icon(Icons.add), - ), - _colDivider, - OutlinedButton.icon( - onPressed: - handlePressed(context, false, "OutlinedButton with Icon"), - icon: const Icon(Icons.add), - label: const Text("Icon"), - ), - _colDivider, - TextButton.icon( - onPressed: handlePressed(context, false, "TextButton with Icon"), - icon: const Icon(Icons.add), - label: const Text("Icon"), - ) - ], - ), + return Row( + children: [ + ElevatedButton.icon( + onPressed: () {}, + icon: const Icon(Icons.add), + label: const Text('Icon'), + ), + const SizedBox(width: tinySpacing), + FilledButton.icon( + onPressed: () {}, + label: const Text('Icon'), + icon: const Icon(Icons.add), + ), + const SizedBox(width: tinySpacing), + FilledButton.tonalIcon( + onPressed: () {}, + label: const Text('Icon'), + icon: const Icon(Icons.add), + ), + const SizedBox(width: tinySpacing), + OutlinedButton.icon( + onPressed: () {}, + icon: const Icon(Icons.add), + label: const Text('Icon'), + ), + const SizedBox(width: tinySpacing), + TextButton.icon( + onPressed: () {}, + icon: const Icon(Icons.add), + label: const Text('Icon'), + ) + ], ); } } @@ -219,30 +279,34 @@ class FloatingActionButtons extends StatelessWidget { @override Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsets.symmetric(vertical: 10), + return ComponentDecoration( + label: 'Floating action buttons', + tooltipMessage: + 'Use FloatingActionButton or FloatingActionButton.extended', child: Wrap( - alignment: WrapAlignment.spaceEvenly, crossAxisAlignment: WrapCrossAlignment.center, + runSpacing: smallSpacing, + spacing: smallSpacing, children: [ FloatingActionButton.small( onPressed: () {}, + tooltip: 'Small', child: const Icon(Icons.add), ), - _rowDivider, - FloatingActionButton( - onPressed: () {}, - child: const Icon(Icons.add), - ), - _rowDivider, FloatingActionButton.extended( onPressed: () {}, + tooltip: 'Extended', icon: const Icon(Icons.add), - label: const Text("Create"), + label: const Text('Create'), + ), + FloatingActionButton( + onPressed: () {}, + tooltip: 'Standard', + child: const Icon(Icons.add), ), - _rowDivider, FloatingActionButton.large( onPressed: () {}, + tooltip: 'Large', child: const Icon(Icons.add), ), ], @@ -256,26 +320,30 @@ class Cards extends StatelessWidget { @override Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsets.symmetric(vertical: 10), + return ComponentDecoration( + label: 'Cards', + tooltipMessage: 'Use Card', child: Wrap( alignment: WrapAlignment.spaceEvenly, children: [ SizedBox( - width: _cardWidth, + width: cardWidth, child: Card( child: Container( - padding: const EdgeInsets.all(10), + padding: const EdgeInsets.fromLTRB(10, 5, 5, 10), child: Column( - children: const [ + children: [ Align( alignment: Alignment.topRight, - child: Icon(Icons.more_vert), + child: IconButton( + icon: const Icon(Icons.more_vert), + onPressed: () {}, + ), ), - SizedBox(height: 35), - Align( + const SizedBox(height: 20), + const Align( alignment: Alignment.bottomLeft, - child: Text("Elevated"), + child: Text('Elevated'), ) ], ), @@ -283,22 +351,25 @@ class Cards extends StatelessWidget { ), ), SizedBox( - width: _cardWidth, + width: cardWidth, child: Card( color: Theme.of(context).colorScheme.surfaceVariant, elevation: 0, child: Container( - padding: const EdgeInsets.all(10), + padding: const EdgeInsets.fromLTRB(10, 5, 5, 10), child: Column( - children: const [ + children: [ Align( alignment: Alignment.topRight, - child: Icon(Icons.more_vert), + child: IconButton( + icon: const Icon(Icons.more_vert), + onPressed: () {}, + ), ), - SizedBox(height: 35), - Align( + const SizedBox(height: 20), + const Align( alignment: Alignment.bottomLeft, - child: Text("Filled"), + child: Text('Filled'), ) ], ), @@ -306,7 +377,7 @@ class Cards extends StatelessWidget { ), ), SizedBox( - width: _cardWidth, + width: cardWidth, child: Card( elevation: 0, shape: RoundedRectangleBorder( @@ -316,17 +387,20 @@ class Cards extends StatelessWidget { borderRadius: const BorderRadius.all(Radius.circular(12)), ), child: Container( - padding: const EdgeInsets.all(10), + padding: const EdgeInsets.fromLTRB(10, 5, 5, 10), child: Column( - children: const [ + children: [ Align( alignment: Alignment.topRight, - child: Icon(Icons.more_vert), + child: IconButton( + icon: const Icon(Icons.more_vert), + onPressed: () {}, + ), ), - SizedBox(height: 35), - Align( + const SizedBox(height: 20), + const Align( alignment: Alignment.bottomLeft, - child: Text("Outlined"), + child: Text('Outlined'), ) ], ), @@ -339,6 +413,161 @@ class Cards extends StatelessWidget { } } +class _ClearButton extends StatelessWidget { + const _ClearButton({required this.controller}); + + final TextEditingController controller; + + @override + Widget build(BuildContext context) => IconButton( + icon: const Icon(Icons.clear), + onPressed: () => controller.clear(), + ); +} + +class TextFields extends StatefulWidget { + const TextFields({super.key}); + + @override + State createState() => _TextFieldsState(); +} + +class _TextFieldsState extends State { + final TextEditingController _controllerFilled = TextEditingController(); + final TextEditingController _controllerOutlined = TextEditingController(); + + @override + Widget build(BuildContext context) { + return ComponentDecoration( + label: 'Text fields', + tooltipMessage: 'Use TextField with different InputDecoration', + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(smallSpacing), + child: TextField( + controller: _controllerFilled, + decoration: InputDecoration( + prefixIcon: const Icon(Icons.search), + suffixIcon: _ClearButton(controller: _controllerFilled), + labelText: 'Filled', + hintText: 'hint text', + helperText: 'supporting text', + filled: true, + ), + ), + ), + Padding( + padding: const EdgeInsets.all(smallSpacing), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Flexible( + child: SizedBox( + width: 200, + child: TextField( + maxLength: 10, + maxLengthEnforcement: MaxLengthEnforcement.none, + controller: _controllerFilled, + decoration: InputDecoration( + prefixIcon: const Icon(Icons.search), + suffixIcon: _ClearButton(controller: _controllerFilled), + labelText: 'Filled', + hintText: 'hint text', + helperText: 'supporting text', + filled: true, + errorText: 'error text', + ), + ), + ), + ), + const SizedBox(width: smallSpacing), + Flexible( + child: SizedBox( + width: 200, + child: TextField( + controller: _controllerFilled, + enabled: false, + decoration: InputDecoration( + prefixIcon: const Icon(Icons.search), + suffixIcon: _ClearButton(controller: _controllerFilled), + labelText: 'Disabled', + hintText: 'hint text', + helperText: 'supporting text', + filled: true, + ), + ), + ), + ), + ], + ), + ), + Padding( + padding: const EdgeInsets.all(smallSpacing), + child: TextField( + controller: _controllerOutlined, + decoration: InputDecoration( + prefixIcon: const Icon(Icons.search), + suffixIcon: _ClearButton(controller: _controllerOutlined), + labelText: 'Outlined', + hintText: 'hint text', + helperText: 'supporting text', + border: const OutlineInputBorder(), + ), + ), + ), + Padding( + padding: const EdgeInsets.all(smallSpacing), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Flexible( + child: SizedBox( + width: 200, + child: TextField( + controller: _controllerOutlined, + decoration: InputDecoration( + prefixIcon: const Icon(Icons.search), + suffixIcon: + _ClearButton(controller: _controllerOutlined), + labelText: 'Outlined', + hintText: 'hint text', + helperText: 'supporting text', + errorText: 'error text', + border: const OutlineInputBorder(), + filled: true, + ), + ), + ), + ), + const SizedBox(width: smallSpacing), + Flexible( + child: SizedBox( + width: 200, + child: TextField( + controller: _controllerOutlined, + enabled: false, + decoration: InputDecoration( + prefixIcon: const Icon(Icons.search), + suffixIcon: + _ClearButton(controller: _controllerOutlined), + labelText: 'Disabled', + hintText: 'hint text', + helperText: 'supporting text', + border: const OutlineInputBorder(), + filled: true, + ), + ), + ), + ), + ])), + ], + ), + ); + } +} + class Dialogs extends StatefulWidget { const Dialogs({super.key}); @@ -351,16 +580,16 @@ class _DialogsState extends State { showDialog( context: context, builder: (context) => AlertDialog( - title: const Text("Basic Dialog Title"), + title: const Text('What is a dialog?'), content: const Text( - "A dialog is a type of modal window that appears in front of app content to provide critical information, or prompt for a decision to be made."), + 'A dialog is a type of modal window that appears in front of app content to provide critical information, or prompt for a decision to be made.'), actions: [ TextButton( - child: const Text('Dismiss'), + child: const Text('Okay'), onPressed: () => Navigator.of(context).pop(), ), - TextButton( - child: const Text('Action'), + FilledButton( + child: const Text('Dismiss'), onPressed: () => Navigator.of(context).pop(), ), ], @@ -370,14 +599,262 @@ class _DialogsState extends State { @override Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsets.symmetric(vertical: 10), - child: TextButton( - child: const Text( - "Open Dialog", - style: TextStyle(fontWeight: FontWeight.bold), + return Center( + child: ComponentDecoration( + label: 'Dialog', + tooltipMessage: 'Use AlertDialog or SimpleDialog', + child: UnconstrainedBox( + child: TextButton( + child: const Text( + 'Show dialog', + style: TextStyle(fontWeight: FontWeight.bold), + ), + onPressed: () => openDialog(context), + ), + ), + ), + ); + } +} + +class Switches extends StatelessWidget { + const Switches({super.key}); + + @override + Widget build(BuildContext context) { + return ComponentDecoration( + label: 'Switches', + tooltipMessage: 'Use SwitchListTile or Switch', + child: Column( + children: const [ + SwitchRow(isEnabled: true), + SwitchRow(isEnabled: false), + ], + ), + ); + } +} + +class SwitchRow extends StatefulWidget { + const SwitchRow({super.key, required this.isEnabled}); + + final bool isEnabled; + + @override + State createState() => _SwitchRowState(); +} + +class _SwitchRowState extends State { + bool value0 = false; + bool value1 = true; + + final MaterialStateProperty thumbIcon = + MaterialStateProperty.resolveWith((states) { + if (states.contains(MaterialState.selected)) { + return const Icon(Icons.check); + } + return const Icon(Icons.close); + }); + + @override + Widget build(BuildContext context) { + return Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + // TODO: use SwitchListTile when thumbIcon is available https://github.com/flutter/flutter/issues/118616 + Switch( + value: value0, + onChanged: widget.isEnabled + ? (value) { + setState(() { + value0 = value; + }); + } + : null, ), - onPressed: () => openDialog(context), + Switch( + thumbIcon: thumbIcon, + value: value1, + onChanged: widget.isEnabled + ? (value) { + setState(() { + value1 = value; + }); + } + : null, + ), + ], + ); + } +} + +class Checkboxes extends StatefulWidget { + const Checkboxes({super.key}); + + @override + State createState() => _CheckboxesState(); +} + +class _CheckboxesState extends State { + bool? isChecked0 = true; + bool? isChecked1; + bool? isChecked2 = false; + + @override + Widget build(BuildContext context) { + return ComponentDecoration( + label: 'Checkboxes', + tooltipMessage: 'Use CheckboxListTile or Checkbox', + child: Column( + children: [ + CheckboxListTile( + tristate: true, + value: isChecked0, + title: const Text('Option 1'), + onChanged: (value) { + setState(() { + isChecked0 = value; + }); + }, + ), + CheckboxListTile( + tristate: true, + value: isChecked1, + title: const Text('Option 2'), + onChanged: (value) { + setState(() { + isChecked1 = value; + }); + }, + ), + CheckboxListTile( + tristate: true, + value: isChecked2, + title: const Text('Option 3'), + // TODO: showcase error state https://github.com/flutter/flutter/issues/118616 + onChanged: (value) { + setState(() { + isChecked2 = value; + }); + }, + ), + const CheckboxListTile( + tristate: true, + title: Text('Option 4'), + value: true, + onChanged: null, + ), + ], + ), + ); + } +} + +enum Value { first, second } + +class Radios extends StatefulWidget { + const Radios({super.key}); + + @override + State createState() => _RadiosState(); +} + +enum Options { option1, option2, option3 } + +class _RadiosState extends State { + Options? _selectedOption = Options.option1; + + @override + Widget build(BuildContext context) { + return ComponentDecoration( + label: 'Radio buttons', + tooltipMessage: 'Use RadioListTile or Radio', + child: Column( + children: [ + RadioListTile( + title: const Text('Option 1'), + value: Options.option1, + groupValue: _selectedOption, + onChanged: (value) { + setState(() { + _selectedOption = value; + }); + }, + ), + RadioListTile( + title: const Text('Option 2'), + value: Options.option2, + groupValue: _selectedOption, + onChanged: (value) { + setState(() { + _selectedOption = value; + }); + }, + ), + RadioListTile( + title: const Text('Option 3'), + value: Options.option3, + groupValue: _selectedOption, + onChanged: null, + ), + ], + ), + ); + } +} + +class ProgressIndicators extends StatefulWidget { + const ProgressIndicators({super.key}); + + @override + State createState() => _ProgressIndicatorsState(); +} + +class _ProgressIndicatorsState extends State { + bool playProgressIndicator = false; + + @override + Widget build(BuildContext context) { + final double? progressValue = playProgressIndicator ? null : 0.7; + + return ComponentDecoration( + label: 'Progress indicators', + tooltipMessage: + 'Use CircularProgressIndicator or LinearProgressIndicator', + child: Column( + children: [ + Row( + children: [ + IconButton( + isSelected: playProgressIndicator, + selectedIcon: const Icon(Icons.pause), + icon: const Icon(Icons.play_arrow), + onPressed: () { + setState(() { + playProgressIndicator = !playProgressIndicator; + }); + }, + ), + Expanded( + child: Row( + children: [ + rowDivider, + CircularProgressIndicator( + value: progressValue, + ), + rowDivider, + Expanded( + child: LinearProgressIndicator( + value: progressValue, + ), + ), + rowDivider, + ], + ), + ), + ], + ), + ], ), ); } @@ -385,141 +862,1065 @@ class _DialogsState extends State { const List appBarDestinations = [ NavigationDestination( - tooltip: "", + tooltip: '', icon: Icon(Icons.widgets_outlined), label: 'Components', selectedIcon: Icon(Icons.widgets), ), NavigationDestination( - tooltip: "", + tooltip: '', icon: Icon(Icons.format_paint_outlined), label: 'Color', selectedIcon: Icon(Icons.format_paint), ), NavigationDestination( - tooltip: "", + tooltip: '', icon: Icon(Icons.text_snippet_outlined), label: 'Typography', selectedIcon: Icon(Icons.text_snippet), ), NavigationDestination( - tooltip: "", + tooltip: '', icon: Icon(Icons.invert_colors_on_outlined), label: 'Elevation', selectedIcon: Icon(Icons.opacity), ) ]; -final List navRailDestinations = appBarDestinations - .map( - (destination) => NavigationRailDestination( - icon: Tooltip( - message: destination.label, - child: destination.icon, - ), - selectedIcon: Tooltip( - message: destination.label, - child: destination.selectedIcon, - ), - label: Text(destination.label), - ), - ) - .toList(); - const List exampleBarDestinations = [ NavigationDestination( - tooltip: "", + tooltip: '', icon: Icon(Icons.explore_outlined), label: 'Explore', selectedIcon: Icon(Icons.explore), ), NavigationDestination( - tooltip: "", + tooltip: '', icon: Icon(Icons.pets_outlined), label: 'Pets', selectedIcon: Icon(Icons.pets), ), NavigationDestination( - tooltip: "", + tooltip: '', icon: Icon(Icons.account_box_outlined), label: 'Account', selectedIcon: Icon(Icons.account_box), ) ]; +List barWithBadgeDestinations = [ + NavigationDestination( + tooltip: '', + icon: Badge.count(count: 1000, child: const Icon(Icons.mail_outlined)), + label: 'Mail', + selectedIcon: Badge.count(count: 1000, child: const Icon(Icons.mail)), + ), + const NavigationDestination( + tooltip: '', + icon: Badge(label: Text('10'), child: Icon(Icons.chat_bubble_outline)), + label: 'Chat', + selectedIcon: Badge(label: Text('10'), child: Icon(Icons.chat_bubble)), + ), + const NavigationDestination( + tooltip: '', + icon: Badge(child: Icon(Icons.group_outlined)), + label: 'Rooms', + selectedIcon: Badge(child: Icon(Icons.group_rounded)), + ), + NavigationDestination( + tooltip: '', + icon: Badge.count(count: 3, child: const Icon(Icons.videocam_outlined)), + label: 'Meet', + selectedIcon: Badge.count(count: 3, child: const Icon(Icons.videocam)), + ) +]; + class NavigationBars extends StatefulWidget { + const NavigationBars({ + super.key, + this.onSelectItem, + required this.selectedIndex, + required this.isExampleBar, + this.isBadgeExample, + }); + final void Function(int)? onSelectItem; final int selectedIndex; final bool isExampleBar; - - const NavigationBars( - {super.key, - this.onSelectItem, - required this.selectedIndex, - required this.isExampleBar}); + final bool? isBadgeExample; @override State createState() => _NavigationBarsState(); } class _NavigationBarsState extends State { - int _selectedIndex = 0; + late int selectedIndex; @override void initState() { super.initState(); - _selectedIndex = widget.selectedIndex; + selectedIndex = widget.selectedIndex; } @override - Widget build(BuildContext context) { - return NavigationBar( - selectedIndex: _selectedIndex, + void didUpdateWidget(covariant NavigationBars oldWidget) { + super.didUpdateWidget(oldWidget); + if (widget.selectedIndex != oldWidget.selectedIndex) { + selectedIndex = widget.selectedIndex; + } + } + + @override + Widget build(BuildContext context) { + bool isBadgeExample = widget.isBadgeExample ?? false; + Widget navigationBar = NavigationBar( + selectedIndex: selectedIndex, onDestinationSelected: (index) { setState(() { - _selectedIndex = index; + selectedIndex = index; }); if (!widget.isExampleBar) widget.onSelectItem!(index); }, - destinations: - widget.isExampleBar ? exampleBarDestinations : appBarDestinations, + destinations: widget.isExampleBar && isBadgeExample + ? barWithBadgeDestinations + : widget.isExampleBar + ? exampleBarDestinations + : appBarDestinations, ); + + if (widget.isExampleBar && isBadgeExample) { + navigationBar = ComponentDecoration( + label: 'Badges', + tooltipMessage: 'Use Badge or Badge.count', + child: navigationBar); + } else if (widget.isExampleBar) { + navigationBar = ComponentDecoration( + label: 'Navigation bar', + tooltipMessage: 'Use NavigationBar', + child: navigationBar); + } + + return navigationBar; } } -class NavigationRailSection extends StatefulWidget { - final void Function(int) onSelectItem; - final int selectedIndex; +class IconToggleButtons extends StatefulWidget { + const IconToggleButtons({super.key}); + + @override + State createState() => _IconToggleButtonsState(); +} + +class _IconToggleButtonsState extends State { + @override + Widget build(BuildContext context) { + return ComponentDecoration( + label: 'Icon buttons', + tooltipMessage: 'Use IconButton', + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Column( + // Standard IconButton + children: const [ + IconToggleButton( + isEnabled: true, + tooltip: 'Standard', + ), + colDivider, + IconToggleButton( + isEnabled: false, + tooltip: 'Standard (disabled)', + ), + ], + ), + Column( + children: const [ + // Filled IconButton + IconToggleButton( + isEnabled: true, + tooltip: 'Filled', + getDefaultStyle: enabledFilledButtonStyle, + ), + colDivider, + IconToggleButton( + isEnabled: false, + tooltip: 'Filled (disabled)', + getDefaultStyle: disabledFilledButtonStyle, + ), + ], + ), + Column( + children: const [ + // Filled Tonal IconButton + IconToggleButton( + isEnabled: true, + tooltip: 'Filled tonal', + getDefaultStyle: enabledFilledTonalButtonStyle, + ), + colDivider, + IconToggleButton( + isEnabled: false, + tooltip: 'Filled tonal (disabled)', + getDefaultStyle: disabledFilledTonalButtonStyle, + ), + ], + ), + Column( + children: const [ + // Outlined IconButton + IconToggleButton( + isEnabled: true, + tooltip: 'Outlined', + getDefaultStyle: enabledOutlinedButtonStyle, + ), + colDivider, + IconToggleButton( + isEnabled: false, + tooltip: 'Outlined (disabled)', + getDefaultStyle: disabledOutlinedButtonStyle, + ), + ], + ), + ], + ), + ); + } +} + +class IconToggleButton extends StatefulWidget { + const IconToggleButton({ + required this.isEnabled, + required this.tooltip, + this.getDefaultStyle, + super.key, + }); - const NavigationRailSection( - {super.key, required this.onSelectItem, required this.selectedIndex}); + final bool isEnabled; + final String tooltip; + final ButtonStyle? Function(bool, ColorScheme)? getDefaultStyle; @override - State createState() => _NavigationRailSectionState(); + State createState() => _IconToggleButtonState(); } -class _NavigationRailSectionState extends State { - int _selectedIndex = 0; +class _IconToggleButtonState extends State { + bool selected = false; @override - void initState() { - super.initState(); - _selectedIndex = widget.selectedIndex; + Widget build(BuildContext context) { + final ColorScheme colors = Theme.of(context).colorScheme; + final VoidCallback? onPressed = widget.isEnabled + ? () { + setState(() { + selected = !selected; + }); + } + : null; + ButtonStyle? style = widget.getDefaultStyle?.call(selected, colors); + + return IconButton( + visualDensity: VisualDensity.standard, + isSelected: selected, + tooltip: widget.tooltip, + icon: const Icon(Icons.settings_outlined), + selectedIcon: const Icon(Icons.settings), + onPressed: onPressed, + style: style, + ); } +} + +ButtonStyle enabledFilledButtonStyle(bool selected, ColorScheme colors) { + return IconButton.styleFrom( + foregroundColor: selected ? colors.onPrimary : colors.primary, + backgroundColor: selected ? colors.primary : colors.surfaceVariant, + disabledForegroundColor: colors.onSurface.withOpacity(0.38), + disabledBackgroundColor: colors.onSurface.withOpacity(0.12), + hoverColor: selected + ? colors.onPrimary.withOpacity(0.08) + : colors.primary.withOpacity(0.08), + focusColor: selected + ? colors.onPrimary.withOpacity(0.12) + : colors.primary.withOpacity(0.12), + highlightColor: selected + ? colors.onPrimary.withOpacity(0.12) + : colors.primary.withOpacity(0.12), + ); +} + +ButtonStyle disabledFilledButtonStyle(bool selected, ColorScheme colors) { + return IconButton.styleFrom( + disabledForegroundColor: colors.onSurface.withOpacity(0.38), + disabledBackgroundColor: colors.onSurface.withOpacity(0.12), + ); +} + +ButtonStyle enabledFilledTonalButtonStyle(bool selected, ColorScheme colors) { + return IconButton.styleFrom( + foregroundColor: + selected ? colors.onSecondaryContainer : colors.onSurfaceVariant, + backgroundColor: + selected ? colors.secondaryContainer : colors.surfaceVariant, + hoverColor: selected + ? colors.onSecondaryContainer.withOpacity(0.08) + : colors.onSurfaceVariant.withOpacity(0.08), + focusColor: selected + ? colors.onSecondaryContainer.withOpacity(0.12) + : colors.onSurfaceVariant.withOpacity(0.12), + highlightColor: selected + ? colors.onSecondaryContainer.withOpacity(0.12) + : colors.onSurfaceVariant.withOpacity(0.12), + ); +} + +ButtonStyle disabledFilledTonalButtonStyle(bool selected, ColorScheme colors) { + return IconButton.styleFrom( + disabledForegroundColor: colors.onSurface.withOpacity(0.38), + disabledBackgroundColor: colors.onSurface.withOpacity(0.12), + ); +} + +ButtonStyle enabledOutlinedButtonStyle(bool selected, ColorScheme colors) { + return IconButton.styleFrom( + backgroundColor: selected ? colors.inverseSurface : null, + hoverColor: selected + ? colors.onInverseSurface.withOpacity(0.08) + : colors.onSurfaceVariant.withOpacity(0.08), + focusColor: selected + ? colors.onInverseSurface.withOpacity(0.12) + : colors.onSurfaceVariant.withOpacity(0.12), + highlightColor: selected + ? colors.onInverseSurface.withOpacity(0.12) + : colors.onSurface.withOpacity(0.12), + side: BorderSide(color: colors.outline), + ).copyWith( + foregroundColor: MaterialStateProperty.resolveWith((states) { + if (states.contains(MaterialState.selected)) { + return colors.onInverseSurface; + } + if (states.contains(MaterialState.pressed)) { + return colors.onSurface; + } + return null; + }), + ); +} + +ButtonStyle disabledOutlinedButtonStyle(bool selected, ColorScheme colors) { + return IconButton.styleFrom( + disabledForegroundColor: colors.onSurface.withOpacity(0.38), + disabledBackgroundColor: + selected ? colors.onSurface.withOpacity(0.12) : null, + side: selected ? null : BorderSide(color: colors.outline.withOpacity(0.12)), + ); +} + +class Chips extends StatefulWidget { + const Chips({super.key}); + + @override + State createState() => _ChipsState(); +} + +class _ChipsState extends State { + bool isFiltered = true; @override Widget build(BuildContext context) { - return NavigationRail( - minWidth: 50, - destinations: navRailDestinations, - selectedIndex: _selectedIndex, - useIndicator: true, - onDestinationSelected: (index) { + return ComponentDecoration( + label: 'Chips', + tooltipMessage: + 'Use ActionChip, FilterChip, or InputChip. \nActionChip can also be used for suggestion chip', + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Wrap( + spacing: smallSpacing, + runSpacing: smallSpacing, + children: [ + ActionChip( + label: const Text('Assist'), + avatar: const Icon(Icons.event), + onPressed: () {}, + ), + FilterChip( + label: const Text('Filter'), + selected: isFiltered, + onSelected: (selected) { + setState(() => isFiltered = selected); + }, + ), + InputChip( + label: const Text('Input'), + onPressed: () {}, + onDeleted: () {}, + ), + ActionChip( + label: const Text('Suggestion'), + onPressed: () {}, + ), + ], + ), + colDivider, + Wrap( + spacing: smallSpacing, + runSpacing: smallSpacing, + children: [ + const ActionChip( + label: Text('Assist'), + avatar: Icon(Icons.event), + ), + FilterChip( + label: const Text('Filter'), + selected: isFiltered, + onSelected: null, + ), + InputChip( + label: const Text('Input'), + onDeleted: () {}, + isEnabled: false, + ), + const ActionChip( + label: Text('Suggestion'), + ), + ], + ), + ], + ), + ); + } +} + +class SegmentedButtons extends StatelessWidget { + const SegmentedButtons({super.key}); + + @override + Widget build(BuildContext context) { + return ComponentDecoration( + label: 'Segmented buttons', + tooltipMessage: 'Use SegmentedButton', + child: Column( + children: const [ + SingleChoice(), + colDivider, + MultipleChoice(), + ], + ), + ); + } +} + +enum Calendar { day, week, month, year } + +class SingleChoice extends StatefulWidget { + const SingleChoice({super.key}); + + @override + State createState() => _SingleChoiceState(); +} + +class _SingleChoiceState extends State { + Calendar calendarView = Calendar.day; + + @override + Widget build(BuildContext context) { + return SegmentedButton( + segments: const >[ + ButtonSegment( + value: Calendar.day, + label: Text('Day'), + icon: Icon(Icons.calendar_view_day)), + ButtonSegment( + value: Calendar.week, + label: Text('Week'), + icon: Icon(Icons.calendar_view_week)), + ButtonSegment( + value: Calendar.month, + label: Text('Month'), + icon: Icon(Icons.calendar_view_month)), + ButtonSegment( + value: Calendar.year, + label: Text('Year'), + icon: Icon(Icons.calendar_today)), + ], + selected: {calendarView}, + onSelectionChanged: (newSelection) { + setState(() { + // By default there is only a single segment that can be + // selected at one time, so its value is always the first + // item in the selected set. + calendarView = newSelection.first; + }); + }, + ); + } +} + +enum Sizes { extraSmall, small, medium, large, extraLarge } + +class MultipleChoice extends StatefulWidget { + const MultipleChoice({super.key}); + + @override + State createState() => _MultipleChoiceState(); +} + +class _MultipleChoiceState extends State { + Set selection = {Sizes.large, Sizes.extraLarge}; + + @override + Widget build(BuildContext context) { + return SegmentedButton( + segments: const >[ + ButtonSegment(value: Sizes.extraSmall, label: Text('XS')), + ButtonSegment(value: Sizes.small, label: Text('S')), + ButtonSegment(value: Sizes.medium, label: Text('M')), + ButtonSegment( + value: Sizes.large, + label: Text('L'), + ), + ButtonSegment(value: Sizes.extraLarge, label: Text('XL')), + ], + selected: selection, + onSelectionChanged: (newSelection) { + setState(() { + selection = newSelection; + }); + }, + multiSelectionEnabled: true, + ); + } +} + +class SnackBarSection extends StatelessWidget { + const SnackBarSection({super.key}); + + @override + Widget build(BuildContext context) { + return ComponentDecoration( + label: 'Snackbar', + tooltipMessage: 'Use SnackBar', + child: TextButton( + onPressed: () { + final snackBar = SnackBar( + behavior: SnackBarBehavior.floating, + width: 400.0, + content: const Text('This is a snackbar'), + action: SnackBarAction( + label: 'Close', + onPressed: () {}, + ), + ); + + ScaffoldMessenger.of(context).hideCurrentSnackBar(); + ScaffoldMessenger.of(context).showSnackBar(snackBar); + }, + child: const Text( + 'Show snackbar', + style: TextStyle(fontWeight: FontWeight.bold), + ), + ), + ); + } +} + +class BottomSheetSection extends StatelessWidget { + const BottomSheetSection({super.key}); + + @override + Widget build(BuildContext context) { + List buttonList = [ + IconButton(onPressed: () {}, icon: const Icon(Icons.share_outlined)), + IconButton(onPressed: () {}, icon: const Icon(Icons.add)), + IconButton(onPressed: () {}, icon: const Icon(Icons.delete_outline)), + IconButton(onPressed: () {}, icon: const Icon(Icons.archive_outlined)), + IconButton(onPressed: () {}, icon: const Icon(Icons.settings_outlined)), + IconButton(onPressed: () {}, icon: const Icon(Icons.favorite_border)), + ]; + List labelList = const [ + Text('Share'), + Text('Add to'), + Text('Trash'), + Text('Archive'), + Text('Settings'), + Text('Favorite') + ]; + + buttonList = List.generate( + buttonList.length, + (index) => Padding( + padding: const EdgeInsets.fromLTRB(20.0, 30.0, 20.0, 20.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + buttonList[index], + labelList[index], + ], + ), + )); + + return ComponentDecoration( + label: 'Bottom sheet', + tooltipMessage: 'Use showModalBottomSheet or showBottomSheet', + child: TextButton( + child: const Text( + 'Show bottom sheet', + style: TextStyle(fontWeight: FontWeight.bold), + ), + onPressed: () { + showModalBottomSheet( + context: context, + // TODO: Remove when this is in the framework https://github.com/flutter/flutter/issues/118619 + constraints: const BoxConstraints(maxWidth: 640), + builder: (context) { + return SizedBox( + height: 150, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 32.0), + child: ListView( + shrinkWrap: true, + scrollDirection: Axis.horizontal, + children: buttonList, + ), + ), + ); + }, + ); + }, + ), + ); + } +} + +class BottomAppBars extends StatelessWidget { + const BottomAppBars({super.key}); + + @override + Widget build(BuildContext context) { + return ComponentDecoration( + label: 'Bottom app bar', + tooltipMessage: 'Use BottomAppBar', + child: Column( + children: [ + SizedBox( + height: 80, + child: Scaffold( + floatingActionButton: FloatingActionButton( + onPressed: () {}, + elevation: 0.0, + child: const Icon(Icons.add), + ), + floatingActionButtonLocation: + FloatingActionButtonLocation.endContained, + bottomNavigationBar: BottomAppBar( + child: Row( + children: [ + IconButton( + icon: const Icon(Icons.more_vert), + onPressed: () {}, + ), + IconButton( + tooltip: 'Search', + icon: const Icon(Icons.search), + onPressed: () {}, + ), + IconButton( + tooltip: 'Favorite', + icon: const Icon(Icons.favorite), + onPressed: () {}, + ), + ], + ), + ), + ), + ), + ], + ), + ); + } +} + +class NavigationDrawers extends StatelessWidget { + const NavigationDrawers({super.key, required this.scaffoldKey}); + final GlobalKey scaffoldKey; + + @override + Widget build(BuildContext context) { + return ComponentDecoration( + label: 'Navigation drawer', + tooltipMessage: 'Use NavigationDrawer', + child: UnconstrainedBox( + child: TextButton( + child: const Text('Show navigation drawer', + style: TextStyle(fontWeight: FontWeight.bold)), + onPressed: () { + scaffoldKey.currentState!.openEndDrawer(); + }, + ), + ), + ); + } +} + +class NavigationDrawerSection extends StatefulWidget { + const NavigationDrawerSection({super.key}); + + @override + State createState() => + _NavigationDrawerSectionState(); +} + +class _NavigationDrawerSectionState extends State { + int navDrawerIndex = 0; + + @override + Widget build(BuildContext context) { + return NavigationDrawer( + onDestinationSelected: (selectedIndex) { setState(() { - _selectedIndex = index; + navDrawerIndex = selectedIndex; }); - widget.onSelectItem(index); }, + selectedIndex: navDrawerIndex, + children: [ + Padding( + padding: const EdgeInsets.fromLTRB(28, 16, 16, 10), + child: Text( + 'Mail', + style: Theme.of(context).textTheme.titleSmall, + ), + ), + ...destinations.map((destination) { + return NavigationDrawerDestination( + label: Text(destination.label), + icon: destination.icon, + selectedIcon: destination.selectedIcon, + ); + }), + const Padding( + padding: EdgeInsets.symmetric(horizontal: 28), + child: Divider(), + ), + Padding( + padding: const EdgeInsets.fromLTRB(28, 16, 16, 10), + child: Text( + 'Labels', + style: Theme.of(context).textTheme.titleSmall, + ), + ), + ...labelDestinations.map((destination) { + return NavigationDrawerDestination( + label: Text(destination.label), + icon: destination.icon, + selectedIcon: destination.selectedIcon, + ); + }), + ], + ); + } +} + +class ExampleDestination { + const ExampleDestination(this.label, this.icon, this.selectedIcon); + + final String label; + final Widget icon; + final Widget selectedIcon; +} + +const List destinations = [ + ExampleDestination('Inbox', Icon(Icons.inbox_outlined), Icon(Icons.inbox)), + ExampleDestination('Outbox', Icon(Icons.send_outlined), Icon(Icons.send)), + ExampleDestination( + 'Favorites', Icon(Icons.favorite_outline), Icon(Icons.favorite)), + ExampleDestination('Trash', Icon(Icons.delete_outline), Icon(Icons.delete)), +]; + +const List labelDestinations = [ + ExampleDestination( + 'Family', Icon(Icons.bookmark_border), Icon(Icons.bookmark)), + ExampleDestination( + 'School', Icon(Icons.bookmark_border), Icon(Icons.bookmark)), + ExampleDestination('Work', Icon(Icons.bookmark_border), Icon(Icons.bookmark)), +]; + +class Tabs extends StatefulWidget { + const Tabs({super.key}); + + @override + State createState() => _TabsState(); +} + +class _TabsState extends State with TickerProviderStateMixin { + late TabController _tabController; + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 3, vsync: this); + } + + @override + Widget build(BuildContext context) { + return ComponentDecoration( + label: 'Tabs', + tooltipMessage: 'Use TabBar', + child: SizedBox( + height: 80, + child: Scaffold( + appBar: AppBar( + bottom: TabBar( + controller: _tabController, + tabs: const [ + Tab( + icon: Icon(Icons.videocam_outlined), + text: 'Video', + iconMargin: EdgeInsets.only(bottom: 0.0), + ), + Tab( + icon: Icon(Icons.photo_outlined), + text: 'Photos', + iconMargin: EdgeInsets.only(bottom: 0.0), + ), + Tab( + icon: Icon(Icons.audiotrack_sharp), + text: 'Audio', + iconMargin: EdgeInsets.only(bottom: 0.0), + ), + ], + ), + ), + ), + ), + ); + } +} + +class DropdownMenus extends StatefulWidget { + const DropdownMenus({super.key}); + + @override + State createState() => _DropdownMenusState(); +} + +class _DropdownMenusState extends State { + final TextEditingController colorController = TextEditingController(); + final TextEditingController iconController = TextEditingController(); + IconLabel? selectedIcon = IconLabel.smile; + ColorLabel? selectedColor; + + @override + Widget build(BuildContext context) { + final List> colorEntries = + >[]; + for (final ColorLabel color in ColorLabel.values) { + colorEntries.add(DropdownMenuEntry( + value: color, label: color.label, enabled: color.label != 'Grey')); + } + + final List> iconEntries = + >[]; + for (final IconLabel icon in IconLabel.values) { + iconEntries + .add(DropdownMenuEntry(value: icon, label: icon.label)); + } + + return ComponentDecoration( + label: 'Dropdown menus', + tooltipMessage: 'Use DropdownMenu', + child: Wrap( + alignment: WrapAlignment.spaceAround, + runAlignment: WrapAlignment.start, + crossAxisAlignment: WrapCrossAlignment.center, + spacing: smallSpacing, + runSpacing: smallSpacing, + children: [ + DropdownMenu( + controller: colorController, + label: const Text('Color'), + enableFilter: true, + dropdownMenuEntries: colorEntries, + inputDecorationTheme: const InputDecorationTheme(filled: true), + onSelected: (color) { + setState(() { + selectedColor = color; + }); + }, + ), + DropdownMenu( + initialSelection: IconLabel.smile, + controller: iconController, + leadingIcon: const Icon(Icons.search), + label: const Text('Icon'), + dropdownMenuEntries: iconEntries, + onSelected: (icon) { + setState(() { + selectedIcon = icon; + }); + }, + ), + Icon( + selectedIcon?.icon, + color: selectedColor?.color ?? Colors.grey.withOpacity(0.5), + ) + ], + ), + ); + } +} + +enum ColorLabel { + blue('Blue', Colors.blue), + pink('Pink', Colors.pink), + green('Green', Colors.green), + yellow('Yellow', Colors.yellow), + grey('Grey', Colors.grey); + + const ColorLabel(this.label, this.color); + final String label; + final Color color; +} + +enum IconLabel { + smile('Smile', Icons.sentiment_satisfied_outlined), + cloud( + 'Cloud', + Icons.cloud_outlined, + ), + brush('Brush', Icons.brush_outlined), + heart('Heart', Icons.favorite); + + const IconLabel(this.label, this.icon); + final String label; + final IconData icon; +} + +class Sliders extends StatefulWidget { + const Sliders({super.key}); + + @override + State createState() => _SlidersState(); +} + +class _SlidersState extends State { + double sliderValue0 = 30.0; + double sliderValue1 = 20.0; + + @override + Widget build(BuildContext context) { + return ComponentDecoration( + label: 'Sliders', + tooltipMessage: 'Use Slider or RangeSlider', + child: Column( + children: [ + Slider( + max: 100, + value: sliderValue0, + onChanged: (value) { + setState(() { + sliderValue0 = value; + }); + }, + ), + const SizedBox(height: 20), + Slider( + max: 100, + divisions: 5, + value: sliderValue1, + label: sliderValue1.round().toString(), + onChanged: (value) { + setState(() { + sliderValue1 = value; + }); + }, + ), + ], + )); + } +} + +class ComponentDecoration extends StatelessWidget { + const ComponentDecoration({ + super.key, + required this.label, + required this.child, + this.tooltipMessage = '', + }); + + final String label; + final Widget child; + final String? tooltipMessage; + + @override + Widget build(BuildContext context) { + return RepaintBoundary( + child: Padding( + padding: const EdgeInsets.symmetric(vertical: smallSpacing), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text(label, style: Theme.of(context).textTheme.titleSmall), + Tooltip( + message: tooltipMessage, + child: const Padding( + padding: EdgeInsets.symmetric(horizontal: 5.0), + child: Icon(Icons.info_outline, size: 16)), + ), + ], + ), + ConstrainedBox( + constraints: + const BoxConstraints.tightFor(width: widthConstraint), + child: Card( + elevation: 0, + shape: RoundedRectangleBorder( + side: BorderSide( + color: Theme.of(context).colorScheme.outlineVariant, + ), + borderRadius: const BorderRadius.all(Radius.circular(12)), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 5.0, vertical: 20.0), + child: Center(child: child), + ), + ), + ), + ], + ), + ), + ); + } +} + +class ComponentGroupDecoration extends StatelessWidget { + const ComponentGroupDecoration( + {super.key, required this.label, required this.children}); + + final String label; + final List children; + + @override + Widget build(BuildContext context) { + return Card( + margin: EdgeInsets.zero, + elevation: 0, + color: Theme.of(context).colorScheme.surfaceVariant.withOpacity(0.3), + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 20.0), + child: Center( + child: Column( + children: [ + Text(label, style: Theme.of(context).textTheme.titleLarge), + colDivider, + ...children + ], + ), + ), + ), ); } } diff --git a/material_3_demo/lib/elevation_screen.dart b/material_3_demo/lib/elevation_screen.dart index ea18d5d806c..0f3d6299ef0 100644 --- a/material_3_demo/lib/elevation_screen.dart +++ b/material_3_demo/lib/elevation_screen.dart @@ -12,37 +12,47 @@ class ElevationScreen extends StatelessWidget { Color shadowColor = Theme.of(context).colorScheme.shadow; Color surfaceTint = Theme.of(context).colorScheme.primary; return Expanded( - child: ListView( - children: [ - Padding( - padding: const EdgeInsets.fromLTRB(16.0, 20, 16.0, 0), - child: Text( - 'Surface Tint only', - style: Theme.of(context).textTheme.titleLarge, + child: CustomScrollView( + slivers: [ + SliverToBoxAdapter( + child: Padding( + padding: const EdgeInsets.fromLTRB(16.0, 20, 16.0, 0), + child: Text( + 'Surface Tint Color Only', + style: Theme.of(context).textTheme.titleLarge, + ), ), ), ElevationGrid(surfaceTintColor: surfaceTint), - const SizedBox(height: 10), - Padding( - padding: const EdgeInsets.fromLTRB(16.0, 8.0, 16.0, 0), - child: Text( - 'Surface Tint and Shadow', - style: Theme.of(context).textTheme.titleLarge, - ), + SliverList( + delegate: SliverChildListDelegate([ + const SizedBox(height: 10), + Padding( + padding: const EdgeInsets.fromLTRB(16.0, 8.0, 16.0, 0), + child: Text( + 'Surface Tint Color and Shadow Color', + style: Theme.of(context).textTheme.titleLarge, + ), + ), + ]), ), ElevationGrid( shadowColor: shadowColor, surfaceTintColor: surfaceTint, ), - const SizedBox(height: 10), - Padding( - padding: const EdgeInsets.fromLTRB(16.0, 8.0, 16.0, 0), - child: Text( - 'Shadow only', - style: Theme.of(context).textTheme.titleLarge, - ), + SliverList( + delegate: SliverChildListDelegate([ + const SizedBox(height: 10), + Padding( + padding: const EdgeInsets.fromLTRB(16.0, 8.0, 16.0, 0), + child: Text( + 'Shadow Color Only', + style: Theme.of(context).textTheme.titleLarge, + ), + ), + ]), ), - ElevationGrid(shadowColor: shadowColor) + ElevationGrid(shadowColor: shadowColor), ], ), ); @@ -72,18 +82,16 @@ class ElevationGrid extends StatelessWidget { @override Widget build(BuildContext context) { - return Padding( + return SliverPadding( padding: const EdgeInsets.all(8), - child: LayoutBuilder(builder: (context, constraints) { - if (constraints.maxWidth < narrowScreenWidthThreshold) { - return GridView.count( - shrinkWrap: true, + sliver: SliverLayoutBuilder(builder: (context, constraints) { + if (constraints.crossAxisExtent < narrowScreenWidthThreshold) { + return SliverGrid.count( crossAxisCount: 3, children: elevationCards(shadowColor, surfaceTintColor), ); } else { - return GridView.count( - shrinkWrap: true, + return SliverGrid.count( crossAxisCount: 6, children: elevationCards(shadowColor, surfaceTintColor), ); @@ -117,7 +125,6 @@ class _ElevationCardState extends State { @override Widget build(BuildContext context) { const BorderRadius borderRadius = BorderRadius.all(Radius.circular(4.0)); - final bool showOpacity = _elevation == widget.info.elevation; final Color color = Theme.of(context).colorScheme.surface; return Padding( @@ -142,7 +149,7 @@ class _ElevationCardState extends State { '${widget.info.level.toInt()} dp', style: Theme.of(context).textTheme.labelMedium, ), - if (showOpacity) + if (widget.surfaceTint != null) Expanded( child: Align( alignment: Alignment.bottomRight, diff --git a/material_3_demo/lib/main.dart b/material_3_demo/lib/main.dart index 2d31ceb7c28..b36fd8f1046 100644 --- a/material_3_demo/lib/main.dart +++ b/material_3_demo/lib/main.dart @@ -3,6 +3,7 @@ // found in the LICENSE file. import 'package:flutter/material.dart'; +import 'package:flutter/scheduler.dart'; import 'color_palettes_screen.dart'; import 'component_screen.dart'; @@ -10,7 +11,12 @@ import 'elevation_screen.dart'; import 'typography_screen.dart'; void main() { - runApp(const Material3Demo()); + runApp( + const MaterialApp( + debugShowCheckedModeBanner: false, + home: Material3Demo(), + ), + ); } class Material3Demo extends StatefulWidget { @@ -24,180 +30,708 @@ class Material3Demo extends StatefulWidget { // screenWidthThreshold; otherwise, NavigationBar is used for navigation. const double narrowScreenWidthThreshold = 450; -const Color m3BaseColor = Color(0xff6750a4); -const List colorOptions = [ - m3BaseColor, - Colors.blue, - Colors.teal, - Colors.green, - Colors.yellow, - Colors.orange, - Colors.pink -]; -const List colorText = [ - "M3 Baseline", - "Blue", - "Teal", - "Green", - "Yellow", - "Orange", - "Pink", -]; - -class _Material3DemoState extends State { +const double transitionLength = 500; + +enum ColorSeed { + baseColor('M3 Baseline', Color(0xff6750a4)), + indigo('Indigo', Colors.indigo), + blue('Blue', Colors.blue), + teal('Teal', Colors.teal), + green('Green', Colors.green), + yellow('Yellow', Colors.yellow), + orange('Orange', Colors.orange), + deepOrange('Deep Orange', Colors.deepOrange), + pink('Pink', Colors.pink); + + const ColorSeed(this.label, this.color); + final String label; + final Color color; +} + +enum ScreenSelected { + component(0), + color(1), + typography(2), + elevation(3); + + const ScreenSelected(this.value); + final int value; +} + +class _Material3DemoState extends State + with SingleTickerProviderStateMixin { + final GlobalKey scaffoldKey = GlobalKey(); + late final AnimationController controller; + late final CurvedAnimation railAnimation; + bool controllerInitialized = false; + bool showMediumSizeLayout = false; + bool showLargeSizeLayout = false; bool useMaterial3 = true; - bool useLightMode = true; - int colorSelected = 0; - int screenIndex = 0; + ThemeMode themeMode = ThemeMode.system; + bool get useLightMode { + switch (themeMode) { + case ThemeMode.system: + return SchedulerBinding.instance.window.platformBrightness == + Brightness.light; + case ThemeMode.light: + return true; + case ThemeMode.dark: + return false; + } + } - late ThemeData themeData; + ColorSeed colorSelected = ColorSeed.baseColor; + int screenIndex = ScreenSelected.component.value; @override initState() { super.initState(); - themeData = updateThemes(colorSelected, useMaterial3, useLightMode); + controller = AnimationController( + duration: Duration(milliseconds: transitionLength.toInt() * 2), + value: 0, + vsync: this, + ); + railAnimation = CurvedAnimation( + parent: controller, + curve: const Interval(0.5, 1.0), + ); } - ThemeData updateThemes(int colorIndex, bool useMaterial3, bool useLightMode) { - return ThemeData( - colorSchemeSeed: colorOptions[colorSelected], - useMaterial3: useMaterial3, - brightness: useLightMode ? Brightness.light : Brightness.dark); + @override + void dispose() { + controller.dispose(); + super.dispose(); + } + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + + final double width = MediaQuery.of(context).size.width; + final AnimationStatus status = controller.status; + if (width > 1000) { + if (width > 1500) { + showMediumSizeLayout = false; + showLargeSizeLayout = true; + } else { + showMediumSizeLayout = true; + showLargeSizeLayout = false; + } + if (status != AnimationStatus.forward && + status != AnimationStatus.completed) { + controller.forward(); + } + } else { + showMediumSizeLayout = false; + showLargeSizeLayout = false; + if (status != AnimationStatus.reverse && + status != AnimationStatus.dismissed) { + controller.reverse(); + } + } + if (!controllerInitialized) { + controllerInitialized = true; + controller.value = width > 1000 ? 1 : 0; + } } - void handleScreenChanged(int selectedScreen) { + void handleScreenChanged(int screenSelected) { setState(() { - screenIndex = selectedScreen; + screenIndex = screenSelected; }); } - void handleBrightnessChange() { + void handleBrightnessChange(bool useLightMode) { setState(() { - useLightMode = !useLightMode; - themeData = updateThemes(colorSelected, useMaterial3, useLightMode); + themeMode = useLightMode ? ThemeMode.light : ThemeMode.dark; }); } void handleMaterialVersionChange() { setState(() { useMaterial3 = !useMaterial3; - themeData = updateThemes(colorSelected, useMaterial3, useLightMode); }); } void handleColorSelect(int value) { setState(() { - colorSelected = value; - themeData = updateThemes(colorSelected, useMaterial3, useLightMode); + colorSelected = ColorSeed.values[value]; }); } - Widget createScreenFor(int screenIndex, bool showNavBarExample) { - switch (screenIndex) { - case 0: - return ComponentScreen(showNavBottomBar: showNavBarExample); - case 1: + Widget createScreenFor( + ScreenSelected screenSelected, bool showNavBarExample) { + switch (screenSelected) { + case ScreenSelected.component: + return Expanded( + child: OneTwoTransition( + animation: railAnimation, + one: FirstComponentList( + showNavBottomBar: showNavBarExample, + scaffoldKey: scaffoldKey, + showSecondList: showMediumSizeLayout || showLargeSizeLayout), + two: SecondComponentList( + scaffoldKey: scaffoldKey, + ), + ), + ); + case ScreenSelected.color: return const ColorPalettesScreen(); - case 2: + case ScreenSelected.typography: return const TypographyScreen(); - case 3: + case ScreenSelected.elevation: return const ElevationScreen(); default: - return ComponentScreen(showNavBottomBar: showNavBarExample); + return FirstComponentList( + showNavBottomBar: showNavBarExample, + scaffoldKey: scaffoldKey, + showSecondList: showMediumSizeLayout || showLargeSizeLayout); } } PreferredSizeWidget createAppBar() { return AppBar( - title: useMaterial3 ? const Text("Material 3") : const Text("Material 2"), - actions: [ - IconButton( - icon: useLightMode - ? const Icon(Icons.wb_sunny_outlined) - : const Icon(Icons.wb_sunny), - onPressed: handleBrightnessChange, - tooltip: "Toggle brightness", - ), - IconButton( - icon: useMaterial3 - ? const Icon(Icons.filter_3) - : const Icon(Icons.filter_2), - onPressed: handleMaterialVersionChange, - tooltip: "Switch to Material ${useMaterial3 ? 2 : 3}", - ), - PopupMenuButton( - icon: const Icon(Icons.more_vert), - shape: - RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), - itemBuilder: (context) { - return List.generate(colorOptions.length, (index) { - return PopupMenuItem( - value: index, - child: Wrap( - children: [ - Padding( - padding: const EdgeInsets.only(left: 10), - child: Icon( - index == colorSelected - ? Icons.color_lens - : Icons.color_lens_outlined, - color: colorOptions[index], - ), - ), - Padding( - padding: const EdgeInsets.only(left: 20), - child: Text(colorText[index])) - ], - )); - }); - }, - onSelected: handleColorSelect, - ), - ], + title: useMaterial3 ? const Text('Material 3') : const Text('Material 2'), + actions: !showMediumSizeLayout && !showLargeSizeLayout + ? [ + _BrightnessButton( + handleBrightnessChange: handleBrightnessChange, + ), + _Material3Button( + handleMaterialVersionChange: handleMaterialVersionChange, + ), + _ColorSeedButton( + handleColorSelect: handleColorSelect, + colorSelected: colorSelected, + ), + ] + : [Container()], ); } + Widget _expandedTrailingActions() => Container( + constraints: const BoxConstraints.tightFor(width: 250), + padding: const EdgeInsets.symmetric(horizontal: 30), + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Row( + children: [ + const Text('Brightness'), + Expanded(child: Container()), + Switch( + value: useLightMode, + onChanged: (value) { + handleBrightnessChange(value); + }) + ], + ), + Row( + children: [ + useMaterial3 + ? const Text('Material 3') + : const Text('Material 2'), + Expanded(child: Container()), + Switch( + value: useMaterial3, + onChanged: (_) { + handleMaterialVersionChange(); + }) + ], + ), + const Divider(), + ConstrainedBox( + constraints: const BoxConstraints(maxHeight: 200.0), + child: GridView.count( + crossAxisCount: 3, + children: List.generate( + ColorSeed.values.length, + (i) => IconButton( + icon: const Icon(Icons.radio_button_unchecked), + color: ColorSeed.values[i].color, + isSelected: + colorSelected.color == ColorSeed.values[i].color, + selectedIcon: const Icon(Icons.circle), + onPressed: () { + handleColorSelect(i); + }, + )), + ), + ), + ], + ), + ); + + Widget _trailingActions() => Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Flexible( + child: _BrightnessButton( + handleBrightnessChange: handleBrightnessChange, + showTooltipBelow: false, + ), + ), + Flexible( + child: _Material3Button( + handleMaterialVersionChange: handleMaterialVersionChange, + showTooltipBelow: false, + ), + ), + Flexible( + child: _ColorSeedButton( + handleColorSelect: handleColorSelect, + colorSelected: colorSelected, + ), + ), + ], + ); + @override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, title: 'Material 3', - themeMode: useLightMode ? ThemeMode.light : ThemeMode.dark, - theme: themeData, - home: LayoutBuilder(builder: (context, constraints) { - if (constraints.maxWidth < narrowScreenWidthThreshold) { - return Scaffold( + themeMode: themeMode, + theme: ThemeData( + colorSchemeSeed: colorSelected.color, + useMaterial3: useMaterial3, + brightness: Brightness.light, + ), + darkTheme: ThemeData( + colorSchemeSeed: colorSelected.color, + useMaterial3: useMaterial3, + brightness: Brightness.dark, + ), + home: AnimatedBuilder( + animation: controller, + builder: (context, child) { + return NavigationTransition( + scaffoldKey: scaffoldKey, + animationController: controller, + railAnimation: railAnimation, appBar: createAppBar(), - body: Row(children: [ - createScreenFor(screenIndex, false), - ]), - bottomNavigationBar: NavigationBars( - onSelectItem: handleScreenChanged, + body: createScreenFor( + ScreenSelected.values[screenIndex], controller.value == 1), + navigationRail: NavigationRail( + extended: showLargeSizeLayout, + destinations: navRailDestinations, + selectedIndex: screenIndex, + onDestinationSelected: (index) { + setState(() { + screenIndex = index; + handleScreenChanged(screenIndex); + }); + }, + trailing: Expanded( + child: Padding( + padding: const EdgeInsets.only(bottom: 20), + child: showLargeSizeLayout + ? _expandedTrailingActions() + : _trailingActions(), + ), + ), + ), + navigationBar: NavigationBars( + onSelectItem: (index) { + setState(() { + screenIndex = index; + handleScreenChanged(screenIndex); + }); + }, selectedIndex: screenIndex, isExampleBar: false, ), ); - } else { - return Scaffold( - appBar: createAppBar(), - body: SafeArea( - bottom: false, - top: false, - child: Row( - children: [ - Padding( - padding: const EdgeInsets.symmetric(horizontal: 5), - child: NavigationRailSection( - onSelectItem: handleScreenChanged, - selectedIndex: screenIndex)), - const VerticalDivider(thickness: 1, width: 1), - createScreenFor(screenIndex, true), - ], - ), + }, + ), + ); + } +} + +class _BrightnessButton extends StatelessWidget { + const _BrightnessButton({ + required this.handleBrightnessChange, + this.showTooltipBelow = true, + }); + + final Function handleBrightnessChange; + final bool showTooltipBelow; + + @override + Widget build(BuildContext context) { + final isBright = Theme.of(context).brightness == Brightness.light; + return Tooltip( + preferBelow: showTooltipBelow, + message: 'Toggle brightness', + child: IconButton( + icon: isBright + ? const Icon(Icons.dark_mode_outlined) + : const Icon(Icons.light_mode_outlined), + onPressed: () => handleBrightnessChange(!isBright), + ), + ); + } +} + +class _Material3Button extends StatelessWidget { + const _Material3Button({ + required this.handleMaterialVersionChange, + this.showTooltipBelow = true, + }); + + final void Function() handleMaterialVersionChange; + final bool showTooltipBelow; + + @override + Widget build(BuildContext context) { + final useMaterial3 = Theme.of(context).useMaterial3; + return Tooltip( + preferBelow: showTooltipBelow, + message: 'Switch to Material ${useMaterial3 ? 2 : 3}', + child: IconButton( + icon: useMaterial3 + ? const Icon(Icons.filter_2) + : const Icon(Icons.filter_3), + onPressed: handleMaterialVersionChange, + ), + ); + } +} + +class _ColorSeedButton extends StatelessWidget { + const _ColorSeedButton({ + required this.handleColorSelect, + required this.colorSelected, + }); + + final void Function(int) handleColorSelect; + final ColorSeed colorSelected; + + @override + Widget build(BuildContext context) { + return PopupMenuButton( + icon: Icon( + Icons.palette_outlined, + color: Theme.of(context).colorScheme.onSurfaceVariant, + ), + tooltip: 'Select a seed color', + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), + itemBuilder: (context) { + return List.generate(ColorSeed.values.length, (index) { + ColorSeed currentColor = ColorSeed.values[index]; + + return PopupMenuItem( + value: index, + enabled: currentColor != colorSelected, + child: Wrap( + children: [ + Padding( + padding: const EdgeInsets.only(left: 10), + child: Icon( + currentColor == colorSelected + ? Icons.color_lens + : Icons.color_lens_outlined, + color: currentColor.color, + ), + ), + Padding( + padding: const EdgeInsets.only(left: 20), + child: Text(currentColor.label), + ), + ], ), ); - } - }), + }); + }, + onSelected: handleColorSelect, + ); + } +} + +class NavigationTransition extends StatefulWidget { + const NavigationTransition( + {super.key, + required this.scaffoldKey, + required this.animationController, + required this.railAnimation, + required this.navigationRail, + required this.navigationBar, + required this.appBar, + required this.body}); + + final GlobalKey scaffoldKey; + final AnimationController animationController; + final CurvedAnimation railAnimation; + final Widget navigationRail; + final Widget navigationBar; + final PreferredSizeWidget appBar; + final Widget body; + + @override + State createState() => _NavigationTransitionState(); +} + +class _NavigationTransitionState extends State { + late final AnimationController controller; + late final CurvedAnimation railAnimation; + late final ReverseAnimation barAnimation; + bool controllerInitialized = false; + bool showDivider = false; + + @override + void initState() { + super.initState(); + + controller = widget.animationController; + railAnimation = widget.railAnimation; + + barAnimation = ReverseAnimation( + CurvedAnimation( + parent: controller, + curve: const Interval(0.0, 0.5), + ), + ); + } + + @override + Widget build(BuildContext context) { + final ColorScheme colorScheme = Theme.of(context).colorScheme; + + return Scaffold( + key: widget.scaffoldKey, + appBar: widget.appBar, + body: Row( + children: [ + RailTransition( + animation: railAnimation, + backgroundColor: colorScheme.surface, + child: widget.navigationRail, + ), + widget.body, + ], + ), + bottomNavigationBar: BarTransition( + animation: barAnimation, + backgroundColor: colorScheme.surface, + child: widget.navigationBar, + ), + endDrawer: const NavigationDrawerSection(), + ); + } +} + +final List navRailDestinations = appBarDestinations + .map( + (destination) => NavigationRailDestination( + icon: Tooltip( + message: destination.label, + child: destination.icon, + ), + selectedIcon: Tooltip( + message: destination.label, + child: destination.selectedIcon, + ), + label: Text(destination.label), + ), + ) + .toList(); + +class SizeAnimation extends CurvedAnimation { + SizeAnimation(Animation parent) + : super( + parent: parent, + curve: const Interval( + 0.2, + 0.8, + curve: Curves.easeInOutCubicEmphasized, + ), + reverseCurve: Interval( + 0, + 0.2, + curve: Curves.easeInOutCubicEmphasized.flipped, + ), + ); +} + +class OffsetAnimation extends CurvedAnimation { + OffsetAnimation(Animation parent) + : super( + parent: parent, + curve: const Interval( + 0.4, + 1.0, + curve: Curves.easeInOutCubicEmphasized, + ), + reverseCurve: Interval( + 0, + 0.2, + curve: Curves.easeInOutCubicEmphasized.flipped, + ), + ); +} + +class RailTransition extends StatefulWidget { + const RailTransition( + {super.key, + required this.animation, + required this.backgroundColor, + required this.child}); + + final Animation animation; + final Widget child; + final Color backgroundColor; + + @override + State createState() => _RailTransition(); +} + +class _RailTransition extends State { + late Animation offsetAnimation; + late Animation widthAnimation; + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + + // The animations are only rebuilt by this method when the text + // direction changes because this widget only depends on Directionality. + final bool ltr = Directionality.of(context) == TextDirection.ltr; + + widthAnimation = Tween( + begin: 0, + end: 1, + ).animate(SizeAnimation(widget.animation)); + + offsetAnimation = Tween( + begin: ltr ? const Offset(-1, 0) : const Offset(1, 0), + end: Offset.zero, + ).animate(OffsetAnimation(widget.animation)); + } + + @override + Widget build(BuildContext context) { + return ClipRect( + child: DecoratedBox( + decoration: BoxDecoration(color: widget.backgroundColor), + child: Align( + alignment: Alignment.topLeft, + widthFactor: widthAnimation.value, + child: FractionalTranslation( + translation: offsetAnimation.value, + child: widget.child, + ), + ), + ), + ); + } +} + +class BarTransition extends StatefulWidget { + const BarTransition( + {super.key, + required this.animation, + required this.backgroundColor, + required this.child}); + + final Animation animation; + final Color backgroundColor; + final Widget child; + + @override + State createState() => _BarTransition(); +} + +class _BarTransition extends State { + late final Animation offsetAnimation; + late final Animation heightAnimation; + + @override + void initState() { + super.initState(); + + offsetAnimation = Tween( + begin: const Offset(0, 1), + end: Offset.zero, + ).animate(OffsetAnimation(widget.animation)); + + heightAnimation = Tween( + begin: 0, + end: 1, + ).animate(SizeAnimation(widget.animation)); + } + + @override + Widget build(BuildContext context) { + return ClipRect( + child: DecoratedBox( + decoration: BoxDecoration(color: widget.backgroundColor), + child: Align( + alignment: Alignment.topLeft, + heightFactor: heightAnimation.value, + child: FractionalTranslation( + translation: offsetAnimation.value, + child: widget.child, + ), + ), + ), + ); + } +} + +class OneTwoTransition extends StatefulWidget { + const OneTwoTransition({ + super.key, + required this.animation, + required this.one, + required this.two, + }); + + final Animation animation; + final Widget one; + final Widget two; + + @override + State createState() => _OneTwoTransitionState(); +} + +class _OneTwoTransitionState extends State { + late final Animation offsetAnimation; + late final Animation widthAnimation; + + @override + void initState() { + super.initState(); + + offsetAnimation = Tween( + begin: const Offset(1, 0), + end: Offset.zero, + ).animate(OffsetAnimation(widget.animation)); + + widthAnimation = Tween( + begin: 0, + end: 1000, + ).animate(SizeAnimation(widget.animation)); + } + + @override + Widget build(BuildContext context) { + return Row( + children: [ + Flexible( + flex: 1000, + child: widget.one, + ), + if (widthAnimation.value.toInt() > 0) ...[ + Flexible( + flex: widthAnimation.value.toInt(), + child: FractionalTranslation( + translation: offsetAnimation.value, + child: widget.two, + ), + ) + ], + ], ); } } diff --git a/material_3_demo/lib/typography_screen.dart b/material_3_demo/lib/typography_screen.dart index 6ffa270da3a..6950e9575fa 100644 --- a/material_3_demo/lib/typography_screen.dart +++ b/material_3_demo/lib/typography_screen.dart @@ -17,26 +17,26 @@ class TypographyScreen extends StatelessWidget { children: [ const SizedBox(height: 7), TextStyleExample( - name: "Display Large", style: textTheme.displayLarge!), + name: 'Display Large', style: textTheme.displayLarge!), TextStyleExample( - name: "Display Medium", style: textTheme.displayMedium!), + name: 'Display Medium', style: textTheme.displayMedium!), TextStyleExample( - name: "Display Small", style: textTheme.displaySmall!), + name: 'Display Small', style: textTheme.displaySmall!), TextStyleExample( - name: "Headline Large", style: textTheme.headlineLarge!), + name: 'Headline Large', style: textTheme.headlineLarge!), TextStyleExample( - name: "Headline Medium", style: textTheme.headlineMedium!), + name: 'Headline Medium', style: textTheme.headlineMedium!), TextStyleExample( - name: "Headline Small", style: textTheme.headlineSmall!), - TextStyleExample(name: "Title Large", style: textTheme.titleLarge!), - TextStyleExample(name: "Title Medium", style: textTheme.titleMedium!), - TextStyleExample(name: "Title Small", style: textTheme.titleSmall!), - TextStyleExample(name: "Label Large", style: textTheme.labelLarge!), - TextStyleExample(name: "Label Medium", style: textTheme.labelMedium!), - TextStyleExample(name: "Label Small", style: textTheme.labelSmall!), - TextStyleExample(name: "Body Large", style: textTheme.bodyLarge!), - TextStyleExample(name: "Body Medium", style: textTheme.bodyMedium!), - TextStyleExample(name: "Body Small", style: textTheme.bodySmall!), + name: 'Headline Small', style: textTheme.headlineSmall!), + TextStyleExample(name: 'Title Large', style: textTheme.titleLarge!), + TextStyleExample(name: 'Title Medium', style: textTheme.titleMedium!), + TextStyleExample(name: 'Title Small', style: textTheme.titleSmall!), + TextStyleExample(name: 'Label Large', style: textTheme.labelLarge!), + TextStyleExample(name: 'Label Medium', style: textTheme.labelMedium!), + TextStyleExample(name: 'Label Small', style: textTheme.labelSmall!), + TextStyleExample(name: 'Body Large', style: textTheme.bodyLarge!), + TextStyleExample(name: 'Body Medium', style: textTheme.bodyMedium!), + TextStyleExample(name: 'Body Small', style: textTheme.bodySmall!), ], ), ); diff --git a/material_3_demo/macos/Runner.xcodeproj/project.pbxproj b/material_3_demo/macos/Runner.xcodeproj/project.pbxproj index ea4fdf82099..34b8722c1d0 100644 --- a/material_3_demo/macos/Runner.xcodeproj/project.pbxproj +++ b/material_3_demo/macos/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 54; objects = { /* Begin PBXAggregateTarget section */ @@ -235,6 +235,7 @@ /* Begin PBXShellScriptBuildPhase section */ 3399D490228B24CF009A79C7 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -344,7 +345,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; @@ -423,7 +424,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; @@ -470,7 +471,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; diff --git a/material_3_demo/pubspec.yaml b/material_3_demo/pubspec.yaml index 8e134197054..63371e70bd5 100644 --- a/material_3_demo/pubspec.yaml +++ b/material_3_demo/pubspec.yaml @@ -8,7 +8,7 @@ publish_to: "none" version: 1.0.0+1 environment: - sdk: ">=2.17.0-0 <3.0.0" + sdk: ">=2.18.0-0 <3.0.0" dependencies: flutter: diff --git a/material_3_demo/test/color_screen_test.dart b/material_3_demo/test/color_screen_test.dart index 754b18a8a82..92a21673d59 100644 --- a/material_3_demo/test/color_screen_test.dart +++ b/material_3_demo/test/color_screen_test.dart @@ -16,46 +16,61 @@ void main() { 'on NavigationBar', (tester) async { widgetSetup(tester, 449); addTearDown(tester.binding.window.clearPhysicalSizeTestValue); - await tester.pumpWidget(const Material3Demo()); + await tester.pumpWidget(const MaterialApp(home: Material3Demo())); - expect(find.text("Light Theme"), findsNothing); - expect(find.text("Dark Theme"), findsNothing); + expect(find.text('Light Theme'), findsNothing); + expect(find.text('Dark Theme'), findsNothing); expect(find.byType(NavigationBar), findsOneWidget); - Finder colorIconOnBar = find.byIcon(Icons.format_paint_outlined); + Finder colorIconOnBar = find.descendant( + of: find.byType(NavigationBar), + matching: find.widgetWithIcon( + NavigationDestination, Icons.format_paint_outlined)); expect(colorIconOnBar, findsOneWidget); await tester.tap(colorIconOnBar); await tester.pumpAndSettle(const Duration(microseconds: 500)); expect(colorIconOnBar, findsNothing); - expect(find.byIcon(Icons.format_paint), findsOneWidget); - expect(find.text("Light Theme"), findsOneWidget); - expect(find.text("Dark Theme"), findsOneWidget); + + Finder selectedColorIconOnBar = find.descendant( + of: find.byType(NavigationBar), + matching: + find.widgetWithIcon(NavigationDestination, Icons.format_paint)); + expect(selectedColorIconOnBar, findsOneWidget); + expect(find.text('Light Theme'), findsOneWidget); + expect(find.text('Dark Theme'), findsOneWidget); }); testWidgets( 'Color palettes screen shows correctly when color icon is clicked ' 'on NavigationRail', (tester) async { - widgetSetup(tester, 450); // NavigationRail shows only when width is >= 450. + widgetSetup( + tester, 1200); // NavigationRail shows only when width is > 1000. addTearDown(tester.binding.window.clearPhysicalSizeTestValue); - await tester.pumpWidget(const Material3Demo()); - expect(find.text("Light Theme"), findsNothing); - expect(find.text("Dark Theme"), findsNothing); + await tester.pumpWidget(const MaterialApp(home: Material3Demo())); + await tester.pumpAndSettle(); + expect(find.text('Light Theme'), findsNothing); + expect(find.text('Dark Theme'), findsNothing); expect(find.byType(NavigationRail), findsOneWidget); - Finder colorIconOnRail = find.byIcon(Icons.format_paint_outlined); + Finder colorIconOnRail = find.descendant( + of: find.byType(NavigationRail), + matching: find.byIcon(Icons.format_paint_outlined)); expect(colorIconOnRail, findsOneWidget); await tester.tap(colorIconOnRail); await tester.pumpAndSettle(const Duration(microseconds: 500)); expect(colorIconOnRail, findsNothing); - expect(find.byIcon(Icons.format_paint), findsOneWidget); - expect(find.text("Light Theme"), findsOneWidget); - expect(find.text("Dark Theme"), findsOneWidget); + Finder selectedColorIconOnRail = find.descendant( + of: find.byType(NavigationRail), + matching: find.byIcon(Icons.format_paint)); + expect(selectedColorIconOnRail, findsOneWidget); + expect(find.text('Light Theme'), findsOneWidget); + expect(find.text('Dark Theme'), findsOneWidget); }); testWidgets('Color screen shows correct content', (tester) async { await tester.pumpWidget(MaterialApp( home: Scaffold(body: Row(children: const [ColorPalettesScreen()])), )); - expect(find.text("Light Theme"), findsOneWidget); - expect(find.text("Dark Theme"), findsOneWidget); + expect(find.text('Light Theme'), findsOneWidget); + expect(find.text('Dark Theme'), findsOneWidget); expect(find.byType(ColorGroup, skipOffstage: false), findsNWidgets(14)); }); } diff --git a/material_3_demo/test/component_screen_test.dart b/material_3_demo/test/component_screen_test.dart index 5a573d6e83a..769b87e8192 100644 --- a/material_3_demo/test/component_screen_test.dart +++ b/material_3_demo/test/component_screen_test.dart @@ -10,186 +10,216 @@ import 'package:material_3_demo/main.dart'; void main() { testWidgets('Default main page shows all M3 components', (tester) async { - await tester.pumpWidget(const Material3Demo()); + widgetSetup(tester, 800, windowHeight: 7000); + await tester.pumpWidget(const MaterialApp(home: Material3Demo())); // Elements on the app bar expect(find.text('Material 3'), findsOneWidget); - expect(find.widgetWithIcon(IconButton, Icons.wb_sunny_outlined), - findsOneWidget); - expect(find.widgetWithIcon(IconButton, Icons.filter_3), findsOneWidget); - expect(find.widgetWithIcon(IconButton, Icons.more_vert), findsOneWidget); + expect( + find.widgetWithIcon(AppBar, Icons.dark_mode_outlined), findsOneWidget); + expect(find.widgetWithIcon(AppBar, Icons.filter_2), findsOneWidget); + expect(find.widgetWithIcon(AppBar, Icons.palette_outlined), findsOneWidget); // Elements on the component screen // Buttons - expect(find.widgetWithText(ElevatedButton, "Elevated"), findsNWidgets(2)); - expect(find.widgetWithText(ElevatedButton, "Filled"), findsNWidgets(2)); - expect( - find.widgetWithText(ElevatedButton, "Filled Tonal"), findsNWidgets(2)); - expect(find.widgetWithText(OutlinedButton, "Outlined"), findsNWidgets(2)); - expect(find.widgetWithText(TextButton, "Text"), findsNWidgets(2)); - expect(find.text("Icon"), findsNWidgets(5)); + expect(find.widgetWithText(ElevatedButton, 'Elevated'), findsNWidgets(2)); + expect(find.widgetWithText(FilledButton, 'Filled'), findsNWidgets(2)); + expect(find.widgetWithText(FilledButton, 'Filled tonal'), findsNWidgets(2)); + expect(find.widgetWithText(OutlinedButton, 'Outlined'), findsNWidgets(2)); + expect(find.widgetWithText(TextButton, 'Text'), findsNWidgets(2)); + expect(find.widgetWithText(Buttons, 'Icon'), findsNWidgets(5)); + + // IconButtons + expect(find.byType(IconToggleButton), findsNWidgets(8)); // FABs - Finder floatingActionButton = find.text("Create"); - await tester.scrollUntilVisible( - floatingActionButton, - 500.0, - ); - expect( - find.widgetWithIcon(FloatingActionButton, Icons.add), findsNWidgets(4)); - expect(find.widgetWithText(FloatingActionButton, "Create"), findsOneWidget); + expect(find.byType(FloatingActionButton), + findsNWidgets(5)); // 2 more shows up in the bottom app bar. + expect(find.widgetWithText(FloatingActionButton, 'Create'), findsOneWidget); + + // Chips + expect(find.byType(ActionChip), + findsNWidgets(4)); // includes Assist and Suggestion chip. + expect(find.byType(FilterChip), findsNWidgets(2)); + expect(find.byType(InputChip), findsNWidgets(2)); // Cards - expect(find.widgetWithText(Card, "Elevated"), findsOneWidget); - expect(find.widgetWithText(Card, "Filled"), findsOneWidget); - expect(find.widgetWithText(Card, "Outlined"), findsOneWidget); + expect(find.widgetWithText(Cards, 'Elevated'), findsOneWidget); + expect(find.widgetWithText(Cards, 'Filled'), findsOneWidget); + expect(find.widgetWithText(Cards, 'Outlined'), findsOneWidget); + + // TextFields + expect(find.widgetWithText(TextField, 'Disabled'), findsNWidgets(2)); + expect(find.widgetWithText(TextField, 'Filled'), findsNWidgets(2)); + expect(find.widgetWithText(TextField, 'Outlined'), findsNWidgets(2)); // Alert Dialog - Finder dialogExample = find.widgetWithText(TextButton, "Open Dialog"); - await tester.scrollUntilVisible( - dialogExample, - 500.0, - ); + Finder dialogExample = find.widgetWithText(TextButton, 'Show dialog'); expect(dialogExample, findsOneWidget); + + // Switches + Finder switchExample = find.byType(Switch); + expect(switchExample, findsNWidgets(4)); + + // Checkboxes + Finder checkboxExample = find.byType(CheckboxListTile); + expect(checkboxExample, findsNWidgets(4)); + + // Radios + // TODO(guidezpl): Figure out why this isn't working + // Finder radioExample = find.byType(RadioListTile); + // expect(radioExample, findsNWidgets(4)); + + // ProgressIndicator + Finder circularProgressIndicator = find.byType(CircularProgressIndicator); + expect(circularProgressIndicator, findsOneWidget); + Finder linearProgressIndicator = find.byType(LinearProgressIndicator); + expect(linearProgressIndicator, findsOneWidget); }); testWidgets( - 'NavigationRail doesn\'t show when width value is small than 450 ' + 'NavigationRail doesn\'t show when width value is small than 1000 ' '(in Portrait mode or narrow screen)', (tester) async { - widgetSetup(tester, 449); - await tester.pumpWidget(const Material3Demo()); - - // When screen width is less than 450, NavigationBar will show. At the same - // time, the NavigationRail and the NavigationBar example will NOT show. - expect(find.byType(NavigationBars), findsOneWidget); - expect(find.widgetWithText(NavigationBar, "Components"), findsOneWidget); - expect(find.widgetWithText(NavigationBar, "Color"), findsOneWidget); - expect(find.widgetWithText(NavigationBar, "Typography"), findsOneWidget); - expect(find.widgetWithText(NavigationBar, "Elevation"), findsOneWidget); - - expect(find.byType(NavigationRailSection), findsNothing); - expect(find.widgetWithText(NavigationBar, "Explore"), findsNothing); - expect(find.widgetWithText(NavigationBar, "Pets"), findsNothing); - expect(find.widgetWithText(NavigationBar, "Account"), findsNothing); + widgetSetup(tester, 999, windowHeight: 7000); + await tester.pumpWidget(const MaterialApp(home: Material3Demo())); + await tester.pumpAndSettle(); + + // When screen width is less than 1000, NavigationBar will show. At the same + // time, the NavigationBar example still show up in the navigation group. + expect(find.byType(NavigationBars), + findsNWidgets(3)); // The real navBar, badges example and navBar example + expect(find.widgetWithText(NavigationBar, 'Components'), findsOneWidget); + expect(find.widgetWithText(NavigationBar, 'Color'), findsOneWidget); + expect(find.widgetWithText(NavigationBar, 'Typography'), findsOneWidget); + expect(find.widgetWithText(NavigationBar, 'Elevation'), findsOneWidget); + + expect(find.widgetWithText(NavigationBar, 'Explore'), findsOneWidget); + expect(find.widgetWithText(NavigationBar, 'Pets'), findsOneWidget); + expect(find.widgetWithText(NavigationBar, 'Account'), findsOneWidget); }); testWidgets( 'NavigationRail shows when width value is greater than or equal ' - 'to 450 (in Landscape mode or wider screen)', (tester) async { - widgetSetup(tester, 450); - await tester.pumpWidget(const Material3Demo()); - - // When screen width is greater than or equal to 450, NavigationRail and - // NavigationBar example will show. At the same time, the NavigationBar - // will NOT show. - expect(find.byType(NavigationRailSection), findsOneWidget); + 'to 1000 (in Landscape mode or wider screen)', (tester) async { + widgetSetup(tester, 1001, windowHeight: 3000); + await tester.pumpWidget(const MaterialApp(home: Material3Demo())); + await tester.pumpAndSettle(); + + // When screen width is greater than or equal to 1000, NavigationRail will show. + // At the same time, the NavigationBar will NOT show. + expect(find.byType(NavigationRail), findsOneWidget); expect(find.byType(Tooltip, skipOffstage: false), findsWidgets); - expect(find.widgetWithText(NavigationRailSection, "Components"), - findsOneWidget); - expect(find.widgetWithText(NavigationRailSection, "Color"), findsOneWidget); - expect(find.widgetWithText(NavigationRailSection, "Typography"), - findsOneWidget); - expect(find.widgetWithText(NavigationRailSection, "Elevation"), - findsOneWidget); - - final navbarExample = find.byType(NavigationBars); - await tester.scrollUntilVisible( - navbarExample, - 500.0, - ); - expect(find.byType(NavigationBars), findsOneWidget); - expect(find.widgetWithText(NavigationBar, "Explore"), findsOneWidget); - expect(find.widgetWithText(NavigationBar, "Pets"), findsOneWidget); - expect(find.widgetWithText(NavigationBar, "Account"), findsOneWidget); - - expect(find.widgetWithText(NavigationBar, "Components"), findsNothing); - expect(find.widgetWithText(NavigationBar, "Colors"), findsNothing); - expect(find.widgetWithText(NavigationBar, "Typography"), findsNothing); - expect(find.widgetWithText(NavigationBar, "Elevation"), findsNothing); + expect(find.widgetWithText(NavigationRail, 'Components'), findsOneWidget); + expect(find.widgetWithText(NavigationRail, 'Color'), findsOneWidget); + expect(find.widgetWithText(NavigationRail, 'Typography'), findsOneWidget); + expect(find.widgetWithText(NavigationRail, 'Elevation'), findsOneWidget); + + expect(find.widgetWithText(NavigationBar, 'Explore'), findsOneWidget); + expect(find.widgetWithText(NavigationBar, 'Pets'), findsOneWidget); + expect(find.widgetWithText(NavigationBar, 'Account'), findsOneWidget); + + // the Navigation bar should be out of screen. + final RenderBox box = + tester.renderObject(find.widgetWithText(NavigationBar, 'Components')); + expect(box.localToGlobal(Offset.zero), const Offset(0.0, 3080.0)); }); testWidgets( 'Material version switches between Material3 and Material2 when' 'the version icon is clicked', (tester) async { - await tester.pumpWidget(const Material3Demo()); - Finder m3Icon = find.widgetWithIcon(IconButton, Icons.filter_3); - Finder m2Icon = find.widgetWithIcon(IconButton, Icons.filter_2); + widgetSetup(tester, 450, windowHeight: 7000); + await tester.pumpWidget(const MaterialApp(home: Material3Demo())); BuildContext defaultElevatedButton = tester.firstElement(find.byType(ElevatedButton)); + BuildContext defaultIconButton = + tester.firstElement(find.byType(IconButton)); BuildContext defaultFAB = tester.firstElement(find.byType(FloatingActionButton)); - BuildContext defaultCard = tester.firstElement(find.byType(Card)); - Finder dialog = find.text("Open Dialog"); - await tester.scrollUntilVisible( - dialog, - 500.0, - ); + BuildContext defaultCard = + tester.firstElement(find.widgetWithText(Card, 'Elevated')); + BuildContext defaultChip = + tester.firstElement(find.widgetWithText(ActionChip, 'Assist')); + Finder dialog = find.text('Show dialog'); await tester.tap(dialog); await tester.pumpAndSettle(const Duration(microseconds: 500)); BuildContext defaultAlertDialog = tester.element(find.byType(AlertDialog)); expect(Theme.of(defaultAlertDialog).useMaterial3, true); - Finder dismiss = find.text("Dismiss"); - await tester.scrollUntilVisible( - dismiss, - 500.0, - ); + Finder dismiss = find.text('Okay'); await tester.tap(dismiss); await tester.pumpAndSettle(const Duration(microseconds: 500)); - expect(m3Icon, findsOneWidget); - expect(m2Icon, findsNothing); - expect(find.text("Material 3"), findsOneWidget); + expect(find.widgetWithIcon(AppBar, Icons.filter_2), findsOneWidget); + expect(find.widgetWithIcon(AppBar, Icons.filter_3), findsNothing); + expect(find.text('Material 3'), findsOneWidget); expect(Theme.of(defaultElevatedButton).useMaterial3, true); + expect(Theme.of(defaultIconButton).useMaterial3, true); expect(Theme.of(defaultFAB).useMaterial3, true); expect(Theme.of(defaultCard).useMaterial3, true); + expect(Theme.of(defaultChip).useMaterial3, true); - await tester.tap(m3Icon); + Finder appbarM3Icon = find.descendant( + of: find.byType(AppBar), + matching: find.widgetWithIcon(IconButton, Icons.filter_2)); + await tester.tap(appbarM3Icon); await tester.pumpAndSettle(const Duration(microseconds: 500)); BuildContext updatedElevatedButton = tester.firstElement(find.byType(ElevatedButton)); + BuildContext updatedIconButton = + tester.firstElement(find.byType(IconButton)); BuildContext updatedFAB = tester.firstElement(find.byType(FloatingActionButton)); BuildContext updatedCard = tester.firstElement(find.byType(Card)); - Finder updatedDialog = find.text("Open Dialog"); - await tester.scrollUntilVisible( - updatedDialog, - 500.0, - ); + BuildContext updatedChip = + tester.firstElement(find.widgetWithText(ActionChip, 'Assist')); + Finder updatedDialog = find.text('Show dialog'); await tester.tap(updatedDialog); await tester.pumpAndSettle(const Duration(microseconds: 500)); BuildContext updatedAlertDialog = tester.firstElement(find.byType(AlertDialog)); expect(Theme.of(updatedAlertDialog).useMaterial3, false); - Finder updatedDismiss = find.text("Dismiss"); - await tester.scrollUntilVisible( - updatedDismiss, - 500.0, - ); + Finder updatedDismiss = find.text('Dismiss'); await tester.tap(updatedDismiss); await tester.pumpAndSettle(const Duration(microseconds: 500)); - expect(m3Icon, findsNothing); - expect(m2Icon, findsOneWidget); - expect(find.text("Material 2"), findsOneWidget); + expect(find.widgetWithIcon(AppBar, Icons.filter_3), findsOneWidget); + expect(find.widgetWithIcon(AppBar, Icons.filter_2), findsNothing); + expect(find.text('Material 2'), findsOneWidget); expect(Theme.of(updatedElevatedButton).useMaterial3, false); + expect(Theme.of(updatedIconButton).useMaterial3, false); expect(Theme.of(updatedFAB).useMaterial3, false); expect(Theme.of(updatedCard).useMaterial3, false); + expect(Theme.of(updatedChip).useMaterial3, false); }); testWidgets( 'Other screens become Material2 mode after changing mode from ' 'main screen', (tester) async { - await tester.pumpWidget(const Material3Demo()); - await tester.tap(find.widgetWithIcon(IconButton, Icons.filter_3)); - await tester.tap(find.byIcon(Icons.format_paint_outlined)); + await tester.pumpWidget(const MaterialApp(home: Material3Demo())); + Finder appbarM2Icon = find.descendant( + of: find.byType(AppBar), + matching: find.widgetWithIcon(IconButton, Icons.filter_2)); + await tester.tap(appbarM2Icon); + Finder secondScreenIcon = find.descendant( + of: find.byType(NavigationBar), + matching: find.widgetWithIcon( + NavigationDestination, Icons.format_paint_outlined)); + await tester.tap(secondScreenIcon); await tester.pumpAndSettle(const Duration(microseconds: 500)); - BuildContext lightThemeText = tester.element(find.text("Light Theme")); + BuildContext lightThemeText = tester.element(find.text('Light Theme')); expect(Theme.of(lightThemeText).useMaterial3, false); - await tester.tap(find.byIcon(Icons.text_snippet_outlined)); + Finder thirdScreenIcon = find.descendant( + of: find.byType(NavigationBar), + matching: find.widgetWithIcon( + NavigationDestination, Icons.text_snippet_outlined)); + await tester.tap(thirdScreenIcon); await tester.pumpAndSettle(const Duration(microseconds: 500)); - BuildContext displayLargeText = tester.element(find.text("Display Large")); + BuildContext displayLargeText = tester.element(find.text('Display Large')); expect(Theme.of(displayLargeText).useMaterial3, false); - await tester.tap(find.byIcon(Icons.invert_colors_on_outlined)); + Finder fourthScreenIcon = find.descendant( + of: find.byType(NavigationBar), + matching: find.widgetWithIcon( + NavigationDestination, Icons.invert_colors_on_outlined)); + await tester.tap(fourthScreenIcon); await tester.pumpAndSettle(const Duration(microseconds: 500)); BuildContext material = tester.firstElement(find.byType(Material)); expect(Theme.of(material).useMaterial3, false); @@ -198,25 +228,30 @@ void main() { testWidgets( 'Brightness mode switches between dark and light when' 'the brightness icon is clicked', (tester) async { - await tester.pumpWidget(const Material3Demo()); - Finder lightIcon = find.widgetWithIcon(IconButton, Icons.wb_sunny_outlined); - Finder darkIcon = find.widgetWithIcon(IconButton, Icons.wb_sunny); - BuildContext appBar = tester.element(find.byType(AppBar)); - BuildContext body = tester.element(find.byType(Scaffold)); - BuildContext navigationRail = tester.element(find.byType(NavigationRail)); - expect(lightIcon, findsOneWidget); - expect(darkIcon, findsNothing); + await tester.pumpWidget(const MaterialApp(home: Material3Demo())); + Finder lightIcon = find.descendant( + of: find.byType(AppBar), + matching: find.widgetWithIcon(IconButton, Icons.light_mode_outlined)); + Finder darkIcon = find.descendant( + of: find.byType(AppBar), + matching: find.widgetWithIcon(IconButton, Icons.dark_mode_outlined)); + BuildContext appBar = tester.element(find.byType(AppBar).first); + BuildContext body = tester.firstElement(find.byType(Scaffold).first); + BuildContext navigationRail = tester.element( + find.widgetWithIcon(NavigationRail, Icons.format_paint_outlined)); + expect(darkIcon, findsOneWidget); + expect(lightIcon, findsNothing); expect(Theme.of(appBar).brightness, Brightness.light); expect(Theme.of(body).brightness, Brightness.light); expect(Theme.of(navigationRail).brightness, Brightness.light); - await tester.tap(lightIcon); + await tester.tap(darkIcon); await tester.pumpAndSettle(const Duration(microseconds: 500)); - BuildContext appBar2 = tester.element(find.byType(AppBar)); - BuildContext body2 = tester.element(find.byType(Scaffold)); + BuildContext appBar2 = tester.element(find.byType(AppBar).first); + BuildContext body2 = tester.element(find.byType(Scaffold).first); BuildContext navigationRail2 = tester.element(find.byType(NavigationRail)); - expect(lightIcon, findsNothing); - expect(darkIcon, findsOneWidget); + expect(darkIcon, findsNothing); + expect(lightIcon, findsOneWidget); expect(Theme.of(appBar2).brightness, Brightness.dark); expect(Theme.of(body2).brightness, Brightness.dark); expect(Theme.of(navigationRail2).brightness, Brightness.dark); @@ -224,10 +259,15 @@ void main() { testWidgets('Color theme changes when a color is selected from menu', (tester) async { - await tester.pumpWidget(const Material3Demo()); - Finder menuIcon = find.widgetWithIcon(IconButton, Icons.more_vert); - BuildContext appBar = tester.element(find.byType(AppBar)); - BuildContext body = tester.element(find.byType(Scaffold)); + Color m3BaseColor = const Color(0xff6750a4); + await tester.pumpWidget(Container()); + await tester.pumpWidget(const MaterialApp(home: Material3Demo())); + await tester.pump(); + Finder menuIcon = find.descendant( + of: find.byType(AppBar), + matching: find.widgetWithIcon(IconButton, Icons.palette_outlined)); + BuildContext appBar = tester.element(find.byType(AppBar).first); + BuildContext body = tester.element(find.byType(Scaffold).first); BuildContext navigationRail = tester.element(find.byType(NavigationRail)); expect(Theme.of(appBar).primaryColor, m3BaseColor); @@ -235,11 +275,11 @@ void main() { expect(Theme.of(navigationRail).primaryColor, m3BaseColor); await tester.tap(menuIcon); await tester.pumpAndSettle(); - await tester.tap(find.text("Blue")); + await tester.tap(find.text('Blue').last); await tester.pumpAndSettle(); - BuildContext appBar2 = tester.element(find.byType(AppBar)); - BuildContext body2 = tester.element(find.byType(Scaffold)); + BuildContext appBar2 = tester.element(find.byType(AppBar).first); + BuildContext body2 = tester.element(find.byType(Scaffold).first); BuildContext navigationRail2 = tester.element(find.byType(NavigationRail)); ThemeData expectedTheme = ThemeData(colorSchemeSeed: Colors.blue); expect(Theme.of(appBar2).primaryColor, expectedTheme.primaryColor); @@ -248,9 +288,11 @@ void main() { }); } -void widgetSetup(WidgetTester tester, double width) { - const height = 846; +void widgetSetup(WidgetTester tester, double windowWidth, + {double? windowHeight}) { + final height = windowHeight ?? 846; tester.binding.window.devicePixelRatioTestValue = (2); final dpi = tester.binding.window.devicePixelRatio; - tester.binding.window.physicalSizeTestValue = Size(width * dpi, height * dpi); + tester.binding.window.physicalSizeTestValue = + Size(windowWidth * dpi, height * dpi); } diff --git a/material_3_demo/test/elevation_screen_test.dart b/material_3_demo/test/elevation_screen_test.dart index 8bb89229171..14f3cac2c13 100644 --- a/material_3_demo/test/elevation_screen_test.dart +++ b/material_3_demo/test/elevation_screen_test.dart @@ -16,43 +16,54 @@ void main() { 'selected on NavigationBar', (tester) async { widgetSetup(tester, 449); addTearDown(tester.binding.window.clearPhysicalSizeTestValue); - await tester.pumpWidget(const Material3Demo()); + await tester.pumpWidget(const MaterialApp(home: Material3Demo())); - expect(find.text("Surface Tint only"), findsNothing); + expect(find.text('Surface Tint Color Only'), findsNothing); expect(find.byType(NavigationBar), findsOneWidget); - Finder tintIconOnBar = find.byIcon(Icons.invert_colors_on_outlined); + Finder tintIconOnBar = find.descendant( + of: find.byType(NavigationBar), + matching: find.widgetWithIcon( + NavigationDestination, Icons.invert_colors_on_outlined)); expect(tintIconOnBar, findsOneWidget); await tester.tap(tintIconOnBar); await tester.pumpAndSettle(const Duration(microseconds: 500)); expect(tintIconOnBar, findsNothing); - expect(find.byIcon(Icons.opacity), findsOneWidget); - expect(find.text("Surface Tint only"), findsOneWidget); + Finder selectedTintIconOnBar = find.descendant( + of: find.byType(NavigationBar), + matching: find.widgetWithIcon(NavigationDestination, Icons.opacity)); + expect(selectedTintIconOnBar, findsOneWidget); + expect(find.text('Surface Tint Color Only'), findsOneWidget); }); testWidgets( 'Surface Tones screen shows correctly when the corresponding icon is ' 'selected on NavigationRail', (tester) async { - widgetSetup(tester, 450); // NavigationRail shows only when width is >= 450. + widgetSetup( + tester, 1200); // NavigationRail shows only when width is > 1000. addTearDown(tester.binding.window.clearPhysicalSizeTestValue); - await tester.pumpWidget(const Material3Demo()); - expect(find.text("Surface Tint only"), findsNothing); + await tester.pumpWidget(const MaterialApp(home: Material3Demo())); + expect(find.text('Surface Tint Color Only'), findsNothing); expect(find.byType(NavigationRail), findsOneWidget); - Finder tintIconOnRail = find.byIcon(Icons.invert_colors_on_outlined); + Finder tintIconOnRail = find.descendant( + of: find.byType(NavigationRail), + matching: find.byIcon(Icons.invert_colors_on_outlined)); expect(tintIconOnRail, findsOneWidget); await tester.tap(tintIconOnRail); await tester.pumpAndSettle(const Duration(microseconds: 500)); expect(tintIconOnRail, findsNothing); - expect(find.byIcon(Icons.opacity), findsOneWidget); - expect(find.text("Surface Tint only"), findsOneWidget); + Finder selectedTintIconOnRail = find.descendant( + of: find.byType(NavigationRail), matching: find.byIcon(Icons.opacity)); + expect(selectedTintIconOnRail, findsOneWidget); + expect(find.text('Surface Tint Color Only'), findsOneWidget); }); testWidgets('Surface Tones screen shows correct content', (tester) async { await tester.pumpWidget(MaterialApp( home: Scaffold(body: Row(children: const [ElevationScreen()])), )); - expect(find.text("Surface Tint only"), findsOneWidget); - expect(find.text("Surface Tint and Shadow"), findsOneWidget); - expect(find.text("Shadow only"), findsOneWidget); + expect(find.text('Surface Tint Color Only'), findsOneWidget); + expect(find.text('Surface Tint Color and Shadow Color'), findsOneWidget); + expect(find.text('Shadow Color Only'), findsOneWidget); expect(find.byType(ElevationGrid), findsNWidgets(3)); expect(find.byType(ElevationCard), findsNWidgets(18)); }); diff --git a/material_3_demo/test/typography_screen_test.dart b/material_3_demo/test/typography_screen_test.dart index bbf340f4740..257a37e5bf4 100644 --- a/material_3_demo/test/typography_screen_test.dart +++ b/material_3_demo/test/typography_screen_test.dart @@ -16,59 +16,70 @@ void main() { 'selected on NavigationBar', (tester) async { widgetSetup(tester, 449); addTearDown(tester.binding.window.clearPhysicalSizeTestValue); - await tester.pumpWidget(const Material3Demo()); + await tester.pumpWidget(const MaterialApp(home: Material3Demo())); - expect(find.text("Display Large"), findsNothing); + expect(find.text('Display Large'), findsNothing); expect(find.byType(NavigationBar), findsOneWidget); - Finder textIconOnBar = find.byIcon(Icons.text_snippet_outlined); + Finder textIconOnBar = find.descendant( + of: find.byType(NavigationBar), + matching: find.byIcon(Icons.text_snippet_outlined)); expect(textIconOnBar, findsOneWidget); await tester.tap(textIconOnBar); await tester.pumpAndSettle(const Duration(microseconds: 500)); expect(textIconOnBar, findsNothing); - expect(find.byIcon(Icons.text_snippet), findsOneWidget); - expect(find.text("Display Large"), findsOneWidget); + Finder selectedTextIconOnBar = find.descendant( + of: find.byType(NavigationBar), + matching: find.byIcon(Icons.text_snippet)); + expect(selectedTextIconOnBar, findsOneWidget); + expect(find.text('Display Large'), findsOneWidget); }); testWidgets( 'Typography screen shows correctly when the corresponding icon is ' 'selected on NavigationRail', (tester) async { - widgetSetup(tester, 450); // NavigationRail shows only when width is >= 450. + widgetSetup( + tester, 1200); // NavigationRail shows only when width is > 1000. addTearDown(tester.binding.window.clearPhysicalSizeTestValue); - await tester.pumpWidget(const Material3Demo()); - expect(find.text("Display Large"), findsNothing); + await tester.pumpWidget(const MaterialApp(home: Material3Demo())); + expect(find.text('Display Large'), findsNothing); expect(find.byType(NavigationRail), findsOneWidget); - Finder textIconOnRail = find.byIcon(Icons.text_snippet_outlined); + Finder textIconOnRail = find.descendant( + of: find.byType(NavigationRail), + matching: find.byIcon(Icons.text_snippet_outlined)); expect(textIconOnRail, findsOneWidget); await tester.tap(textIconOnRail); await tester.pumpAndSettle(const Duration(microseconds: 500)); expect(textIconOnRail, findsNothing); - expect(find.byIcon(Icons.text_snippet), findsOneWidget); - expect(find.text("Display Large"), findsOneWidget); + Finder selectedTextIconOnRail = find.descendant( + of: find.byType(NavigationRail), + matching: find.byIcon(Icons.text_snippet)); + expect(selectedTextIconOnRail, findsOneWidget); + expect(find.text('Display Large'), findsOneWidget); }); testWidgets('Typography screen shows correct content', (tester) async { await tester.pumpWidget(MaterialApp( home: Scaffold(body: Row(children: const [TypographyScreen()])), )); - expect(find.text("Display Large"), findsOneWidget); - expect(find.text("Display Medium"), findsOneWidget); - expect(find.text("Display Small"), findsOneWidget); - expect(find.text("Headline Large"), findsOneWidget); - expect(find.text("Headline Medium"), findsOneWidget); - expect(find.text("Headline Small"), findsOneWidget); - expect(find.text("Title Large"), findsOneWidget); - expect(find.text("Title Medium"), findsOneWidget); - expect(find.text("Title Small"), findsOneWidget); + expect(find.text('Display Large'), findsOneWidget); + expect(find.text('Display Medium'), findsOneWidget); + expect(find.text('Display Small'), findsOneWidget); + expect(find.text('Headline Large'), findsOneWidget); + expect(find.text('Headline Medium'), findsOneWidget); + expect(find.text('Headline Small'), findsOneWidget); + expect(find.text('Title Large'), findsOneWidget); + expect(find.text('Title Medium'), findsOneWidget); + expect(find.text('Title Small'), findsOneWidget); await tester.scrollUntilVisible( - find.text("Body Small"), + find.text('Body Small'), 500.0, ); - expect(find.text("Label Large"), findsOneWidget); - expect(find.text("Label Medium"), findsOneWidget); - expect(find.text("Label Small"), findsOneWidget); - expect(find.text("Body Large"), findsOneWidget); - expect(find.text("Body Medium"), findsOneWidget); - expect(find.text("Body Small"), findsOneWidget); + expect(find.text('Label Large'), findsOneWidget); + expect(find.text('Label Medium'), findsOneWidget); + expect(find.text('Label Small'), findsOneWidget); + expect(find.text('Body Large'), findsOneWidget); + expect(find.text('Body Medium'), findsOneWidget); + expect(find.text('Body Small'), findsOneWidget); expect(find.byType(TextStyleExample), findsNWidgets(15)); }); diff --git a/navigation_and_routing/.metadata b/navigation_and_routing/.metadata index 31b763f97f2..d680382e18c 100644 --- a/navigation_and_routing/.metadata +++ b/navigation_and_routing/.metadata @@ -4,8 +4,8 @@ # This file should be version controlled. version: - revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - channel: stable + revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + channel: beta project_type: app @@ -13,26 +13,26 @@ project_type: app migration: platforms: - platform: root - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: android - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: ios - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: linux - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: macos - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: web - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: windows - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 # User provided section diff --git a/navigation_and_routing/android/app/build.gradle b/navigation_and_routing/android/app/build.gradle index 7659e247ff2..04490c21854 100644 --- a/navigation_and_routing/android/app/build.gradle +++ b/navigation_and_routing/android/app/build.gradle @@ -46,7 +46,7 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "dev.flutter.navigation_and_routing" // You can update the following values to match your application needs. - // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. + // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. minSdkVersion flutter.minSdkVersion targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() diff --git a/navigation_and_routing/android/build.gradle b/navigation_and_routing/android/build.gradle index 83ae220041c..58a8c74b147 100644 --- a/navigation_and_routing/android/build.gradle +++ b/navigation_and_routing/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.6.10' + ext.kotlin_version = '1.7.10' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.1.2' + classpath 'com.android.tools.build:gradle:7.2.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/navigation_and_routing/android/gradle/wrapper/gradle-wrapper.properties b/navigation_and_routing/android/gradle/wrapper/gradle-wrapper.properties index cb24abda10a..3c472b99c6f 100644 --- a/navigation_and_routing/android/gradle/wrapper/gradle-wrapper.properties +++ b/navigation_and_routing/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip diff --git a/navigation_and_routing/codelab_rebuild.yaml b/navigation_and_routing/codelab_rebuild.yaml index d9c4dc47fb1..ab57d0a52b8 100644 --- a/navigation_and_routing/codelab_rebuild.yaml +++ b/navigation_and_routing/codelab_rebuild.yaml @@ -11,6 +11,9 @@ steps: - windows - name: Flutter recreate flutter: create --org dev.flutter . + - name: Strip DEVELOPMENT_TEAM + strip-lines-containing: DEVELOPMENT_TEAM = + path: ios/Runner.xcodeproj/project.pbxproj - name: Patch web/index.html path: web/index.html patch-u: | diff --git a/navigation_and_routing/ios/Runner.xcodeproj/project.pbxproj b/navigation_and_routing/ios/Runner.xcodeproj/project.pbxproj index 61215d506f1..e180961dd77 100644 --- a/navigation_and_routing/ios/Runner.xcodeproj/project.pbxproj +++ b/navigation_and_routing/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -171,6 +171,7 @@ /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -185,6 +186,7 @@ }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -478,4 +480,4 @@ /* End XCConfigurationList section */ }; rootObject = 97C146E61CF9000F007C117D /* Project object */; -} +} \ No newline at end of file diff --git a/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png index 28c6bf03016..7353c41ecf9 100644 Binary files a/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and b/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png index 2ccbfd967d9..797d452e458 100644 Binary files a/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and b/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png index f091b6b0bca..6ed2d933e11 100644 Binary files a/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and b/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png index 4cde12118dd..4cd7b0099ca 100644 Binary files a/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and b/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png index d0ef06e7edb..fe730945a01 100644 Binary files a/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and b/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png index dcdc2306c28..321773cd857 100644 Binary files a/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and b/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png index 2ccbfd967d9..797d452e458 100644 Binary files a/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and b/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png index c8f9ed8f5ce..502f463a9bc 100644 Binary files a/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and b/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png index a6d6b8609df..0ec30343922 100644 Binary files a/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and b/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png index a6d6b8609df..0ec30343922 100644 Binary files a/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and b/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png index 75b2d164a5a..e9f5fea27c7 100644 Binary files a/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and b/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png index c4df70d39da..84ac32ae7d9 100644 Binary files a/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and b/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png index 6a84f41e14e..8953cba0906 100644 Binary files a/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and b/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png index d0e1f585360..0467bf12aa4 100644 Binary files a/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and b/navigation_and_routing/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/navigation_and_routing/macos/Podfile b/navigation_and_routing/macos/Podfile index dade8dfad0d..049abe29542 100644 --- a/navigation_and_routing/macos/Podfile +++ b/navigation_and_routing/macos/Podfile @@ -1,4 +1,4 @@ -platform :osx, '10.11' +platform :osx, '10.14' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/navigation_and_routing/macos/Runner.xcodeproj/project.pbxproj b/navigation_and_routing/macos/Runner.xcodeproj/project.pbxproj index b2a4ce02ebc..32eb7587fec 100644 --- a/navigation_and_routing/macos/Runner.xcodeproj/project.pbxproj +++ b/navigation_and_routing/macos/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 54; objects = { /* Begin PBXAggregateTarget section */ @@ -235,6 +235,7 @@ /* Begin PBXShellScriptBuildPhase section */ 3399D490228B24CF009A79C7 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -344,7 +345,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; @@ -423,7 +424,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; @@ -470,7 +471,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; diff --git a/navigation_and_routing/macos/Runner/Configs/AppInfo.xcconfig b/navigation_and_routing/macos/Runner/Configs/AppInfo.xcconfig index db43dccc0a6..57da72ec3ad 100644 --- a/navigation_and_routing/macos/Runner/Configs/AppInfo.xcconfig +++ b/navigation_and_routing/macos/Runner/Configs/AppInfo.xcconfig @@ -11,4 +11,4 @@ PRODUCT_NAME = navigation_and_routing PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.navigationAndRouting // The copyright displayed in application information -PRODUCT_COPYRIGHT = Copyright © 2022 dev.flutter. All rights reserved. +PRODUCT_COPYRIGHT = Copyright © 2023 dev.flutter. All rights reserved. diff --git a/navigation_and_routing/web/index.html b/navigation_and_routing/web/index.html index bfaefe26ae6..90dfe9209b4 100644 --- a/navigation_and_routing/web/index.html +++ b/navigation_and_routing/web/index.html @@ -46,11 +46,12 @@ _flutter.loader.loadEntrypoint({ serviceWorker: { serviceWorkerVersion: serviceWorkerVersion, + }, + onEntrypointLoaded: function(engineInitializer) { + engineInitializer.initializeEngine().then(function(appRunner) { + appRunner.runApp(); + }); } - }).then(function(engineInitializer) { - return engineInitializer.initializeEngine(); - }).then(function(appRunner) { - return appRunner.runApp(); }); }); diff --git a/navigation_and_routing/windows/runner/CMakeLists.txt b/navigation_and_routing/windows/runner/CMakeLists.txt index 17411a8ab8e..394917c053a 100644 --- a/navigation_and_routing/windows/runner/CMakeLists.txt +++ b/navigation_and_routing/windows/runner/CMakeLists.txt @@ -33,6 +33,7 @@ target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") # Add dependency libraries and include directories. Add any application-specific # dependencies here. target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) +target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") # Run the Flutter tool portions of the build. This must not be removed. diff --git a/navigation_and_routing/windows/runner/Runner.rc b/navigation_and_routing/windows/runner/Runner.rc index 0434c99e38b..d97574e4e0c 100644 --- a/navigation_and_routing/windows/runner/Runner.rc +++ b/navigation_and_routing/windows/runner/Runner.rc @@ -93,7 +93,7 @@ BEGIN VALUE "FileDescription", "navigation_and_routing" "\0" VALUE "FileVersion", VERSION_AS_STRING "\0" VALUE "InternalName", "navigation_and_routing" "\0" - VALUE "LegalCopyright", "Copyright (C) 2022 dev.flutter. All rights reserved." "\0" + VALUE "LegalCopyright", "Copyright (C) 2023 dev.flutter. All rights reserved." "\0" VALUE "OriginalFilename", "navigation_and_routing.exe" "\0" VALUE "ProductName", "navigation_and_routing" "\0" VALUE "ProductVersion", VERSION_AS_STRING "\0" diff --git a/navigation_and_routing/windows/runner/flutter_window.cpp b/navigation_and_routing/windows/runner/flutter_window.cpp index b43b9095ea3..b25e363efa4 100644 --- a/navigation_and_routing/windows/runner/flutter_window.cpp +++ b/navigation_and_routing/windows/runner/flutter_window.cpp @@ -26,6 +26,11 @@ bool FlutterWindow::OnCreate() { } RegisterPlugins(flutter_controller_->engine()); SetChildContent(flutter_controller_->view()->GetNativeWindow()); + + flutter_controller_->engine()->SetNextFrameCallback([&]() { + this->Show(); + }); + return true; } diff --git a/navigation_and_routing/windows/runner/main.cpp b/navigation_and_routing/windows/runner/main.cpp index 719a9884ea3..3911285347e 100644 --- a/navigation_and_routing/windows/runner/main.cpp +++ b/navigation_and_routing/windows/runner/main.cpp @@ -27,7 +27,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, FlutterWindow window(project); Win32Window::Point origin(10, 10); Win32Window::Size size(1280, 720); - if (!window.CreateAndShow(L"navigation_and_routing", origin, size)) { + if (!window.Create(L"navigation_and_routing", origin, size)) { return EXIT_FAILURE; } window.SetQuitOnClose(true); diff --git a/navigation_and_routing/windows/runner/win32_window.cpp b/navigation_and_routing/windows/runner/win32_window.cpp index c10f08dc7da..041a3855474 100644 --- a/navigation_and_routing/windows/runner/win32_window.cpp +++ b/navigation_and_routing/windows/runner/win32_window.cpp @@ -1,13 +1,31 @@ #include "win32_window.h" +#include #include #include "resource.h" namespace { +/// Window attribute that enables dark mode window decorations. +/// +/// Redefined in case the developer's machine has a Windows SDK older than +/// version 10.0.22000.0. +/// See: https://docs.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute +#ifndef DWMWA_USE_IMMERSIVE_DARK_MODE +#define DWMWA_USE_IMMERSIVE_DARK_MODE 20 +#endif + constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; +/// Registry key for app theme preference. +/// +/// A value of 0 indicates apps should use dark mode. A non-zero or missing +/// value indicates apps should use light mode. +constexpr const wchar_t kGetPreferredBrightnessRegKey[] = + L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; +constexpr const wchar_t kGetPreferredBrightnessRegValue[] = L"AppsUseLightTheme"; + // The number of Win32Window objects that currently exist. static int g_active_window_count = 0; @@ -31,8 +49,8 @@ void EnableFullDpiSupportIfAvailable(HWND hwnd) { GetProcAddress(user32_module, "EnableNonClientDpiScaling")); if (enable_non_client_dpi_scaling != nullptr) { enable_non_client_dpi_scaling(hwnd); - FreeLibrary(user32_module); } + FreeLibrary(user32_module); } } // namespace @@ -102,9 +120,9 @@ Win32Window::~Win32Window() { Destroy(); } -bool Win32Window::CreateAndShow(const std::wstring& title, - const Point& origin, - const Size& size) { +bool Win32Window::Create(const std::wstring& title, + const Point& origin, + const Size& size) { Destroy(); const wchar_t* window_class = @@ -117,7 +135,7 @@ bool Win32Window::CreateAndShow(const std::wstring& title, double scale_factor = dpi / 96.0; HWND window = CreateWindow( - window_class, title.c_str(), WS_OVERLAPPEDWINDOW | WS_VISIBLE, + window_class, title.c_str(), WS_OVERLAPPEDWINDOW, Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), Scale(size.width, scale_factor), Scale(size.height, scale_factor), nullptr, nullptr, GetModuleHandle(nullptr), this); @@ -126,9 +144,15 @@ bool Win32Window::CreateAndShow(const std::wstring& title, return false; } + UpdateTheme(window); + return OnCreate(); } +bool Win32Window::Show() { + return ShowWindow(window_handle_, SW_SHOWNORMAL); +} + // static LRESULT CALLBACK Win32Window::WndProc(HWND const window, UINT const message, @@ -188,6 +212,10 @@ Win32Window::MessageHandler(HWND hwnd, SetFocus(child_content_); } return 0; + + case WM_DWMCOLORIZATIONCOLORCHANGED: + UpdateTheme(hwnd); + return 0; } return DefWindowProc(window_handle_, message, wparam, lparam); @@ -243,3 +271,18 @@ bool Win32Window::OnCreate() { void Win32Window::OnDestroy() { // No-op; provided for subclasses. } + +void Win32Window::UpdateTheme(HWND const window) { + DWORD light_mode; + DWORD light_mode_size = sizeof(light_mode); + LSTATUS result = RegGetValue(HKEY_CURRENT_USER, kGetPreferredBrightnessRegKey, + kGetPreferredBrightnessRegValue, + RRF_RT_REG_DWORD, nullptr, &light_mode, + &light_mode_size); + + if (result == ERROR_SUCCESS) { + BOOL enable_dark_mode = light_mode == 0; + DwmSetWindowAttribute(window, DWMWA_USE_IMMERSIVE_DARK_MODE, + &enable_dark_mode, sizeof(enable_dark_mode)); + } +} diff --git a/navigation_and_routing/windows/runner/win32_window.h b/navigation_and_routing/windows/runner/win32_window.h index 17ba431125b..c86632d8a6b 100644 --- a/navigation_and_routing/windows/runner/win32_window.h +++ b/navigation_and_routing/windows/runner/win32_window.h @@ -28,15 +28,16 @@ class Win32Window { Win32Window(); virtual ~Win32Window(); - // Creates and shows a win32 window with |title| and position and size using + // Creates a win32 window with |title| that is positioned and sized using // |origin| and |size|. New windows are created on the default monitor. Window // sizes are specified to the OS in physical pixels, hence to ensure a - // consistent size to will treat the width height passed in to this function - // as logical pixels and scale to appropriate for the default monitor. Returns - // true if the window was created successfully. - bool CreateAndShow(const std::wstring& title, - const Point& origin, - const Size& size); + // consistent size this function will scale the inputted width and height as + // as appropriate for the default monitor. The window is invisible until + // |Show| is called. Returns true if the window was created successfully. + bool Create(const std::wstring& title, const Point& origin, const Size& size); + + // Show the current window. Returns true if the window was successfully shown. + bool Show(); // Release OS resources associated with window. void Destroy(); @@ -86,6 +87,9 @@ class Win32Window { // Retrieves a class instance pointer for |window| static Win32Window* GetThisFromHandle(HWND const window) noexcept; + // Update the window frame's theme to match the system theme. + static void UpdateTheme(HWND const window); + bool quit_on_close_ = false; // window handle for top level window. diff --git a/place_tracker/.metadata b/place_tracker/.metadata index af040ba02a1..56886885ada 100644 --- a/place_tracker/.metadata +++ b/place_tracker/.metadata @@ -4,8 +4,8 @@ # This file should be version controlled. version: - revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - channel: stable + revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + channel: beta project_type: app @@ -13,17 +13,17 @@ project_type: app migration: platforms: - platform: root - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: android - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: ios - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: web - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 # User provided section diff --git a/place_tracker/android/app/build.gradle b/place_tracker/android/app/build.gradle index 70482972859..b5ab0a2a46c 100644 --- a/place_tracker/android/app/build.gradle +++ b/place_tracker/android/app/build.gradle @@ -46,7 +46,7 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "dev.flutter.place_tracker" // You can update the following values to match your application needs. - // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. + // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. minSdkVersion flutter.minSdkVersion targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() diff --git a/place_tracker/android/build.gradle b/place_tracker/android/build.gradle index 83ae220041c..58a8c74b147 100644 --- a/place_tracker/android/build.gradle +++ b/place_tracker/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.6.10' + ext.kotlin_version = '1.7.10' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.1.2' + classpath 'com.android.tools.build:gradle:7.2.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/place_tracker/android/gradle/wrapper/gradle-wrapper.properties b/place_tracker/android/gradle/wrapper/gradle-wrapper.properties index cb24abda10a..3c472b99c6f 100644 --- a/place_tracker/android/gradle/wrapper/gradle-wrapper.properties +++ b/place_tracker/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip diff --git a/place_tracker/codelab_rebuild.yaml b/place_tracker/codelab_rebuild.yaml index e26198ac2b7..92f5731f8ff 100644 --- a/place_tracker/codelab_rebuild.yaml +++ b/place_tracker/codelab_rebuild.yaml @@ -8,6 +8,9 @@ steps: - web - name: Rebuild Runner flutter: create --org dev.flutter --platform android,ios,web . + - name: Strip DEVELOPMENT_TEAM + strip-lines-containing: DEVELOPMENT_TEAM = + path: ios/Runner.xcodeproj/project.pbxproj - name: Update deps flutter: pub upgrade --major-versions - name: Patch android/app/src/main/AndroidManifest.xml @@ -74,3 +77,6 @@ steps: # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' + - name: Build iOS simulator bundle + platforms: [ macos ] + flutter: build ios --simulator diff --git a/place_tracker/ios/Runner.xcodeproj/project.pbxproj b/place_tracker/ios/Runner.xcodeproj/project.pbxproj index d83354220df..9d42eb3d796 100644 --- a/place_tracker/ios/Runner.xcodeproj/project.pbxproj +++ b/place_tracker/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -13,6 +13,7 @@ 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; + FD257B9AFC26F20EF95399A6 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 030844B556B92CAB93247FCD /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -29,12 +30,16 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 030844B556B92CAB93247FCD /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 10DA7636174A8CCA366BC3EC /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 42882CC38FD55F3B0AA21215 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 7FBFBACD752E73C606BCB05F /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -49,12 +54,32 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + FD257B9AFC26F20EF95399A6 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 0965E239963A71287DC08CF0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 030844B556B92CAB93247FCD /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 71012C096D381D2157389CB4 /* Pods */ = { + isa = PBXGroup; + children = ( + 7FBFBACD752E73C606BCB05F /* Pods-Runner.debug.xcconfig */, + 10DA7636174A8CCA366BC3EC /* Pods-Runner.release.xcconfig */, + 42882CC38FD55F3B0AA21215 /* Pods-Runner.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -72,6 +97,8 @@ 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, + 71012C096D381D2157389CB4 /* Pods */, + 0965E239963A71287DC08CF0 /* Frameworks */, ); sourceTree = ""; }; @@ -105,12 +132,14 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( + BF1E106F26106C23A66FEBC7 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + 039E51B57830741D102B2CE8 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -169,8 +198,26 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 039E51B57830741D102B2CE8 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Copy Pods Resources"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -185,6 +232,7 @@ }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -197,6 +245,28 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; + BF1E106F26106C23A66FEBC7 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ diff --git a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png index 28c6bf03016..7353c41ecf9 100644 Binary files a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png index 2ccbfd967d9..797d452e458 100644 Binary files a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png index f091b6b0bca..6ed2d933e11 100644 Binary files a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png index 4cde12118dd..4cd7b0099ca 100644 Binary files a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png index d0ef06e7edb..fe730945a01 100644 Binary files a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png index dcdc2306c28..321773cd857 100644 Binary files a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png index 2ccbfd967d9..797d452e458 100644 Binary files a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png index c8f9ed8f5ce..502f463a9bc 100644 Binary files a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png index a6d6b8609df..0ec30343922 100644 Binary files a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png index a6d6b8609df..0ec30343922 100644 Binary files a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png index 75b2d164a5a..e9f5fea27c7 100644 Binary files a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png index c4df70d39da..84ac32ae7d9 100644 Binary files a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png index 6a84f41e14e..8953cba0906 100644 Binary files a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png index d0e1f585360..0467bf12aa4 100644 Binary files a/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and b/place_tracker/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/place_tracker/pubspec.yaml b/place_tracker/pubspec.yaml index 7ef8e273451..76dfcc47dcc 100644 --- a/place_tracker/pubspec.yaml +++ b/place_tracker/pubspec.yaml @@ -4,7 +4,7 @@ description: A new Flutter project. version: 1.0.0+1 environment: - sdk: ">=2.17.0-0 <3.0.0" + sdk: ">=2.18.0 <3.0.0" dependencies: flutter: diff --git a/place_tracker/web/index.html b/place_tracker/web/index.html index b2dc04a9208..1d8a9783ad4 100644 --- a/place_tracker/web/index.html +++ b/place_tracker/web/index.html @@ -46,11 +46,12 @@ _flutter.loader.loadEntrypoint({ serviceWorker: { serviceWorkerVersion: serviceWorkerVersion, + }, + onEntrypointLoaded: function(engineInitializer) { + engineInitializer.initializeEngine().then(function(appRunner) { + appRunner.runApp(); + }); } - }).then(function(engineInitializer) { - return engineInitializer.initializeEngine(); - }).then(function(appRunner) { - return appRunner.runApp(); }); }); diff --git a/platform_channels/.metadata b/platform_channels/.metadata index a7f9d6a7ae7..8da4f9720db 100644 --- a/platform_channels/.metadata +++ b/platform_channels/.metadata @@ -4,8 +4,8 @@ # This file should be version controlled. version: - revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - channel: stable + revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + channel: beta project_type: app @@ -13,14 +13,14 @@ project_type: app migration: platforms: - platform: root - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: android - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: ios - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 # User provided section diff --git a/platform_channels/android/app/build.gradle b/platform_channels/android/app/build.gradle index 7c9441dae4c..13205644d40 100644 --- a/platform_channels/android/app/build.gradle +++ b/platform_channels/android/app/build.gradle @@ -46,7 +46,7 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "dev.flutter.platform_channels" // You can update the following values to match your application needs. - // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. + // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. minSdkVersion flutter.minSdkVersion targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() diff --git a/platform_channels/android/build.gradle b/platform_channels/android/build.gradle index 83ae220041c..58a8c74b147 100644 --- a/platform_channels/android/build.gradle +++ b/platform_channels/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.6.10' + ext.kotlin_version = '1.7.10' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.1.2' + classpath 'com.android.tools.build:gradle:7.2.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/platform_channels/android/gradle/wrapper/gradle-wrapper.properties b/platform_channels/android/gradle/wrapper/gradle-wrapper.properties index cb24abda10a..3c472b99c6f 100644 --- a/platform_channels/android/gradle/wrapper/gradle-wrapper.properties +++ b/platform_channels/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip diff --git a/platform_channels/codelab_rebuild.yaml b/platform_channels/codelab_rebuild.yaml index 9f4a94d6755..bab5eb84964 100644 --- a/platform_channels/codelab_rebuild.yaml +++ b/platform_channels/codelab_rebuild.yaml @@ -7,6 +7,9 @@ steps: - ios - name: Flutter recreate flutter: create --platform android,ios --org dev.flutter . + - name: Strip DEVELOPMENT_TEAM + strip-lines-containing: DEVELOPMENT_TEAM = + path: ios/Runner.xcodeproj/project.pbxproj - name: Patch android/settings.gradle path: android/settings.gradle patch-u: | diff --git a/platform_channels/ios/Runner.xcodeproj/project.pbxproj b/platform_channels/ios/Runner.xcodeproj/project.pbxproj index fade5e471a0..70520893ce2 100644 --- a/platform_channels/ios/Runner.xcodeproj/project.pbxproj +++ b/platform_channels/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -171,6 +171,7 @@ /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -185,6 +186,7 @@ }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -478,4 +480,4 @@ /* End XCConfigurationList section */ }; rootObject = 97C146E61CF9000F007C117D /* Project object */; -} +} \ No newline at end of file diff --git a/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png index 28c6bf03016..7353c41ecf9 100644 Binary files a/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and b/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png index 2ccbfd967d9..797d452e458 100644 Binary files a/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and b/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png index f091b6b0bca..6ed2d933e11 100644 Binary files a/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and b/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png index 4cde12118dd..4cd7b0099ca 100644 Binary files a/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and b/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png index d0ef06e7edb..fe730945a01 100644 Binary files a/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and b/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png index dcdc2306c28..321773cd857 100644 Binary files a/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and b/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png index 2ccbfd967d9..797d452e458 100644 Binary files a/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and b/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png index c8f9ed8f5ce..502f463a9bc 100644 Binary files a/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and b/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png index a6d6b8609df..0ec30343922 100644 Binary files a/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and b/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png index a6d6b8609df..0ec30343922 100644 Binary files a/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and b/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png index 75b2d164a5a..e9f5fea27c7 100644 Binary files a/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and b/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png index c4df70d39da..84ac32ae7d9 100644 Binary files a/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and b/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png index 6a84f41e14e..8953cba0906 100644 Binary files a/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and b/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png index d0e1f585360..0467bf12aa4 100644 Binary files a/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and b/platform_channels/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/platform_design/.metadata b/platform_design/.metadata index af040ba02a1..56886885ada 100644 --- a/platform_design/.metadata +++ b/platform_design/.metadata @@ -4,8 +4,8 @@ # This file should be version controlled. version: - revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - channel: stable + revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + channel: beta project_type: app @@ -13,17 +13,17 @@ project_type: app migration: platforms: - platform: root - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: android - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: ios - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: web - create_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 - base_revision: ffccd96b62ee8cec7740dab303538c5fc26ac543 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 # User provided section diff --git a/platform_design/android/app/build.gradle b/platform_design/android/app/build.gradle index 3be9de9b5e4..2dfc0657f7c 100644 --- a/platform_design/android/app/build.gradle +++ b/platform_design/android/app/build.gradle @@ -46,7 +46,7 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "dev.flutter.platform_design" // You can update the following values to match your application needs. - // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. + // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. minSdkVersion flutter.minSdkVersion targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() diff --git a/platform_design/android/build.gradle b/platform_design/android/build.gradle index 83ae220041c..58a8c74b147 100644 --- a/platform_design/android/build.gradle +++ b/platform_design/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.6.10' + ext.kotlin_version = '1.7.10' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.1.2' + classpath 'com.android.tools.build:gradle:7.2.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/platform_design/android/gradle/wrapper/gradle-wrapper.properties b/platform_design/android/gradle/wrapper/gradle-wrapper.properties index cb24abda10a..3c472b99c6f 100644 --- a/platform_design/android/gradle/wrapper/gradle-wrapper.properties +++ b/platform_design/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip diff --git a/platform_design/codelab_rebuild.yaml b/platform_design/codelab_rebuild.yaml index 778c5e19318..f36734d29a7 100644 --- a/platform_design/codelab_rebuild.yaml +++ b/platform_design/codelab_rebuild.yaml @@ -8,6 +8,9 @@ steps: - web - name: Flutter recreate runner flutter: create --platform android,ios,web --org dev.flutter . + - name: Strip DEVELOPMENT_TEAM + strip-lines-containing: DEVELOPMENT_TEAM = + path: ios/Runner.xcodeproj/project.pbxproj - name: Patch web/manifest.json path: web/manifest.json patch-u: | @@ -22,5 +25,8 @@ steps: "orientation": "portrait-primary", "prefer_related_applications": false, "icons": [ + - name: Update dependencies + flutter: pub upgrade --major-versions - name: Build for iOS + platforms: [ macos ] flutter: build ios --simulator diff --git a/platform_design/ios/Runner.xcodeproj/project.pbxproj b/platform_design/ios/Runner.xcodeproj/project.pbxproj index 9fad160f225..536b0d0de86 100644 --- a/platform_design/ios/Runner.xcodeproj/project.pbxproj +++ b/platform_design/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -171,6 +171,7 @@ /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -185,6 +186,7 @@ }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); diff --git a/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png index 28c6bf03016..7353c41ecf9 100644 Binary files a/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and b/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png index 2ccbfd967d9..797d452e458 100644 Binary files a/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and b/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png index f091b6b0bca..6ed2d933e11 100644 Binary files a/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and b/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png index 4cde12118dd..4cd7b0099ca 100644 Binary files a/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and b/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png index d0ef06e7edb..fe730945a01 100644 Binary files a/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and b/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png index dcdc2306c28..321773cd857 100644 Binary files a/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and b/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png index 2ccbfd967d9..797d452e458 100644 Binary files a/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and b/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png index c8f9ed8f5ce..502f463a9bc 100644 Binary files a/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and b/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png index a6d6b8609df..0ec30343922 100644 Binary files a/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and b/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png index a6d6b8609df..0ec30343922 100644 Binary files a/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and b/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png index 75b2d164a5a..e9f5fea27c7 100644 Binary files a/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and b/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png index c4df70d39da..84ac32ae7d9 100644 Binary files a/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and b/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png index 6a84f41e14e..8953cba0906 100644 Binary files a/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and b/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png index d0e1f585360..0467bf12aa4 100644 Binary files a/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and b/platform_design/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/platform_design/web/index.html b/platform_design/web/index.html index 91504295d76..f9194a32b69 100644 --- a/platform_design/web/index.html +++ b/platform_design/web/index.html @@ -46,11 +46,12 @@ _flutter.loader.loadEntrypoint({ serviceWorker: { serviceWorkerVersion: serviceWorkerVersion, + }, + onEntrypointLoaded: function(engineInitializer) { + engineInitializer.initializeEngine().then(function(appRunner) { + appRunner.runApp(); + }); } - }).then(function(engineInitializer) { - return engineInitializer.initializeEngine(); - }).then(function(appRunner) { - return appRunner.runApp(); }); }); diff --git a/provider_shopper/.metadata b/provider_shopper/.metadata index e27f5ccf8b8..d680382e18c 100644 --- a/provider_shopper/.metadata +++ b/provider_shopper/.metadata @@ -4,8 +4,8 @@ # This file should be version controlled. version: - revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 - channel: stable + revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + channel: beta project_type: app @@ -13,26 +13,26 @@ project_type: app migration: platforms: - platform: root - create_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 - base_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: android - create_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 - base_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: ios - create_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 - base_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: linux - create_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 - base_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: macos - create_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 - base_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: web - create_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 - base_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 - platform: windows - create_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 - base_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 + create_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 + base_revision: 686fe913dc963954b99e62048569cb9ac8e551c8 # User provided section diff --git a/provider_shopper/android/app/build.gradle b/provider_shopper/android/app/build.gradle index 16ea281366c..f14c998e60c 100644 --- a/provider_shopper/android/app/build.gradle +++ b/provider_shopper/android/app/build.gradle @@ -46,7 +46,7 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "dev.flutter.provider_shopper" // You can update the following values to match your application needs. - // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. + // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. minSdkVersion flutter.minSdkVersion targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() diff --git a/provider_shopper/android/build.gradle b/provider_shopper/android/build.gradle index 83ae220041c..58a8c74b147 100644 --- a/provider_shopper/android/build.gradle +++ b/provider_shopper/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.6.10' + ext.kotlin_version = '1.7.10' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.1.2' + classpath 'com.android.tools.build:gradle:7.2.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/provider_shopper/android/gradle/wrapper/gradle-wrapper.properties b/provider_shopper/android/gradle/wrapper/gradle-wrapper.properties index cb24abda10a..3c472b99c6f 100644 --- a/provider_shopper/android/gradle/wrapper/gradle-wrapper.properties +++ b/provider_shopper/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip diff --git a/provider_shopper/codelab_rebuild.yaml b/provider_shopper/codelab_rebuild.yaml index c2e92b26dc6..d972fb5dd27 100644 --- a/provider_shopper/codelab_rebuild.yaml +++ b/provider_shopper/codelab_rebuild.yaml @@ -11,3 +11,11 @@ steps: - windows - name: Flutter recreate flutter: create --org dev.flutter . + - name: Strip DEVELOPMENT_TEAM + strip-lines-containing: DEVELOPMENT_TEAM = + path: ios/Runner.xcodeproj/project.pbxproj + - name: Update dependencies + flutter: pub upgrade --major-versions + - name: Build iOS simulator bundle + platforms: [ macos ] + flutter: build ios --simulator diff --git a/provider_shopper/ios/Runner.xcodeproj/project.pbxproj b/provider_shopper/ios/Runner.xcodeproj/project.pbxproj index 80a93988ec4..bde2a837502 100644 --- a/provider_shopper/ios/Runner.xcodeproj/project.pbxproj +++ b/provider_shopper/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -13,6 +13,7 @@ 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; + A16AF2B2BD9158CD349F8A32 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 69142DFAD75FC2B5E954185B /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -31,7 +32,10 @@ /* Begin PBXFileReference section */ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 2D52EFD5568A5BA04B844B0F /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 4292536A2DFEA1AAAE0A2A11 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 69142DFAD75FC2B5E954185B /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; @@ -42,6 +46,7 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + BA81FF81B84F76D4D7929913 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -49,12 +54,24 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + A16AF2B2BD9158CD349F8A32 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 40C0A41DA9CF6B17B647CD56 /* Pods */ = { + isa = PBXGroup; + children = ( + 4292536A2DFEA1AAAE0A2A11 /* Pods-Runner.debug.xcconfig */, + BA81FF81B84F76D4D7929913 /* Pods-Runner.release.xcconfig */, + 2D52EFD5568A5BA04B844B0F /* Pods-Runner.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -72,6 +89,8 @@ 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, + 40C0A41DA9CF6B17B647CD56 /* Pods */, + EA8CFCD89029CC9949C84519 /* Frameworks */, ); sourceTree = ""; }; @@ -98,6 +117,14 @@ path = Runner; sourceTree = ""; }; + EA8CFCD89029CC9949C84519 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 69142DFAD75FC2B5E954185B /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -105,6 +132,7 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( + EDBEF8361A7DE33B26F08D47 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, @@ -171,6 +199,7 @@ /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -185,6 +214,7 @@ }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -197,6 +227,28 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; + EDBEF8361A7DE33B26F08D47 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -288,7 +340,6 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = TC87DMJLQP; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -417,7 +468,6 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = TC87DMJLQP; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -440,7 +490,6 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = TC87DMJLQP; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( diff --git a/provider_shopper/ios/Runner.xcworkspace/contents.xcworkspacedata b/provider_shopper/ios/Runner.xcworkspace/contents.xcworkspacedata index 1d526a16ed0..21a3cc14c74 100644 --- a/provider_shopper/ios/Runner.xcworkspace/contents.xcworkspacedata +++ b/provider_shopper/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -4,4 +4,7 @@ + + diff --git a/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png index 28c6bf03016..7353c41ecf9 100644 Binary files a/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and b/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png index 2ccbfd967d9..797d452e458 100644 Binary files a/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and b/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png index f091b6b0bca..6ed2d933e11 100644 Binary files a/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and b/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png index 4cde12118dd..4cd7b0099ca 100644 Binary files a/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and b/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png index d0ef06e7edb..fe730945a01 100644 Binary files a/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and b/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png index dcdc2306c28..321773cd857 100644 Binary files a/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and b/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png index 2ccbfd967d9..797d452e458 100644 Binary files a/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and b/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png index c8f9ed8f5ce..502f463a9bc 100644 Binary files a/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and b/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png index a6d6b8609df..0ec30343922 100644 Binary files a/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and b/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png index a6d6b8609df..0ec30343922 100644 Binary files a/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and b/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png index 75b2d164a5a..e9f5fea27c7 100644 Binary files a/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and b/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png index c4df70d39da..84ac32ae7d9 100644 Binary files a/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and b/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png index 6a84f41e14e..8953cba0906 100644 Binary files a/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and b/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png index d0e1f585360..0467bf12aa4 100644 Binary files a/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and b/provider_shopper/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/provider_shopper/macos/Podfile b/provider_shopper/macos/Podfile index dade8dfad0d..049abe29542 100644 --- a/provider_shopper/macos/Podfile +++ b/provider_shopper/macos/Podfile @@ -1,4 +1,4 @@ -platform :osx, '10.11' +platform :osx, '10.14' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/provider_shopper/macos/Runner.xcodeproj/project.pbxproj b/provider_shopper/macos/Runner.xcodeproj/project.pbxproj index 58ea768f163..d86acc44a76 100644 --- a/provider_shopper/macos/Runner.xcodeproj/project.pbxproj +++ b/provider_shopper/macos/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 54; objects = { /* Begin PBXAggregateTarget section */ @@ -235,6 +235,7 @@ /* Begin PBXShellScriptBuildPhase section */ 3399D490228B24CF009A79C7 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -344,7 +345,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; @@ -423,7 +424,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; @@ -470,7 +471,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.14; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; diff --git a/provider_shopper/macos/Runner/Configs/AppInfo.xcconfig b/provider_shopper/macos/Runner/Configs/AppInfo.xcconfig index d03fb001860..15f324de3eb 100644 --- a/provider_shopper/macos/Runner/Configs/AppInfo.xcconfig +++ b/provider_shopper/macos/Runner/Configs/AppInfo.xcconfig @@ -11,4 +11,4 @@ PRODUCT_NAME = provider_shopper PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.providerShopper // The copyright displayed in application information -PRODUCT_COPYRIGHT = Copyright © 2022 dev.flutter. All rights reserved. +PRODUCT_COPYRIGHT = Copyright © 2023 dev.flutter. All rights reserved. diff --git a/provider_shopper/web/index.html b/provider_shopper/web/index.html index 1f4b645b7fa..db026fff83f 100644 --- a/provider_shopper/web/index.html +++ b/provider_shopper/web/index.html @@ -46,11 +46,12 @@ _flutter.loader.loadEntrypoint({ serviceWorker: { serviceWorkerVersion: serviceWorkerVersion, + }, + onEntrypointLoaded: function(engineInitializer) { + engineInitializer.initializeEngine().then(function(appRunner) { + appRunner.runApp(); + }); } - }).then(function(engineInitializer) { - return engineInitializer.initializeEngine(); - }).then(function(appRunner) { - return appRunner.runApp(); }); }); diff --git a/provider_shopper/windows/runner/CMakeLists.txt b/provider_shopper/windows/runner/CMakeLists.txt index 17411a8ab8e..394917c053a 100644 --- a/provider_shopper/windows/runner/CMakeLists.txt +++ b/provider_shopper/windows/runner/CMakeLists.txt @@ -33,6 +33,7 @@ target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") # Add dependency libraries and include directories. Add any application-specific # dependencies here. target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) +target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") # Run the Flutter tool portions of the build. This must not be removed. diff --git a/provider_shopper/windows/runner/Runner.rc b/provider_shopper/windows/runner/Runner.rc index d280de586c9..5a6de2241e4 100644 --- a/provider_shopper/windows/runner/Runner.rc +++ b/provider_shopper/windows/runner/Runner.rc @@ -93,7 +93,7 @@ BEGIN VALUE "FileDescription", "provider_shopper" "\0" VALUE "FileVersion", VERSION_AS_STRING "\0" VALUE "InternalName", "provider_shopper" "\0" - VALUE "LegalCopyright", "Copyright (C) 2022 dev.flutter. All rights reserved." "\0" + VALUE "LegalCopyright", "Copyright (C) 2023 dev.flutter. All rights reserved." "\0" VALUE "OriginalFilename", "provider_shopper.exe" "\0" VALUE "ProductName", "provider_shopper" "\0" VALUE "ProductVersion", VERSION_AS_STRING "\0" diff --git a/provider_shopper/windows/runner/flutter_window.cpp b/provider_shopper/windows/runner/flutter_window.cpp index b43b9095ea3..b25e363efa4 100644 --- a/provider_shopper/windows/runner/flutter_window.cpp +++ b/provider_shopper/windows/runner/flutter_window.cpp @@ -26,6 +26,11 @@ bool FlutterWindow::OnCreate() { } RegisterPlugins(flutter_controller_->engine()); SetChildContent(flutter_controller_->view()->GetNativeWindow()); + + flutter_controller_->engine()->SetNextFrameCallback([&]() { + this->Show(); + }); + return true; } diff --git a/provider_shopper/windows/runner/main.cpp b/provider_shopper/windows/runner/main.cpp index 3733f6e0ba5..ec36daf39d2 100644 --- a/provider_shopper/windows/runner/main.cpp +++ b/provider_shopper/windows/runner/main.cpp @@ -27,7 +27,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, FlutterWindow window(project); Win32Window::Point origin(10, 10); Win32Window::Size size(1280, 720); - if (!window.CreateAndShow(L"provider_shopper", origin, size)) { + if (!window.Create(L"provider_shopper", origin, size)) { return EXIT_FAILURE; } window.SetQuitOnClose(true); diff --git a/provider_shopper/windows/runner/win32_window.cpp b/provider_shopper/windows/runner/win32_window.cpp index c10f08dc7da..041a3855474 100644 --- a/provider_shopper/windows/runner/win32_window.cpp +++ b/provider_shopper/windows/runner/win32_window.cpp @@ -1,13 +1,31 @@ #include "win32_window.h" +#include #include #include "resource.h" namespace { +/// Window attribute that enables dark mode window decorations. +/// +/// Redefined in case the developer's machine has a Windows SDK older than +/// version 10.0.22000.0. +/// See: https://docs.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute +#ifndef DWMWA_USE_IMMERSIVE_DARK_MODE +#define DWMWA_USE_IMMERSIVE_DARK_MODE 20 +#endif + constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; +/// Registry key for app theme preference. +/// +/// A value of 0 indicates apps should use dark mode. A non-zero or missing +/// value indicates apps should use light mode. +constexpr const wchar_t kGetPreferredBrightnessRegKey[] = + L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; +constexpr const wchar_t kGetPreferredBrightnessRegValue[] = L"AppsUseLightTheme"; + // The number of Win32Window objects that currently exist. static int g_active_window_count = 0; @@ -31,8 +49,8 @@ void EnableFullDpiSupportIfAvailable(HWND hwnd) { GetProcAddress(user32_module, "EnableNonClientDpiScaling")); if (enable_non_client_dpi_scaling != nullptr) { enable_non_client_dpi_scaling(hwnd); - FreeLibrary(user32_module); } + FreeLibrary(user32_module); } } // namespace @@ -102,9 +120,9 @@ Win32Window::~Win32Window() { Destroy(); } -bool Win32Window::CreateAndShow(const std::wstring& title, - const Point& origin, - const Size& size) { +bool Win32Window::Create(const std::wstring& title, + const Point& origin, + const Size& size) { Destroy(); const wchar_t* window_class = @@ -117,7 +135,7 @@ bool Win32Window::CreateAndShow(const std::wstring& title, double scale_factor = dpi / 96.0; HWND window = CreateWindow( - window_class, title.c_str(), WS_OVERLAPPEDWINDOW | WS_VISIBLE, + window_class, title.c_str(), WS_OVERLAPPEDWINDOW, Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), Scale(size.width, scale_factor), Scale(size.height, scale_factor), nullptr, nullptr, GetModuleHandle(nullptr), this); @@ -126,9 +144,15 @@ bool Win32Window::CreateAndShow(const std::wstring& title, return false; } + UpdateTheme(window); + return OnCreate(); } +bool Win32Window::Show() { + return ShowWindow(window_handle_, SW_SHOWNORMAL); +} + // static LRESULT CALLBACK Win32Window::WndProc(HWND const window, UINT const message, @@ -188,6 +212,10 @@ Win32Window::MessageHandler(HWND hwnd, SetFocus(child_content_); } return 0; + + case WM_DWMCOLORIZATIONCOLORCHANGED: + UpdateTheme(hwnd); + return 0; } return DefWindowProc(window_handle_, message, wparam, lparam); @@ -243,3 +271,18 @@ bool Win32Window::OnCreate() { void Win32Window::OnDestroy() { // No-op; provided for subclasses. } + +void Win32Window::UpdateTheme(HWND const window) { + DWORD light_mode; + DWORD light_mode_size = sizeof(light_mode); + LSTATUS result = RegGetValue(HKEY_CURRENT_USER, kGetPreferredBrightnessRegKey, + kGetPreferredBrightnessRegValue, + RRF_RT_REG_DWORD, nullptr, &light_mode, + &light_mode_size); + + if (result == ERROR_SUCCESS) { + BOOL enable_dark_mode = light_mode == 0; + DwmSetWindowAttribute(window, DWMWA_USE_IMMERSIVE_DARK_MODE, + &enable_dark_mode, sizeof(enable_dark_mode)); + } +} diff --git a/provider_shopper/windows/runner/win32_window.h b/provider_shopper/windows/runner/win32_window.h index 17ba431125b..c86632d8a6b 100644 --- a/provider_shopper/windows/runner/win32_window.h +++ b/provider_shopper/windows/runner/win32_window.h @@ -28,15 +28,16 @@ class Win32Window { Win32Window(); virtual ~Win32Window(); - // Creates and shows a win32 window with |title| and position and size using + // Creates a win32 window with |title| that is positioned and sized using // |origin| and |size|. New windows are created on the default monitor. Window // sizes are specified to the OS in physical pixels, hence to ensure a - // consistent size to will treat the width height passed in to this function - // as logical pixels and scale to appropriate for the default monitor. Returns - // true if the window was created successfully. - bool CreateAndShow(const std::wstring& title, - const Point& origin, - const Size& size); + // consistent size this function will scale the inputted width and height as + // as appropriate for the default monitor. The window is invisible until + // |Show| is called. Returns true if the window was created successfully. + bool Create(const std::wstring& title, const Point& origin, const Size& size); + + // Show the current window. Returns true if the window was successfully shown. + bool Show(); // Release OS resources associated with window. void Destroy(); @@ -86,6 +87,9 @@ class Win32Window { // Retrieves a class instance pointer for |window| static Win32Window* GetThisFromHandle(HWND const window) noexcept; + // Update the window frame's theme to match the system theme. + static void UpdateTheme(HWND const window); + bool quit_on_close_ = false; // window handle for top level window. diff --git a/simplistic_editor/lib/basic_text_field.dart b/simplistic_editor/lib/basic_text_field.dart index 12b32666ec2..a082e396a38 100644 --- a/simplistic_editor/lib/basic_text_field.dart +++ b/simplistic_editor/lib/basic_text_field.dart @@ -104,8 +104,7 @@ class _BasicTextFieldState extends State { break; } - return FocusTrapArea( - focusNode: widget.focusNode, + return TextFieldTapRegion( child: GestureDetector( behavior: HitTestBehavior.translucent, onPanStart: (dragStartDetails) => _onDragStart(dragStartDetails), diff --git a/simplistic_editor/lib/basic_text_input_client.dart b/simplistic_editor/lib/basic_text_input_client.dart index 7190d555511..cee2b89df09 100644 --- a/simplistic_editor/lib/basic_text_input_client.dart +++ b/simplistic_editor/lib/basic_text_input_client.dart @@ -66,6 +66,15 @@ class BasicTextInputClientState extends State super.dispose(); } + @override + void didChangeInputControl( + TextInputControl? oldControl, TextInputControl? newControl) { + if (_hasFocus && _hasInputConnection) { + oldControl?.hide(); + newControl?.show(); + } + } + /// [DeltaTextInputClient] method implementations. @override void connectionClosed() { @@ -100,6 +109,11 @@ class BasicTextInputClientState extends State // Will not implement. } + @override + void performSelector(String selectorName) { + // Will not implement. + } + @override void removeTextPlaceholder() { // Will not implement. This method is used for Scribble support. @@ -685,6 +699,7 @@ class BasicTextInputClientState extends State onSelectionHandleTapped: () { _toggleToolbar(); }, + magnifierConfiguration: TextMagnifierConfiguration.disabled, ); } else { _selectionOverlay!.update(_value); @@ -757,7 +772,8 @@ class BasicTextInputClientState extends State textAlign: TextAlign.left, textDirection: _textDirection, locale: Localizations.maybeLocaleOf(context), - textHeightBehavior: DefaultTextHeightBehavior.of(context), + textHeightBehavior: + DefaultTextHeightBehavior.maybeOf(context), textWidthBasis: TextWidthBasis.parent, obscuringCharacter: '•', obscureText: diff --git a/tool/flutter_ci_script_beta.sh b/tool/flutter_ci_script_beta.sh index 12063109b64..84b073c447f 100755 --- a/tool/flutter_ci_script_beta.sh +++ b/tool/flutter_ci_script_beta.sh @@ -28,15 +28,13 @@ declare -ar PROJECT_NAMES=( "experimental/federated_plugin/federated_plugin_platform_interface" "experimental/federated_plugin/federated_plugin_web" "experimental/federated_plugin/federated_plugin_windows" - # TODO(DomesticMouse): 'bottomAppBarColor' is deprecated and shouldn't be used. - # "experimental/linting_tool" + "experimental/linting_tool" "experimental/material_3_demo" "experimental/pedometer" "experimental/varfont_shader_puzzle" "experimental/web_dashboard" "flutter_maps_firestore" - # TODO(DomesticMouse): 'errorColor' is deprecated and shouldn't be used. - # "form_app" + "form_app" "game_template" "infinite_list" "ios_app_clip" @@ -51,8 +49,7 @@ declare -ar PROJECT_NAMES=( "provider_counter" "provider_shopper" "simplistic_calculator" - # TODO(DomesticMouse): A value of type 'dynamic' can't be returned from the method 'build' because it has a return type of 'Widget'. - # "simplistic_editor" + "simplistic_editor" "testing_app" "veggieseasons" "web/_tool" diff --git a/tool/flutter_ci_script_master.sh b/tool/flutter_ci_script_master.sh index bb6f9ea7a65..0632b987d8c 100755 --- a/tool/flutter_ci_script_master.sh +++ b/tool/flutter_ci_script_master.sh @@ -28,15 +28,13 @@ declare -ar PROJECT_NAMES=( "experimental/federated_plugin/federated_plugin_platform_interface" "experimental/federated_plugin/federated_plugin_web" "experimental/federated_plugin/federated_plugin_windows" - # TODO(DomesticMouse): 'bottomAppBarColor' is deprecated and shouldn't be used. - # "experimental/linting_tool" + "experimental/linting_tool" "experimental/material_3_demo" "experimental/pedometer" "experimental/varfont_shader_puzzle" "experimental/web_dashboard" "flutter_maps_firestore" - # TODO(DomesticMouse): 'errorColor' is deprecated and shouldn't be used. - # "form_app" + "form_app" "game_template" "infinite_list" "ios_app_clip" @@ -51,8 +49,7 @@ declare -ar PROJECT_NAMES=( "provider_counter" "provider_shopper" "simplistic_calculator" - # TODO(DomesticMouse): A value of type 'dynamic' can't be returned from the method 'build' because it has a return type of 'Widget'. - # "simplistic_editor" + "simplistic_editor" "testing_app" "veggieseasons" "web/_tool" diff --git a/tool/flutter_ci_script_stable.sh b/tool/flutter_ci_script_stable.sh index a854b102b36..689a8561ea8 100755 --- a/tool/flutter_ci_script_stable.sh +++ b/tool/flutter_ci_script_stable.sh @@ -21,8 +21,7 @@ declare -ar PROJECT_NAMES=( "code_sharing/shared" "desktop_photo_search/fluent_ui" "desktop_photo_search/material" - # TODO(DomesticMouse): enable after Flutter stable increment - # "experimental/context_menus" + "experimental/context_menus" "experimental/federated_plugin/federated_plugin" "experimental/federated_plugin/federated_plugin/example" "experimental/federated_plugin/federated_plugin_macos" @@ -30,12 +29,9 @@ declare -ar PROJECT_NAMES=( "experimental/federated_plugin/federated_plugin_web" "experimental/federated_plugin/federated_plugin_windows" "experimental/linting_tool" - # TODO(DomesticMouse): enable after Flutter stable increment - # "experimental/material_3_demo" - # TODO(DomesticMouse): enable after Flutter stable increment - # "experimental/pedometer" - # TODO(DomesticMouse): enable after Flutter stable increment - # "experimental/varfont_shader_puzzle" + "experimental/material_3_demo" + "experimental/pedometer" + "experimental/varfont_shader_puzzle" "experimental/web_dashboard" "flutter_maps_firestore" "form_app" diff --git a/web/.gitignore b/web/.gitignore index dea4d4c6d22..5c644e171ef 100644 --- a/web/.gitignore +++ b/web/.gitignore @@ -1,2 +1 @@ -!**/pubspec.lock */build