Skip to content

Commit 68d2f95

Browse files
committed
chore: update example app to Flutter 3.38
1 parent b7b5406 commit 68d2f95

9 files changed

Lines changed: 50 additions & 44 deletions

File tree

example/.metadata

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# This file should be version controlled and should not be manually edited.
55

66
version:
7-
revision: "05db9689081f091050f01aed79f04dce0c750154"
7+
revision: "19074d12f7eaf6a8180cd4036a430c1d76de904e"
88
channel: "stable"
99

1010
project_type: app
@@ -13,26 +13,26 @@ project_type: app
1313
migration:
1414
platforms:
1515
- platform: root
16-
create_revision: 05db9689081f091050f01aed79f04dce0c750154
17-
base_revision: 05db9689081f091050f01aed79f04dce0c750154
16+
create_revision: 19074d12f7eaf6a8180cd4036a430c1d76de904e
17+
base_revision: 19074d12f7eaf6a8180cd4036a430c1d76de904e
1818
- platform: android
19-
create_revision: 05db9689081f091050f01aed79f04dce0c750154
20-
base_revision: 05db9689081f091050f01aed79f04dce0c750154
19+
create_revision: 19074d12f7eaf6a8180cd4036a430c1d76de904e
20+
base_revision: 19074d12f7eaf6a8180cd4036a430c1d76de904e
2121
- platform: ios
22-
create_revision: 05db9689081f091050f01aed79f04dce0c750154
23-
base_revision: 05db9689081f091050f01aed79f04dce0c750154
22+
create_revision: 19074d12f7eaf6a8180cd4036a430c1d76de904e
23+
base_revision: 19074d12f7eaf6a8180cd4036a430c1d76de904e
2424
- platform: linux
25-
create_revision: 05db9689081f091050f01aed79f04dce0c750154
26-
base_revision: 05db9689081f091050f01aed79f04dce0c750154
25+
create_revision: 19074d12f7eaf6a8180cd4036a430c1d76de904e
26+
base_revision: 19074d12f7eaf6a8180cd4036a430c1d76de904e
2727
- platform: macos
28-
create_revision: 05db9689081f091050f01aed79f04dce0c750154
29-
base_revision: 05db9689081f091050f01aed79f04dce0c750154
28+
create_revision: 19074d12f7eaf6a8180cd4036a430c1d76de904e
29+
base_revision: 19074d12f7eaf6a8180cd4036a430c1d76de904e
3030
- platform: web
31-
create_revision: 05db9689081f091050f01aed79f04dce0c750154
32-
base_revision: 05db9689081f091050f01aed79f04dce0c750154
31+
create_revision: 19074d12f7eaf6a8180cd4036a430c1d76de904e
32+
base_revision: 19074d12f7eaf6a8180cd4036a430c1d76de904e
3333
- platform: windows
34-
create_revision: 05db9689081f091050f01aed79f04dce0c750154
35-
base_revision: 05db9689081f091050f01aed79f04dce0c750154
34+
create_revision: 19074d12f7eaf6a8180cd4036a430c1d76de904e
35+
base_revision: 19074d12f7eaf6a8180cd4036a430c1d76de904e
3636

3737
# User provided section
3838

example/android/app/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ android {
1111
ndkVersion = flutter.ndkVersion
1212

1313
compileOptions {
14-
sourceCompatibility = JavaVersion.VERSION_11
15-
targetCompatibility = JavaVersion.VERSION_11
14+
sourceCompatibility = JavaVersion.VERSION_17
15+
targetCompatibility = JavaVersion.VERSION_17
1616
}
1717

1818
kotlinOptions {
19-
jvmTarget = JavaVersion.VERSION_11.toString()
19+
jvmTarget = JavaVersion.VERSION_17.toString()
2020
}
2121

2222
defaultConfig {

example/android/gradle.properties

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

example/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-8.12-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip

example/android/settings.gradle.kts

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

2020
plugins {
2121
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
22-
id("com.android.application") version "8.9.1" apply false
23-
id("org.jetbrains.kotlin.android") version "2.1.0" apply false
22+
id("com.android.application") version "8.11.1" apply false
23+
id("org.jetbrains.kotlin.android") version "2.2.20" apply false
2424
}
2525

2626
include(":app")

example/lib/main.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class _MyHomePageState extends State<MyHomePage> {
103103
// action in the IDE, or press "p" in the console), to see the
104104
// wireframe for each widget.
105105
mainAxisAlignment: MainAxisAlignment.center,
106-
children: <Widget>[
106+
children: [
107107
const Text('You have pushed the button this many times:'),
108108
Text(
109109
'$_counter',
@@ -116,7 +116,7 @@ class _MyHomePageState extends State<MyHomePage> {
116116
onPressed: _incrementCounter,
117117
tooltip: 'Increment',
118118
child: const Icon(Icons.add),
119-
), // This trailing comma makes auto-formatting nicer for build methods.
119+
),
120120
);
121121
}
122122
}

example/linux/runner/my_application.cc

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ struct _MyApplication {
1515
G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION)
1616

1717
// Called when first Flutter frame received.
18-
static void first_frame_cb(MyApplication* self, FlView *view)
19-
{
18+
static void first_frame_cb(MyApplication* self, FlView* view) {
2019
gtk_widget_show(gtk_widget_get_toplevel(GTK_WIDGET(view)));
2120
}
2221

@@ -56,19 +55,22 @@ static void my_application_activate(GApplication* application) {
5655
gtk_window_set_default_size(window, 1280, 720);
5756

5857
g_autoptr(FlDartProject) project = fl_dart_project_new();
59-
fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments);
58+
fl_dart_project_set_dart_entrypoint_arguments(
59+
project, self->dart_entrypoint_arguments);
6060

6161
FlView* view = fl_view_new(project);
6262
GdkRGBA background_color;
63-
// Background defaults to black, override it here if necessary, e.g. #00000000 for transparent.
63+
// Background defaults to black, override it here if necessary, e.g. #00000000
64+
// for transparent.
6465
gdk_rgba_parse(&background_color, "#000000");
6566
fl_view_set_background_color(view, &background_color);
6667
gtk_widget_show(GTK_WIDGET(view));
6768
gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view));
6869

6970
// Show the window when Flutter renders.
7071
// 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+
g_signal_connect_swapped(view, "first-frame", G_CALLBACK(first_frame_cb),
73+
self);
7274
gtk_widget_realize(GTK_WIDGET(view));
7375

7476
fl_register_plugins(FL_PLUGIN_REGISTRY(view));
@@ -77,16 +79,18 @@ static void my_application_activate(GApplication* application) {
7779
}
7880

7981
// Implements GApplication::local_command_line.
80-
static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) {
82+
static gboolean my_application_local_command_line(GApplication* application,
83+
gchar*** arguments,
84+
int* exit_status) {
8185
MyApplication* self = MY_APPLICATION(application);
8286
// Strip out the first argument as it is the binary name.
8387
self->dart_entrypoint_arguments = g_strdupv(*arguments + 1);
8488

8589
g_autoptr(GError) error = nullptr;
8690
if (!g_application_register(application, nullptr, &error)) {
87-
g_warning("Failed to register: %s", error->message);
88-
*exit_status = 1;
89-
return TRUE;
91+
g_warning("Failed to register: %s", error->message);
92+
*exit_status = 1;
93+
return TRUE;
9094
}
9195

9296
g_application_activate(application);
@@ -97,7 +101,7 @@ static gboolean my_application_local_command_line(GApplication* application, gch
97101

98102
// Implements GApplication::startup.
99103
static void my_application_startup(GApplication* application) {
100-
//MyApplication* self = MY_APPLICATION(object);
104+
// MyApplication* self = MY_APPLICATION(object);
101105

102106
// Perform any actions required at application startup.
103107

@@ -106,7 +110,7 @@ static void my_application_startup(GApplication* application) {
106110

107111
// Implements GApplication::shutdown.
108112
static void my_application_shutdown(GApplication* application) {
109-
//MyApplication* self = MY_APPLICATION(object);
113+
// MyApplication* self = MY_APPLICATION(object);
110114

111115
// Perform any actions required at application shutdown.
112116

@@ -122,7 +126,8 @@ static void my_application_dispose(GObject* object) {
122126

123127
static void my_application_class_init(MyApplicationClass* klass) {
124128
G_APPLICATION_CLASS(klass)->activate = my_application_activate;
125-
G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line;
129+
G_APPLICATION_CLASS(klass)->local_command_line =
130+
my_application_local_command_line;
126131
G_APPLICATION_CLASS(klass)->startup = my_application_startup;
127132
G_APPLICATION_CLASS(klass)->shutdown = my_application_shutdown;
128133
G_OBJECT_CLASS(klass)->dispose = my_application_dispose;
@@ -138,7 +143,6 @@ MyApplication* my_application_new() {
138143
g_set_prgname(APPLICATION_ID);
139144

140145
return MY_APPLICATION(g_object_new(my_application_get_type(),
141-
"application-id", APPLICATION_ID,
142-
"flags", G_APPLICATION_NON_UNIQUE,
143-
nullptr));
146+
"application-id", APPLICATION_ID, "flags",
147+
G_APPLICATION_NON_UNIQUE, nullptr));
144148
}

example/linux/runner/my_application.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33

44
#include <gtk/gtk.h>
55

6-
G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION,
6+
G_DECLARE_FINAL_TYPE(MyApplication,
7+
my_application,
8+
MY,
9+
APPLICATION,
710
GtkApplication)
811

912
/**

example/pubspec.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ packages:
6666
dependency: transitive
6767
description:
6868
name: logger
69-
sha256: "55d6c23a6c15db14920e037fe7e0dc32e7cdaf3b64b4b25df2d541b5b6b81c0c"
69+
sha256: a7967e31b703831a893bbc3c3dd11db08126fe5f369b5c648a36f821979f5be3
7070
url: "https://pub.dev"
7171
source: hosted
72-
version: "2.6.1"
72+
version: "2.6.2"
7373
material_color_utilities:
7474
dependency: transitive
7575
description:
@@ -82,10 +82,10 @@ packages:
8282
dependency: transitive
8383
description:
8484
name: meta
85-
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
85+
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
8686
url: "https://pub.dev"
8787
source: hosted
88-
version: "1.16.0"
88+
version: "1.17.0"
8989
package_rename:
9090
dependency: "direct dev"
9191
description:

0 commit comments

Comments
 (0)