Skip to content

Commit

Permalink
Fix backward compatibility with Flutter@master & beta
Browse files Browse the repository at this point in the history
  • Loading branch information
daohoangson committed Nov 13, 2024
1 parent 49d8258 commit 83ff6c9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions packages/core/test/src/core_legacy_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,15 @@ void main() {

testWidgets('tsb.build', (tester) async {
const html = '<span class="build-op">Foo</span>';
const abcdef = Color(0x00abcdef);
final buildOp = BuildOp(
onTree: (_, tree) => tree.append(
WidgetBit.block(
tree,
WidgetPlaceholder(
builder: (context, child) {
final style = tree.tsb.build(context).style;
final colored = style.copyWith(color: const Color(0x00abcdef));
final colored = style.copyWith(color: abcdef);
return Text('hi', style: colored);
},
),
Expand All @@ -83,7 +84,7 @@ void main() {
),
useExplainer: false,
);
expect(explained, contains('0x00abcdef'));
expect(explained, contains(abcdef.toString()));
});
});

Expand Down
6 changes: 4 additions & 2 deletions packages/core/test/tag_li_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1000,14 +1000,16 @@ Future<void> main() async {
'<ul style="color: #f00"><li>Foo</li></ul>',
useExplainer: false,
);
expect(disc, contains('Color(0xffff0000)'));
const red = Color(0xffff0000);
expect(disc, contains(red.toString()));

final circle = await explain(
tester,
'<ul style="color: #0f0"><li>Foo</li></ul>',
useExplainer: false,
);
expect(circle, contains('Color(0xff00ff00)'));
const green = Color(0xff00ff00);
expect(circle, contains(green.toString()));
});
});
}
Expand Down

0 comments on commit 83ff6c9

Please sign in to comment.