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

Web Validation - Cannot read property 'Symbol(dartx.length)' of null #298

Closed
jaxnz opened this issue May 31, 2020 · 2 comments
Closed

Web Validation - Cannot read property 'Symbol(dartx.length)' of null #298

jaxnz opened this issue May 31, 2020 · 2 comments
Labels
question Further information is requested

Comments

@jaxnz
Copy link

jaxnz commented May 31, 2020

Getting this error on Flutter Web with basic TextField form validation - had it for a while, but just removed validation for development.

Flutter 1.19.0-2.0.pre.214 • channel master • https://github.com/flutter/flutter.git
Framework • revision 1d395c5e18 (9 hours ago) • 2020-05-31 07:41:50 -0700
Engine • revision 923687f0e7
Tools • Dart 2.9.0 (build 2.9.0-13.0.dev 6489a0c68d)
TypeError: Cannot read property 'Symbol(dartx.length)' of null
    at http://localhost:49347/packages/flutter_form_builder/src/fields/form_builder_image_picker.dart.lib.js:10774:66
    at text_form_field._TextFormFieldState.new.[_validate] (http://localhost:49347/packages/flutter/src/widgets/form.dart.lib.js:446:151)
    at http://localhost:49347/packages/flutter/src/widgets/form.dart.lib.js:440:26
    at text_form_field._TextFormFieldState.new.setState (http://localhost:49347/packages/flutter/src/widgets/widget_span.dart.lib.js:14710:22)
    at text_form_field._TextFormFieldState.new.validate (http://localhost:49347/packages/flutter/src/widgets/form.dart.lib.js:439:14)
    at form.FormState.new.[_validate] (http://localhost:49347/packages/flutter/src/widgets/form.dart.lib.js:226:37)
    at form.FormState.new.validate (http://localhost:49347/packages/flutter/src/widgets/form.dart.lib.js:221:29)
    at form_builder.FormBuilderState.new.saveAndValidate (http://localhost:49347/packages/flutter_form_builder/src/form_builder.dart.lib.js:247:42)
    at enquiry_form._EnquiryFormState.new.<anonymous> (http://localhost:49347/packages/webenrol/shared/widgets/form/day_selection.dart.lib.js:3389:77)
    at Generator.next (<anonymous>)
    at runBody (http://localhost:49347/dart_sdk.js:35674:34)
    at Object._async [as async] (http://localhost:49347/dart_sdk.js:35702:7)
    at ink_well.InkWell.new.<anonymous> (http://localhost:49347/packages/webenrol/shared/widgets/form/day_selection.dart.lib.js:3388:436)
    at _InkResponseState.new.[_handleTap] (http://localhost:49347/packages/flutter/src/material/icon_button.dart.lib.js:43158:23)
    at http://localhost:49347/packages/flutter/src/material/icon_button.dart.lib.js:43234:634
    at tap.TapGestureRecognizer.new.invokeCallback (http://localhost:49347/packages/flutter/src/gestures/recognizer.dart.lib.js:191:18)
    at tap.TapGestureRecognizer.new.handleTapUp (http://localhost:49347/packages/flutter/src/gestures/tap.dart.lib.js:355:40)
    at tap.TapGestureRecognizer.new.[_checkUp] (http://localhost:49347/packages/flutter/src/gestures/tap.dart.lib.js:186:12)
    at tap.TapGestureRecognizer.new.acceptGesture (http://localhost:49347/packages/flutter/src/gestures/tap.dart.lib.js:164:23)
    at arena.GestureArenaManager.new.sweep (http://localhost:49347/packages/flutter/src/gestures/arena.dart.lib.js:201:31)
    at binding$5.WidgetsFlutterBinding.new.handleEvent (http://localhost:49347/packages/flutter/src/gestures/binding.dart.lib.js:170:27)
    at binding$5.WidgetsFlutterBinding.new.dispatchEvent (http://localhost:49347/packages/flutter/src/gestures/binding.dart.lib.js:154:24)
    at binding$5.WidgetsFlutterBinding.new.[_handlePointerEvent] (http://localhost:49347/packages/flutter/src/gestures/binding.dart.lib.js:131:14)
    at binding$5.WidgetsFlutterBinding.new.[_flushPointerEventQueue] (http://localhost:49347/packages/flutter/src/gestures/binding.dart.lib.js:105:34)
    at binding$5.WidgetsFlutterBinding.new.[_handlePointerDataPacket] (http://localhost:49347/packages/flutter/src/gestures/binding.dart.lib.js:96:65)
    at Object._invoke1 (http://localhost:49347/dart_sdk.js:159738:7)
    at _engine.EngineWindow.new.invokeOnPointerDataPacket (http://localhost:49347/dart_sdk.js:156917:15)
    at _engine.PointerBinding.__.[_onPointerData] (http://localhost:49347/dart_sdk.js:137115:24)
    at http://localhost:49347/dart_sdk.js:137457:26
    at http://localhost:49347/dart_sdk.js:137422:16

@danvick
Copy link
Collaborator

danvick commented Jun 13, 2020

Hi @jaxnz,
Are you sure that the issue comes from this package? We aren't using dartx package directly in this repo.
My knowledge of Flutter Web is a bit limited though.

@danvick danvick added the question Further information is requested label Jun 14, 2020
@jaxnz
Copy link
Author

jaxnz commented Jun 18, 2020

Turns out it was a re-usable widget I had created to use as a Textarea.. have reverted back to using a FormBuilderTextField

class CustomTextArea extends StatelessWidget {
  final int minLines;
  final List<FormFieldValidator> validators;
  final String label;
  final String initialValue;
  final bool readOnly;
  final double textSize;
  CustomTextArea({this.minLines = 5, this.label, this.initialValue, this.readOnly = false, this.textSize = 17, this.validators});
  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.only(top: 10, bottom: 10),
      child: FormBuilderTextField(
        readOnly: readOnly,
        initialValue: initialValue,
        attribute: label,
        minLines: minLines,
        decoration: InputDecoration(
          labelStyle: TextStyle(fontSize: textSize),
          enabledBorder: OutlineInputBorder(
            borderSide: BorderSide(color: Colors.grey[300]),
          ),
          border: OutlineInputBorder(),
          labelText: label,
          alignLabelWithHint: true,
        ),
        validators: validators,
      ),
    );
  }
}

@jaxnz jaxnz closed this as completed Jun 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants