Skip to content

Commit

Permalink
Update playground
Browse files Browse the repository at this point in the history
  • Loading branch information
greglittlefield-wf committed Jan 22, 2024
1 parent ae28bff commit 7510775
Showing 1 changed file with 27 additions and 7 deletions.
34 changes: 27 additions & 7 deletions tools/analyzer_plugin/playground/web/missing_required_props.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ import 'package:over_react/over_react.dart';

part 'missing_required_props.over_react.g.dart';

UiFactory<UiProps> GenericFactory = uiFunction((_) {}, UiFactoryConfig());

UiFactory<NoRequiredProps> NoRequired = uiFunction((_) {}, _$NoRequiredConfig);
mixin NoRequiredProps on UiProps {
String? optional1;
String? optional2;
}


UiFactory<WithLateRequiredProps> WithLateRequired = uiFunction((_) {}, _$WithLateRequiredConfig);
mixin WithLateRequiredProps on UiProps {
late String required1;
Expand All @@ -16,27 +19,40 @@ mixin WithLateRequiredProps on UiProps {
String? optional2;
}


UiFactory<InheritsLateRequiredProps> InheritsLateRequired = uiFunction((_) {}, _$InheritsLateRequiredConfig);
mixin InheritsLateRequiredPropsMixin on UiProps {
late String requiredInSubclass;
}
class InheritsLateRequiredProps = UiProps with WithLateRequiredProps, InheritsLateRequiredPropsMixin;


UiFactory<RequiredWithSameNameAsPrefixedProps> RequiredWithSameNameAsPrefixed = uiFunction((_) {},
_$RequiredWithSameNameAsPrefixedConfig);
UiFactory<RequiredWithSameNameAsPrefixedProps> RequiredWithSameNameAsPrefixed = uiFunction((_) {}, _$RequiredWithSameNameAsPrefixedConfig);
mixin RequiredWithSameNameAsPrefixedProps on UiProps {
late bool hidden;
}


class InheritsLateRequiredProps = UiProps with WithLateRequiredProps, InheritsLateRequiredPropsMixin;
UiFactory<DisableValidationProps> DisableValidation = uiFunction((_) {}, _$DisableValidationConfig);
mixin DisableValidationProps on UiProps {
@disableRequiredPropValidation
late String requiredPropWithDisabledValidation;
}


UiFactory<IgnoresSomeRequiredProps> IgnoresSomeRequired = uiFunction((_) {}, _$IgnoresSomeRequiredConfig);
mixin IgnoresSomeRequiredPropsMixin on UiProps {
late String requiredInSubclass1;
late String requiredInSubclass2;
}
@Props(ignoreRequiredProps: {'required1', 'requiredInSubclass1'})
class IgnoresSomeRequiredProps = UiProps with WithLateRequiredProps, IgnoresSomeRequiredPropsMixin;


UiFactory<WithAnnotationRequiredProps> WithAnnotationRequired = uiFunction((_) {}, _$WithAnnotationRequiredConfig);
mixin WithAnnotationRequiredProps on UiProps {
@requiredProp
String? required1;
@requiredProp
String? required2;
@requiredProp String? required1;
@requiredProp String? required2;
String? optional1;
String? optional2;
}
Expand All @@ -56,6 +72,10 @@ main() {

WithAnnotationRequired()();

DisableValidation()();

IgnoresSomeRequired()();

// Make sure prefixed props aren't mistaken for the missing required prop.
(RequiredWithSameNameAsPrefixed()..dom.hidden = true)();
}

0 comments on commit 7510775

Please sign in to comment.