Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/on-commit-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ jobs:
- name: Checkout project
uses: actions/checkout@v7
- name: Setup Java
uses: actions/setup-java@v5
uses: actions/setup-java@v6
with:
distribution: 'zulu'
java-version: '17'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ jobs:
- name: Checkout project
uses: actions/checkout@v7
- name: Setup Java
uses: actions/setup-java@v5
uses: actions/setup-java@v6
with:
distribution: 'zulu'
java-version: '17'
Expand Down
9 changes: 9 additions & 0 deletions example/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
analyzer:
exclude:
- build/**
- android/**
- ios/**
- web/**
- windows/**
- macos/**
- linux/**
include: ../analysis_options.yaml

linter:
Expand Down
5 changes: 2 additions & 3 deletions example/lib/flutter_map_mbtiles/page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:flutter_map_mbtiles/flutter_map_mbtiles.dart';
import 'package:flutter_map_plugins_example/common/utils.dart';
import 'package:latlong2/latlong.dart';
import 'package:mbtiles/mbtiles.dart';

class FlutterMapMbTilesPage extends StatefulWidget {
Expand All @@ -24,7 +23,7 @@ class _FlutterMapMbTilesPageState extends State<FlutterMapMbTilesPage> {
final file = await copyAssetToFile(
'assets/mbtiles/countries-raster.mbtiles',
);
return MbTiles(mbtilesPath: file.path);
return MbTiles(path: file.path);
}

@override
Expand Down Expand Up @@ -82,7 +81,7 @@ class _FlutterMapMbTilesPageState extends State<FlutterMapMbTilesPage> {
@override
void dispose() {
// close the open database connection
_mbtiles?.dispose();
_mbtiles?.close();
super.dispose();
}
}
5 changes: 2 additions & 3 deletions example/lib/vector_map_tiles_mbtiles/page.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:flutter_map_plugins_example/common/utils.dart';
import 'package:latlong2/latlong.dart';
import 'package:mbtiles/mbtiles.dart';
import 'package:vector_map_tiles/vector_map_tiles.dart';
import 'package:vector_map_tiles_mbtiles/vector_map_tiles_mbtiles.dart';
Expand Down Expand Up @@ -29,7 +28,7 @@ class _VectorMapTilesMbTilesPageState extends State<VectorMapTilesMbTilesPage> {
final file = await copyAssetToFile(
'assets/mbtiles/malta-vector.mbtiles',
);
return MbTiles(mbtilesPath: file.path, gzip: false);
return MbTiles(path: file.path, gzip: false);
}

@override
Expand Down Expand Up @@ -95,7 +94,7 @@ class _VectorMapTilesMbTilesPageState extends State<VectorMapTilesMbTilesPage> {
@override
void dispose() {
// close the open database connection
_mbtiles?.dispose();
_mbtiles?.close();
super.dispose();
}
}
2 changes: 2 additions & 0 deletions example/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import FlutterMacOS
import Foundation

import connectivity_plus
import maplibre
import sqlite3_flutter_libs
import url_launcher_macos

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin"))
MaplibrePlugin.register(with: registry.registrar(forPlugin: "MaplibrePlugin"))
Sqlite3FlutterLibsPlugin.register(with: registry.registrar(forPlugin: "Sqlite3FlutterLibsPlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
}
9 changes: 4 additions & 5 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies:
flutter_map: ^8.0.0
flutter_web_plugins:
sdk: flutter
latlong2: ^0.9.0
latlong2: ">=0.9.0 <0.11.0"
url_launcher: ^6.2.4
connectivity_plus: ^7.0.0
path_provider: ^2.0.15
Expand All @@ -22,10 +22,9 @@ dependencies:
http_cache_drift_store: ^7.0.0
http_cache_file_store: ^2.0.0
http_cache_hive_store: ^5.0.0
sqlite3_flutter_libs: ^0.5.15
vector_map_tiles: ^9.0.0-beta.8
vector_tile_renderer: ^6.0.0
mbtiles: ^0.4.0
vector_map_tiles: ^10.0.0-beta.2
vector_tile_renderer: ^7.0.0-beta.1
mbtiles: ^0.5.0
maplibre: ^0.3.0

flutter_map_cache:
Expand Down
1 change: 0 additions & 1 deletion flutter_map_cache/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ dependencies:

# drift
http_cache_drift_store: ^7.0.0
sqlite3_flutter_libs: ^0.5.15

# file system
http_cache_file_store: ^2.0.0
Expand Down
3 changes: 3 additions & 0 deletions flutter_map_cache/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
analyzer:
exclude:
- build/**
include: ../analysis_options.yaml
2 changes: 1 addition & 1 deletion flutter_map_cache/lib/src/cached_image_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class CachedImageProvider extends ImageProvider<CachedImageProvider> {
final bytes = Uint8List.fromList(response.data!);
final codec = decode(await ImmutableBuffer.fromUint8List(bytes));
cancelLoading.ignore();
return codec;
return await codec;
} catch (error) {
// check if request is cancelled
if (error is DioException) {
Expand Down
2 changes: 1 addition & 1 deletion flutter_map_cache/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ dev_dependencies:
flutter_test:
sdk: flutter
http_mock_adapter: ^0.6.1
latlong2: ^0.9.0
latlong2: ">=0.9.0 <0.11.0"
test: ^1.24.9
very_good_analysis: ^10.0.0
3 changes: 3 additions & 0 deletions flutter_map_compass/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
analyzer:
exclude:
- build/**
include: ../analysis_options.yaml
2 changes: 1 addition & 1 deletion flutter_map_compass/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
latlong2: ^0.9.0
latlong2: ">=0.9.0 <0.11.0"
test: ^1.24.9
very_good_analysis: ^10.0.0
3 changes: 3 additions & 0 deletions flutter_map_maplibre/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
analyzer:
exclude:
- build/**
include: ../analysis_options.yaml

linter:
Expand Down
2 changes: 1 addition & 1 deletion flutter_map_maplibre/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dependencies:
flutter:
sdk: flutter
flutter_map: ^8.0.0
latlong2: ^0.9.1
latlong2: ">=0.9.0 <0.11.0"
maplibre: ^0.3.0

dev_dependencies:
Expand Down
3 changes: 3 additions & 0 deletions flutter_map_mbtiles/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
analyzer:
exclude:
- build/**
include: ../analysis_options.yaml
4 changes: 2 additions & 2 deletions flutter_map_mbtiles/lib/src/mbtiles_tile_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class MbTilesTileProvider extends TileProvider {
MbTilesTileProvider.fromPath({
required String path,
this.silenceTileNotFound = !kDebugMode,
}) : mbtiles = MbTiles(mbtilesPath: path),
}) : mbtiles = MbTiles(path: path),
_createdInternally = true;

/// MBTiles database
Expand All @@ -44,7 +44,7 @@ class MbTilesTileProvider extends TileProvider {

@override
void dispose() {
if (_createdInternally) mbtiles.dispose();
if (_createdInternally) mbtiles.close();
super.dispose();
}
}
5 changes: 2 additions & 3 deletions flutter_map_mbtiles/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@ dependencies:
flutter:
sdk: flutter
flutter_map: ">=6.0.0 <9.0.0"
mbtiles: ^0.4.0
sqlite3_flutter_libs: ^0.5.18
mbtiles: ^0.5.0

dev_dependencies:
build_runner: ^2.4.8
flutter_test:
sdk: flutter
latlong2: ^0.9.0
latlong2: ">=0.9.0 <0.11.0"
mockito: ^5.4.4
test: ^1.24.9
very_good_analysis: ^10.0.0
78 changes: 64 additions & 14 deletions flutter_map_mbtiles/test/integration_test.mocks.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
// Mocks generated by Mockito 5.4.5 from annotations
// Mocks generated by Mockito from annotations
// in flutter_map_mbtiles/test/integration_test.dart.
// Do not manually edit this file.

// ignore_for_file: no_leading_underscores_for_library_prefixes

import 'dart:typed_data' as _i4;

import 'package:mbtiles/src/mbtiles.dart' as _i3;
import 'package:mbtiles/src/model/mbtiles_metadata.dart' as _i2;
import 'package:mbtiles/src/model/metadata.dart' as _i2;
import 'package:mockito/mockito.dart' as _i1;

// ignore_for_file: type=lint
Expand All @@ -15,18 +16,25 @@ import 'package:mockito/mockito.dart' as _i1;
// ignore_for_file: comment_references
// ignore_for_file: deprecated_member_use
// ignore_for_file: deprecated_member_use_from_same_package
// ignore_for_file: experimental_member_use
// ignore_for_file: implementation_imports
// ignore_for_file: invalid_use_of_visible_for_testing_member
// ignore_for_file: must_be_immutable
// ignore_for_file: prefer_const_constructors
// ignore_for_file: unnecessary_parenthesis
// ignore_for_file: camel_case_types
// ignore_for_file: subtype_of_sealed_class
// ignore_for_file: invalid_use_of_internal_member

class _FakeMbTilesMetadata_0 extends _i1.SmartFake
implements _i2.MbTilesMetadata {
_FakeMbTilesMetadata_0(Object parent, Invocation parentInvocation)
: super(parent, parentInvocation);
_FakeMbTilesMetadata_0(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
}

/// A class which mocks [MbTiles].
Expand All @@ -43,27 +51,54 @@ class MockMbTiles extends _i1.Mock implements _i3.MbTiles {
@override
_i2.MbTilesMetadata getMetadata({bool? allowCache = true}) =>
(super.noSuchMethod(
Invocation.method(#getMetadata, [], {#allowCache: allowCache}),
Invocation.method(
#getMetadata,
[],
{#allowCache: allowCache},
),
returnValue: _FakeMbTilesMetadata_0(
this,
Invocation.method(#getMetadata, [], {#allowCache: allowCache}),
Invocation.method(
#getMetadata,
[],
{#allowCache: allowCache},
),
),
returnValueForMissingStub: _FakeMbTilesMetadata_0(
this,
Invocation.method(#getMetadata, [], {#allowCache: allowCache}),
Invocation.method(
#getMetadata,
[],
{#allowCache: allowCache},
),
),
) as _i2.MbTilesMetadata);

@override
_i4.Uint8List? getTile({required int? z, required int? x, required int? y}) =>
_i4.Uint8List? getTile({
required int? z,
required int? x,
required int? y,
}) =>
(super.noSuchMethod(
Invocation.method(#getTile, [], {#z: z, #x: x, #y: y}),
Invocation.method(
#getTile,
[],
{
#z: z,
#x: x,
#y: y,
},
),
returnValueForMissingStub: null,
) as _i4.Uint8List?);

@override
void createTables() => super.noSuchMethod(
Invocation.method(#createTables, []),
Invocation.method(
#createTables,
[],
),
returnValueForMissingStub: null,
);

Expand All @@ -75,19 +110,34 @@ class MockMbTiles extends _i1.Mock implements _i3.MbTiles {
required _i4.Uint8List? bytes,
}) =>
super.noSuchMethod(
Invocation.method(#putTile, [], {#z: z, #x: x, #y: y, #bytes: bytes}),
Invocation.method(
#putTile,
[],
{
#z: z,
#x: x,
#y: y,
#bytes: bytes,
},
),
returnValueForMissingStub: null,
);

@override
void setMetadata(_i2.MbTilesMetadata? metadata) => super.noSuchMethod(
Invocation.method(#setMetadata, [metadata]),
Invocation.method(
#setMetadata,
[metadata],
),
returnValueForMissingStub: null,
);

@override
void dispose() => super.noSuchMethod(
Invocation.method(#dispose, []),
void close() => super.noSuchMethod(
Invocation.method(
#close,
[],
),
returnValueForMissingStub: null,
);
}
1 change: 0 additions & 1 deletion flutter_map_mbtiles/test/utils/test_app.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:flutter_map_mbtiles/src/mbtiles_tile_provider.dart';
import 'package:latlong2/latlong.dart';
import 'package:mbtiles/mbtiles.dart';

class TestApp extends StatelessWidget {
Expand Down
3 changes: 3 additions & 0 deletions flutter_map_pmtiles/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
analyzer:
exclude:
- build/**
include: ../analysis_options.yaml
4 changes: 2 additions & 2 deletions flutter_map_pmtiles/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ dependencies:
flutter:
sdk: flutter
flutter_map: ">=6.0.0 <9.0.0"
pmtiles: ^1.2.0
pmtiles: ^2.0.0

dev_dependencies:
flutter_test:
sdk: flutter
test: ^1.24.9
mockito: ^5.4.4
build_runner: ^2.4.8
latlong2: ^0.9.0
latlong2: ">=0.9.0 <0.11.0"
very_good_analysis: ^10.0.0
Loading
Loading