Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Downloads in dart with simpler interface without Databases #793

Closed
wants to merge 58 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
17ef212
Add basic Android 13 support
rekire Sep 11, 2022
d0b332c
Convert classes to kotlin
rekire Sep 11, 2022
503a104
Add missing imports and fix some null value issues
rekire Sep 12, 2022
914cacd
Rename variable
rekire Sep 13, 2022
da64872
Native download basement
rekire Sep 18, 2022
dcacc92
Reformat generation of metadata
rekire Sep 18, 2022
3d8aa48
Fix test on Windows
rekire Sep 18, 2022
27ebe3b
Add way to isolate tests
rekire Sep 18, 2022
e5c6781
Playing with platform interface
rekire Oct 1, 2022
673a16a
Migrate to simplified API
rekire Oct 9, 2022
1f3fcb3
Migrate sample app to new api
rekire Dec 4, 2022
8a30069
Extend download class to keep track of progress
rekire Dec 11, 2022
642c454
Deprecate legacy api and add a migration path
rekire Dec 11, 2022
1e2e82d
Sync UI with ValueNotifier
rekire Dec 13, 2022
1dd5ff2
Track download progress
rekire Dec 17, 2022
39d2262
Fix memory leak and download progress
rekire Jan 2, 2023
0d976a0
Add code to resume downloads
rekire Jan 8, 2023
e236787
Make pause and resuming working
rekire Jan 13, 2023
2ef9e50
Rename files
rekire Jan 14, 2023
ce3ef3a
Add abstraction layer to support platform specific overrides
rekire Jan 14, 2023
1c29f12
Sync Dart with Android code
rekire Jan 14, 2023
8bb4da7
Make the download working without status updates on Android using wor…
rekire Jan 14, 2023
b561b92
Add progress updates from Android
rekire Jan 15, 2023
ef8195b
Random changes after running app in emulator
rekire Jan 15, 2023
634c317
Hello objective C: Avoid crashes
rekire Jan 15, 2023
cab5a4a
Update iOS meta data
rekire Jan 15, 2023
e8a53b7
Add swift support and delete legacy code
rekire Jan 16, 2023
5cb7f98
Add Linux sample app
rekire Jan 16, 2023
3adbe75
Add MacOS sample app
rekire Jan 16, 2023
27718fc
Make MacOS sample app working
rekire Jan 16, 2023
b19bf75
Hide window control bar on MacOS
rekire Jan 16, 2023
ee35d30
Add entitlements to make network communication working
rekire Jan 16, 2023
e078c72
Make downloads working in iOS
rekire Jan 18, 2023
9c7569e
Delete unused files
rekire Jan 18, 2023
378be18
Send status updates from swift
rekire Jan 21, 2023
9422f3b
Parse url from meta file
rekire Jan 21, 2023
43826e7
Update documentation
rekire Jan 21, 2023
91f4aca
Refactoring to support pausing
rekire Jan 21, 2023
1f600c6
Simplify code: cancel is pause and delete
rekire Jan 21, 2023
c237ed6
Add missing Windows sample files
rekire Jan 22, 2023
c3b7ccd
Add missing metadata
rekire Jan 22, 2023
2b97abc
Cleanup
rekire Jan 22, 2023
3732e31
Remove last "vn.hunghd" usages
rekire Jan 22, 2023
e2d1ca4
Cleanup
rekire Jan 22, 2023
d938149
Add some debugging paused calls not received on native code
rekire Jan 22, 2023
788b358
Allow pausing and resuming on iOS
rekire Jan 23, 2023
58fdfaa
Refactoring to use enums for the download status and equalize code st…
rekire Jan 24, 2023
935f501
Cleanup
rekire Jan 25, 2023
88898bd
Fix progress recovery
rekire Jan 25, 2023
ab42221
Update documentation
rekire Jan 30, 2023
ac02b88
Extend documentation and some refactoring
rekire Jan 31, 2023
a2ec20f
Simplify code
rekire Jan 31, 2023
8759a6a
Yet another simplifying pass with migration to the JSON format
rekire Jan 31, 2023
1abf64c
Class renamings and migration to json config
rekire Feb 26, 2023
7be20ac
Deduplicate code for metadata and make state recovering working again
rekire Feb 26, 2023
ba9b83b
Partially safe progress on iOS
rekire Mar 1, 2023
b9eeb20
Resume downloads on Android
rekire Mar 4, 2023
fa53de2
Add support for observing and controlling groups of downloads
rekire Mar 4, 2023
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ unlinked_spec.ds
**/android/gradlew
**/android/gradlew.bat
**/android/local.properties
**/android/app/local.properties
**/android/**/GeneratedPluginRegistrant.java
**/android/key.properties
*.jks
Expand Down Expand Up @@ -87,6 +88,10 @@ unlinked_spec.ds
# Coverage
coverage/

# temp files
*.meta
*.part

# Exceptions to above rules.
!**/ios/**/default.mode1v3
!**/ios/**/default.mode2v3
Expand Down
36 changes: 36 additions & 0 deletions .metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled.

version:
revision: 096162697a9cdc79f4e47f7230d70935fa81fd24
channel: beta

project_type: plugin

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 096162697a9cdc79f4e47f7230d70935fa81fd24
base_revision: 096162697a9cdc79f4e47f7230d70935fa81fd24
- platform: android
create_revision: 096162697a9cdc79f4e47f7230d70935fa81fd24
base_revision: 096162697a9cdc79f4e47f7230d70935fa81fd24
- platform: ios
create_revision: 096162697a9cdc79f4e47f7230d70935fa81fd24
base_revision: 096162697a9cdc79f4e47f7230d70935fa81fd24
- platform: windows
create_revision: 096162697a9cdc79f4e47f7230d70935fa81fd24
base_revision: 096162697a9cdc79f4e47f7230d70935fa81fd24

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
2 changes: 1 addition & 1 deletion android/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*.iml
.gradle
/local.properties
local.properties
/.idea/workspace.xml
/.idea/misc.xml
/.idea/markdown-navigator
Expand Down
21 changes: 15 additions & 6 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
group 'vn.hunghd.flutterdownloader'
group 'com.github.fluttercommunity.flutterdownloader'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use double quotes for all strings. It'll be easier to convert to Gradle Kotlin DSL in the future.

version '1.0-SNAPSHOT'

buildscript {
ext.kotlin_version = '1.6.21'
ext.kotlin_version = '1.8.0'
repositories {
google()
mavenCentral()
Expand All @@ -11,6 +11,7 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:7.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
}
}

Expand All @@ -22,6 +23,8 @@ rootProject.allprojects {
}

apply plugin: 'com.android.library'
apply plugin: 'org.jetbrains.kotlin.android'
apply plugin: 'kotlinx-serialization'

android {
compileSdkVersion 31
Expand All @@ -37,11 +40,17 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
}

dependencies {
implementation 'androidx.work:work-runtime:2.7.1'
implementation 'androidx.annotation:annotation:1.3.0'
implementation 'androidx.core:core:1.7.0'
implementation 'androidx.fragment:fragment:1.4.1'
implementation "androidx.work:work-runtime-ktx:2.7.1"
implementation "androidx.concurrent:concurrent-futures-ktx:1.1.0"
implementation 'androidx.annotation:annotation:1.4.0'
implementation 'androidx.core:core:1.9.0'
implementation 'androidx.fragment:fragment:1.5.2'
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0-RC"
testImplementation 'junit:junit:4.12'
}
3 changes: 2 additions & 1 deletion android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="vn.hunghd.flutterdownloader">
package="com.github.fluttercommunity.flutterdownloader">

<!-- See https://developer.android.com/training/package-visibility -->
<queries>
<intent>
<action android:name="android.intent.action.VIEW" />
</intent>
</queries>
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

</manifest>

This file was deleted.

This file was deleted.

Loading