Skip to content

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

Description

@ibrahim-mubarak

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions