File tree Expand file tree Collapse file tree 2 files changed +34
-1
lines changed
lib/src/dart3_suggestors/null_safety_prep
test/dart3_suggestors/null_safety_prep Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Original file line number Diff line number Diff 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 ;
Original file line number Diff line number Diff 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+ }
You can’t perform that action at this time.
0 commit comments