Skip to content

Commit 26793c2

Browse files
authored
Make cupertino_http example runnable on android and windows. (#775)
1 parent e1669bc commit 26793c2

Some content is hidden

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

55 files changed

+1749
-17
lines changed

pkgs/cupertino_http/example/.metadata

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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.
5+
6+
version:
7+
revision: c8569b6e98e3b83df410c6a1e78545f933d5e735
8+
channel: master
9+
10+
project_type: app
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: c8569b6e98e3b83df410c6a1e78545f933d5e735
17+
base_revision: c8569b6e98e3b83df410c6a1e78545f933d5e735
18+
- platform: android
19+
create_revision: c8569b6e98e3b83df410c6a1e78545f933d5e735
20+
base_revision: c8569b6e98e3b83df410c6a1e78545f933d5e735
21+
- platform: ios
22+
create_revision: c8569b6e98e3b83df410c6a1e78545f933d5e735
23+
base_revision: c8569b6e98e3b83df410c6a1e78545f933d5e735
24+
- platform: linux
25+
create_revision: c8569b6e98e3b83df410c6a1e78545f933d5e735
26+
base_revision: c8569b6e98e3b83df410c6a1e78545f933d5e735
27+
- platform: macos
28+
create_revision: c8569b6e98e3b83df410c6a1e78545f933d5e735
29+
base_revision: c8569b6e98e3b83df410c6a1e78545f933d5e735
30+
- platform: web
31+
create_revision: c8569b6e98e3b83df410c6a1e78545f933d5e735
32+
base_revision: c8569b6e98e3b83df410c6a1e78545f933d5e735
33+
- platform: windows
34+
create_revision: c8569b6e98e3b83df410c6a1e78545f933d5e735
35+
base_revision: c8569b6e98e3b83df410c6a1e78545f933d5e735
36+
37+
# User provided section
38+
39+
# List of Local paths (relative to this file) that should be
40+
# ignored by the migrate tool.
41+
#
42+
# Files that are not part of the templates will be ignored by default.
43+
unmanaged_files:
44+
- 'lib/main.dart'
45+
- '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: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
def localProperties = new Properties()
2+
def localPropertiesFile = rootProject.file('local.properties')
3+
if (localPropertiesFile.exists()) {
4+
localPropertiesFile.withReader('UTF-8') { reader ->
5+
localProperties.load(reader)
6+
}
7+
}
8+
9+
def flutterRoot = localProperties.getProperty('flutter.sdk')
10+
if (flutterRoot == null) {
11+
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12+
}
13+
14+
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15+
if (flutterVersionCode == null) {
16+
flutterVersionCode = '1'
17+
}
18+
19+
def flutterVersionName = localProperties.getProperty('flutter.versionName')
20+
if (flutterVersionName == null) {
21+
flutterVersionName = '1.0'
22+
}
23+
24+
apply plugin: 'com.android.application'
25+
apply plugin: 'kotlin-android'
26+
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27+
28+
android {
29+
compileSdkVersion flutter.compileSdkVersion
30+
ndkVersion flutter.ndkVersion
31+
32+
compileOptions {
33+
sourceCompatibility JavaVersion.VERSION_1_8
34+
targetCompatibility JavaVersion.VERSION_1_8
35+
}
36+
37+
kotlinOptions {
38+
jvmTarget = '1.8'
39+
}
40+
41+
sourceSets {
42+
main.java.srcDirs += 'src/main/kotlin'
43+
}
44+
45+
defaultConfig {
46+
applicationId "io.flutter.cupertino_http_example"
47+
// You can update the following values to match your application needs.
48+
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
49+
minSdkVersion flutter.minSdkVersion
50+
targetSdkVersion flutter.targetSdkVersion
51+
versionCode flutterVersionCode.toInteger()
52+
versionName flutterVersionName
53+
}
54+
55+
buildTypes {
56+
release {
57+
// TODO: Add your own signing config for the release build.
58+
// Signing with the debug keys for now, so `flutter run --release` works.
59+
signingConfig signingConfigs.debug
60+
}
61+
}
62+
}
63+
64+
flutter {
65+
source '../..'
66+
}
67+
68+
dependencies {
69+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
70+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="io.flutter.cupertino_http_example">
3+
<uses-permission android:name="android.permission.INTERNET"/>
4+
</manifest>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="io.flutter.cupertino_http_example">
3+
<uses-permission android:name="android.permission.INTERNET"/>
4+
<application
5+
android:label="example"
6+
android:name="${applicationName}"
7+
android:icon="@mipmap/ic_launcher">
8+
<activity
9+
android:name=".MainActivity"
10+
android:exported="true"
11+
android:launchMode="singleTop"
12+
android:theme="@style/LaunchTheme"
13+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
14+
android:hardwareAccelerated="true"
15+
android:windowSoftInputMode="adjustResize">
16+
<!-- Specifies an Android theme to apply to this Activity as soon as
17+
the Android process has started. This theme is visible to the user
18+
while the Flutter UI initializes. After that, this theme continues
19+
to determine the Window background behind the Flutter UI. -->
20+
<meta-data
21+
android:name="io.flutter.embedding.android.NormalTheme"
22+
android:resource="@style/NormalTheme"
23+
/>
24+
<intent-filter>
25+
<action android:name="android.intent.action.MAIN"/>
26+
<category android:name="android.intent.category.LAUNCHER"/>
27+
</intent-filter>
28+
</activity>
29+
<!-- Don't delete the meta-data below.
30+
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
31+
<meta-data
32+
android:name="flutterEmbedding"
33+
android:value="2" />
34+
</application>
35+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package io.flutter.cupertino_http_example
2+
3+
import io.flutter.embedding.android.FlutterActivity
4+
5+
class MainActivity: FlutterActivity() {
6+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Modify this file to customize your launch splash screen -->
3+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
4+
<item android:drawable="?android:colorBackground" />
5+
6+
<!-- You can insert your own image assets here -->
7+
<!-- <item>
8+
<bitmap
9+
android:gravity="center"
10+
android:src="@mipmap/launch_image" />
11+
</item> -->
12+
</layer-list>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Modify this file to customize your launch splash screen -->
3+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
4+
<item android:drawable="@android:color/white" />
5+
6+
<!-- You can insert your own image assets here -->
7+
<!-- <item>
8+
<bitmap
9+
android:gravity="center"
10+
android:src="@mipmap/launch_image" />
11+
</item> -->
12+
</layer-list>
544 Bytes
Loading
442 Bytes
Loading

0 commit comments

Comments
 (0)