Skip to content

Commit 51632a2

Browse files
author
Raghav Rawat
committed
adding android code
1 parent 9b13bbc commit 51632a2

File tree

102 files changed

+2994
-0
lines changed

Some content is hidden

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

102 files changed

+2994
-0
lines changed

.gitignore

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
26+
/pubspec.lock
27+
**/doc/api/
28+
.dart_tool/
29+
.packages
30+
build/

.metadata

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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: cd41fdd495f6944ecd3506c21e94c6567b073278
8+
channel: stable
9+
10+
project_type: plugin
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: cd41fdd495f6944ecd3506c21e94c6567b073278
17+
base_revision: cd41fdd495f6944ecd3506c21e94c6567b073278
18+
- platform: android
19+
create_revision: cd41fdd495f6944ecd3506c21e94c6567b073278
20+
base_revision: cd41fdd495f6944ecd3506c21e94c6567b073278
21+
- platform: ios
22+
create_revision: cd41fdd495f6944ecd3506c21e94c6567b073278
23+
base_revision: cd41fdd495f6944ecd3506c21e94c6567b073278
24+
- platform: web
25+
create_revision: cd41fdd495f6944ecd3506c21e94c6567b073278
26+
base_revision: cd41fdd495f6944ecd3506c21e94c6567b073278
27+
28+
# User provided section
29+
30+
# List of Local paths (relative to this file) that should be
31+
# ignored by the migrate tool.
32+
#
33+
# Files that are not part of the templates will be ignored by default.
34+
unmanaged_files:
35+
- 'lib/main.dart'
36+
- 'ios/Runner.xcodeproj/project.pbxproj'

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 0.0.1
2+
3+
* TODO: Describe initial release.

LICENSE

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
TODO: Add your license here.

analysis_options.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
include: package:flutter_lints/flutter.yaml
2+
3+
# Additional information about this file can be found at
4+
# https://dart.dev/guides/language/analysis-options

android/.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/workspace.xml
5+
/.idea/libraries
6+
.DS_Store
7+
/build
8+
/captures
9+
.cxx

android/build.gradle

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
group 'io.verloop.verloop_flutter_sdk'
2+
version '1.0-SNAPSHOT'
3+
4+
buildscript {
5+
ext.kotlin_version = '1.6.10'
6+
repositories {
7+
google()
8+
mavenCentral()
9+
}
10+
11+
dependencies {
12+
classpath 'com.android.tools.build:gradle:7.2.1'
13+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14+
}
15+
}
16+
17+
rootProject.allprojects {
18+
repositories {
19+
google()
20+
mavenCentral()
21+
maven { url 'https://jitpack.io' }
22+
}
23+
}
24+
25+
apply plugin: 'com.android.library'
26+
apply plugin: 'kotlin-android'
27+
28+
android {
29+
compileSdkVersion 33
30+
31+
compileOptions {
32+
sourceCompatibility JavaVersion.VERSION_1_8
33+
targetCompatibility JavaVersion.VERSION_1_8
34+
}
35+
36+
kotlinOptions {
37+
jvmTarget = '1.8'
38+
}
39+
40+
sourceSets {
41+
main.java.srcDirs += 'src/main/kotlin'
42+
}
43+
44+
defaultConfig {
45+
minSdkVersion 16
46+
}
47+
}
48+
49+
dependencies {
50+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
51+
implementation 'com.github.verloop:android-sdk:1.1.1-rc.2'
52+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#Fri Jun 23 08:50:38 CEST 2017
2+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip

android/settings.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rootProject.name = 'verloop_flutter_sdk'

android/src/main/AndroidManifest.xml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="io.verloop.verloop_flutter_sdk">
3+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package io.verloop.verloop_flutter_sdk
2+
3+
import android.os.Handler
4+
import android.os.Looper
5+
import io.flutter.plugin.common.EventChannel
6+
7+
8+
class ButtonClickHandler : EventChannel.StreamHandler {
9+
private val uiThreadHandler: Handler = Handler(Looper.getMainLooper())
10+
var sink: EventChannel.EventSink? = null
11+
12+
fun buttonClicked(title: String?, type: String?, payload: String?) {
13+
uiThreadHandler.post {
14+
sink?.success(
15+
mapOf(
16+
"TITLE" to title,
17+
"TYPE" to type,
18+
"PAYLOAD" to payload
19+
)
20+
)
21+
}
22+
}
23+
24+
override fun onListen(arguments: Any?, events: EventChannel.EventSink?) {
25+
sink = events
26+
}
27+
28+
override fun onCancel(arguments: Any?) {
29+
sink = null
30+
}
31+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package io.verloop.verloop_flutter_sdk
2+
3+
import android.os.Handler
4+
import android.os.Looper
5+
import io.flutter.plugin.common.EventChannel
6+
7+
8+
class UrlClickHandler : EventChannel.StreamHandler {
9+
private val uiThreadHandler: Handler = Handler(Looper.getMainLooper())
10+
var sink: EventChannel.EventSink? = null
11+
12+
fun urlClicked(url: String?) {
13+
uiThreadHandler.post {
14+
sink?.success(
15+
mapOf(
16+
"URL" to url,
17+
)
18+
)
19+
}
20+
}
21+
22+
override fun onListen(arguments: Any?, events: EventChannel.EventSink?) {
23+
sink = events
24+
}
25+
26+
override fun onCancel(arguments: Any?) {
27+
sink = null
28+
}
29+
}

0 commit comments

Comments
 (0)