Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor specialised variants into subclasses #80

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

petrnymsa
Copy link
Member

No description provided.

),
].indexed) {
test(
'(${testCase.$1}): ${testCase.$2.test} should be valid between ${testCase.$2.start} - ${testCase.$2.end} when testing inclusive and with included time',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: in for loop I would extract index and test case so we dont have to use $1 and $2 in here.

storybook/lib/debug_model.dart Show resolved Hide resolved
Comment on lines 41 to 51
// ..satisfy(
// (value) {
// if (!vipInput.value) {
// return true;
// }

return value >= 18;
},
devError: (_) => 'When VIP enabled you must be at least 18 years old.',
key: _ErrorKeys.ageRestriction,
))
// return value >= 18;
// },
// devError: (_) => 'When VIP enabled you must be at least 18 years old.',
// key: _ErrorKeys.ageRestriction,
// )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary comment

@tenhobi
Copy link
Member

tenhobi commented Jan 26, 2025

Also since we are doing breaking change, we can do these fixes from analysis options?

avoid-commented-out-code: false # code examples in comments
prefer-boolean-prefixes: false # # TODO: release new major version (breaking change)
prefer-named-parameters: false # TODO: release new major version (breaking change)
dispose-class-fields: false # callback parameters are better without named

typedef DateTimeValidatorFactory = ValidatorInstance<DateTime> Function(DateTimeValidator validator);
typedef DateTimeValidatorFactoryNullable = ValidatorInstance<DateTime?> Function(DateTimeValidatorNullable validator);

class DateTimeValidator extends GladeValidator<DateTime> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add isBefore and isAfter, maybe also shorthand for isBeforeNow and isAfterNow?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

Copy link

github-actions bot commented Jan 29, 2025

DCM report

✅ no issues found!

Full report: https://github.com/netglade/glade_forms/runs/36366388403

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants