diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d4d04e2..55ffa48f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,10 @@ Many thanks to my sponsors, no matter how much or how little they donated. Spons # Changelog +## [10.1.2] - 2025/11/17 + +* Upgraded ObjectBox dependencies to permit v5.0.0 - fixes [issue #194](https://github.com/JaffaKetchup/flutter_map_tile_caching/issues/194) + ## [10.1.1] - 2025/02/03 * Fixed bug where import operation fatally crashed on some iOS devices diff --git a/analysis_options.yaml b/analysis_options.yaml index 97dbfab7..acd18fca 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -3,7 +3,10 @@ include: jaffa_lints.yaml analyzer: exclude: - lib/**.g.dart + # language: + # strict-inference: true + # strict-raw-types: true linter: rules: - avoid_slow_async_io: false \ No newline at end of file + avoid_slow_async_io: false diff --git a/example/.metadata b/example/.metadata index dd1f2f95..e925fe81 100644 --- a/example/.metadata +++ b/example/.metadata @@ -4,8 +4,8 @@ # This file should be version controlled and should not be manually edited. version: - revision: "3e493a3e4d0a5c99fa7da51faae354e95a9a1abe" - channel: "beta" + revision: "b45fa18946ecc2d9b4009952c636ba7e2ffbb787" + channel: "stable" project_type: app @@ -13,11 +13,20 @@ project_type: app migration: platforms: - platform: root - create_revision: 3e493a3e4d0a5c99fa7da51faae354e95a9a1abe - base_revision: 3e493a3e4d0a5c99fa7da51faae354e95a9a1abe + create_revision: b45fa18946ecc2d9b4009952c636ba7e2ffbb787 + base_revision: b45fa18946ecc2d9b4009952c636ba7e2ffbb787 - platform: android - create_revision: 3e493a3e4d0a5c99fa7da51faae354e95a9a1abe - base_revision: 3e493a3e4d0a5c99fa7da51faae354e95a9a1abe + create_revision: b45fa18946ecc2d9b4009952c636ba7e2ffbb787 + base_revision: b45fa18946ecc2d9b4009952c636ba7e2ffbb787 + - platform: ios + create_revision: b45fa18946ecc2d9b4009952c636ba7e2ffbb787 + base_revision: b45fa18946ecc2d9b4009952c636ba7e2ffbb787 + - platform: web + create_revision: b45fa18946ecc2d9b4009952c636ba7e2ffbb787 + base_revision: b45fa18946ecc2d9b4009952c636ba7e2ffbb787 + - platform: windows + create_revision: b45fa18946ecc2d9b4009952c636ba7e2ffbb787 + base_revision: b45fa18946ecc2d9b4009952c636ba7e2ffbb787 # User provided section diff --git a/example/android/.gitignore b/example/android/.gitignore index 55afd919..be3943c9 100644 --- a/example/android/.gitignore +++ b/example/android/.gitignore @@ -5,6 +5,7 @@ gradle-wrapper.jar /gradlew.bat /local.properties GeneratedPluginRegistrant.java +.cxx/ # Remember to never publicly share your keystore. # See https://flutter.dev/to/reference-keystore diff --git a/example/android/app/build.gradle.kts b/example/android/app/build.gradle.kts index 8e7323ff..36a88654 100644 --- a/example/android/app/build.gradle.kts +++ b/example/android/app/build.gradle.kts @@ -8,16 +8,15 @@ plugins { android { namespace = "dev.jaffaketchup.fmtc.demo" compileSdk = flutter.compileSdkVersion - // ndkVersion = flutter.ndkVersion - ndkVersion = "27.0.12077973" + ndkVersion = flutter.ndkVersion compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() + jvmTarget = JavaVersion.VERSION_17.toString() } defaultConfig { diff --git a/example/android/app/src/main/kotlin/com/example/fmtc_demo/MainActivity.kt b/example/android/app/src/main/kotlin/dev/jaffaketchup/fmtc/demo/MainActivity.kt similarity index 100% rename from example/android/app/src/main/kotlin/com/example/fmtc_demo/MainActivity.kt rename to example/android/app/src/main/kotlin/dev/jaffaketchup/fmtc/demo/MainActivity.kt diff --git a/example/android/build.gradle.kts b/example/android/build.gradle.kts index 89176ef4..dbee657b 100644 --- a/example/android/build.gradle.kts +++ b/example/android/build.gradle.kts @@ -5,7 +5,10 @@ allprojects { } } -val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get() +val newBuildDir: Directory = + rootProject.layout.buildDirectory + .dir("../../build") + .get() rootProject.layout.buildDirectory.value(newBuildDir) subprojects { diff --git a/example/android/gradle.properties b/example/android/gradle.properties index f018a618..fbee1d8c 100644 --- a/example/android/gradle.properties +++ b/example/android/gradle.properties @@ -1,3 +1,2 @@ org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true -android.enableJetifier=true diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index afa1e8eb..e4ef43fb 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip diff --git a/example/android/settings.gradle.kts b/example/android/settings.gradle.kts index a439442c..ca7fe065 100644 --- a/example/android/settings.gradle.kts +++ b/example/android/settings.gradle.kts @@ -1,11 +1,12 @@ pluginManagement { - val flutterSdkPath = run { - val properties = java.util.Properties() - file("local.properties").inputStream().use { properties.load(it) } - val flutterSdkPath = properties.getProperty("flutter.sdk") - require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } - flutterSdkPath - } + val flutterSdkPath = + run { + val properties = java.util.Properties() + file("local.properties").inputStream().use { properties.load(it) } + val flutterSdkPath = properties.getProperty("flutter.sdk") + require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } + flutterSdkPath + } includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") @@ -18,8 +19,8 @@ pluginManagement { plugins { id("dev.flutter.flutter-plugin-loader") version "1.0.0" - id("com.android.application") version "8.7.0" apply false - id("org.jetbrains.kotlin.android") version "1.8.22" apply false + id("com.android.application") version "8.11.1" apply false + id("org.jetbrains.kotlin.android") version "2.2.20" apply false } include(":app") diff --git a/example/lib/src/screens/main/map_view/components/recovery_regions/recovery_regions.dart b/example/lib/src/screens/main/map_view/components/recovery_regions/recovery_regions.dart index 6566c6d8..134875b9 100644 --- a/example/lib/src/screens/main/map_view/components/recovery_regions/recovery_regions.dart +++ b/example/lib/src/screens/main/map_view/components/recovery_regions/recovery_regions.dart @@ -38,7 +38,9 @@ class RecoveryRegions extends StatelessWidget { borderColor: e.key.toColor(), borderStrokeWidth: 2, label: region.label, - labelPlacement: PolygonLabelPlacement.polylabel, + labelPlacementCalculator: + const PolygonLabelPlacementCalculator + .polylabel(), ), ), ) diff --git a/example/lib/src/shared/components/url_selector.dart b/example/lib/src/shared/components/url_selector.dart index 94b67277..89c74b68 100644 --- a/example/lib/src/shared/components/url_selector.dart +++ b/example/lib/src/shared/components/url_selector.dart @@ -95,7 +95,7 @@ class _UrlSelectorState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( - child: DropdownMenu( + child: DropdownMenu( controller: _urlTextController, expandedInsets: EdgeInsets.zero, // full width requestFocusOnTap: true, @@ -132,8 +132,8 @@ class _UrlSelectorState extends State { }, ); - void _onSelected(String? v) { - if (v == null) { + void _onSelected(String? val) { + if (val == '' || val == null) { sharedPrefs.setStringList( SharedPrefsKeys.customNonStoreUrls.name, (sharedPrefs.getStringList(SharedPrefsKeys.customNonStoreUrls.name) ?? @@ -144,15 +144,16 @@ class _UrlSelectorState extends State { _selectableEntriesManualRefreshStream.add(null); } - widget.onSelected!(v ?? _urlTextController.text); + widget + .onSelected!(val == '' || val == null ? _urlTextController.text : val); _dropdownMenuFocusNode?.unfocus(); } - List> _constructMenuEntries( + List> _constructMenuEntries( AsyncSnapshot>> snapshot, ) => snapshot.data!.entries - .map>( + .map( (e) => DropdownMenuEntry( value: e.key, label: e.key, @@ -189,7 +190,7 @@ class _UrlSelectorState extends State { .toList() ..add( const DropdownMenuEntry( - value: null, + value: '', label: 'To use another URL (without using it in a store),\nenter it, ' 'then hit enter/done/add', diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 9d00b756..1f3e6f5d 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -1,7 +1,7 @@ name: fmtc_demo description: The demo app for 'flutter_map_tile_caching', showcasing its functionality and use-cases. publish_to: "none" -version: 10.1.1 +version: 10.1.2 environment: sdk: ">=3.6.0 <4.0.0" diff --git a/jaffa_lints.yaml b/jaffa_lints.yaml index 81dfd034..f4169d56 100644 --- a/jaffa_lints.yaml +++ b/jaffa_lints.yaml @@ -1,12 +1,17 @@ linter: rules: - always_declare_return_types + # - always_put_control_body_on_new_line + # - always_put_required_named_parameters_first + # - always_specify_types + # - always_use_package_imports - annotate_overrides - annotate_redeclares - avoid_annotating_with_dynamic - avoid_bool_literals_in_conditional_expressions - avoid_catches_without_on_clauses - avoid_catching_errors + # - avoid_classes_with_only_static_members - avoid_double_and_int_checks - avoid_dynamic_calls - avoid_empty_else @@ -59,7 +64,9 @@ linter: - depend_on_referenced_packages - deprecated_consistency - deprecated_member_use_from_same_package + # - diagnostic_describe_all_properties - directives_ordering + # - discarded_futures - do_not_use_environment - document_ignores - empty_catches @@ -68,6 +75,7 @@ linter: - eol_at_end_of_file - exhaustive_cases - file_names + # - flutter_style_todos - hash_and_equals - implementation_imports - implicit_call_tearoffs @@ -99,10 +107,12 @@ linter: - noop_primitive_operations - null_check_on_nullable_type_parameter - null_closures + # - omit_local_variable_types + # - omit_obvious_local_variable_types + # - omit_obvious_property_types - one_member_abstracts - only_throw_errors - overridden_fields - - package_api_docs - package_names - package_prefixed_library_names - parameter_assignments @@ -117,10 +127,12 @@ linter: - prefer_const_literals_to_create_immutables - prefer_constructors_over_static_methods - prefer_contains + # - prefer_double_quotes - prefer_expression_function_bodies - prefer_final_fields - prefer_final_in_for_each - prefer_final_locals + # - prefer_final_parameters - prefer_for_elements_to_map_fromIterable - prefer_foreach - prefer_function_declarations_over_variables @@ -146,6 +158,7 @@ linter: - provide_deprecation_message - public_member_api_docs - recursive_getters + - remove_deprecations_in_breaking_versions - require_trailing_commas - secure_pubspec_urls - sized_box_for_whitespace @@ -155,6 +168,10 @@ linter: - sort_constructors_first - sort_pub_dependencies - sort_unnamed_constructors_first + # - specify_nonobvious_local_variable_types + # - specify_nonobvious_property_types + - strict_top_level_inference + - switch_on_type - test_types_in_equals - throw_in_finally - tighten_type_of_initializing_formals @@ -163,12 +180,15 @@ linter: - type_literal_in_constant_pattern - unawaited_futures - unintended_html_in_doc_comment + - unnecessary_async - unnecessary_await_in_return - unnecessary_brace_in_string_interps - unnecessary_breaks - unnecessary_const - unnecessary_constructor_name + # - unnecessary_final - unnecessary_getters_setters + - unnecessary_ignore - unnecessary_lambdas - unnecessary_late - unnecessary_library_directive @@ -187,8 +207,11 @@ linter: - unnecessary_string_interpolations - unnecessary_this - unnecessary_to_list_in_spreads + - unnecessary_unawaited + - unnecessary_underscores - unreachable_from_main - unrelated_type_equality_checks + - unsafe_variance - use_build_context_synchronously - use_colored_box - use_decorated_box @@ -200,6 +223,7 @@ linter: - use_key_in_widget_constructors - use_late_for_private_fields_and_variables - use_named_constants + - use_null_aware_elements - use_raw_strings - use_rethrow_when_possible - use_setters_to_change_properties @@ -210,4 +234,4 @@ linter: - use_to_and_as_if_applicable - use_truncating_division - valid_regexps - - void_checks \ No newline at end of file + - void_checks diff --git a/lib/src/backend/impls/objectbox/models/generated/objectbox-model.json b/lib/src/backend/impls/objectbox/models/generated/objectbox-model.json index a7397a4e..94774d18 100644 --- a/lib/src/backend/impls/objectbox/models/generated/objectbox-model.json +++ b/lib/src/backend/impls/objectbox/models/generated/objectbox-model.json @@ -17,9 +17,9 @@ { "id": "2:2496811483091029921", "name": "refId", + "indexId": "1:1036386105099927432", "type": 6, - "flags": 40, - "indexId": "1:1036386105099927432" + "flags": 40 }, { "id": "3:3612512640999075849", @@ -54,9 +54,9 @@ { "id": "22:2247444187089993412", "name": "regionId", + "indexId": "5:2172676985778936605", "type": 11, "flags": 520, - "indexId": "5:2172676985778936605", "relationTarget": "ObjectBoxRecoveryRegion" } ], @@ -76,9 +76,9 @@ { "id": "2:1060752758288526798", "name": "name", + "indexId": "2:5602852847672696920", "type": 9, - "flags": 2080, - "indexId": "2:5602852847672696920" + "flags": 2080 }, { "id": "3:7375048950056890678", @@ -127,9 +127,9 @@ { "id": "2:4115905667778721807", "name": "url", + "indexId": "3:4361441212367179043", "type": 9, - "flags": 34848, - "indexId": "3:4361441212367179043" + "flags": 34848 }, { "id": "3:7508139234299399524", @@ -139,9 +139,9 @@ { "id": "4:1172878417733380836", "name": "lastModified", + "indexId": "4:4857742396480146668", "type": 10, - "flags": 8, - "indexId": "4:4857742396480146668" + "flags": 8 } ], "relations": [ diff --git a/lib/src/backend/impls/objectbox/models/generated/objectbox.g.dart b/lib/src/backend/impls/objectbox/models/generated/objectbox.g.dart index 9966f6a1..b8058e73 100644 --- a/lib/src/backend/impls/objectbox/models/generated/objectbox.g.dart +++ b/lib/src/backend/impls/objectbox/models/generated/objectbox.g.dart @@ -24,259 +24,308 @@ export 'package:objectbox/objectbox.dart'; // so that callers only have to impor final _entities = [ obx_int.ModelEntity( - id: const obx_int.IdUid(1, 5472631385587455945), - name: 'ObjectBoxRecovery', - lastPropertyId: const obx_int.IdUid(22, 2247444187089993412), - flags: 0, - properties: [ - obx_int.ModelProperty( - id: const obx_int.IdUid(1, 3769282896877713230), - name: 'id', - type: 6, - flags: 1), - obx_int.ModelProperty( - id: const obx_int.IdUid(2, 2496811483091029921), - name: 'refId', - type: 6, - flags: 40, - indexId: const obx_int.IdUid(1, 1036386105099927432)), - obx_int.ModelProperty( - id: const obx_int.IdUid(3, 3612512640999075849), - name: 'storeName', - type: 9, - flags: 0), - obx_int.ModelProperty( - id: const obx_int.IdUid(4, 1095455913099058361), - name: 'creationTime', - type: 10, - flags: 0), - obx_int.ModelProperty( - id: const obx_int.IdUid(5, 1138350672456876624), - name: 'minZoom', - type: 6, - flags: 0), - obx_int.ModelProperty( - id: const obx_int.IdUid(6, 9040433791555820529), - name: 'maxZoom', - type: 6, - flags: 0), - obx_int.ModelProperty( - id: const obx_int.IdUid(7, 6819230045021667310), - name: 'startTile', - type: 6, - flags: 0), - obx_int.ModelProperty( - id: const obx_int.IdUid(8, 8185724925875119436), - name: 'endTile', - type: 6, - flags: 0), - obx_int.ModelProperty( - id: const obx_int.IdUid(22, 2247444187089993412), - name: 'regionId', - type: 11, - flags: 520, - indexId: const obx_int.IdUid(5, 2172676985778936605), - relationTarget: 'ObjectBoxRecoveryRegion') - ], - relations: [], - backlinks: []), + id: const obx_int.IdUid(1, 5472631385587455945), + name: 'ObjectBoxRecovery', + lastPropertyId: const obx_int.IdUid(22, 2247444187089993412), + flags: 0, + properties: [ + obx_int.ModelProperty( + id: const obx_int.IdUid(1, 3769282896877713230), + name: 'id', + type: 6, + flags: 1, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(2, 2496811483091029921), + name: 'refId', + type: 6, + flags: 40, + indexId: const obx_int.IdUid(1, 1036386105099927432), + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(3, 3612512640999075849), + name: 'storeName', + type: 9, + flags: 0, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(4, 1095455913099058361), + name: 'creationTime', + type: 10, + flags: 0, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(5, 1138350672456876624), + name: 'minZoom', + type: 6, + flags: 0, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(6, 9040433791555820529), + name: 'maxZoom', + type: 6, + flags: 0, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(7, 6819230045021667310), + name: 'startTile', + type: 6, + flags: 0, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(8, 8185724925875119436), + name: 'endTile', + type: 6, + flags: 0, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(22, 2247444187089993412), + name: 'regionId', + type: 11, + flags: 520, + indexId: const obx_int.IdUid(5, 2172676985778936605), + relationField: 'region', + relationTarget: 'ObjectBoxRecoveryRegion', + ), + ], + relations: [], + backlinks: [], + ), obx_int.ModelEntity( - id: const obx_int.IdUid(2, 632249766926720928), - name: 'ObjectBoxStore', - lastPropertyId: const obx_int.IdUid(8, 3489822621946254204), - flags: 0, - properties: [ - obx_int.ModelProperty( - id: const obx_int.IdUid(1, 1672655555406818874), - name: 'id', - type: 6, - flags: 1), - obx_int.ModelProperty( - id: const obx_int.IdUid(2, 1060752758288526798), - name: 'name', - type: 9, - flags: 2080, - indexId: const obx_int.IdUid(2, 5602852847672696920)), - obx_int.ModelProperty( - id: const obx_int.IdUid(3, 7375048950056890678), - name: 'length', - type: 6, - flags: 0), - obx_int.ModelProperty( - id: const obx_int.IdUid(4, 7781853256122686511), - name: 'size', - type: 6, - flags: 0), - obx_int.ModelProperty( - id: const obx_int.IdUid(5, 3183925806131180531), - name: 'hits', - type: 6, - flags: 0), - obx_int.ModelProperty( - id: const obx_int.IdUid(6, 6484030110235711573), - name: 'misses', - type: 6, - flags: 0), - obx_int.ModelProperty( - id: const obx_int.IdUid(7, 7028109958959828879), - name: 'metadataJson', - type: 9, - flags: 0), - obx_int.ModelProperty( - id: const obx_int.IdUid(8, 3489822621946254204), - name: 'maxLength', - type: 6, - flags: 0) - ], - relations: [], - backlinks: [ - obx_int.ModelBacklink( - name: 'tiles', srcEntity: 'ObjectBoxTile', srcField: 'stores') - ]), + id: const obx_int.IdUid(2, 632249766926720928), + name: 'ObjectBoxStore', + lastPropertyId: const obx_int.IdUid(8, 3489822621946254204), + flags: 0, + properties: [ + obx_int.ModelProperty( + id: const obx_int.IdUid(1, 1672655555406818874), + name: 'id', + type: 6, + flags: 1, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(2, 1060752758288526798), + name: 'name', + type: 9, + flags: 2080, + indexId: const obx_int.IdUid(2, 5602852847672696920), + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(3, 7375048950056890678), + name: 'length', + type: 6, + flags: 0, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(4, 7781853256122686511), + name: 'size', + type: 6, + flags: 0, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(5, 3183925806131180531), + name: 'hits', + type: 6, + flags: 0, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(6, 6484030110235711573), + name: 'misses', + type: 6, + flags: 0, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(7, 7028109958959828879), + name: 'metadataJson', + type: 9, + flags: 0, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(8, 3489822621946254204), + name: 'maxLength', + type: 6, + flags: 0, + ), + ], + relations: [], + backlinks: [ + obx_int.ModelBacklink( + name: 'tiles', + srcEntity: 'ObjectBoxTile', + srcField: 'stores', + ), + ], + ), obx_int.ModelEntity( - id: const obx_int.IdUid(3, 8691708694767276679), - name: 'ObjectBoxTile', - lastPropertyId: const obx_int.IdUid(4, 1172878417733380836), - flags: 0, - properties: [ - obx_int.ModelProperty( - id: const obx_int.IdUid(1, 5356545328183635928), - name: 'id', - type: 6, - flags: 1), - obx_int.ModelProperty( - id: const obx_int.IdUid(2, 4115905667778721807), - name: 'url', - type: 9, - flags: 34848, - indexId: const obx_int.IdUid(3, 4361441212367179043)), - obx_int.ModelProperty( - id: const obx_int.IdUid(3, 7508139234299399524), - name: 'bytes', - type: 23, - flags: 0), - obx_int.ModelProperty( - id: const obx_int.IdUid(4, 1172878417733380836), - name: 'lastModified', - type: 10, - flags: 8, - indexId: const obx_int.IdUid(4, 4857742396480146668)) - ], - relations: [ - obx_int.ModelRelation( - id: const obx_int.IdUid(1, 7496298295217061586), - name: 'stores', - targetId: const obx_int.IdUid(2, 632249766926720928)) - ], - backlinks: []), + id: const obx_int.IdUid(3, 8691708694767276679), + name: 'ObjectBoxTile', + lastPropertyId: const obx_int.IdUid(4, 1172878417733380836), + flags: 0, + properties: [ + obx_int.ModelProperty( + id: const obx_int.IdUid(1, 5356545328183635928), + name: 'id', + type: 6, + flags: 1, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(2, 4115905667778721807), + name: 'url', + type: 9, + flags: 34848, + indexId: const obx_int.IdUid(3, 4361441212367179043), + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(3, 7508139234299399524), + name: 'bytes', + type: 23, + flags: 0, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(4, 1172878417733380836), + name: 'lastModified', + type: 10, + flags: 8, + indexId: const obx_int.IdUid(4, 4857742396480146668), + ), + ], + relations: [ + obx_int.ModelRelation( + id: const obx_int.IdUid(1, 7496298295217061586), + name: 'stores', + targetId: const obx_int.IdUid(2, 632249766926720928), + ), + ], + backlinks: [], + ), obx_int.ModelEntity( - id: const obx_int.IdUid(4, 8718814737097934474), - name: 'ObjectBoxRoot', - lastPropertyId: const obx_int.IdUid(3, 6574336219794969200), - flags: 0, - properties: [ - obx_int.ModelProperty( - id: const obx_int.IdUid(1, 3527394784453371799), - name: 'id', - type: 6, - flags: 1), - obx_int.ModelProperty( - id: const obx_int.IdUid(2, 2833017356902860570), - name: 'length', - type: 6, - flags: 0), - obx_int.ModelProperty( - id: const obx_int.IdUid(3, 6574336219794969200), - name: 'size', - type: 6, - flags: 0) - ], - relations: [], - backlinks: []), + id: const obx_int.IdUid(4, 8718814737097934474), + name: 'ObjectBoxRoot', + lastPropertyId: const obx_int.IdUid(3, 6574336219794969200), + flags: 0, + properties: [ + obx_int.ModelProperty( + id: const obx_int.IdUid(1, 3527394784453371799), + name: 'id', + type: 6, + flags: 1, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(2, 2833017356902860570), + name: 'length', + type: 6, + flags: 0, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(3, 6574336219794969200), + name: 'size', + type: 6, + flags: 0, + ), + ], + relations: [], + backlinks: [], + ), obx_int.ModelEntity( - id: const obx_int.IdUid(5, 5692106664767803360), - name: 'ObjectBoxRecoveryRegion', - lastPropertyId: const obx_int.IdUid(14, 2380085283533950474), - flags: 0, - properties: [ - obx_int.ModelProperty( - id: const obx_int.IdUid(1, 4629353002259573678), - name: 'id', - type: 6, - flags: 1), - obx_int.ModelProperty( - id: const obx_int.IdUid(2, 1116094237557270575), - name: 'typeId', - type: 6, - flags: 0), - obx_int.ModelProperty( - id: const obx_int.IdUid(3, 8476920990388836149), - name: 'rectNwLat', - type: 8, - flags: 0), - obx_int.ModelProperty( - id: const obx_int.IdUid(4, 3015129163086269263), - name: 'rectNwLng', - type: 8, - flags: 0), - obx_int.ModelProperty( - id: const obx_int.IdUid(5, 8302525711584098439), - name: 'rectSeLat', - type: 8, - flags: 0), - obx_int.ModelProperty( - id: const obx_int.IdUid(6, 1939082009138163489), - name: 'rectSeLng', - type: 8, - flags: 0), - obx_int.ModelProperty( - id: const obx_int.IdUid(7, 5260761364748928203), - name: 'circleCenterLat', - type: 8, - flags: 0), - obx_int.ModelProperty( - id: const obx_int.IdUid(8, 3329863004721648966), - name: 'circleCenterLng', - type: 8, - flags: 0), - obx_int.ModelProperty( - id: const obx_int.IdUid(9, 8471244801699851283), - name: 'circleRadius', - type: 8, - flags: 0), - obx_int.ModelProperty( - id: const obx_int.IdUid(10, 5745879403192313286), - name: 'lineLats', - type: 29, - flags: 0), - obx_int.ModelProperty( - id: const obx_int.IdUid(11, 4679809662196927204), - name: 'lineLngs', - type: 29, - flags: 0), - obx_int.ModelProperty( - id: const obx_int.IdUid(12, 8730805542251345960), - name: 'lineRadius', - type: 8, - flags: 0), - obx_int.ModelProperty( - id: const obx_int.IdUid(13, 1607230668161719129), - name: 'customPolygonLats', - type: 29, - flags: 0), - obx_int.ModelProperty( - id: const obx_int.IdUid(14, 2380085283533950474), - name: 'customPolygonLngs', - type: 29, - flags: 0) - ], - relations: [ - obx_int.ModelRelation( - id: const obx_int.IdUid(2, 6378075033578405480), - name: 'multiLinkedRegions', - targetId: const obx_int.IdUid(5, 5692106664767803360)) - ], - backlinks: []) + id: const obx_int.IdUid(5, 5692106664767803360), + name: 'ObjectBoxRecoveryRegion', + lastPropertyId: const obx_int.IdUid(14, 2380085283533950474), + flags: 0, + properties: [ + obx_int.ModelProperty( + id: const obx_int.IdUid(1, 4629353002259573678), + name: 'id', + type: 6, + flags: 1, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(2, 1116094237557270575), + name: 'typeId', + type: 6, + flags: 0, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(3, 8476920990388836149), + name: 'rectNwLat', + type: 8, + flags: 0, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(4, 3015129163086269263), + name: 'rectNwLng', + type: 8, + flags: 0, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(5, 8302525711584098439), + name: 'rectSeLat', + type: 8, + flags: 0, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(6, 1939082009138163489), + name: 'rectSeLng', + type: 8, + flags: 0, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(7, 5260761364748928203), + name: 'circleCenterLat', + type: 8, + flags: 0, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(8, 3329863004721648966), + name: 'circleCenterLng', + type: 8, + flags: 0, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(9, 8471244801699851283), + name: 'circleRadius', + type: 8, + flags: 0, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(10, 5745879403192313286), + name: 'lineLats', + type: 29, + flags: 0, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(11, 4679809662196927204), + name: 'lineLngs', + type: 29, + flags: 0, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(12, 8730805542251345960), + name: 'lineRadius', + type: 8, + flags: 0, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(13, 1607230668161719129), + name: 'customPolygonLats', + type: 29, + flags: 0, + ), + obx_int.ModelProperty( + id: const obx_int.IdUid(14, 2380085283533950474), + name: 'customPolygonLngs', + type: 29, + flags: 0, + ), + ], + relations: [ + obx_int.ModelRelation( + id: const obx_int.IdUid(2, 6378075033578405480), + name: 'multiLinkedRegions', + targetId: const obx_int.IdUid(5, 5692106664767803360), + ), + ], + backlinks: [], + ), ]; /// Shortcut for [obx.Store.new] that passes [getObjectBoxModel] and for Flutter @@ -290,335 +339,438 @@ final _entities = [ /// For Flutter apps, also calls `loadObjectBoxLibraryAndroidCompat()` from /// the ObjectBox Flutter library to fix loading the native ObjectBox library /// on Android 6 and older. -Future openStore( - {String? directory, - int? maxDBSizeInKB, - int? maxDataSizeInKB, - int? fileMode, - int? maxReaders, - bool queriesCaseSensitiveDefault = true, - String? macosApplicationGroup}) async { +Future openStore({ + String? directory, + int? maxDBSizeInKB, + int? maxDataSizeInKB, + int? fileMode, + int? maxReaders, + bool queriesCaseSensitiveDefault = true, + String? macosApplicationGroup, +}) async { await loadObjectBoxLibraryAndroidCompat(); - return obx.Store(getObjectBoxModel(), - directory: directory ?? (await defaultStoreDirectory()).path, - maxDBSizeInKB: maxDBSizeInKB, - maxDataSizeInKB: maxDataSizeInKB, - fileMode: fileMode, - maxReaders: maxReaders, - queriesCaseSensitiveDefault: queriesCaseSensitiveDefault, - macosApplicationGroup: macosApplicationGroup); + return obx.Store( + getObjectBoxModel(), + directory: directory ?? (await defaultStoreDirectory()).path, + maxDBSizeInKB: maxDBSizeInKB, + maxDataSizeInKB: maxDataSizeInKB, + fileMode: fileMode, + maxReaders: maxReaders, + queriesCaseSensitiveDefault: queriesCaseSensitiveDefault, + macosApplicationGroup: macosApplicationGroup, + ); } /// Returns the ObjectBox model definition for this project for use with /// [obx.Store.new]. obx_int.ModelDefinition getObjectBoxModel() { final model = obx_int.ModelInfo( - entities: _entities, - lastEntityId: const obx_int.IdUid(5, 5692106664767803360), - lastIndexId: const obx_int.IdUid(5, 2172676985778936605), - lastRelationId: const obx_int.IdUid(2, 6378075033578405480), - lastSequenceId: const obx_int.IdUid(0, 0), - retiredEntityUids: const [], - retiredIndexUids: const [], - retiredPropertyUids: const [ - 7217406424708558740, - 5971465387225017460, - 6703340231106164623, - 741105584939284321, - 2939837278126242427, - 2393337671661697697, - 8055510540122966413, - 9110709438555760246, - 8363656194353400366, - 7008680868853575786, - 7670007285707179405, - 490933261424375687, - 3590067577930145922 - ], - retiredRelationUids: const [], - modelVersion: 5, - modelVersionParserMinimum: 5, - version: 1); + entities: _entities, + lastEntityId: const obx_int.IdUid(5, 5692106664767803360), + lastIndexId: const obx_int.IdUid(5, 2172676985778936605), + lastRelationId: const obx_int.IdUid(2, 6378075033578405480), + lastSequenceId: const obx_int.IdUid(0, 0), + retiredEntityUids: const [], + retiredIndexUids: const [], + retiredPropertyUids: const [ + 7217406424708558740, + 5971465387225017460, + 6703340231106164623, + 741105584939284321, + 2939837278126242427, + 2393337671661697697, + 8055510540122966413, + 9110709438555760246, + 8363656194353400366, + 7008680868853575786, + 7670007285707179405, + 490933261424375687, + 3590067577930145922, + ], + retiredRelationUids: const [], + modelVersion: 5, + modelVersionParserMinimum: 5, + version: 1, + ); final bindings = { ObjectBoxRecovery: obx_int.EntityDefinition( - model: _entities[0], - toOneRelations: (ObjectBoxRecovery object) => [object.region], - toManyRelations: (ObjectBoxRecovery object) => {}, - getId: (ObjectBoxRecovery object) => object.id, - setId: (ObjectBoxRecovery object, int id) { - object.id = id; - }, - objectToFB: (ObjectBoxRecovery object, fb.Builder fbb) { - final storeNameOffset = fbb.writeString(object.storeName); - fbb.startTable(23); - fbb.addInt64(0, object.id); - fbb.addInt64(1, object.refId); - fbb.addOffset(2, storeNameOffset); - fbb.addInt64(3, object.creationTime.millisecondsSinceEpoch); - fbb.addInt64(4, object.minZoom); - fbb.addInt64(5, object.maxZoom); - fbb.addInt64(6, object.startTile); - fbb.addInt64(7, object.endTile); - fbb.addInt64(21, object.region.targetId); - fbb.finish(fbb.endTable()); - return object.id; - }, - objectFromFB: (obx.Store store, ByteData fbData) { - final buffer = fb.BufferContext(fbData); - final rootOffset = buffer.derefObject(0); - final refIdParam = - const fb.Int64Reader().vTableGet(buffer, rootOffset, 6, 0); - final storeNameParam = const fb.StringReader(asciiOptimization: true) - .vTableGet(buffer, rootOffset, 8, ''); - final creationTimeParam = DateTime.fromMillisecondsSinceEpoch( - const fb.Int64Reader().vTableGet(buffer, rootOffset, 10, 0)); - final minZoomParam = - const fb.Int64Reader().vTableGet(buffer, rootOffset, 12, 0); - final maxZoomParam = - const fb.Int64Reader().vTableGet(buffer, rootOffset, 14, 0); - final startTileParam = - const fb.Int64Reader().vTableGet(buffer, rootOffset, 16, 0); - final endTileParam = - const fb.Int64Reader().vTableGet(buffer, rootOffset, 18, 0); - final regionParam = obx.ToOne( - targetId: - const fb.Int64Reader().vTableGet(buffer, rootOffset, 46, 0)); - final object = ObjectBoxRecovery( - refId: refIdParam, - storeName: storeNameParam, - creationTime: creationTimeParam, - minZoom: minZoomParam, - maxZoom: maxZoomParam, - startTile: startTileParam, - endTile: endTileParam, - region: regionParam) - ..id = const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0); - object.region.attach(store); - return object; - }), + model: _entities[0], + toOneRelations: (ObjectBoxRecovery object) => [object.region], + toManyRelations: (ObjectBoxRecovery object) => {}, + getId: (ObjectBoxRecovery object) => object.id, + setId: (ObjectBoxRecovery object, int id) { + object.id = id; + }, + objectToFB: (ObjectBoxRecovery object, fb.Builder fbb) { + final storeNameOffset = fbb.writeString(object.storeName); + fbb.startTable(23); + fbb.addInt64(0, object.id); + fbb.addInt64(1, object.refId); + fbb.addOffset(2, storeNameOffset); + fbb.addInt64(3, object.creationTime.millisecondsSinceEpoch); + fbb.addInt64(4, object.minZoom); + fbb.addInt64(5, object.maxZoom); + fbb.addInt64(6, object.startTile); + fbb.addInt64(7, object.endTile); + fbb.addInt64(21, object.region.targetId); + fbb.finish(fbb.endTable()); + return object.id; + }, + objectFromFB: (obx.Store store, ByteData fbData) { + final buffer = fb.BufferContext(fbData); + final rootOffset = buffer.derefObject(0); + final refIdParam = const fb.Int64Reader().vTableGet( + buffer, + rootOffset, + 6, + 0, + ); + final storeNameParam = const fb.StringReader( + asciiOptimization: true, + ).vTableGet(buffer, rootOffset, 8, ''); + final creationTimeParam = DateTime.fromMillisecondsSinceEpoch( + const fb.Int64Reader().vTableGet(buffer, rootOffset, 10, 0), + ); + final minZoomParam = const fb.Int64Reader().vTableGet( + buffer, + rootOffset, + 12, + 0, + ); + final maxZoomParam = const fb.Int64Reader().vTableGet( + buffer, + rootOffset, + 14, + 0, + ); + final startTileParam = const fb.Int64Reader().vTableGet( + buffer, + rootOffset, + 16, + 0, + ); + final endTileParam = const fb.Int64Reader().vTableGet( + buffer, + rootOffset, + 18, + 0, + ); + final regionParam = obx.ToOne( + targetId: const fb.Int64Reader().vTableGet(buffer, rootOffset, 46, 0), + ); + final object = ObjectBoxRecovery( + refId: refIdParam, + storeName: storeNameParam, + creationTime: creationTimeParam, + minZoom: minZoomParam, + maxZoom: maxZoomParam, + startTile: startTileParam, + endTile: endTileParam, + region: regionParam, + )..id = const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0); + object.region.attach(store); + return object; + }, + ), ObjectBoxStore: obx_int.EntityDefinition( - model: _entities[1], - toOneRelations: (ObjectBoxStore object) => [], - toManyRelations: (ObjectBoxStore object) => { - obx_int.RelInfo.toManyBacklink(1, object.id): - object.tiles - }, - getId: (ObjectBoxStore object) => object.id, - setId: (ObjectBoxStore object, int id) { - object.id = id; - }, - objectToFB: (ObjectBoxStore object, fb.Builder fbb) { - final nameOffset = fbb.writeString(object.name); - final metadataJsonOffset = fbb.writeString(object.metadataJson); - fbb.startTable(9); - fbb.addInt64(0, object.id); - fbb.addOffset(1, nameOffset); - fbb.addInt64(2, object.length); - fbb.addInt64(3, object.size); - fbb.addInt64(4, object.hits); - fbb.addInt64(5, object.misses); - fbb.addOffset(6, metadataJsonOffset); - fbb.addInt64(7, object.maxLength); - fbb.finish(fbb.endTable()); - return object.id; - }, - objectFromFB: (obx.Store store, ByteData fbData) { - final buffer = fb.BufferContext(fbData); - final rootOffset = buffer.derefObject(0); - final nameParam = const fb.StringReader(asciiOptimization: true) - .vTableGet(buffer, rootOffset, 6, ''); - final maxLengthParam = - const fb.Int64Reader().vTableGetNullable(buffer, rootOffset, 18); - final lengthParam = - const fb.Int64Reader().vTableGet(buffer, rootOffset, 8, 0); - final sizeParam = - const fb.Int64Reader().vTableGet(buffer, rootOffset, 10, 0); - final hitsParam = - const fb.Int64Reader().vTableGet(buffer, rootOffset, 12, 0); - final missesParam = - const fb.Int64Reader().vTableGet(buffer, rootOffset, 14, 0); - final metadataJsonParam = - const fb.StringReader(asciiOptimization: true) - .vTableGet(buffer, rootOffset, 16, ''); - final object = ObjectBoxStore( - name: nameParam, - maxLength: maxLengthParam, - length: lengthParam, - size: sizeParam, - hits: hitsParam, - misses: missesParam, - metadataJson: metadataJsonParam) - ..id = const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0); - obx_int.InternalToManyAccess.setRelInfo( - object.tiles, - store, - obx_int.RelInfo.toManyBacklink(1, object.id)); - return object; - }), + model: _entities[1], + toOneRelations: (ObjectBoxStore object) => [], + toManyRelations: (ObjectBoxStore object) => { + obx_int.RelInfo.toManyBacklink(1, object.id): + object.tiles, + }, + getId: (ObjectBoxStore object) => object.id, + setId: (ObjectBoxStore object, int id) { + object.id = id; + }, + objectToFB: (ObjectBoxStore object, fb.Builder fbb) { + final nameOffset = fbb.writeString(object.name); + final metadataJsonOffset = fbb.writeString(object.metadataJson); + fbb.startTable(9); + fbb.addInt64(0, object.id); + fbb.addOffset(1, nameOffset); + fbb.addInt64(2, object.length); + fbb.addInt64(3, object.size); + fbb.addInt64(4, object.hits); + fbb.addInt64(5, object.misses); + fbb.addOffset(6, metadataJsonOffset); + fbb.addInt64(7, object.maxLength); + fbb.finish(fbb.endTable()); + return object.id; + }, + objectFromFB: (obx.Store store, ByteData fbData) { + final buffer = fb.BufferContext(fbData); + final rootOffset = buffer.derefObject(0); + final nameParam = const fb.StringReader( + asciiOptimization: true, + ).vTableGet(buffer, rootOffset, 6, ''); + final maxLengthParam = const fb.Int64Reader().vTableGetNullable( + buffer, + rootOffset, + 18, + ); + final lengthParam = const fb.Int64Reader().vTableGet( + buffer, + rootOffset, + 8, + 0, + ); + final sizeParam = const fb.Int64Reader().vTableGet( + buffer, + rootOffset, + 10, + 0, + ); + final hitsParam = const fb.Int64Reader().vTableGet( + buffer, + rootOffset, + 12, + 0, + ); + final missesParam = const fb.Int64Reader().vTableGet( + buffer, + rootOffset, + 14, + 0, + ); + final metadataJsonParam = const fb.StringReader( + asciiOptimization: true, + ).vTableGet(buffer, rootOffset, 16, ''); + final object = ObjectBoxStore( + name: nameParam, + maxLength: maxLengthParam, + length: lengthParam, + size: sizeParam, + hits: hitsParam, + misses: missesParam, + metadataJson: metadataJsonParam, + )..id = const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0); + obx_int.InternalToManyAccess.setRelInfo( + object.tiles, + store, + obx_int.RelInfo.toManyBacklink(1, object.id), + ); + return object; + }, + ), ObjectBoxTile: obx_int.EntityDefinition( - model: _entities[2], - toOneRelations: (ObjectBoxTile object) => [], - toManyRelations: (ObjectBoxTile object) => { - obx_int.RelInfo.toMany(1, object.id): object.stores - }, - getId: (ObjectBoxTile object) => object.id, - setId: (ObjectBoxTile object, int id) { - object.id = id; - }, - objectToFB: (ObjectBoxTile object, fb.Builder fbb) { - final urlOffset = fbb.writeString(object.url); - final bytesOffset = fbb.writeListInt8(object.bytes); - fbb.startTable(5); - fbb.addInt64(0, object.id); - fbb.addOffset(1, urlOffset); - fbb.addOffset(2, bytesOffset); - fbb.addInt64(3, object.lastModified.millisecondsSinceEpoch); - fbb.finish(fbb.endTable()); - return object.id; - }, - objectFromFB: (obx.Store store, ByteData fbData) { - final buffer = fb.BufferContext(fbData); - final rootOffset = buffer.derefObject(0); - final urlParam = const fb.StringReader(asciiOptimization: true) - .vTableGet(buffer, rootOffset, 6, ''); - final bytesParam = const fb.Uint8ListReader(lazy: false) - .vTableGet(buffer, rootOffset, 8, Uint8List(0)) as Uint8List; - final lastModifiedParam = DateTime.fromMillisecondsSinceEpoch( - const fb.Int64Reader().vTableGet(buffer, rootOffset, 10, 0)); - final object = ObjectBoxTile( - url: urlParam, bytes: bytesParam, lastModified: lastModifiedParam) - ..id = const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0); - obx_int.InternalToManyAccess.setRelInfo(object.stores, - store, obx_int.RelInfo.toMany(1, object.id)); - return object; - }), + model: _entities[2], + toOneRelations: (ObjectBoxTile object) => [], + toManyRelations: (ObjectBoxTile object) => { + obx_int.RelInfo.toMany(1, object.id): object.stores, + }, + getId: (ObjectBoxTile object) => object.id, + setId: (ObjectBoxTile object, int id) { + object.id = id; + }, + objectToFB: (ObjectBoxTile object, fb.Builder fbb) { + final urlOffset = fbb.writeString(object.url); + final bytesOffset = fbb.writeListInt8(object.bytes); + fbb.startTable(5); + fbb.addInt64(0, object.id); + fbb.addOffset(1, urlOffset); + fbb.addOffset(2, bytesOffset); + fbb.addInt64(3, object.lastModified.millisecondsSinceEpoch); + fbb.finish(fbb.endTable()); + return object.id; + }, + objectFromFB: (obx.Store store, ByteData fbData) { + final buffer = fb.BufferContext(fbData); + final rootOffset = buffer.derefObject(0); + final urlParam = const fb.StringReader( + asciiOptimization: true, + ).vTableGet(buffer, rootOffset, 6, ''); + final bytesParam = + const fb.Uint8ListReader( + lazy: false, + ).vTableGet(buffer, rootOffset, 8, Uint8List(0)) + as Uint8List; + final lastModifiedParam = DateTime.fromMillisecondsSinceEpoch( + const fb.Int64Reader().vTableGet(buffer, rootOffset, 10, 0), + ); + final object = ObjectBoxTile( + url: urlParam, + bytes: bytesParam, + lastModified: lastModifiedParam, + )..id = const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0); + obx_int.InternalToManyAccess.setRelInfo( + object.stores, + store, + obx_int.RelInfo.toMany(1, object.id), + ); + return object; + }, + ), ObjectBoxRoot: obx_int.EntityDefinition( - model: _entities[3], - toOneRelations: (ObjectBoxRoot object) => [], - toManyRelations: (ObjectBoxRoot object) => {}, - getId: (ObjectBoxRoot object) => object.id, - setId: (ObjectBoxRoot object, int id) { - object.id = id; - }, - objectToFB: (ObjectBoxRoot object, fb.Builder fbb) { - fbb.startTable(4); - fbb.addInt64(0, object.id); - fbb.addInt64(1, object.length); - fbb.addInt64(2, object.size); - fbb.finish(fbb.endTable()); - return object.id; - }, - objectFromFB: (obx.Store store, ByteData fbData) { - final buffer = fb.BufferContext(fbData); - final rootOffset = buffer.derefObject(0); - final lengthParam = - const fb.Int64Reader().vTableGet(buffer, rootOffset, 6, 0); - final sizeParam = - const fb.Int64Reader().vTableGet(buffer, rootOffset, 8, 0); - final object = ObjectBoxRoot(length: lengthParam, size: sizeParam) - ..id = const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0); - - return object; - }), + model: _entities[3], + toOneRelations: (ObjectBoxRoot object) => [], + toManyRelations: (ObjectBoxRoot object) => {}, + getId: (ObjectBoxRoot object) => object.id, + setId: (ObjectBoxRoot object, int id) { + object.id = id; + }, + objectToFB: (ObjectBoxRoot object, fb.Builder fbb) { + fbb.startTable(4); + fbb.addInt64(0, object.id); + fbb.addInt64(1, object.length); + fbb.addInt64(2, object.size); + fbb.finish(fbb.endTable()); + return object.id; + }, + objectFromFB: (obx.Store store, ByteData fbData) { + final buffer = fb.BufferContext(fbData); + final rootOffset = buffer.derefObject(0); + final lengthParam = const fb.Int64Reader().vTableGet( + buffer, + rootOffset, + 6, + 0, + ); + final sizeParam = const fb.Int64Reader().vTableGet( + buffer, + rootOffset, + 8, + 0, + ); + final object = ObjectBoxRoot(length: lengthParam, size: sizeParam) + ..id = const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0); + + return object; + }, + ), ObjectBoxRecoveryRegion: obx_int.EntityDefinition( - model: _entities[4], - toOneRelations: (ObjectBoxRecoveryRegion object) => [], - toManyRelations: (ObjectBoxRecoveryRegion object) => { - obx_int.RelInfo.toMany(2, object.id): - object.multiLinkedRegions - }, - getId: (ObjectBoxRecoveryRegion object) => object.id, - setId: (ObjectBoxRecoveryRegion object, int id) { - object.id = id; - }, - objectToFB: (ObjectBoxRecoveryRegion object, fb.Builder fbb) { - final lineLatsOffset = object.lineLats == null - ? null - : fbb.writeListFloat64(object.lineLats!); - final lineLngsOffset = object.lineLngs == null - ? null - : fbb.writeListFloat64(object.lineLngs!); - final customPolygonLatsOffset = object.customPolygonLats == null - ? null - : fbb.writeListFloat64(object.customPolygonLats!); - final customPolygonLngsOffset = object.customPolygonLngs == null - ? null - : fbb.writeListFloat64(object.customPolygonLngs!); - fbb.startTable(15); - fbb.addInt64(0, object.id); - fbb.addInt64(1, object.typeId); - fbb.addFloat64(2, object.rectNwLat); - fbb.addFloat64(3, object.rectNwLng); - fbb.addFloat64(4, object.rectSeLat); - fbb.addFloat64(5, object.rectSeLng); - fbb.addFloat64(6, object.circleCenterLat); - fbb.addFloat64(7, object.circleCenterLng); - fbb.addFloat64(8, object.circleRadius); - fbb.addOffset(9, lineLatsOffset); - fbb.addOffset(10, lineLngsOffset); - fbb.addFloat64(11, object.lineRadius); - fbb.addOffset(12, customPolygonLatsOffset); - fbb.addOffset(13, customPolygonLngsOffset); - fbb.finish(fbb.endTable()); - return object.id; - }, - objectFromFB: (obx.Store store, ByteData fbData) { - final buffer = fb.BufferContext(fbData); - final rootOffset = buffer.derefObject(0); - final typeIdParam = - const fb.Int64Reader().vTableGet(buffer, rootOffset, 6, 0); - final rectNwLatParam = - const fb.Float64Reader().vTableGetNullable(buffer, rootOffset, 8); - final rectNwLngParam = const fb.Float64Reader() - .vTableGetNullable(buffer, rootOffset, 10); - final rectSeLatParam = const fb.Float64Reader() - .vTableGetNullable(buffer, rootOffset, 12); - final rectSeLngParam = const fb.Float64Reader() - .vTableGetNullable(buffer, rootOffset, 14); - final circleCenterLatParam = const fb.Float64Reader() - .vTableGetNullable(buffer, rootOffset, 16); - final circleCenterLngParam = const fb.Float64Reader() - .vTableGetNullable(buffer, rootOffset, 18); - final circleRadiusParam = const fb.Float64Reader() - .vTableGetNullable(buffer, rootOffset, 20); - final lineLatsParam = - const fb.ListReader(fb.Float64Reader(), lazy: false) - .vTableGetNullable(buffer, rootOffset, 22); - final lineLngsParam = - const fb.ListReader(fb.Float64Reader(), lazy: false) - .vTableGetNullable(buffer, rootOffset, 24); - final lineRadiusParam = const fb.Float64Reader() - .vTableGetNullable(buffer, rootOffset, 26); - final customPolygonLatsParam = - const fb.ListReader(fb.Float64Reader(), lazy: false) - .vTableGetNullable(buffer, rootOffset, 28); - final customPolygonLngsParam = - const fb.ListReader(fb.Float64Reader(), lazy: false) - .vTableGetNullable(buffer, rootOffset, 30); - final multiLinkedRegionsParam = obx.ToMany(); - final object = ObjectBoxRecoveryRegion( - typeId: typeIdParam, - rectNwLat: rectNwLatParam, - rectNwLng: rectNwLngParam, - rectSeLat: rectSeLatParam, - rectSeLng: rectSeLngParam, - circleCenterLat: circleCenterLatParam, - circleCenterLng: circleCenterLngParam, - circleRadius: circleRadiusParam, - lineLats: lineLatsParam, - lineLngs: lineLngsParam, - lineRadius: lineRadiusParam, - customPolygonLats: customPolygonLatsParam, - customPolygonLngs: customPolygonLngsParam, - multiLinkedRegions: multiLinkedRegionsParam) - ..id = const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0); - obx_int.InternalToManyAccess.setRelInfo( - object.multiLinkedRegions, - store, - obx_int.RelInfo.toMany(2, object.id)); - return object; - }) + model: _entities[4], + toOneRelations: (ObjectBoxRecoveryRegion object) => [], + toManyRelations: (ObjectBoxRecoveryRegion object) => { + obx_int.RelInfo.toMany(2, object.id): + object.multiLinkedRegions, + }, + getId: (ObjectBoxRecoveryRegion object) => object.id, + setId: (ObjectBoxRecoveryRegion object, int id) { + object.id = id; + }, + objectToFB: (ObjectBoxRecoveryRegion object, fb.Builder fbb) { + final lineLatsOffset = object.lineLats == null + ? null + : fbb.writeListFloat64(object.lineLats!); + final lineLngsOffset = object.lineLngs == null + ? null + : fbb.writeListFloat64(object.lineLngs!); + final customPolygonLatsOffset = object.customPolygonLats == null + ? null + : fbb.writeListFloat64(object.customPolygonLats!); + final customPolygonLngsOffset = object.customPolygonLngs == null + ? null + : fbb.writeListFloat64(object.customPolygonLngs!); + fbb.startTable(15); + fbb.addInt64(0, object.id); + fbb.addInt64(1, object.typeId); + fbb.addFloat64(2, object.rectNwLat); + fbb.addFloat64(3, object.rectNwLng); + fbb.addFloat64(4, object.rectSeLat); + fbb.addFloat64(5, object.rectSeLng); + fbb.addFloat64(6, object.circleCenterLat); + fbb.addFloat64(7, object.circleCenterLng); + fbb.addFloat64(8, object.circleRadius); + fbb.addOffset(9, lineLatsOffset); + fbb.addOffset(10, lineLngsOffset); + fbb.addFloat64(11, object.lineRadius); + fbb.addOffset(12, customPolygonLatsOffset); + fbb.addOffset(13, customPolygonLngsOffset); + fbb.finish(fbb.endTable()); + return object.id; + }, + objectFromFB: (obx.Store store, ByteData fbData) { + final buffer = fb.BufferContext(fbData); + final rootOffset = buffer.derefObject(0); + final typeIdParam = const fb.Int64Reader().vTableGet( + buffer, + rootOffset, + 6, + 0, + ); + final rectNwLatParam = const fb.Float64Reader().vTableGetNullable( + buffer, + rootOffset, + 8, + ); + final rectNwLngParam = const fb.Float64Reader().vTableGetNullable( + buffer, + rootOffset, + 10, + ); + final rectSeLatParam = const fb.Float64Reader().vTableGetNullable( + buffer, + rootOffset, + 12, + ); + final rectSeLngParam = const fb.Float64Reader().vTableGetNullable( + buffer, + rootOffset, + 14, + ); + final circleCenterLatParam = const fb.Float64Reader().vTableGetNullable( + buffer, + rootOffset, + 16, + ); + final circleCenterLngParam = const fb.Float64Reader().vTableGetNullable( + buffer, + rootOffset, + 18, + ); + final circleRadiusParam = const fb.Float64Reader().vTableGetNullable( + buffer, + rootOffset, + 20, + ); + final lineLatsParam = const fb.ListReader( + fb.Float64Reader(), + lazy: false, + ).vTableGetNullable(buffer, rootOffset, 22); + final lineLngsParam = const fb.ListReader( + fb.Float64Reader(), + lazy: false, + ).vTableGetNullable(buffer, rootOffset, 24); + final lineRadiusParam = const fb.Float64Reader().vTableGetNullable( + buffer, + rootOffset, + 26, + ); + final customPolygonLatsParam = const fb.ListReader( + fb.Float64Reader(), + lazy: false, + ).vTableGetNullable(buffer, rootOffset, 28); + final customPolygonLngsParam = const fb.ListReader( + fb.Float64Reader(), + lazy: false, + ).vTableGetNullable(buffer, rootOffset, 30); + final multiLinkedRegionsParam = obx.ToMany(); + final object = ObjectBoxRecoveryRegion( + typeId: typeIdParam, + rectNwLat: rectNwLatParam, + rectNwLng: rectNwLngParam, + rectSeLat: rectSeLatParam, + rectSeLng: rectSeLngParam, + circleCenterLat: circleCenterLatParam, + circleCenterLng: circleCenterLngParam, + circleRadius: circleRadiusParam, + lineLats: lineLatsParam, + lineLngs: lineLngsParam, + lineRadius: lineRadiusParam, + customPolygonLats: customPolygonLatsParam, + customPolygonLngs: customPolygonLngsParam, + multiLinkedRegions: multiLinkedRegionsParam, + )..id = const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0); + obx_int.InternalToManyAccess.setRelInfo( + object.multiLinkedRegions, + store, + obx_int.RelInfo.toMany(2, object.id), + ); + return object; + }, + ), }; return obx_int.ModelDefinition(model, bindings); @@ -627,182 +779,222 @@ obx_int.ModelDefinition getObjectBoxModel() { /// [ObjectBoxRecovery] entity fields to define ObjectBox queries. class ObjectBoxRecovery_ { /// See [ObjectBoxRecovery.id]. - static final id = - obx.QueryIntegerProperty(_entities[0].properties[0]); + static final id = obx.QueryIntegerProperty( + _entities[0].properties[0], + ); /// See [ObjectBoxRecovery.refId]. - static final refId = - obx.QueryIntegerProperty(_entities[0].properties[1]); + static final refId = obx.QueryIntegerProperty( + _entities[0].properties[1], + ); /// See [ObjectBoxRecovery.storeName]. - static final storeName = - obx.QueryStringProperty(_entities[0].properties[2]); + static final storeName = obx.QueryStringProperty( + _entities[0].properties[2], + ); /// See [ObjectBoxRecovery.creationTime]. - static final creationTime = - obx.QueryDateProperty(_entities[0].properties[3]); + static final creationTime = obx.QueryDateProperty( + _entities[0].properties[3], + ); /// See [ObjectBoxRecovery.minZoom]. - static final minZoom = - obx.QueryIntegerProperty(_entities[0].properties[4]); + static final minZoom = obx.QueryIntegerProperty( + _entities[0].properties[4], + ); /// See [ObjectBoxRecovery.maxZoom]. - static final maxZoom = - obx.QueryIntegerProperty(_entities[0].properties[5]); + static final maxZoom = obx.QueryIntegerProperty( + _entities[0].properties[5], + ); /// See [ObjectBoxRecovery.startTile]. - static final startTile = - obx.QueryIntegerProperty(_entities[0].properties[6]); + static final startTile = obx.QueryIntegerProperty( + _entities[0].properties[6], + ); /// See [ObjectBoxRecovery.endTile]. - static final endTile = - obx.QueryIntegerProperty(_entities[0].properties[7]); + static final endTile = obx.QueryIntegerProperty( + _entities[0].properties[7], + ); /// See [ObjectBoxRecovery.region]. static final region = obx.QueryRelationToOne( - _entities[0].properties[8]); + _entities[0].properties[8], + ); } /// [ObjectBoxStore] entity fields to define ObjectBox queries. class ObjectBoxStore_ { /// See [ObjectBoxStore.id]. - static final id = - obx.QueryIntegerProperty(_entities[1].properties[0]); + static final id = obx.QueryIntegerProperty( + _entities[1].properties[0], + ); /// See [ObjectBoxStore.name]. - static final name = - obx.QueryStringProperty(_entities[1].properties[1]); + static final name = obx.QueryStringProperty( + _entities[1].properties[1], + ); /// See [ObjectBoxStore.length]. - static final length = - obx.QueryIntegerProperty(_entities[1].properties[2]); + static final length = obx.QueryIntegerProperty( + _entities[1].properties[2], + ); /// See [ObjectBoxStore.size]. - static final size = - obx.QueryIntegerProperty(_entities[1].properties[3]); + static final size = obx.QueryIntegerProperty( + _entities[1].properties[3], + ); /// See [ObjectBoxStore.hits]. - static final hits = - obx.QueryIntegerProperty(_entities[1].properties[4]); + static final hits = obx.QueryIntegerProperty( + _entities[1].properties[4], + ); /// See [ObjectBoxStore.misses]. - static final misses = - obx.QueryIntegerProperty(_entities[1].properties[5]); + static final misses = obx.QueryIntegerProperty( + _entities[1].properties[5], + ); /// See [ObjectBoxStore.metadataJson]. - static final metadataJson = - obx.QueryStringProperty(_entities[1].properties[6]); + static final metadataJson = obx.QueryStringProperty( + _entities[1].properties[6], + ); /// See [ObjectBoxStore.maxLength]. - static final maxLength = - obx.QueryIntegerProperty(_entities[1].properties[7]); + static final maxLength = obx.QueryIntegerProperty( + _entities[1].properties[7], + ); } /// [ObjectBoxTile] entity fields to define ObjectBox queries. class ObjectBoxTile_ { /// See [ObjectBoxTile.id]. - static final id = - obx.QueryIntegerProperty(_entities[2].properties[0]); + static final id = obx.QueryIntegerProperty( + _entities[2].properties[0], + ); /// See [ObjectBoxTile.url]. - static final url = - obx.QueryStringProperty(_entities[2].properties[1]); + static final url = obx.QueryStringProperty( + _entities[2].properties[1], + ); /// See [ObjectBoxTile.bytes]. - static final bytes = - obx.QueryByteVectorProperty(_entities[2].properties[2]); + static final bytes = obx.QueryByteVectorProperty( + _entities[2].properties[2], + ); /// See [ObjectBoxTile.lastModified]. - static final lastModified = - obx.QueryDateProperty(_entities[2].properties[3]); + static final lastModified = obx.QueryDateProperty( + _entities[2].properties[3], + ); /// see [ObjectBoxTile.stores] static final stores = obx.QueryRelationToMany( - _entities[2].relations[0]); + _entities[2].relations[0], + ); } /// [ObjectBoxRoot] entity fields to define ObjectBox queries. class ObjectBoxRoot_ { /// See [ObjectBoxRoot.id]. - static final id = - obx.QueryIntegerProperty(_entities[3].properties[0]); + static final id = obx.QueryIntegerProperty( + _entities[3].properties[0], + ); /// See [ObjectBoxRoot.length]. - static final length = - obx.QueryIntegerProperty(_entities[3].properties[1]); + static final length = obx.QueryIntegerProperty( + _entities[3].properties[1], + ); /// See [ObjectBoxRoot.size]. - static final size = - obx.QueryIntegerProperty(_entities[3].properties[2]); + static final size = obx.QueryIntegerProperty( + _entities[3].properties[2], + ); } /// [ObjectBoxRecoveryRegion] entity fields to define ObjectBox queries. class ObjectBoxRecoveryRegion_ { /// See [ObjectBoxRecoveryRegion.id]. static final id = obx.QueryIntegerProperty( - _entities[4].properties[0]); + _entities[4].properties[0], + ); /// See [ObjectBoxRecoveryRegion.typeId]. static final typeId = obx.QueryIntegerProperty( - _entities[4].properties[1]); + _entities[4].properties[1], + ); /// See [ObjectBoxRecoveryRegion.rectNwLat]. static final rectNwLat = obx.QueryDoubleProperty( - _entities[4].properties[2]); + _entities[4].properties[2], + ); /// See [ObjectBoxRecoveryRegion.rectNwLng]. static final rectNwLng = obx.QueryDoubleProperty( - _entities[4].properties[3]); + _entities[4].properties[3], + ); /// See [ObjectBoxRecoveryRegion.rectSeLat]. static final rectSeLat = obx.QueryDoubleProperty( - _entities[4].properties[4]); + _entities[4].properties[4], + ); /// See [ObjectBoxRecoveryRegion.rectSeLng]. static final rectSeLng = obx.QueryDoubleProperty( - _entities[4].properties[5]); + _entities[4].properties[5], + ); /// See [ObjectBoxRecoveryRegion.circleCenterLat]. static final circleCenterLat = obx.QueryDoubleProperty( - _entities[4].properties[6]); + _entities[4].properties[6], + ); /// See [ObjectBoxRecoveryRegion.circleCenterLng]. static final circleCenterLng = obx.QueryDoubleProperty( - _entities[4].properties[7]); + _entities[4].properties[7], + ); /// See [ObjectBoxRecoveryRegion.circleRadius]. static final circleRadius = obx.QueryDoubleProperty( - _entities[4].properties[8]); + _entities[4].properties[8], + ); /// See [ObjectBoxRecoveryRegion.lineLats]. static final lineLats = obx.QueryDoubleVectorProperty( - _entities[4].properties[9]); + _entities[4].properties[9], + ); /// See [ObjectBoxRecoveryRegion.lineLngs]. static final lineLngs = obx.QueryDoubleVectorProperty( - _entities[4].properties[10]); + _entities[4].properties[10], + ); /// See [ObjectBoxRecoveryRegion.lineRadius]. static final lineRadius = obx.QueryDoubleProperty( - _entities[4].properties[11]); + _entities[4].properties[11], + ); /// See [ObjectBoxRecoveryRegion.customPolygonLats]. static final customPolygonLats = obx.QueryDoubleVectorProperty( - _entities[4].properties[12]); + _entities[4].properties[12], + ); /// See [ObjectBoxRecoveryRegion.customPolygonLngs]. static final customPolygonLngs = obx.QueryDoubleVectorProperty( - _entities[4].properties[13]); + _entities[4].properties[13], + ); /// see [ObjectBoxRecoveryRegion.multiLinkedRegions] static final multiLinkedRegions = obx.QueryRelationToMany( - _entities[4].relations[0]); + _entities[4].relations[0], + ); } diff --git a/pubspec.yaml b/pubspec.yaml index 657345f0..e9e1ee32 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: flutter_map_tile_caching description: Plugin for 'flutter_map' providing advanced caching functionality, with ability to download map regions for offline use. -version: 10.1.1 +version: 10.1.2 repository: https://github.com/JaffaKetchup/flutter_map_tile_caching issue_tracker: https://github.com/JaffaKetchup/flutter_map_tile_caching/issues @@ -37,14 +37,14 @@ dependencies: http: ^1.2.2 latlong2: ^0.9.1 meta: ^1.15.0 - objectbox: ^4.1.0 - objectbox_flutter_libs: ^4.1.0 + objectbox: ">=4.1.0 <6.0.0" + objectbox_flutter_libs: ">=4.1.0 <6.0.0" path: ^1.9.1 path_provider: ^2.1.5 dev_dependencies: build_runner: ^2.4.15 - objectbox_generator: ^4.1.0 + objectbox_generator: ">=4.1.0 <6.0.0" test: ^1.25.15 flutter: null diff --git a/windowsApplicationInstallerSetup.iss b/windowsApplicationInstallerSetup.iss index 3f7c58ad..26585fc8 100644 --- a/windowsApplicationInstallerSetup.iss +++ b/windowsApplicationInstallerSetup.iss @@ -1,7 +1,7 @@ ; Script generated by the Inno Setup Script Wizard #define MyAppName "FMTC Demo" -#define MyAppVersion "for 10.1.1" +#define MyAppVersion "for 10.1.2" #define MyAppPublisher "JaffaKetchup Development" #define MyAppURL "https://github.com/JaffaKetchup/flutter_map_tile_caching" #define MyAppSupportURL "https://github.com/JaffaKetchup/flutter_map_tile_caching/issues" @@ -35,30 +35,6 @@ WizardStyle=modern [Languages] Name: "english"; MessagesFile: "compiler:Default.isl" -Name: "armenian"; MessagesFile: "compiler:Languages\Armenian.isl" -Name: "brazilianportuguese"; MessagesFile: "compiler:Languages\BrazilianPortuguese.isl" -Name: "bulgarian"; MessagesFile: "compiler:Languages\Bulgarian.isl" -Name: "catalan"; MessagesFile: "compiler:Languages\Catalan.isl" -Name: "corsican"; MessagesFile: "compiler:Languages\Corsican.isl" -Name: "czech"; MessagesFile: "compiler:Languages\Czech.isl" -Name: "danish"; MessagesFile: "compiler:Languages\Danish.isl" -Name: "dutch"; MessagesFile: "compiler:Languages\Dutch.isl" -Name: "finnish"; MessagesFile: "compiler:Languages\Finnish.isl" -Name: "french"; MessagesFile: "compiler:Languages\French.isl" -Name: "german"; MessagesFile: "compiler:Languages\German.isl" -Name: "hebrew"; MessagesFile: "compiler:Languages\Hebrew.isl" -Name: "icelandic"; MessagesFile: "compiler:Languages\Icelandic.isl" -Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl" -Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl" -Name: "norwegian"; MessagesFile: "compiler:Languages\Norwegian.isl" -Name: "polish"; MessagesFile: "compiler:Languages\Polish.isl" -Name: "portuguese"; MessagesFile: "compiler:Languages\Portuguese.isl" -Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl" -Name: "slovak"; MessagesFile: "compiler:Languages\Slovak.isl" -Name: "slovenian"; MessagesFile: "compiler:Languages\Slovenian.isl" -Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl" -Name: "turkish"; MessagesFile: "compiler:Languages\Turkish.isl" -Name: "ukrainian"; MessagesFile: "compiler:Languages\Ukrainian.isl" [Tasks] Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked