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

Length Rules should allow For Custom Type support without declaring dynamic #25

Open
ibrahim-mubarak opened this issue Mar 27, 2021 · 0 comments

Comments

@ibrahim-mubarak
Copy link
Contributor

Expected Behavior

The length rules should allow custom type support without initializing the rules with dynamic type

MinLengthRule<MyType>(10)

Current Behavior

If we want to use a custom type, we have to initialize it explicitly with dynamic type

MinLengthRule<dynamic>(10)

We should avoid using dynamic as much as possible.

Possible Solution

Add an interface that provides the length getter or length setter and use the interface for custom types.

Context

Using dynamic doesn't allow for compile time checks that maybe used in other parts of the application.
We should avoid using dynamic as much as possible.

Your Environment

  • Version used: 0.4.0+2
  • Flutter/Dart version: 2.1.0-12.2.pre/2.13.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant