Skip to content

Commit

Permalink
Fix analyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
spydon committed Dec 28, 2024
1 parent dadb9c1 commit 6ddbfdc
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 19 deletions.
4 changes: 2 additions & 2 deletions packages/tiled/lib/src/layer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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).
Expand Down
40 changes: 24 additions & 16 deletions packages/tiled/lib/src/parser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,29 +36,35 @@ class XmlParser extends Parser {
return element.children
.whereType<XmlElement>()
.where((e) => e.name.local == name)
.map((e) => XmlParser(
e,
templateProviders: templateProviders,
tsxProviders: tsxProviders,
))
.map(
(e) => XmlParser(
e,
templateProviders: templateProviders,
tsxProviders: tsxProviders,
),
)
.toList();
}

List<Parser> getChildrenWithNames(Set<String> names) {
return element.children
.whereType<XmlElement>()
.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>(
T Function(JsonParser) json, T Function(XmlParser) xml) {
T Function(JsonParser) json,
T Function(XmlParser) xml,
) {
return xml(this);
}
}
Expand Down Expand Up @@ -88,11 +94,13 @@ class JsonParser extends Parser {
return [];
}
return (json[name] as List<dynamic>)
.map((dynamic e) => JsonParser(
e as Map<String, dynamic>,
templateProviders: templateProviders,
tsxProviders: tsxProviders,
))
.map(
(dynamic e) => JsonParser(
e as Map<String, dynamic>,
templateProviders: templateProviders,
tsxProviders: tsxProviders,
),
)
.toList();
}

Expand Down
2 changes: 1 addition & 1 deletion packages/tiled/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 6ddbfdc

Please sign in to comment.