Skip to content

Commit 7798be7

Browse files
Skip PanelToolbar as well
1 parent 0f3a754 commit 7798be7

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

lib/src/dart3_suggestors/null_safety_prep/required_flux_props.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ class RequiredFluxProps extends RecursiveAstVisitor with ClassSuggestor {
5050
const typesToIgnore = {
5151
'_PanelTitleProps',
5252
'PanelTitleProps',
53-
'PanelTitleV2Props'
53+
'PanelTitleV2Props',
54+
'_PanelToolbarProps',
55+
'PanelToolbarProps',
5456
};
5557
if (typesToIgnore.contains(cascadeWriteEl.name)) {
5658
return;

test/dart3_suggestors/null_safety_prep/required_flux_props_test.dart

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,19 @@ void main() {
8989
);
9090
});
9191

92+
test('leaves PanelToolbars alone', () async {
93+
await testSuggestor(
94+
expectedPatchCount: 0,
95+
input: withMockPanelToolbarComponents(/*language=dart*/ r'''
96+
main() {
97+
final pt = (PanelToolbar()..id = 'pt')();
98+
final pt2 = (_PanelToolbar()..id = 'pt2')();
99+
return [pt, pt2];
100+
}
101+
'''),
102+
);
103+
});
104+
92105
@isTestGroup
93106
void sharedTests({required bool invokeBuilder}) {
94107
String maybeInvokeBuilder(String builderString) {
@@ -1623,3 +1636,21 @@ class PanelTitleV2Component extends FluxUiComponent2<PanelTitleV2Props> {
16231636
}
16241637
''');
16251638
}
1639+
1640+
String withMockPanelToolbarComponents(String source) {
1641+
return withOverReactImport('''$source
1642+
UiFactory<_PanelToolbarProps> _PanelToolbar = castUiFactory(_\$_PanelToolbar); // ignore: undefined_identifier
1643+
class _PanelToolbarProps = UiProps with FluxUiPropsMixin<dynamic, dynamic>;
1644+
class LegacyPanelToolbarComponent extends FluxUiComponent2<_PanelToolbarProps> {
1645+
@override
1646+
render() => null;
1647+
}
1648+
1649+
UiFactory<PanelToolbarProps> PanelToolbar = castUiFactory(_\$PanelToolbar); // ignore: undefined_identifier
1650+
class PanelToolbarProps = UiProps with FluxUiPropsMixin<dynamic, dynamic>;
1651+
class PanelToolbarComponent extends FluxUiComponent2<PanelToolbarProps> {
1652+
@override
1653+
render() => null;
1654+
}
1655+
''');
1656+
}

0 commit comments

Comments
 (0)