Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 0 additions & 45 deletions android/build.gradle

This file was deleted.

19 changes: 19 additions & 0 deletions android/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
group = "com.kasem.receive_sharing_intent"
version = "1.0-SNAPSHOT"

plugins {
id("com.android.library")
kotlin("android") version "1.8.10"
}

android {
compileSdk = 33

defaultConfig {
minSdk = 16
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
lintOptions {
disable += "InvalidPackage"
}
}
2 changes: 2 additions & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
org.gradle.jvmargs=-Xmx1536M
org.gradle.caching=true
org.gradle.vfs.watch=true
4 changes: 2 additions & 2 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu May 30 10:20:31 PDT 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
1 change: 0 additions & 1 deletion android/settings.gradle

This file was deleted.

9 changes: 9 additions & 0 deletions android/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}

rootProject.name = "receive_sharing_intent"
16 changes: 9 additions & 7 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
}


def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
Expand Down Expand Up @@ -26,7 +32,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 30
compileSdk = 30

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -39,8 +45,8 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.kasem.receive_sharing_intent_example"
minSdkVersion 16
targetSdkVersion 30
minSdk = 16
targetSdk = 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
Expand All @@ -58,7 +64,3 @@ android {
flutter {
source '../..'
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
31 changes: 0 additions & 31 deletions example/android/build.gradle

This file was deleted.

12 changes: 12 additions & 0 deletions example/android/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
plugins {
id("com.android.application") version "7.4.2" apply false
kotlin("android") version "1.8.10" apply false
}

rootProject.buildDir = file("../build")
subprojects {
project.buildDir = file("${rootProject.buildDir}/${project.name}")
}
subprojects {
project.evaluationDependsOn(":app")
}
3 changes: 2 additions & 1 deletion example/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true
org.gradle.caching=true
org.gradle.vfs.watch=true
4 changes: 2 additions & 2 deletions example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Mar 05 12:57:35 PST 2021
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
8 changes: 8 additions & 0 deletions example/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}

include ':app'

def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ publish_to: 'none'
version: 1.0.0+1

environment:
sdk: ">=2.12.0 <3.0.0"
sdk: ">=2.12.0"

dependencies:
flutter:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 1.4.5
homepage: https://github.com/KasemJaffer/receive_sharing_intent

environment:
sdk: ">=2.12.0 <3.0.0"
sdk: ">=2.12.0"
flutter: ">=1.10.0"

dependencies:
Expand Down
34 changes: 17 additions & 17 deletions test/receive_sharing_intent_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,29 @@ void main() {

const _testUriString = "content://media/external/images/media/43993";

setUp(() {
channel.setMockMethodCallHandler((MethodCall methodCall) async {
switch (methodCall.method) {
case "getInitialText":
return _testUriString;
case "getInitialTextAsUri":
return Uri.parse(_testUriString);
default:
throw UnimplementedError();
}
});
});
var handler = (methodCall) async {
switch (methodCall.method) {
case "getInitialText":
return _testUriString;
case "getInitialTextAsUri":
return Uri.parse(_testUriString);
default:
throw UnimplementedError();
}
};

tearDown(() {
channel.setMockMethodCallHandler(null);
});
testWidgets("getInitialText", (widgetTester) async {
widgetTester.binding.defaultBinaryMessenger
.setMockMethodCallHandler(channel, handler);

test('getInitialText', () async {
var actual = await ReceiveSharingIntent.getInitialText();
expect(actual, _testUriString);
});

test('getInitialTextAsUri', () async {
testWidgets('getInitialTextAsUri', (tester) async {
tester.binding.defaultBinaryMessenger
.setMockMethodCallHandler(channel, handler);

var actual = await ReceiveSharingIntent.getInitialTextAsUri();
expect(actual, Uri.parse(_testUriString));
});
Expand Down