Skip to content

Commit 7661a0c

Browse files
homescreen_codelab Add a rebuild script and clean up code (#2306)
## 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 9ef5c94 commit 7661a0c

File tree

176 files changed

+3548
-1117
lines changed

Some content is hidden

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

176 files changed

+3548
-1117
lines changed

homescreen_codelab/codelab_rebuild.yaml

Lines changed: 2201 additions & 0 deletions
Large diffs are not rendered by default.

homescreen_codelab/step_03/.gitignore

Lines changed: 2 additions & 1 deletion
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
@@ -27,7 +29,6 @@ migrate_working_dir/
2729
.dart_tool/
2830
.flutter-plugins
2931
.flutter-plugins-dependencies
30-
.packages
3132
.pub-cache/
3233
.pub/
3334
/build/
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "homescreen_widgets",
9+
"request": "launch",
10+
"type": "dart"
11+
}
12+
]
13+
}

homescreen_codelab/step_03/android/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ gradle-wrapper.jar
55
/gradlew.bat
66
/local.properties
77
GeneratedPluginRegistrant.java
8+
.cxx/
89

910
# Remember to never publicly share your keystore.
10-
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11+
# See https://flutter.dev/to/reference-keystore
1112
key.properties
1213
**/*.keystore
1314
**/*.jks

homescreen_codelab/step_03/android/app/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ android {
2323
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
2424
applicationId = "com.mydomain.homescreen_widgets"
2525
// You can update the following values to match your application needs.
26-
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
26+
// For more information, see: https://flutter.dev/to/review-gradle-config.
2727
minSdk = flutter.minSdkVersion
2828
targetSdk = flutter.targetSdkVersion
2929
versionCode = flutter.versionCode

homescreen_codelab/step_03/android/app/src/main/AndroidManifest.xml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
22
<application
3-
android:label="home_widget_codelab"
3+
android:label="homescreen_widgets"
44
android:name="${applicationName}"
55
android:icon="@mipmap/ic_launcher">
66
<activity
77
android:name=".MainActivity"
88
android:exported="true"
99
android:launchMode="singleTop"
10+
android:taskAffinity=""
1011
android:theme="@style/LaunchTheme"
1112
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
1213
android:hardwareAccelerated="true"
@@ -30,4 +31,15 @@
3031
android:name="flutterEmbedding"
3132
android:value="2" />
3233
</application>
34+
<!-- Required to query activities that can process text, see:
35+
https://developer.android.com/training/package-visibility and
36+
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
37+
38+
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
39+
<queries>
40+
<intent>
41+
<action android:name="android.intent.action.PROCESS_TEXT"/>
42+
<data android:mimeType="text/plain"/>
43+
</intent>
44+
</queries>
3345
</manifest>

homescreen_codelab/step_03/android/app/src/main/kotlin/com/mydomain/homescreen_widgets/MainActivity.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ package com.mydomain.homescreen_widgets
22

33
import io.flutter.embedding.android.FlutterActivity
44

5-
class MainActivity: FlutterActivity() {
6-
}
5+
class MainActivity : FlutterActivity()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
org.gradle.jvmargs=-Xmx1536M
1+
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
22
android.useAndroidX=true
33
android.enableJetifier=true

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

homescreen_codelab/step_03/android/settings.gradle.kts

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 "8.7.3" apply false
22-
id("org.jetbrains.kotlin.android") version "2.1.0" apply false
21+
id("com.android.application") version "8.7.0" apply false
22+
id("org.jetbrains.kotlin.android") version "1.8.22" apply false
2323
}
2424

2525
include(":app")

homescreen_codelab/step_03/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>11.0</string>
24+
<string>12.0</string>
2525
</dict>
2626
</plist>

homescreen_codelab/step_03/ios/Podfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Uncomment this line to define a global platform for your project
2-
# platform :ios, '11.0'
2+
# platform :ios, '12.0'
33

44
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
55
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
@@ -29,9 +29,11 @@ flutter_ios_podfile_setup
2929

3030
target 'Runner' do
3131
use_frameworks!
32-
use_modular_headers!
3332

3433
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
34+
target 'RunnerTests' do
35+
inherit! :search_paths
36+
end
3537
end
3638

3739
post_install do |installer|

0 commit comments

Comments
 (0)