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

Error on try to change the field on condition. #52

Open
lleoserrano opened this issue Jul 31, 2024 · 0 comments
Open

Error on try to change the field on condition. #52

lleoserrano opened this issue Jul 31, 2024 · 0 comments

Comments

@lleoserrano
Copy link

Error detected when I'm trying to reset the field when is defined as disabled. I'm trying to reset the field because occasionally the user already interacted with it, and it keeps the error message, it's an attempt to clean this message.

It happens on "didChange", "reset" e others.

Example code:

const FastSwitch(
              name: 'switch',
              adaptive: true,
              titleText: 'Disable text field',
            ),
            const SizedBox(
              height: 8,
            ),
            FastTextField(
              name: 'name',
              autovalidateMode: AutovalidateMode.onUserInteraction,
              validator: (value) => (value == null || value.isEmpty)
                  ? 'Please enter some text'
                  : null,
              decoration: const InputDecoration(
                labelText: 'Name',
                border: OutlineInputBorder(),
              ),
              conditions: {
                (isMet, field) {
                  field.enabled = !isMet;
                  field.reset(); // Here
                }: FastConditionList(
                  [
                    FastCondition(
                      target: 'switch',
                      test: (value, fieldDad) {
                        final result = value is bool && value;
                        return result;
                      },
                    ),
                  ],
                ),
              },
            ),

Error:

#24054  GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:499:20)
binding.dart:499
#24055  GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:475:22)
binding.dart:475
#24056  RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:425:11)
binding.dart:425
#24057  GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:420:7)
binding.dart:420
#24058  GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:383:5)
binding.dart:383
#24059  GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:330:7)
binding.dart:330
#24060  GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:299:9)
binding.dart:299
#24061  _invoke1 (dart:ui/hooks.dart:328:13)
hooks.dart:328
#24062  PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:442:7)
platform_dispatcher.dart:442
#24063  _dispatchPointerDataPacket (dart:ui/hooks.dart:262:31)
hooks.dart:262

Handler: "onTap"
Recognizer: TapGestureRecognizer#a8315
    debugOwner: GestureDetector
    state: ready
    won arena
    finalPosition: Offset(706.3, 106.7)
    finalLocalPosition: Offset(26.3, 18.7)
    button: 1
    sent tap down
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