Skip to content

Commit faab2f7

Browse files
committed
Changelog:Migrated base project to swift/kotlin
- Added effective dart style.
1 parent 0f9b42f commit faab2f7

File tree

40 files changed

+190
-294
lines changed

40 files changed

+190
-294
lines changed

.gitignore

Lines changed: 17 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,24 @@
1-
# Miscellaneous
2-
*.class
3-
*.log
4-
*.pyc
5-
*.swp
61
.DS_Store
7-
.atom/
8-
.buildlog/
9-
.history
10-
.svn/
11-
12-
# IntelliJ related
13-
*.iml
14-
*.ipr
15-
*.iws
16-
.idea/
17-
18-
# Visual Studio Code related
19-
.vscode/
20-
21-
# Flutter/Dart/Pub related
22-
**/doc/api/
232
.dart_tool/
24-
.flutter-plugins
3+
254
.packages
26-
.pub-cache/
275
.pub/
28-
/build/
296

30-
# Android related
31-
**/android/**/gradle-wrapper.jar
32-
**/android/.gradle
33-
**/android/captures/
34-
**/android/gradlew
35-
**/android/gradlew.bat
36-
**/android/local.properties
37-
**/android/**/GeneratedPluginRegistrant.java
7+
build/
388

39-
# iOS/XCode related
40-
**/ios/**/*.mode1v3
41-
**/ios/**/*.mode2v3
42-
**/ios/**/*.moved-aside
43-
**/ios/**/*.pbxuser
44-
**/ios/**/*.perspectivev3
45-
**/ios/**/*sync/
46-
**/ios/**/.sconsign.dblite
47-
**/ios/**/.tags*
48-
**/ios/**/.vagrant/
49-
**/ios/**/DerivedData/
50-
**/ios/**/Icon?
51-
**/ios/**/Pods/
52-
**/ios/**/.symlinks/
53-
**/ios/**/profile
54-
**/ios/**/xcuserdata
55-
**/ios/.generated/
56-
**/ios/Flutter/App.framework
57-
**/ios/Flutter/Flutter.framework
58-
**/ios/Flutter/Generated.xcconfig
59-
**/ios/Flutter/app.flx
60-
**/ios/Flutter/app.zip
61-
**/ios/Flutter/flutter_assets/
62-
**/ios/ServiceDefinitions.json
63-
**/ios/Runner/GeneratedPluginRegistrant.*
649

65-
# Exceptions to above rules.
66-
!**/ios/**/default.mode1v3
67-
!**/ios/**/default.mode2v3
68-
!**/ios/**/default.pbxuser
69-
!**/ios/**/default.perspectivev3
70-
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
10+
.atom/
11+
.idea
12+
.vscode
13+
packages/**/ios/
14+
packages/**/android/
15+
doc/
16+
pubspec.lock
17+
.flutter-plugins
18+
*.iml
19+
coverage/
20+
.test_coverage.dart
21+
*.log
22+
flutter_export_environment.sh
23+
!packages/**/example/ios/
24+
!packages/**/example/android/

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# http_interceptor
22

3+
[![Pub](https://img.shields.io/pub/v/http_interceptor.svg)](https://pub.dev/packages/http_interceptor)
4+
[![style: effective dart](https://img.shields.io/badge/style-effective_dart-40c4ff.svg)](https://github.com/tenhobi/effective_dart)
5+
[![License: MIT](https://img.shields.io/badge/license-MIT-purple.svg)](https://opensource.org/licenses/MIT)
6+
[![Star on GitHub](https://img.shields.io/github/stars/codingalecr/http_interceptor.svg?style=flat&logo=github&colorB=deeppink&label=stars)](https://github.com/codingalecr/http_interceptor)
7+
38
A middleware library that lets you modify requests and responses if desired. Based of on [http_middleware](https://github.com/TEDConsulting/http_middleware)
49

510
## Getting Started

analysis_options.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include: package:effective_dart/analysis_options.1.1.0.yaml

android/build.gradle

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
group 'codingalecr.http_interceptor'
1+
group 'com.example.http_interceptor'
22
version '1.0-SNAPSHOT'
33

44
buildscript {
5+
ext.kotlin_version = '1.2.71'
56
repositories {
67
google()
78
jcenter()
89
}
910

1011
dependencies {
1112
classpath 'com.android.tools.build:gradle:3.2.1'
13+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1214
}
1315
}
1416

@@ -20,10 +22,14 @@ rootProject.allprojects {
2022
}
2123

2224
apply plugin: 'com.android.library'
25+
apply plugin: 'kotlin-android'
2326

2427
android {
2528
compileSdkVersion 28
2629

30+
sourceSets {
31+
main.java.srcDirs += 'src/main/kotlin'
32+
}
2733
defaultConfig {
2834
minSdkVersion 16
2935
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
@@ -32,3 +38,7 @@ android {
3238
disable 'InvalidPackage'
3339
}
3440
}
41+
42+
dependencies {
43+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
44+
}

android/gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
org.gradle.jvmargs=-Xmx1536M
2+
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+
zipStoreBase=GRADLE_USER_HOME
4+
zipStorePath=wrapper/dists
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="codingalecr.http_interceptor">
2+
package="com.example.http_interceptor">
33
</manifest>

android/src/main/java/codingalecr/http_interceptor/HttpInterceptorPlugin.java

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package com.example.http_interceptor
2+
3+
import io.flutter.plugin.common.MethodCall
4+
import io.flutter.plugin.common.MethodChannel
5+
import io.flutter.plugin.common.MethodChannel.MethodCallHandler
6+
import io.flutter.plugin.common.MethodChannel.Result
7+
import io.flutter.plugin.common.PluginRegistry.Registrar
8+
9+
class HttpInterceptorPlugin: MethodCallHandler {
10+
companion object {
11+
@JvmStatic
12+
fun registerWith(registrar: Registrar) {
13+
val channel = MethodChannel(registrar.messenger(), "http_interceptor")
14+
channel.setMethodCallHandler(HttpInterceptorPlugin())
15+
}
16+
}
17+
18+
override fun onMethodCall(call: MethodCall, result: Result) {
19+
if (call.method == "getPlatformVersion") {
20+
result.success("Android ${android.os.Build.VERSION.RELEASE}")
21+
} else {
22+
result.notImplemented()
23+
}
24+
}
25+
}

example/.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
*.iws
1616
.idea/
1717

18-
# Visual Studio Code related
18+
# The .vscode folder contains launch configuration and tasks you configure in
19+
# VS Code which you may wish to be included in version control, so this line
20+
# is commented out by default.
1921
.vscode/
2022

2123
# Flutter/Dart/Pub related
@@ -59,6 +61,7 @@
5961
**/ios/Flutter/app.flx
6062
**/ios/Flutter/app.zip
6163
**/ios/Flutter/flutter_assets/
64+
**/ios/Flutter/flutter_export_environment.sh
6265
**/ios/ServiceDefinitions.json
6366
**/ios/Runner/GeneratedPluginRegistrant.*
6467

@@ -67,4 +70,4 @@
6770
!**/ios/**/default.mode2v3
6871
!**/ios/**/default.pbxuser
6972
!**/ios/**/default.perspectivev3
70-
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
73+
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages

0 commit comments

Comments
 (0)