Skip to content

Commit

Permalink
Remove duplicate exports and make imports consistent
Browse files Browse the repository at this point in the history
The plugin API no longer exports classes which flutter_map already
exports.

Imports within this package now import the actual classes they use
rather than the whole flutter_map library. Internal code should not
depend on the exported library definition.
  • Loading branch information
rorystephenson committed Jun 27, 2023
1 parent 5750b6a commit 5d8aca1
Show file tree
Hide file tree
Showing 15 changed files with 36 additions and 16 deletions.
1 change: 1 addition & 0 deletions lib/flutter_map.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export 'package:flutter_map/src/layer/tile_layer/tile_provider/file_providers/ti
export 'package:flutter_map/src/layer/tile_layer/tile_provider/network_tile_provider.dart';
export 'package:flutter_map/src/layer/tile_layer/tile_update_event.dart';
export 'package:flutter_map/src/layer/tile_layer/tile_update_transformer.dart';
export 'package:flutter_map/src/map/camera/camera.dart';
export 'package:flutter_map/src/map/camera/camera_constraint.dart';
export 'package:flutter_map/src/map/camera/camera_fit.dart';
export 'package:flutter_map/src/map/map_controller.dart';
Expand Down
3 changes: 0 additions & 3 deletions lib/plugin_api.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
library flutter_map.plugin_api;

export 'package:flutter_map/flutter_map.dart';
export 'package:flutter_map/src/map/camera/camera.dart';
export 'package:flutter_map/src/map/map_controller.dart';
export 'package:flutter_map/src/misc/private/bounds.dart';
export 'package:flutter_map/src/misc/private/positioned_tap_detector_2.dart';
export 'package:flutter_map/src/misc/private/util.dart';
1 change: 0 additions & 1 deletion lib/src/layer/attribution_layer/simple.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';

/// A simple, classic style, attribution widget, to be placed in
/// [FlutterMap.nonRotatedChildren]
Expand Down
2 changes: 1 addition & 1 deletion lib/src/layer/overlay_image_layer.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:flutter/widgets.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:flutter_map/src/geo/latlng_bounds.dart';
import 'package:flutter_map/src/map/camera/camera.dart';
import 'package:flutter_map/src/misc/private/bounds.dart';
import 'package:latlong2/latlong.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/src/layer/polygon_layer.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:ui' as ui;

import 'package:flutter/widgets.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:flutter_map/src/geo/latlng_bounds.dart';
import 'package:flutter_map/src/layer/label.dart';
import 'package:flutter_map/src/map/camera/camera.dart';
import 'package:latlong2/latlong.dart' hide Path; // conflict with Path from UI
Expand Down
2 changes: 1 addition & 1 deletion lib/src/layer/tile_layer/tile_coordinates.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'dart:math';

import 'package:flutter_map/flutter_map.dart';
import 'package:flutter_map/src/misc/point.dart';

class TileCoordinates extends CustomPoint<int> {
final int z;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import 'package:flutter/rendering.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:flutter_map/src/layer/tile_layer/tile_coordinates.dart';
import 'package:flutter_map/src/layer/tile_layer/tile_layer.dart';
import 'package:flutter_map/src/layer/tile_layer/tile_provider/base_tile_provider.dart';
import 'package:flutter_map/src/layer/tile_layer/tile_provider/network_image_provider.dart';
import 'package:http/http.dart';
import 'package:http/retry.dart';
Expand Down
8 changes: 7 additions & 1 deletion lib/src/map/map_controller.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import 'dart:async';

import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:flutter_map/src/geo/latlng_bounds.dart';
import 'package:flutter_map/src/gestures/map_events.dart';
import 'package:flutter_map/src/map/camera/camera.dart';
import 'package:flutter_map/src/map/camera/camera_fit.dart';
import 'package:flutter_map/src/map/inherited_model.dart';
import 'package:flutter_map/src/map/map_controller_impl.dart';
import 'package:flutter_map/src/misc/center_zoom.dart';
import 'package:flutter_map/src/misc/fit_bounds_options.dart';
import 'package:flutter_map/src/misc/move_and_rotate_result.dart';
import 'package:flutter_map/src/misc/point.dart';
import 'package:latlong2/latlong.dart';

/// Controller to programmatically interact with [FlutterMap], such as
Expand Down
2 changes: 1 addition & 1 deletion lib/src/misc/position.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:flutter_map/flutter_map.dart';
import 'package:flutter_map/src/geo/latlng_bounds.dart';
import 'package:latlong2/latlong.dart';

class MapPosition {
Expand Down
4 changes: 3 additions & 1 deletion test/flutter_map_controller_test.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import 'package:flutter/widgets.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:flutter_map/src/geo/latlng_bounds.dart';
import 'package:flutter_map/src/map/camera/camera_fit.dart';
import 'package:flutter_map/src/map/map_controller.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:latlong2/latlong.dart';

Expand Down
3 changes: 2 additions & 1 deletion test/layer/circle_layer_test.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:flutter_map/src/layer/circle_layer.dart';
import 'package:flutter_map/src/map/widget.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:latlong2/latlong.dart';

Expand Down
3 changes: 2 additions & 1 deletion test/layer/marker_layer_test.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:flutter_map/src/layer/marker_layer.dart';
import 'package:flutter_map/src/map/widget.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:latlong2/latlong.dart';

Expand Down
3 changes: 2 additions & 1 deletion test/layer/polygon_layer_test.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:flutter_map/src/layer/polygon_layer.dart';
import 'package:flutter_map/src/map/widget.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:latlong2/latlong.dart';

Expand Down
3 changes: 2 additions & 1 deletion test/layer/polyline_layer_test.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:flutter_map/src/layer/polyline_layer.dart';
import 'package:flutter_map/src/map/widget.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:latlong2/latlong.dart';

Expand Down
11 changes: 10 additions & 1 deletion test/test_utils/test_app.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
import 'dart:convert';

import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:flutter_map/src/layer/circle_layer.dart';
import 'package:flutter_map/src/layer/marker_layer.dart';
import 'package:flutter_map/src/layer/polygon_layer.dart';
import 'package:flutter_map/src/layer/polyline_layer.dart';
import 'package:flutter_map/src/layer/tile_layer/tile_coordinates.dart';
import 'package:flutter_map/src/layer/tile_layer/tile_layer.dart';
import 'package:flutter_map/src/layer/tile_layer/tile_provider/base_tile_provider.dart';
import 'package:flutter_map/src/map/map_controller.dart';
import 'package:flutter_map/src/map/options.dart';
import 'package:flutter_map/src/map/widget.dart';
import 'package:latlong2/latlong.dart';

class TestApp extends StatelessWidget {
Expand Down

0 comments on commit 5d8aca1

Please sign in to comment.