From 6ddbfdc9145a83d691f2e9247992eaa41722fcd0 Mon Sep 17 00:00:00 2001 From: Lukas Klingsbo Date: Sat, 28 Dec 2024 21:51:02 +0100 Subject: [PATCH] Fix analyzer --- packages/tiled/lib/src/layer.dart | 4 +-- packages/tiled/lib/src/parser.dart | 40 ++++++++++++++++++------------ packages/tiled/pubspec.yaml | 2 +- 3 files changed, 27 insertions(+), 19 deletions(-) diff --git a/packages/tiled/lib/src/layer.dart b/packages/tiled/lib/src/layer.dart index 9bbfb90..d544d22 100644 --- a/packages/tiled/lib/src/layer.dart +++ b/packages/tiled/lib/src/layer.dart @@ -336,7 +336,7 @@ abstract class Layer { decompressed = const ZLibDecoder().decodeBytes(decodedString); break; case Compression.gzip: - decompressed = GZipDecoder().decodeBytes(decodedString); + decompressed = const GZipDecoder().decodeBytes(decodedString); break; case Compression.zstd: throw UnsupportedError('zstd is an unsupported compression'); @@ -428,7 +428,7 @@ class TileLayer extends Layer { } class ObjectGroup extends Layer { - static const defaultColor = ColorData.rgb(160, 160, 164, 255); + static const defaultColor = ColorData.rgb(160, 160, 164); static const defaultColorHex = '%a0a0a4'; /// topdown (default) or index (indexOrder). diff --git a/packages/tiled/lib/src/parser.dart b/packages/tiled/lib/src/parser.dart index 72c4ac4..2f6d64b 100644 --- a/packages/tiled/lib/src/parser.dart +++ b/packages/tiled/lib/src/parser.dart @@ -36,11 +36,13 @@ class XmlParser extends Parser { return element.children .whereType() .where((e) => e.name.local == name) - .map((e) => XmlParser( - e, - templateProviders: templateProviders, - tsxProviders: tsxProviders, - )) + .map( + (e) => XmlParser( + e, + templateProviders: templateProviders, + tsxProviders: tsxProviders, + ), + ) .toList(); } @@ -48,17 +50,21 @@ class XmlParser extends Parser { return element.children .whereType() .where((e) => names.contains(e.name.local)) - .map((e) => XmlParser( - e, - tsxProviders: tsxProviders, - templateProviders: templateProviders, - )) + .map( + (e) => XmlParser( + e, + tsxProviders: tsxProviders, + templateProviders: templateProviders, + ), + ) .toList(); } @override T formatSpecificParsing( - T Function(JsonParser) json, T Function(XmlParser) xml) { + T Function(JsonParser) json, + T Function(XmlParser) xml, + ) { return xml(this); } } @@ -88,11 +94,13 @@ class JsonParser extends Parser { return []; } return (json[name] as List) - .map((dynamic e) => JsonParser( - e as Map, - templateProviders: templateProviders, - tsxProviders: tsxProviders, - )) + .map( + (dynamic e) => JsonParser( + e as Map, + templateProviders: templateProviders, + tsxProviders: tsxProviders, + ), + ) .toList(); } diff --git a/packages/tiled/pubspec.yaml b/packages/tiled/pubspec.yaml index 4fc2027..14b3833 100644 --- a/packages/tiled/pubspec.yaml +++ b/packages/tiled/pubspec.yaml @@ -15,5 +15,5 @@ dependencies: dev_dependencies: dartdoc: ^8.3.1 flame_lint: ^1.1.2 - test: ^1.24.8 path: ^1.8.3 + test: ^1.24.8