Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit adc3880

Browse files
[path_provider_macos] Adds example app (#2559)
* Add macos exmaple * Update version * Fix analyzer * Fix * space * Remove tests * Address comment * Remove show * Import * Add platform * Use right import
1 parent 73033b4 commit adc3880

75 files changed

Lines changed: 2635 additions & 2 deletions

File tree

Some content is hidden

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

packages/path_provider/path_provider_macos/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.0.4
2+
3+
* Adds an example app to run integration tests.
4+
15
## 0.0.3+1
26

37
* Make the pedantic dev_dependency explicit.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# path_provider_macos_example
2+
3+
Demonstrates how to use the path_provider_macos plugin.
4+
5+
## Getting Started
6+
7+
For help getting started with Flutter, view our online
8+
[documentation](http://flutter.io/).
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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 from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
26+
27+
android {
28+
compileSdkVersion 28
29+
30+
lintOptions {
31+
disable 'InvalidPackage'
32+
}
33+
34+
defaultConfig {
35+
applicationId "io.flutter.plugins.pathproviderexample"
36+
minSdkVersion 16
37+
targetSdkVersion 28
38+
versionCode flutterVersionCode.toInteger()
39+
versionName flutterVersionName
40+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
41+
}
42+
43+
buildTypes {
44+
release {
45+
// TODO: Add your own signing config for the release build.
46+
// Signing with the debug keys for now, so `flutter run --release` works.
47+
signingConfig signingConfigs.debug
48+
}
49+
}
50+
}
51+
52+
flutter {
53+
source '../..'
54+
}
55+
56+
dependencies {
57+
androidTestImplementation 'androidx.test:runner:1.2.0'
58+
androidTestImplementation 'androidx.test:rules:1.2.0'
59+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
60+
61+
testImplementation 'junit:junit:4.12'
62+
androidTestImplementation 'androidx.test:runner:1.1.1'
63+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
64+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
package io.flutter.plugins.pathprovider;
3+
4+
import androidx.test.rule.ActivityTestRule;
5+
import dev.flutter.plugins.e2e.FlutterRunner;
6+
import io.flutter.plugins.pathproviderexample.EmbeddingV1Activity;
7+
import org.junit.Rule;
8+
import org.junit.runner.RunWith;
9+
10+
@RunWith(FlutterRunner.class)
11+
public class EmbeddingV1ActivityTest {
12+
@Rule
13+
public ActivityTestRule<EmbeddingV1Activity> rule =
14+
new ActivityTestRule<>(EmbeddingV1Activity.class);
15+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
package io.flutter.plugins.pathprovider;
3+
4+
import androidx.test.rule.ActivityTestRule;
5+
import dev.flutter.plugins.e2e.FlutterRunner;
6+
import io.flutter.plugins.pathproviderexample.MainActivity;
7+
import org.junit.Rule;
8+
import org.junit.runner.RunWith;
9+
10+
@RunWith(FlutterRunner.class)
11+
public class MainActivityTest {
12+
@Rule public ActivityTestRule<MainActivity> rule = new ActivityTestRule<>(MainActivity.class);
13+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="io.flutter.plugins.pathproviderexample">
3+
4+
<uses-permission android:name="android.permission.INTERNET"/>
5+
6+
<application android:name="io.flutter.app.FlutterApplication" android:label="path_provider_example" android:icon="@mipmap/ic_launcher">
7+
<activity
8+
android:name=".EmbeddingV1Activity"
9+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale"
10+
android:hardwareAccelerated="true"
11+
android:windowSoftInputMode="adjustResize">
12+
</activity>
13+
<activity android:name=".MainActivity"
14+
android:launchMode="singleTop"
15+
android:theme="@android:style/Theme.Black.NoTitleBar"
16+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection"
17+
android:hardwareAccelerated="true"
18+
android:windowSoftInputMode="adjustResize">
19+
<intent-filter>
20+
<action android:name="android.intent.action.MAIN"/>
21+
<category android:name="android.intent.category.LAUNCHER"/>
22+
</intent-filter>
23+
</activity>
24+
</application>
25+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
package io.flutter.plugins.pathproviderexample;
3+
4+
import android.os.Bundle;
5+
import io.flutter.app.FlutterActivity;
6+
import io.flutter.plugins.GeneratedPluginRegistrant;
7+
8+
public class EmbeddingV1Activity extends FlutterActivity {
9+
@Override
10+
protected void onCreate(Bundle savedInstanceState) {
11+
super.onCreate(savedInstanceState);
12+
GeneratedPluginRegistrant.registerWith(this);
13+
}
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2017 The Chromium 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 io.flutter.plugins.pathproviderexample;
6+
7+
import dev.flutter.plugins.e2e.E2EPlugin;
8+
import io.flutter.embedding.android.FlutterActivity;
9+
import io.flutter.embedding.engine.FlutterEngine;
10+
import io.flutter.plugins.pathprovider.PathProviderPlugin;
11+
12+
public class MainActivity extends FlutterActivity {
13+
// TODO(xster): Remove this once v2 of GeneratedPluginRegistrant rolls to stable. https://github.com/flutter/flutter/issues/42694
14+
@Override
15+
public void configureFlutterEngine(FlutterEngine flutterEngine) {
16+
flutterEngine.getPlugins().add(new PathProviderPlugin());
17+
flutterEngine.getPlugins().add(new E2EPlugin());
18+
}
19+
}
544 Bytes
Loading

0 commit comments

Comments
 (0)