Skip to content

Commit

Permalink
Fix deprecations and minor linter warnings (#1438)
Browse files Browse the repository at this point in the history
* Fix api deprecations

* Fix minor lineter warning

When handling the error of `evict()` return false inside the onError
function of catchError so that the Future completes with false to
indicate that the value wasn't removed successfully.
  • Loading branch information
pablojimpas committed Jan 28, 2023
1 parent 078fa32 commit df464ae
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions example/lib/pages/tile_builder_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ class _TileBuilderPageState extends State<TileBuilderPage> {
if (showCoords)
Text(
'${coords.x.floor()} : ${coords.y.floor()} : ${coords.z.floor()}',
style: Theme.of(context).textTheme.headline5,
style: Theme.of(context).textTheme.headlineSmall,
),
if (loadingTime)
Text(
tile.loaded == null
? 'Loading'
// sometimes result is negative which shouldn't happen, abs() corrects it
: '${(tile.loaded!.millisecond - tile.loadStarted.millisecond).abs()} ms',
style: Theme.of(context).textTheme.headline5,
style: Theme.of(context).textTheme.headlineSmall,
),
],
),
Expand Down
1 change: 1 addition & 0 deletions lib/src/layer/tile_layer/tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class Tile {
try {
imageProvider.evict().catchError((Object e) {
debugPrint(e.toString());
return false;
});
} catch (e) {
// this may be never called because catchError will handle errors, however
Expand Down
4 changes: 2 additions & 2 deletions lib/src/layer/tile_layer/tile_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Widget coordinateDebugTileBuilder(
Center(
child: Text(
readableKey,
style: Theme.of(context).textTheme.headline5,
style: Theme.of(context).textTheme.headlineSmall,
),
),
],
Expand Down Expand Up @@ -127,7 +127,7 @@ Widget loadingTimeDebugTileBuilder(
Center(
child: Text(
time,
style: Theme.of(context).textTheme.headline5,
style: Theme.of(context).textTheme.headlineSmall,
),
),
],
Expand Down

0 comments on commit df464ae

Please sign in to comment.