Skip to content

Commit

Permalink
Forward exporteIDs through widget's ScalableImageSource (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
zathras committed Oct 5, 2024
1 parent def047c commit f3ddc4d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 11 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## [1.1.24] - Upcoming
- Fix `exportedIDs` with widget image sources (Issue 118)

## [1.1.23] - October 2024

- Get rid of buggy dartdoc @category annotations.
Expand Down
33 changes: 22 additions & 11 deletions lib/src/widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,8 @@ class _SvgBundleSource extends ScalableImageSource {
currentColor: currentColor,
compact: compact,
bigFloats: bigFloats,
warnF: _warnArg);
warnF: _warnArg,
exportedIDs: exportedIDs);

@override
bool operator ==(final Object other) {
Expand All @@ -881,19 +882,22 @@ class _SvgBundleSource extends ScalableImageSource {
key == other.key &&
currentColor == other.currentColor &&
compact == other.compact &&
bigFloats == other.bigFloats;
bigFloats == other.bigFloats &&
listEquals(exportedIDs, other.exportedIDs);
} else {
return false;
}
}

@override
int get hashCode =>
0x544f0d11 ^ Object.hash(bundle, key, currentColor, compact, bigFloats);
0x544f0d11 ^
Object.hash(bundle, key, currentColor, compact, bigFloats,
Object.hashAll(exportedIDs));

@override
String toString() =>
'_SVGBundleSource($key $bundle $compact $bigFloats currentColor)';
String toString() => '_SVGBundleSource($key $bundle $compact $bigFloats '
'$currentColor $exportedIDs)';
}

class _SvgHttpSource extends ScalableImageSource {
Expand Down Expand Up @@ -928,6 +932,7 @@ class _SvgHttpSource extends ScalableImageSource {
bigFloats: bigFloats,
warnF: _warnArg,
defaultEncoding: defaultEncoding,
exportedIDs: exportedIDs,
httpHeaders: httpHeaders);

@override
Expand All @@ -938,7 +943,8 @@ class _SvgHttpSource extends ScalableImageSource {
compact == other.compact &&
bigFloats == other.bigFloats &&
mapEquals(httpHeaders, other.httpHeaders) &&
defaultEncoding == other.defaultEncoding;
defaultEncoding == other.defaultEncoding &&
listEquals(exportedIDs, other.exportedIDs);
} else {
return false;
}
Expand All @@ -948,11 +954,12 @@ class _SvgHttpSource extends ScalableImageSource {
int get hashCode =>
// I just leave out httpHeaders
0xf7972f9b ^
Object.hash(url, currentColor, compact, bigFloats, defaultEncoding);
Object.hash(url, currentColor, compact, bigFloats, defaultEncoding,
Object.hashAll(exportedIDs));

@override
String toString() => '_SVGHttpSource($url $compact $bigFloats '
'$currentColor $defaultEncoding $httpHeaders)';
'$currentColor $defaultEncoding $httpHeaders $exportedIDs)';
}

class _SvgFileSource extends ScalableImageSource {
Expand Down Expand Up @@ -982,6 +989,7 @@ class _SvgFileSource extends ScalableImageSource {
currentColor: currentColor,
compact: compact,
bigFloats: bigFloats,
exportedIDs: exportedIDs,
warnF: warnF);
}

Expand All @@ -991,19 +999,22 @@ class _SvgFileSource extends ScalableImageSource {
return file == other.file &&
currentColor == other.currentColor &&
compact == other.compact &&
bigFloats == other.bigFloats;
bigFloats == other.bigFloats &&
listEquals(exportedIDs, other.exportedIDs);
} else {
return false;
}
}

@override
int get hashCode =>
0xd111d574 ^ Object.hash(file, currentColor, compact, bigFloats);
0xd111d574 ^
Object.hash(
file, currentColor, compact, bigFloats, Object.hashAll(exportedIDs));

@override
String toString() =>
'_SVGFileSource($file $compact $bigFloats $currentColor ';
'_SVGFileSource($file $compact $bigFloats $currentColor $exportedIDs)';
}

class _AvdHttpSource extends ScalableImageSource {
Expand Down

0 comments on commit f3ddc4d

Please sign in to comment.