Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit fde39d9

Browse files
committed
Added CancellableNetworkTileProvider
Added repository metafiles
1 parent 7ab371f commit fde39d9

File tree

10 files changed

+428
-25
lines changed

10 files changed

+428
-25
lines changed

.gitignore

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,30 @@
1-
# See https://www.dartlang.org/guides/libraries/private-files
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.buildlog/
9+
.history
10+
.svn/
11+
migrate_working_dir/
212

3-
# Files and directories created by pub
13+
# IntelliJ related
14+
*.iml
15+
*.ipr
16+
*.iws
17+
.idea/
18+
19+
# The .vscode folder contains launch configuration and tasks you configure in
20+
# VS Code which you may wish to be included in version control, so this line
21+
# is commented out by default.
22+
#.vscode/
23+
24+
# Flutter/Dart/Pub related
25+
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
26+
/pubspec.lock
27+
**/doc/api/
428
.dart_tool/
529
.packages
630
build/
7-
# If you're building an application, you may want to check-in your pubspec.lock
8-
pubspec.lock
9-
10-
# Directory created by dartdoc
11-
# If you don't generate documentation locally you can remove this line.
12-
doc/api/
13-
14-
# dotenv environment variables file
15-
.env*
16-
17-
# Avoid committing generated Javascript files:
18-
*.dart.js
19-
*.info.json # Produced by the --dump-info flag.
20-
*.js # When generated by dart2js. Don't specify *.js if your
21-
# project includes source files written in JavaScript.
22-
*.js_
23-
*.js.deps
24-
*.js.map
25-
26-
.flutter-plugins
27-
.flutter-plugins-dependencies

.metadata

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled and should not be manually edited.
5+
6+
version:
7+
revision: "e1e47221e86272429674bec4f1bd36acc4fc7b77"
8+
channel: "stable"
9+
10+
project_type: package

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# CHANGELOG
2+
3+
## 1.0.0-preview
4+
5+
* Initial version, awaiting flutter_map v6 release before v1

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/lib/ @jaffaketchup

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BSD 3-Clause License
22

3-
Copyright (c) 2023, fleaflet
3+
Copyright (c) 2023, the 'flutter_map' authors and maintainers
44

55
Redistribution and use in source and binary forms, with or without
66
modification, are permitted provided that the following conditions are met:

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
11
# flutter_map_cancellable_tile_provider
2-
Plugin for flutter_map that provides a `TileProvider` with the capability to cancel unnecessary HTTP requests
2+
3+
Plugin for [flutter_map](https://github.com/fleaflet/flutter_map) that provides a `TileProvider` with the capability to cancel unnecessary HTTP requests (on the web)
4+
5+
- Reduce tile loading durations
6+
- Reduce costly tile requests to tile servers*
7+
- Reduce (cellular) data consumption
8+
9+
---
10+
11+
Unlike `NetworkTileProvider`, this uses '[dio](https://pub.dev/packages/dio)' to support cancelling/aborting unnecessary HTTP requests in-flight. Tiles that are removed/pruned before they are fully loaded do not need to complete loading, and therefore do not need to complete the request/download. This results in the tiles currently in the map's camera/viewport being loaded faster, as the tiles loaded whilst panning, zooming, or rotating are pruned, freeing up HTTP connections. It may also result in a reduction of costs, as there are less full tile requests to your tile server, but this will depend on their backend configuration and how quickly the tile is pruned.
12+
13+
Note that these advantages only occur on the web, as only the web supports the abortion of HTTP requests. On other platforms, this acts equivalent to `NetworkTileProvider`, except using 'dio' instead of 'http'.

analysis_options.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include: jaffa_lints.yaml

jaffa_lints.yaml

Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
linter:
2+
rules:
3+
- always_declare_return_types
4+
- always_require_non_null_named_parameters
5+
- annotate_overrides
6+
- avoid_annotating_with_dynamic
7+
- avoid_catching_errors
8+
- avoid_double_and_int_checks
9+
- avoid_dynamic_calls
10+
- avoid_empty_else
11+
- avoid_escaping_inner_quotes
12+
- avoid_field_initializers_in_const_classes
13+
- avoid_final_parameters
14+
- avoid_function_literals_in_foreach_calls
15+
- avoid_implementing_value_types
16+
- avoid_init_to_null
17+
- avoid_js_rounded_ints
18+
- avoid_multiple_declarations_per_line
19+
- avoid_null_checks_in_equality_operators
20+
- avoid_positional_boolean_parameters
21+
- avoid_print
22+
- avoid_private_typedef_functions
23+
- avoid_redundant_argument_values
24+
- avoid_relative_lib_imports
25+
- avoid_renaming_method_parameters
26+
- avoid_return_types_on_setters
27+
- avoid_returning_null
28+
- avoid_returning_null_for_future
29+
- avoid_returning_null_for_void
30+
- avoid_returning_this
31+
- avoid_setters_without_getters
32+
- avoid_shadowing_type_parameters
33+
- avoid_single_cascade_in_expression_statements
34+
- avoid_slow_async_io
35+
- avoid_type_to_string
36+
- avoid_types_as_parameter_names
37+
- avoid_unnecessary_containers
38+
- avoid_unused_constructor_parameters
39+
- avoid_void_async
40+
- avoid_web_libraries_in_flutter
41+
- await_only_futures
42+
- camel_case_extensions
43+
- camel_case_types
44+
- cancel_subscriptions
45+
- cascade_invocations
46+
- cast_nullable_to_non_nullable
47+
- close_sinks
48+
- comment_references
49+
- conditional_uri_does_not_exist
50+
- constant_identifier_names
51+
- control_flow_in_finally
52+
- curly_braces_in_flow_control_structures
53+
- depend_on_referenced_packages
54+
- deprecated_consistency
55+
- directives_ordering
56+
- do_not_use_environment
57+
- empty_catches
58+
- empty_constructor_bodies
59+
- empty_statements
60+
- eol_at_end_of_file
61+
- exhaustive_cases
62+
- file_names
63+
- hash_and_equals
64+
- implementation_imports
65+
- iterable_contains_unrelated_type
66+
- join_return_with_assignment
67+
- leading_newlines_in_multiline_strings
68+
- library_names
69+
- library_prefixes
70+
- library_private_types_in_public_api
71+
- list_remove_unrelated_type
72+
- literal_only_boolean_expressions
73+
- missing_whitespace_between_adjacent_strings
74+
- no_adjacent_strings_in_list
75+
- no_default_cases
76+
- no_duplicate_case_values
77+
- no_leading_underscores_for_library_prefixes
78+
- no_leading_underscores_for_local_identifiers
79+
- no_logic_in_create_state
80+
- no_runtimeType_toString
81+
- non_constant_identifier_names
82+
- noop_primitive_operations
83+
- null_check_on_nullable_type_parameter
84+
- null_closures
85+
- one_member_abstracts
86+
- only_throw_errors
87+
- overridden_fields
88+
- package_api_docs
89+
- package_names
90+
- package_prefixed_library_names
91+
- parameter_assignments
92+
- prefer_adjacent_string_concatenation
93+
- prefer_asserts_in_initializer_lists
94+
- prefer_asserts_with_message
95+
- prefer_collection_literals
96+
- prefer_conditional_assignment
97+
- prefer_const_constructors
98+
- prefer_const_constructors_in_immutables
99+
- prefer_const_declarations
100+
- prefer_const_literals_to_create_immutables
101+
- prefer_constructors_over_static_methods
102+
- prefer_contains
103+
- prefer_equal_for_default_values
104+
- prefer_expression_function_bodies
105+
- prefer_final_fields
106+
- prefer_final_in_for_each
107+
- prefer_final_locals
108+
- prefer_for_elements_to_map_fromIterable
109+
- prefer_foreach
110+
- prefer_function_declarations_over_variables
111+
- prefer_generic_function_type_aliases
112+
- prefer_if_null_operators
113+
- prefer_initializing_formals
114+
- prefer_inlined_adds
115+
- prefer_int_literals
116+
- prefer_interpolation_to_compose_strings
117+
- prefer_is_empty
118+
- prefer_is_not_empty
119+
- prefer_is_not_operator
120+
- prefer_iterable_whereType
121+
- prefer_mixin
122+
- prefer_null_aware_method_calls
123+
- prefer_null_aware_operators
124+
- prefer_relative_imports
125+
- prefer_single_quotes
126+
- prefer_spread_collections
127+
- prefer_typing_uninitialized_variables
128+
- prefer_void_to_null
129+
- provide_deprecation_message
130+
- recursive_getters
131+
- require_trailing_commas
132+
- secure_pubspec_urls
133+
- sized_box_for_whitespace
134+
- sized_box_shrink_expand
135+
- slash_for_doc_comments
136+
- sort_child_properties_last
137+
- sort_pub_dependencies
138+
- sort_unnamed_constructors_first
139+
- test_types_in_equals
140+
- throw_in_finally
141+
- tighten_type_of_initializing_formals
142+
- type_annotate_public_apis
143+
- type_init_formals
144+
- unawaited_futures
145+
- unnecessary_await_in_return
146+
- unnecessary_brace_in_string_interps
147+
- unnecessary_const
148+
- unnecessary_constructor_name
149+
- unnecessary_getters_setters
150+
- unnecessary_lambdas
151+
- unnecessary_late
152+
- unnecessary_new
153+
- unnecessary_null_aware_assignments
154+
- unnecessary_null_checks
155+
- unnecessary_null_in_if_null_operators
156+
- unnecessary_nullable_for_final_variable_declarations
157+
- unnecessary_overrides
158+
- unnecessary_parenthesis
159+
- unnecessary_raw_strings
160+
- unnecessary_statements
161+
- unnecessary_string_escapes
162+
- unnecessary_string_interpolations
163+
- unnecessary_this
164+
- unrelated_type_equality_checks
165+
- unsafe_html
166+
- use_build_context_synchronously
167+
- use_colored_box
168+
- use_decorated_box
169+
- use_enums
170+
- use_full_hex_values_for_flutter_colors
171+
- use_function_type_syntax_for_parameters
172+
- use_if_null_to_convert_nulls_to_bools
173+
- use_is_even_rather_than_modulo
174+
- use_key_in_widget_constructors
175+
- use_late_for_private_fields_and_variables
176+
- use_named_constants
177+
- use_raw_strings
178+
- use_rethrow_when_possible
179+
- use_setters_to_change_properties
180+
- use_string_buffers
181+
- use_super_parameters
182+
- use_test_throws_matchers
183+
- use_to_and_as_if_applicable
184+
- valid_regexps
185+
- void_checks

0 commit comments

Comments
 (0)