Skip to content

Commit 3d80d77

Browse files
Update for Flutter 3.27 (#2250)
## Pre-launch Checklist - [x] I read the [Effective Dart: Style] _recently_, and have followed its advice. - [x] I signed the [CLA]. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-devrel channel on [Discord]. <!-- Links --> [Effective Dart: Style]: https://dart.dev/guides/language/effective-dart/style [CLA]: https://cla.developers.google.com/ [Discord]: https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md
1 parent 0bfb040 commit 3d80d77

File tree

1,665 files changed

+24477
-18209
lines changed

Some content is hidden

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

1,665 files changed

+24477
-18209
lines changed

adaptive_app/codelab_rebuild.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,9 +1074,9 @@ steps:
10741074
- name: Create yt_cors_proxy
10751075
path: adaptive_app
10761076
dart: create --template server-shelf yt_cors_proxy
1077-
- name: Remove args
1077+
- name: Remove shelf_router test
10781078
path: adaptive_app/yt_cors_proxy
1079-
dart: pub remove args shelf_router test
1079+
dart: pub remove shelf_router test
10801080
- name: Add http shelf_cors_headers
10811081
path: adaptive_app/yt_cors_proxy
10821082
dart: pub add http shelf_cors_headers
@@ -1303,7 +1303,7 @@ steps:
13031303
patch-u: |
13041304
--- b/adaptive_app/step_07/.gitignore
13051305
+++ a/adaptive_app/step_07/.gitignore
1306-
@@ -41,3 +41,6 @@ app.*.map.json
1306+
@@ -43,3 +43,6 @@ app.*.map.json
13071307
/android/app/debug
13081308
/android/app/profile
13091309
/android/app/release

adaptive_app/step_03/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
*.swp
66
.DS_Store
77
.atom/
8+
.build/
89
.buildlog/
910
.history
1011
.svn/
12+
.swiftpm/
1113
migrate_working_dir/
1214

1315
# IntelliJ related

adaptive_app/step_03/android/gradle/wrapper/gradle-wrapper.properties

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

adaptive_app/step_03/android/settings.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ pluginManagement {
1818

1919
plugins {
2020
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21-
id "com.android.application" version "7.3.0" apply false
22-
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
21+
id "com.android.application" version "8.1.0" apply false
22+
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
2323
}
2424

2525
include ":app"

adaptive_app/step_03/linux/CMakeLists.txt

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Project-level configuration.
2-
cmake_minimum_required(VERSION 3.10)
2+
cmake_minimum_required(VERSION 3.13)
33
project(runner LANGUAGES CXX)
44

55
# The name of the executable created for the application. Change this to change
@@ -54,25 +54,8 @@ add_subdirectory(${FLUTTER_MANAGED_DIR})
5454
find_package(PkgConfig REQUIRED)
5555
pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
5656

57-
add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}")
58-
59-
# Define the application target. To change its name, change BINARY_NAME above,
60-
# not the value here, or `flutter run` will no longer work.
61-
#
62-
# Any new source files that you add to the application should be added here.
63-
add_executable(${BINARY_NAME}
64-
"main.cc"
65-
"my_application.cc"
66-
"${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
67-
)
68-
69-
# Apply the standard set of build settings. This can be removed for applications
70-
# that need different build settings.
71-
apply_standard_settings(${BINARY_NAME})
72-
73-
# Add dependency libraries. Add any application-specific dependencies here.
74-
target_link_libraries(${BINARY_NAME} PRIVATE flutter)
75-
target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK)
57+
# Application build; see runner/CMakeLists.txt.
58+
add_subdirectory("runner")
7659

7760
# Run the Flutter tool portions of the build. This must not be removed.
7861
add_dependencies(${BINARY_NAME} flutter_assemble)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
cmake_minimum_required(VERSION 3.13)
2+
project(runner LANGUAGES CXX)
3+
4+
# Define the application target. To change its name, change BINARY_NAME in the
5+
# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer
6+
# work.
7+
#
8+
# Any new source files that you add to the application should be added here.
9+
add_executable(${BINARY_NAME}
10+
"main.cc"
11+
"my_application.cc"
12+
"${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
13+
)
14+
15+
# Apply the standard set of build settings. This can be removed for applications
16+
# that need different build settings.
17+
apply_standard_settings(${BINARY_NAME})
18+
19+
# Add preprocessor definitions for the application ID.
20+
add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}")
21+
22+
# Add dependency libraries. Add any application-specific dependencies here.
23+
target_link_libraries(${BINARY_NAME} PRIVATE flutter)
24+
target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK)
25+
26+
target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
File renamed without changes.

adaptive_app/step_03/linux/my_application.cc renamed to adaptive_app/step_03/linux/runner/my_application.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,12 @@ static void my_application_class_init(MyApplicationClass* klass) {
117117
static void my_application_init(MyApplication* self) {}
118118

119119
MyApplication* my_application_new() {
120+
// Set the program name to the application ID, which helps various systems
121+
// like GTK and desktop environments map this running application to its
122+
// corresponding .desktop file. This ensures better integration by allowing
123+
// the application to be recognized beyond its binary name.
124+
g_set_prgname(APPLICATION_ID);
125+
120126
return MY_APPLICATION(g_object_new(my_application_get_type(),
121127
"application-id", APPLICATION_ID,
122128
"flags", G_APPLICATION_NON_UNIQUE,

adaptive_app/step_03/macos/Runner/AppDelegate.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@ class AppDelegate: FlutterAppDelegate {
66
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
77
return true
88
}
9+
10+
override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
11+
return true
12+
}
913
}

0 commit comments

Comments
 (0)