Skip to content

Commit 32f3258

Browse files
committed
Update to v6.1.0
Former-commit-id: 17bb9a028fad5ae0a9f4ff4440d50d84b92a8e34 [formerly 80d8963] Former-commit-id: fcedfaf6dbe79c814dabda97bd3f4caedd5d5819
1 parent 454abcb commit 32f3258

File tree

10 files changed

+44
-32
lines changed

10 files changed

+44
-32
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,21 @@
44
2. Minor version releases change the second digit and signify minor (breaking with deprecation warnings, or non-breaking) API changes or internal refactoring
55
3. Revision version releases change the third digit and signify bug fixes or documentation changes
66

7+
Many thanks to my sponsors, no matter how much or how little they donated:
8+
9+
* @tonyshkurenko
10+
* @Mmisiek
11+
* @huulbaek
12+
713
---
814

15+
## [6.1.0] - 2022/09/23
16+
17+
* Fixed bugs within import functionality
18+
* Added support for notifications on Android 13+
19+
* Improved performance
20+
* Updated dependencies
21+
922
## [6.0.1] - 2022/09/11
1023

1124
* Improved stability

example/android/app/build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
2828
android {
2929
compileSdkVersion rootProject.ext.compileSdkVersion
3030

31+
defaultConfig {
32+
multiDexEnabled true
33+
}
34+
3135
compileOptions {
36+
coreLibraryDesugaringEnabled true
3237
sourceCompatibility JavaVersion.VERSION_1_8
3338
targetCompatibility JavaVersion.VERSION_1_8
3439
}
@@ -65,4 +70,5 @@ flutter {
6570

6671
dependencies {
6772
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
73+
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
6874
}

example/currentAppVersion.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.0.0
1+
6.1.0

example/lib/main.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ void main() async {
2222
);
2323

2424
final SharedPreferences prefs = await SharedPreferences.getInstance();
25+
2526
FlutterMapTileCaching.initialise(await RootDirectory.normalCache);
2627
await FMTC.instance.rootDirectory.migrator.fromV4();
2728

example/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ environment:
1111

1212
dependencies:
1313
badges: ^2.0.2
14-
better_open_file: ^3.6.3
14+
better_open_file: ^3.6.4
1515
flutter:
1616
sdk: flutter
17-
flutter_foreground_task: ^3.7.3
17+
flutter_foreground_task: ^3.9.0
1818
flutter_map: ^3.0.0-beta.1
1919
flutter_map_tile_caching:
2020
path: ../

lib/src/internal/exts.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ extension AndroidNotificationDetailsExts on AndroidNotificationDetails {
8282
AndroidNotificationChannelAction? channelAction,
8383
NotificationVisibility? visibility,
8484
int? timeoutAfter,
85-
String? category,
85+
AndroidNotificationCategory? category,
8686
bool? fullScreenIntent,
8787
String? shortcutId,
8888
Int32List? additionalFlags,

lib/src/root/import.dart

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -76,39 +76,27 @@ class RootImport {
7676
final StoreManagement storeManagement =
7777
StoreDirectory(_rootDirectory, storeName, autoCreate: false).manage;
7878

79-
if (!await compute(_import, {
79+
await compute(_import, {
8080
_rootDirectory.access.stores > storeName:
8181
await File(inputFile.absolute.path).readAsBytes(),
82-
})) return error(storeManagement);
82+
});
8383

8484
if (await storeManagement.readyAsync) return true;
8585
return error(storeManagement);
8686
}
8787
}
8888

89-
Future<bool> _import(Map<String, Uint8List> data) async {
90-
try {
91-
final Directory baseDirectory = Directory(data.keys.toList()[0]);
92-
final Archive archive = ZipDecoder().decodeBytes(
93-
data.values.toList()[0],
94-
verify: true,
95-
);
89+
void _import(Map<String, Uint8List> data) {
90+
final Directory dir = Directory(data.keys.toList()[0]);
91+
final Archive archive = ZipDecoder().decodeBytes(data.values.toList()[0]);
9692

97-
await Future.wait(
98-
[
99-
archive
100-
.where((f) => !f.isFile)
101-
.map((f) => (baseDirectory >> f.name).create(recursive: true)),
102-
archive.where((f) => f.isFile).map(
103-
(f) async =>
104-
(await (baseDirectory >>> f.name).create(recursive: true))
105-
.writeAsBytes(f.content),
106-
),
107-
].expand((e) => e),
108-
);
109-
110-
return true;
111-
} catch (_) {
112-
return false;
93+
for (final f in archive) {
94+
if (f.isFile) {
95+
(dir >>> f.name)
96+
..createSync(recursive: true)
97+
..writeAsBytesSync(f.content);
98+
} else {
99+
(dir >> f.name).createSync(recursive: true);
100+
}
113101
}
114102
}

lib/src/store/download.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,10 @@ class DownloadManagement {
158158
android: AndroidInitializationSettings(progressNotificationIcon),
159159
),
160160
);
161+
await notification
162+
.resolvePlatformSpecificImplementation<
163+
AndroidFlutterLocalNotificationsPlugin>()!
164+
.requestPermission();
161165

162166
final Stream<DownloadProgress> downloadStream = startForeground(
163167
region: region,

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: flutter_map_tile_caching
22
description: Plugin for 'flutter_map' providing advanced caching functionality,
33
with ability to download map regions for offline use.
4-
version: 6.0.1
4+
version: 6.1.0
55
repository: https://github.com/JaffaKetchup/flutter_map_tile_caching
66
issue_tracker: https://github.com/JaffaKetchup/flutter_map_tile_caching/issues
77
documentation: https://fmtc.jaffaketchup.dev
@@ -29,7 +29,7 @@ dependencies:
2929
flutter:
3030
sdk: flutter
3131
flutter_background: ^1.1.0
32-
flutter_local_notifications: ^9.4.1
32+
flutter_local_notifications: ^11.0.0
3333
flutter_map: ^3.0.0
3434
http: ^0.13.5
3535
ini: ^2.1.0

windowsApplicationInstallerSetup.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; Script generated by the Inno Setup Script Wizard
22

33
#define MyAppName "FMTC Demo"
4-
#define MyAppVersion "for 6.0.0"
4+
#define MyAppVersion "for 6.1.0"
55
#define MyAppPublisher "JaffaKetchup Development"
66
#define MyAppURL "https://github.com/JaffaKetchup/flutter_map_tile_caching"
77
#define MyAppSupportURL "https://github.com/JaffaKetchup/flutter_map_tile_caching/issues"

0 commit comments

Comments
 (0)