Skip to content

Commit f1c2cf3

Browse files
committed
Update for Flutter 3.36
1 parent 082c7f7 commit f1c2cf3

File tree

145 files changed

+621
-290
lines changed

Some content is hidden

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

145 files changed

+621
-290
lines changed

intro_flutter_gpu/codelab_rebuild.yaml

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,11 +285,42 @@ steps:
285285
<string>MainMenu</string>
286286
<key>NSPrincipalClass</key>
287287
<string>NSApplication</string>
288-
+ <!-- flutter_gpu requires Impeller -->
289-
+ <key>FLTEnableImpeller</key>
288+
+ <!-- Required for flutter_gpu -->
289+
+ <key>FLTEnableFlutterGPU</key>
290290
+ <true />
291291
</dict>
292292
</plist>
293+
- name: Patch ios/Runner/Info.plist
294+
path: intro_flutter_gpu/ios/Runner/Info.plist
295+
patch-u: |
296+
--- a/intro_flutter_gpu/step_12/ios/Runner/Info.plist
297+
+++ b/intro_flutter_gpu/step_12/ios/Runner/Info.plist
298+
@@ -45,5 +45,8 @@
299+
<true/>
300+
<key>UIApplicationSupportsIndirectInputEvents</key>
301+
<true/>
302+
+ <!-- Required for flutter_gpu -->
303+
+ <key>FLTEnableFlutterGPU</key>
304+
+ <true />
305+
</dict>
306+
</plist>
307+
- name: Patch android/app/src/main/AndroidManifest.xml
308+
path: intro_flutter_gpu/android/app/src/main/AndroidManifest.xml
309+
patch-u: |
310+
--- a/intro_flutter_gpu/step_12/android/app/src/main/AndroidManifest.xml
311+
+++ b/intro_flutter_gpu/step_12/android/app/src/main/AndroidManifest.xml
312+
@@ -3,6 +3,11 @@
313+
android:label="intro_flutter_gpu"
314+
android:name="${applicationName}"
315+
android:icon="@mipmap/ic_launcher">
316+
+
317+
+ <meta-data
318+
+ android:name="io.flutter.embedding.android.EnableFlutterGPU"
319+
+ android:value="true" />
320+
+
321+
<activity
322+
android:name=".MainActivity"
323+
android:exported="true"
293324
- name: Copy step_01
294325
copydir:
295326
from: intro_flutter_gpu

intro_flutter_gpu/step_01/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ migrate_working_dir/
2727
**/doc/api/
2828
**/ios/Flutter/.last_build_id
2929
.dart_tool/
30-
.flutter-plugins
3130
.flutter-plugins-dependencies
3231
.pub-cache/
3332
.pub/
3433
/build/
34+
/coverage/
3535

3636
# Symbolication related
3737
app.*.symbols

intro_flutter_gpu/step_01/android/app/src/main/AndroidManifest.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
android:label="intro_flutter_gpu"
44
android:name="${applicationName}"
55
android:icon="@mipmap/ic_launcher">
6+
7+
<meta-data
8+
android:name="io.flutter.embedding.android.EnableFlutterGPU"
9+
android:value="true" />
10+
611
<activity
712
android:name=".MainActivity"
813
android:exported="true"

intro_flutter_gpu/step_01/android/build.gradle.kts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ allprojects {
55
}
66
}
77

8-
val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get()
8+
val newBuildDir: Directory =
9+
rootProject.layout.buildDirectory
10+
.dir("../../build")
11+
.get()
912
rootProject.layout.buildDirectory.value(newBuildDir)
1013

1114
subprojects {
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
22
android.useAndroidX=true
3-
android.enableJetifier=true

intro_flutter_gpu/step_01/android/settings.gradle.kts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
pluginManagement {
2-
val flutterSdkPath = run {
3-
val properties = java.util.Properties()
4-
file("local.properties").inputStream().use { properties.load(it) }
5-
val flutterSdkPath = properties.getProperty("flutter.sdk")
6-
require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
7-
flutterSdkPath
8-
}
2+
val flutterSdkPath =
3+
run {
4+
val properties = java.util.Properties()
5+
file("local.properties").inputStream().use { properties.load(it) }
6+
val flutterSdkPath = properties.getProperty("flutter.sdk")
7+
require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
8+
flutterSdkPath
9+
}
910

1011
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
1112

@@ -18,7 +19,7 @@ pluginManagement {
1819

1920
plugins {
2021
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
21-
id("com.android.application") version "8.7.3" apply false
22+
id("com.android.application") version "8.9.1" apply false
2223
id("org.jetbrains.kotlin.android") version "2.1.0" apply false
2324
}
2425

intro_flutter_gpu/step_01/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
2323
<key>MinimumOSVersion</key>
24-
<string>12.0</string>
24+
<string>13.0</string>
2525
</dict>
2626
</plist>

intro_flutter_gpu/step_01/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@
346346
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
347347
GCC_WARN_UNUSED_FUNCTION = YES;
348348
GCC_WARN_UNUSED_VARIABLE = YES;
349-
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
349+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
350350
MTL_ENABLE_DEBUG_INFO = NO;
351351
SDKROOT = iphoneos;
352352
SUPPORTED_PLATFORMS = iphoneos;
@@ -472,7 +472,7 @@
472472
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
473473
GCC_WARN_UNUSED_FUNCTION = YES;
474474
GCC_WARN_UNUSED_VARIABLE = YES;
475-
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
475+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
476476
MTL_ENABLE_DEBUG_INFO = YES;
477477
ONLY_ACTIVE_ARCH = YES;
478478
SDKROOT = iphoneos;
@@ -523,7 +523,7 @@
523523
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
524524
GCC_WARN_UNUSED_FUNCTION = YES;
525525
GCC_WARN_UNUSED_VARIABLE = YES;
526-
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
526+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
527527
MTL_ENABLE_DEBUG_INFO = NO;
528528
SDKROOT = iphoneos;
529529
SUPPORTED_PLATFORMS = iphoneos;

intro_flutter_gpu/step_01/ios/Runner/Info.plist

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,8 @@
4545
<true/>
4646
<key>UIApplicationSupportsIndirectInputEvents</key>
4747
<true/>
48+
<!-- Required for flutter_gpu -->
49+
<key>FLTEnableFlutterGPU</key>
50+
<true />
4851
</dict>
4952
</plist>

intro_flutter_gpu/step_01/linux/runner/my_application.cc

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ struct _MyApplication {
1414

1515
G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION)
1616

17+
// Called when first Flutter frame received.
18+
static void first_frame_cb(MyApplication* self, FlView *view)
19+
{
20+
gtk_widget_show(gtk_widget_get_toplevel(GTK_WIDGET(view)));
21+
}
22+
1723
// Implements GApplication::activate.
1824
static void my_application_activate(GApplication* application) {
1925
MyApplication* self = MY_APPLICATION(application);
@@ -48,15 +54,23 @@ static void my_application_activate(GApplication* application) {
4854
}
4955

5056
gtk_window_set_default_size(window, 1280, 720);
51-
gtk_widget_show(GTK_WIDGET(window));
5257

5358
g_autoptr(FlDartProject) project = fl_dart_project_new();
5459
fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments);
5560

5661
FlView* view = fl_view_new(project);
62+
GdkRGBA background_color;
63+
// Background defaults to black, override it here if necessary, e.g. #00000000 for transparent.
64+
gdk_rgba_parse(&background_color, "#000000");
65+
fl_view_set_background_color(view, &background_color);
5766
gtk_widget_show(GTK_WIDGET(view));
5867
gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view));
5968

69+
// Show the window when Flutter renders.
70+
// Requires the view to be realized so we can start rendering.
71+
g_signal_connect_swapped(view, "first-frame", G_CALLBACK(first_frame_cb), self);
72+
gtk_widget_realize(GTK_WIDGET(view));
73+
6074
fl_register_plugins(FL_PLUGIN_REGISTRY(view));
6175

6276
gtk_widget_grab_focus(GTK_WIDGET(view));

0 commit comments

Comments
 (0)