Skip to content

Commit 15bfecd

Browse files
authored
Bump native Android deps (#873)
* bump Gradle to 8.2.1, bump Kotlin to 1.9.0 * bump deps, set min Flutter to 3.10 * fix analyzer being angry * remove unnecessasry gradle files * fix ktlint warnings * flutter format -> dart format
1 parent 40950b3 commit 15bfecd

File tree

14 files changed

+26
-35
lines changed

14 files changed

+26
-35
lines changed

.github/workflows/prepare.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
flutter-version: ['3.0.x', '3.3.x', '3.7.x', '3.10.x']
16+
flutter-version: ['3.10.x']
1717

1818
steps:
1919
- name: Clone repository
@@ -47,7 +47,7 @@ jobs:
4747

4848
- name: flutter format (example app)
4949
working-directory: ./example
50-
run: flutter format --set-exit-if-changed .
50+
run: dart format --set-exit-if-changed .
5151

5252
- name: flutter analyze (example app)
5353
working-directory: ./example

android/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
buildscript {
2-
ext.kotlin_version = "1.7.22"
2+
ext.kotlin_version = "1.9.0"
33
repositories {
44
google()
55
mavenCentral()
66
gradlePluginPortal()
77
}
88

99
dependencies {
10-
classpath "com.android.tools.build:gradle:7.2.2"
10+
classpath "com.android.tools.build:gradle:7.4.2"
1111
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
12-
classpath "org.jlleitschuh.gradle:ktlint-gradle:11.0.0"
12+
classpath "org.jlleitschuh.gradle:ktlint-gradle:11.5.0"
1313
}
1414
}
1515

@@ -29,7 +29,7 @@ rootProject.allprojects {
2929

3030
android {
3131
namespace "vn.hunghd.flutterdownloader"
32-
compileSdk 32
32+
compileSdk 33
3333

3434
compileOptions {
3535
sourceCompatibility JavaVersion.VERSION_1_8
@@ -46,7 +46,7 @@ android {
4646

4747
defaultConfig {
4848
minSdk 19
49-
targetSdk 32
49+
targetSdk 33
5050
}
5151
}
5252

android/gradle.properties

Lines changed: 0 additions & 3 deletions
This file was deleted.

android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 0 additions & 5 deletions
This file was deleted.

android/src/main/kotlin/vn/hunghd/flutterdownloader/DownloadWorker.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ class DownloadWorker(context: Context, params: WorkerParameters) :
257257
filename: String?,
258258
headers: String,
259259
isResume: Boolean,
260-
timeout: Int,
260+
timeout: Int
261261
) {
262262
var actualFilename = filename
263263
var url = fileURL

android/src/main/kotlin/vn/hunghd/flutterdownloader/FlutterDownloaderPlugin.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class FlutterDownloaderPlugin : MethodChannel.MethodCallHandler, FlutterPlugin {
9191
requiresStorageNotLow: Boolean,
9292
saveInPublicStorage: Boolean,
9393
timeout: Int,
94-
allowCellular: Boolean,
94+
allowCellular: Boolean
9595
): WorkRequest {
9696
return OneTimeWorkRequest.Builder(DownloadWorker::class.java)
9797
.setConstraints(

android/src/main/kotlin/vn/hunghd/flutterdownloader/TaskDao.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class TaskDao(private val dbHelper: TaskDbHelper) {
2121
TaskEntry.COLUMN_NAME_SHOW_NOTIFICATION,
2222
TaskEntry.COLUMN_NAME_TIME_CREATED,
2323
TaskEntry.COLUMN_SAVE_IN_PUBLIC_STORAGE,
24-
TaskEntry.COLUMN_ALLOW_CELLULAR,
24+
TaskEntry.COLUMN_ALLOW_CELLULAR
2525
)
2626

2727
fun insertOrUpdateNewTask(

example/android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
buildscript {
2-
ext.kotlin_version = "1.7.22"
2+
ext.kotlin_version = "1.9.0"
33
repositories {
44
google()
55
mavenCentral()
66
}
77

88
dependencies {
9-
classpath "com.android.tools.build:gradle:7.2.2"
9+
classpath "com.android.tools.build:gradle:7.4.2"
1010
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1111
}
1212
}

example/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip

example/lib/download_list_item.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ class DownloadListItem extends StatelessWidget {
1212
});
1313

1414
final ItemHolder? data;
15-
final Function(TaskInfo?)? onTap;
16-
final Function(TaskInfo)? onActionTap;
17-
final Function(TaskInfo)? onCancel;
15+
final void Function(TaskInfo?)? onTap;
16+
final void Function(TaskInfo)? onActionTap;
17+
final void Function(TaskInfo)? onCancel;
1818

1919
Widget? _buildTrailing(TaskInfo task) {
2020
if (task.status == DownloadTaskStatus.undefined) {

0 commit comments

Comments
 (0)