-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* remove import external libs on pluginClass * add macos dummy plugin * add android dummy plugin * add ios dummy plugin * update lib * Update pubspec.yaml * update example
- Loading branch information
1 parent
c2a6142
commit 628e986
Showing
25 changed files
with
281 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/workspace.xml | ||
/.idea/libraries | ||
.DS_Store | ||
/build | ||
/captures |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
group 'com.mesosfer.flimer' | ||
version '1.0-SNAPSHOT' | ||
|
||
buildscript { | ||
ext.kotlin_version = '1.3.50' | ||
repositories { | ||
google() | ||
jcenter() | ||
} | ||
|
||
dependencies { | ||
classpath 'com.android.tools.build:gradle:4.1.0' | ||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | ||
} | ||
} | ||
|
||
rootProject.allprojects { | ||
repositories { | ||
google() | ||
jcenter() | ||
} | ||
} | ||
|
||
apply plugin: 'com.android.library' | ||
apply plugin: 'kotlin-android' | ||
|
||
android { | ||
compileSdkVersion 30 | ||
|
||
sourceSets { | ||
main.java.srcDirs += 'src/main/kotlin' | ||
} | ||
defaultConfig { | ||
minSdkVersion 16 | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
org.gradle.jvmargs=-Xmx1536M | ||
android.useAndroidX=true | ||
android.enableJetifier=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rootProject.name = 'flimer' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.mesosfer.flimer"> | ||
</manifest> |
32 changes: 32 additions & 0 deletions
32
android/src/main/kotlin/com/mesosfer/flimer/FlimerPlugin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.mesosfer.flimer | ||
|
||
import androidx.annotation.NonNull | ||
|
||
import io.flutter.embedding.engine.plugins.FlutterPlugin | ||
import io.flutter.plugin.common.MethodCall | ||
import io.flutter.plugin.common.MethodChannel | ||
import io.flutter.plugin.common.MethodChannel.MethodCallHandler | ||
import io.flutter.plugin.common.MethodChannel.Result | ||
import io.flutter.plugin.common.PluginRegistry.Registrar | ||
|
||
/** FlimerPlugin */ | ||
class FlimerPlugin: FlutterPlugin, MethodCallHandler { | ||
/// The MethodChannel that will the communication between Flutter and native Android | ||
/// | ||
/// This local reference serves to register the plugin with the Flutter Engine and unregister it | ||
/// when the Flutter Engine is detached from the Activity | ||
private lateinit var channel : MethodChannel | ||
|
||
override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { | ||
channel = MethodChannel(flutterPluginBinding.binaryMessenger, "flimer") | ||
channel.setMethodCallHandler(this) | ||
} | ||
|
||
override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) { | ||
result.notImplemented() | ||
} | ||
|
||
override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) { | ||
channel.setMethodCallHandler(null) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
.idea/ | ||
.vagrant/ | ||
.sconsign.dblite | ||
.svn/ | ||
|
||
.DS_Store | ||
*.swp | ||
profile | ||
|
||
DerivedData/ | ||
build/ | ||
GeneratedPluginRegistrant.h | ||
GeneratedPluginRegistrant.m | ||
|
||
.generated/ | ||
|
||
*.pbxuser | ||
*.mode1v3 | ||
*.mode2v3 | ||
*.perspectivev3 | ||
|
||
!default.pbxuser | ||
!default.mode1v3 | ||
!default.mode2v3 | ||
!default.perspectivev3 | ||
|
||
xcuserdata | ||
|
||
*.moved-aside | ||
|
||
*.pyc | ||
*sync/ | ||
Icon? | ||
.tags* | ||
|
||
/Flutter/Generated.xcconfig | ||
/Flutter/flutter_export_environment.sh |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#import <Flutter/Flutter.h> | ||
|
||
@interface FlimerPlugin : NSObject<FlutterPlugin> | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#import "FlimerPlugin.h" | ||
#if __has_include(<flimer/flimer-Swift.h>) | ||
#import <flimer/flimer-Swift.h> | ||
#else | ||
// Support project import fallback if the generated compatibility header | ||
// is not copied when this plugin is created as a library. | ||
// https://forums.swift.org/t/swift-static-libraries-dont-copy-generated-objective-c-header/19816 | ||
#import "flimer-Swift.h" | ||
#endif | ||
|
||
@implementation FlimerPlugin | ||
+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar { | ||
[SwiftFlimerPlugin registerWithRegistrar:registrar]; | ||
} | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import Flutter | ||
import UIKit | ||
|
||
public class SwiftFlimerPlugin: NSObject, FlutterPlugin { | ||
public static func register(with registrar: FlutterPluginRegistrar) { | ||
let channel = FlutterMethodChannel(name: "flimer", binaryMessenger: registrar.messenger()) | ||
let instance = SwiftFlimerPlugin() | ||
registrar.addMethodCallDelegate(instance, channel: channel) | ||
} | ||
|
||
public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { | ||
result(FlutterMethodNotImplemented) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# | ||
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. | ||
# Run `pod lib lint flimer.podspec` to validate before publishing. | ||
# | ||
Pod::Spec.new do |s| | ||
s.name = 'flimer' | ||
s.version = '1.0.0' | ||
s.summary = 'Flutter plugin for picking images on Mobile, Desktop and Web.' | ||
s.description = <<-DESC | ||
Flutter plugin for picking images on Mobile, Desktop and Web. | ||
DESC | ||
s.homepage = 'https://github.com/eyro-labs/flimer' | ||
s.license = { :file => '../LICENSE' } | ||
s.author = { 'Eyro Labs' => '[email protected]' } | ||
s.source = { :path => '.' } | ||
s.source_files = 'Classes/**/*' | ||
s.dependency 'Flutter' | ||
s.platform = :ios, '8.0' | ||
|
||
# Flutter.framework does not contain a i386 slice. | ||
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } | ||
s.swift_version = '5.0' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/// Specifies the source where the picked image should come from. | ||
enum ImageSource { | ||
/// Opens up the device camera, letting the user to take a new picture. | ||
camera, | ||
|
||
/// Opens the user's photo gallery. | ||
gallery, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import Cocoa | ||
import FlutterMacOS | ||
|
||
public class FlimerPlugin: NSObject, FlutterPlugin { | ||
public static func register(with registrar: FlutterPluginRegistrar) { | ||
let channel = FlutterMethodChannel(name: "flimer", binaryMessenger: registrar.messenger) | ||
let instance = FlimerPlugin() | ||
registrar.addMethodCallDelegate(instance, channel: channel) | ||
} | ||
|
||
public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { | ||
result(FlutterMethodNotImplemented) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# | ||
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. | ||
# Run `pod lib lint flimer.podspec` to validate before publishing. | ||
# | ||
Pod::Spec.new do |s| | ||
s.name = 'flimer' | ||
s.version = '1.0.0' | ||
s.summary = 'Flutter plugin for picking images on Mobile, Desktop and Web.' | ||
s.description = <<-DESC | ||
Flutter plugin for picking images on Mobile, Desktop and Web. | ||
DESC | ||
s.homepage = 'https://github.com/eyro-labs/flimer' | ||
s.license = { :file => '../LICENSE' } | ||
s.author = { 'Eyro Labs' => '[email protected]' } | ||
s.source = { :path => '.' } | ||
s.source_files = 'Classes/**/*' | ||
s.dependency 'FlutterMacOS' | ||
|
||
s.platform = :osx, '10.11' | ||
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } | ||
s.swift_version = '5.0' | ||
end |
Oops, something went wrong.