Skip to content

Commit 1e2e2fe

Browse files
committed
added earliest begin date
1 parent 5d367b7 commit 1e2e2fe

Some content is hidden

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

52 files changed

+1708
-1387
lines changed

.cirrus.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
code_style_task:
2+
container:
3+
dockerfile: .ci/Dockerfile
4+
cpu: 8
5+
memory: 16G
6+
# upgrade_script:
7+
# - flutter channel master
8+
# - flutter upgrade
9+
# - git fetch origin master
10+
# activate_script: pub global activate flutter_plugin_tools
11+
matrix:
12+
- name: test+format
13+
# install_script:
14+
# - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
15+
# - sudo apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-7 main"
16+
# - sudo apt-get update
17+
# - sudo apt-get install -y --allow-unauthenticated clang-format-7
18+
format_script: script/format.sh
19+
- name: analyze
20+
script:
21+
- pub global activate tuneup
22+
- flutter packages get
23+
- pub global run tuneup check
24+
25+
android_task:
26+
container:
27+
dockerfile: .ci/Dockerfile
28+
cpu: 8
29+
memory: 16G
30+
build_script:
31+
- cd example && flutter build apk --release
32+
33+
ios_task:
34+
osx_instance:
35+
image: mojave-flutter
36+
build_script:
37+
- pod repo update
38+
- cd example && flutter build ios --release --no-codesign

CHANGELOG.md

+39
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,42 @@
1+
## 1.2.0
2+
3+
- iOS: fix multipartform upload to be able upload large files
4+
- iOS: fix multipartform upload to be able upload multiple files in one uplaod task
5+
6+
## 1.1.0
7+
8+
- iOS: define clang module
9+
- iOS: upgrade example project xcode version & compatibility
10+
11+
## 1.0.6
12+
13+
- fix #21 - handle other successful status code (from http spec) in iOS
14+
15+
## 1.0.5+1
16+
17+
- Android: update AGP and various dependencies
18+
- Android: fixes memory leaks in the example project due to old image_picker dependency
19+
- Android: fix memory leak due not unregistering ActivityLifecycleCallbacks
20+
- Android: fix memory leak due to not unregistering WorkManager observers
21+
22+
## 1.0.3+2
23+
24+
- fix bug that upon cancellation it was cancelling the work request however it wasn't cancelling the already progressing upload request (android);
25+
26+
## 1.0.3+1
27+
28+
- remove Accept-Encoding header because OkHttp transparently adds it (android)
29+
- documentation update
30+
- clean up some code
31+
32+
## 1.0.3
33+
34+
- prevent from start uploading when directory is passed as file path
35+
- update androidx workmanager to 2.0.0
36+
- use observable for tracking progress instead of localbroadcastmanager (deprecation) on android
37+
- fixed few typoes in code
38+
- fixes few typoes in document
39+
140
## 1.0.2
241

342
Thanks @ened for pull requests

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Flutter Uploader
22

3-
A plugin for creating and managing download tasks. Supports iOS and Android.
3+
A plugin for creating and managing upload tasks. Supports iOS and Android.
44

55
This plugin is based on [`WorkManager`][1] in Android and [`NSURLSessionUploadTask`][2] in iOS to run upload task in background mode.
66

@@ -74,7 +74,7 @@ This plugin is inspired by [`flutter_downloader`][5]. Thanks to Hung Duy Ha & Fl
7474
</provider>
7575
```
7676

77-
- **Localize notification messages:** you can localize notification messages of download progress by localizing following messages. (you can find the detail of string localization in Android in this [link][4])
77+
- **Localize notification messages:** you can localize notification messages of upload progress by localizing following messages. (you can find the detail of string localization in Android in this [link][4])
7878

7979
```xml
8080
<string name="flutter_uploader_notification_started">Upload started</string>
@@ -127,7 +127,7 @@ final uploader = FlutterUploader();
127127
final taskId = await uploader.enqueue(
128128
url: "your upload link", //required: url to upload to
129129
files: [FileItem(filename: filename, savedDir: savedDir, fieldname:"file")], // required: list of files that you want to upload
130-
method: UplaodMethod.POST, // HTTP method (POST or PUT or PATCH)
130+
method: UploadMethod.POST, // HTTP method (POST or PUT or PATCH)
131131
headers: {"apikey": "api_123456", "userkey": "userkey_123456"},
132132
data: {"name": "john"}, // any data you want to send in upload request
133133
showNotification: false, // send local notification (android only) for upload status

android/.classpath

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-14/"/>
4+
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
5+
<classpathentry kind="output" path="bin/default"/>
6+
</classpath>

android/.project

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>flutter_uploader</name>
4+
<comment>Project flutter_uploader created by Buildship.</comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>org.eclipse.jdt.core.javanature</nature>
21+
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
22+
</natures>
23+
</projectDescription>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
arguments=
2+
auto.sync=false
3+
build.scans.enabled=false
4+
connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(6.3))
5+
connection.project.dir=
6+
eclipse.preferences.version=1
7+
gradle.user.home=
8+
java.home=/Library/Java/JavaVirtualMachines/adoptopenjdk-14.jdk/Contents/Home
9+
jvm.arguments=
10+
offline.mode=false
11+
override.workspace.settings=true
12+
show.console.view=true
13+
show.executions.view=true

android/build.gradle

+20-9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
group 'com.bluechilli.flutteruploader'
22
version '1.0-SNAPSHOT'
3-
def lifecycle_version = "2.0.0"
4-
def work_version = '1.0.0-rc02'
5-
def futures_version = "1.0.0-alpha03"
3+
def lifecycle_version = "2.1.0"
4+
def work_version = "2.2.0"
5+
def futures_version = "1.0.0-beta01"
6+
def core_version = "1.2.0-alpha04"
7+
def annotation_version = "1.1.0"
8+
def okhttp_version = "4.2.2"
9+
def gson_version = "2.8.5"
610

711
buildscript {
812
repositories {
@@ -11,7 +15,7 @@ buildscript {
1115
}
1216

1317
dependencies {
14-
classpath 'com.android.tools.build:gradle:3.4.1'
18+
classpath 'com.android.tools.build:gradle:3.5.1'
1519
}
1620
}
1721

@@ -31,16 +35,23 @@ android {
3135
minSdkVersion 16
3236
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
3337
}
38+
39+
compileOptions {
40+
sourceCompatibility JavaVersion.VERSION_1_8
41+
targetCompatibility JavaVersion.VERSION_1_8
42+
}
43+
3444
lintOptions {
3545
disable 'InvalidPackage'
3646
}
3747
}
3848

3949
dependencies {
40-
implementation "androidx.work:work-runtime:2.0.0"
50+
implementation "androidx.work:work-runtime:$work_version"
4151
implementation "androidx.concurrent:concurrent-futures:$futures_version"
42-
implementation 'androidx.annotation:annotation:1.0.1'
43-
implementation 'androidx.core:core:1.0.1'
44-
implementation 'com.squareup.okhttp3:okhttp:3.13.1'
45-
implementation 'com.google.code.gson:gson:2.8.5'
52+
implementation "androidx.annotation:annotation:$annotation_version"
53+
implementation "androidx.lifecycle:lifecycle-livedata:$lifecycle_version"
54+
implementation "androidx.core:core:$core_version"
55+
implementation "com.squareup.okhttp3:okhttp:$okhttp_version"
56+
implementation "com.google.code.gson:gson:$gson_version"
4657
}

android/src/main/java/com/bluechilli/flutteruploader/CountingRequestBody.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.bluechilli.flutteruploader;
22

3+
import androidx.annotation.NonNull;
34
import java.io.IOException;
45
import okhttp3.MediaType;
56
import okhttp3.RequestBody;
@@ -33,7 +34,7 @@ public long contentLength() throws IOException {
3334
}
3435

3536
@Override
36-
public void writeTo(BufferedSink sink) throws IOException {
37+
public void writeTo(@NonNull BufferedSink sink) throws IOException {
3738
try {
3839
_countingSink = new CountingSink(this, sink);
3940
BufferedSink bufferedSink = Okio.buffer(_countingSink);
@@ -67,7 +68,7 @@ public CountingSink(CountingRequestBody parent, Sink sink) {
6768
}
6869

6970
@Override
70-
public void write(Buffer source, long byteCount) throws IOException {
71+
public void write(@NonNull Buffer source, long byteCount) throws IOException {
7172
try {
7273
super.write(source, byteCount);
7374

0 commit comments

Comments
 (0)