Skip to content

Commit 79e4cbe

Browse files
authored
[rfw] Adds support for DecorationImage.filterQuality. (#6781)
And hard-codes filter qualities in tests to prepare for flutter/flutter#148799, which switches the default to `medium`. This hard-codes a filter quality in the test so the test passes no matter what the default is.
1 parent 6525441 commit 79e4cbe

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

packages/rfw/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 1.0.27
2+
* Adds support for `DecorationImage.filterQuality`.
3+
14
## 1.0.26
25
* Supports overriding the error widget builder.
36

packages/rfw/lib/src/flutter/argument_decoders.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,7 @@ class ArgumentDecoders {
550550
centerSlice: rect(source, [...key, 'centerSlice']),
551551
repeat: enumValue<ImageRepeat>(ImageRepeat.values, source, [...key, 'repeat']) ?? ImageRepeat.noRepeat,
552552
matchTextDirection: source.v<bool>([...key, 'matchTextDirection']) ?? false,
553+
filterQuality: enumValue<FilterQuality>(FilterQuality.values, source, [...key, 'filterQuality']) ?? FilterQuality.medium,
553554
);
554555
}
555556

packages/rfw/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: rfw
22
description: "Remote Flutter widgets: a library for rendering declarative widget description files at runtime."
33
repository: https://github.com/flutter/packages/tree/main/packages/rfw
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+rfw%22
5-
version: 1.0.26
5+
version: 1.0.27
66

77
environment:
88
sdk: ^3.2.0

packages/rfw/test/argument_decoders_test.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ void main() {
295295
1.0, 1.0, 1.0, 1.0, 1.0,
296296
],
297297
},
298+
filterQuality: "none",
298299
},
299300
gradient: {
300301
type: 'sweep',
@@ -314,6 +315,7 @@ void main() {
314315
blendMode: "xor",
315316
},
316317
onError: event 'image-error-event' { },
318+
filterQuality: "high",
317319
},
318320
gradient: {
319321
type: 'linear',
@@ -383,13 +385,13 @@ void main() {
383385
(tester.widgetList<DecoratedBox>(find.byType(DecoratedBox)).toList()[1].decoration as BoxDecoration).image.toString(),
384386
'DecorationImage(AssetImage(bundle: null, name: "asset"), ' // this just seemed like the easiest way to check all this...
385387
'ColorFilter.matrix([$matrix]), '
386-
'Alignment.center, centerSlice: Rect.fromLTRB(5.0, 8.0, 105.0, 78.0), scale 1.0, opacity 1.0, FilterQuality.low)',
388+
'Alignment.center, centerSlice: Rect.fromLTRB(5.0, 8.0, 105.0, 78.0), scale 1.0, opacity 1.0, FilterQuality.none)',
387389
);
388390
expect(
389391
(tester.widgetList<DecoratedBox>(find.byType(DecoratedBox)).toList()[0].decoration as BoxDecoration).image.toString(),
390392
'DecorationImage(NetworkImage("x-invalid://", scale: 1.0), '
391393
'ColorFilter.mode(Color(0xff8811ff), BlendMode.xor), Alignment.center, scale 1.0, '
392-
'opacity 1.0, FilterQuality.low)',
394+
'opacity 1.0, FilterQuality.high)',
393395
);
394396

395397
ArgumentDecoders.colorFilterDecoders['custom'] = (DataSource source, List<Object> key) {

0 commit comments

Comments
 (0)