Skip to content

Commit 0651975

Browse files
[platform] Example app for platform (#4834)
This creates an example app for the platform package. Fixes flutter/flutter#133471
1 parent f4fccb2 commit 0651975

File tree

114 files changed

+4215
-1
lines changed

Some content is hidden

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

114 files changed

+4215
-1
lines changed

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,17 @@ updates:
537537
- dependency-name: "org.robolectric:*"
538538
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
539539

540+
- package-ecosystem: "gradle"
541+
directory: "/packages/platform/example/android/app"
542+
commit-message:
543+
prefix: "[platform]"
544+
schedule:
545+
interval: "weekly"
546+
open-pull-requests-limit: 10
547+
ignore:
548+
- dependency-name: "*"
549+
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
550+
540551
- package-ecosystem: "gradle"
541552
directory: "/packages/pigeon/platform_tests/test_plugin/android"
542553
commit-message:

packages/platform/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 3.1.3
2+
3+
* Adds example app.
4+
15
## 3.1.2
26

37
* Adds pub topics to package metadata.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.buildlog/
9+
.history
10+
.svn/
11+
migrate_working_dir/
12+
13+
# IntelliJ related
14+
*.iml
15+
*.ipr
16+
*.iws
17+
.idea/
18+
19+
# The .vscode folder contains launch configuration and tasks you configure in
20+
# VS Code which you may wish to be included in version control, so this line
21+
# is commented out by default.
22+
#.vscode/
23+
24+
# Flutter/Dart/Pub related
25+
**/doc/api/
26+
**/ios/Flutter/.last_build_id
27+
.dart_tool/
28+
.flutter-plugins
29+
.flutter-plugins-dependencies
30+
.packages
31+
.pub-cache/
32+
.pub/
33+
/build/
34+
35+
# Symbolication related
36+
app.*.symbols
37+
38+
# Obfuscation related
39+
app.*.map.json
40+
41+
# Android Studio will place build artifacts here
42+
/android/app/debug
43+
/android/app/profile
44+
/android/app/release
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled and should not be manually edited.
5+
6+
version:
7+
revision: "efbf63d9c66b9f6ec30e9ad4611189aa80003d31"
8+
channel: "stable"
9+
10+
project_type: app
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: efbf63d9c66b9f6ec30e9ad4611189aa80003d31
17+
base_revision: efbf63d9c66b9f6ec30e9ad4611189aa80003d31
18+
- platform: android
19+
create_revision: efbf63d9c66b9f6ec30e9ad4611189aa80003d31
20+
base_revision: efbf63d9c66b9f6ec30e9ad4611189aa80003d31
21+
- platform: ios
22+
create_revision: efbf63d9c66b9f6ec30e9ad4611189aa80003d31
23+
base_revision: efbf63d9c66b9f6ec30e9ad4611189aa80003d31
24+
- platform: linux
25+
create_revision: efbf63d9c66b9f6ec30e9ad4611189aa80003d31
26+
base_revision: efbf63d9c66b9f6ec30e9ad4611189aa80003d31
27+
- platform: macos
28+
create_revision: efbf63d9c66b9f6ec30e9ad4611189aa80003d31
29+
base_revision: efbf63d9c66b9f6ec30e9ad4611189aa80003d31
30+
- platform: windows
31+
create_revision: efbf63d9c66b9f6ec30e9ad4611189aa80003d31
32+
base_revision: efbf63d9c66b9f6ec30e9ad4611189aa80003d31
33+
34+
# User provided section
35+
36+
# List of Local paths (relative to this file) that should be
37+
# ignored by the migrate tool.
38+
#
39+
# Files that are not part of the templates will be ignored by default.
40+
unmanaged_files:
41+
- 'lib/main.dart'
42+
- 'ios/Runner.xcodeproj/project.pbxproj'
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
gradle-wrapper.jar
2+
/.gradle
3+
/captures/
4+
/gradlew
5+
/gradlew.bat
6+
/local.properties
7+
GeneratedPluginRegistrant.java
8+
9+
# Remember to never publicly share your keystore.
10+
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11+
key.properties
12+
**/*.keystore
13+
**/*.jks
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
id "dev.flutter.flutter-gradle-plugin"
5+
}
6+
7+
def localProperties = new Properties()
8+
def localPropertiesFile = rootProject.file('local.properties')
9+
if (localPropertiesFile.exists()) {
10+
localPropertiesFile.withReader('UTF-8') { reader ->
11+
localProperties.load(reader)
12+
}
13+
}
14+
15+
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
16+
if (flutterVersionCode == null) {
17+
flutterVersionCode = '1'
18+
}
19+
20+
def flutterVersionName = localProperties.getProperty('flutter.versionName')
21+
if (flutterVersionName == null) {
22+
flutterVersionName = '1.0'
23+
}
24+
25+
android {
26+
namespace "dev.flutter.plaform_example"
27+
compileSdkVersion flutter.compileSdkVersion
28+
ndkVersion flutter.ndkVersion
29+
30+
compileOptions {
31+
sourceCompatibility JavaVersion.VERSION_1_8
32+
targetCompatibility JavaVersion.VERSION_1_8
33+
}
34+
35+
kotlinOptions {
36+
jvmTarget = '1.8'
37+
}
38+
39+
sourceSets {
40+
main.java.srcDirs += 'src/main/kotlin'
41+
}
42+
43+
defaultConfig {
44+
applicationId "dev.flutter.plaform_example"
45+
minSdkVersion flutter.minSdkVersion
46+
targetSdkVersion flutter.targetSdkVersion
47+
versionCode flutterVersionCode.toInteger()
48+
versionName flutterVersionName
49+
}
50+
51+
buildTypes {
52+
release {
53+
signingConfig signingConfigs.debug
54+
}
55+
}
56+
}
57+
58+
flutter {
59+
source '../..'
60+
}
61+
62+
dependencies {}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
<!-- The INTERNET permission is required for development. Specifically,
3+
the Flutter tool needs it to communicate with the running application
4+
to allow setting breakpoints, to provide hot reload, etc.
5+
-->
6+
<uses-permission android:name="android.permission.INTERNET"/>
7+
</manifest>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
<application
3+
android:label="plaform_example"
4+
android:name="${applicationName}"
5+
android:icon="@mipmap/ic_launcher">
6+
<activity
7+
android:name=".MainActivity"
8+
android:exported="true"
9+
android:launchMode="singleTop"
10+
android:theme="@style/LaunchTheme"
11+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
12+
android:hardwareAccelerated="true"
13+
android:windowSoftInputMode="adjustResize">
14+
<!-- Specifies an Android theme to apply to this Activity as soon as
15+
the Android process has started. This theme is visible to the user
16+
while the Flutter UI initializes. After that, this theme continues
17+
to determine the Window background behind the Flutter UI. -->
18+
<meta-data
19+
android:name="io.flutter.embedding.android.NormalTheme"
20+
android:resource="@style/NormalTheme"
21+
/>
22+
<intent-filter>
23+
<action android:name="android.intent.action.MAIN"/>
24+
<category android:name="android.intent.category.LAUNCHER"/>
25+
</intent-filter>
26+
</activity>
27+
<!-- Don't delete the meta-data below.
28+
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
29+
<meta-data
30+
android:name="flutterEmbedding"
31+
android:value="2" />
32+
</application>
33+
</manifest>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Copyright 2013 The Flutter Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
package dev.flutter.plaform_example
6+
7+
import io.flutter.embedding.android.FlutterActivity
8+
9+
class MainActivity: FlutterActivity() {
10+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
3+
<item android:drawable="?android:colorBackground" />
4+
</layer-list>

0 commit comments

Comments
 (0)