jaumard / sms_autofill

Flutter plugin to provide SMS code autofill support
MIT License
289 stars 184 forks source link

Compiler error: Type 'AutovalidateMode' not found. #84

Closed ShJavokhir closed 3 years ago

ShJavokhir commented 3 years ago

This is the error message:

Launching lib\main.dart on Android SDK built for x86 in debug mode...
 lib\main.dart

Compiler message:
/C:/user/Development/Flutter/flutter_windows_1.17.4-stable/flutter/.pub-cache/hosted/pub.dartlang.org/pin_input_text_field-3.3.0/lib/src/widget/pin_widget.dart:402:5: Error: Type 'AutovalidateMode' not found.
    AutovalidateMode autovalidateMode = AutovalidateMode.disabled,
    ^^^^^^^^^^^^^^^^
/C:/user/Development/Flutter/flutter_windows_1.17.4-stable/flutter/.pub-cache/hosted/pub.dartlang.org/sms_autofill-1.3.0/lib/sms_autofill.dart:92:37: Error: Getter not found: 'AutofillHints'.
      autofillHints: const <String>[AutofillHints.oneTimeCode],
                                    ^^^^^^^^^^^^^
/C:/user/Development/Flutter/flutter_windows_1.17.4-stable/flutter/.pub-cache/hosted/pub.dartlang.org/sms_autofill-1.3.0/lib/sms_autofill.dart:312:7: Error: No named parameter with the name 'autofillHints'.
      autofillHints: [AutofillHints.telephoneNumber],
      ^^^^^^^^^^^^^
/C:/user/Development/Flutter/flutter_windows_1.17.4-stable/flutter/packages/flutter/lib/src/material/text_field.dart:304:9: Context: Found this candidate, but the arguments don't match.
  const TextField({
        ^^^^^^^^^
/C:/user/Development/Flutter/flutter_windows_1.17.4-stable/flutter/.pub-cache/hosted/pub.dartlang.org/sms_autofill-1.3.0/lib/sms_autofill.dart:325:7: Error: No named parameter with the name 'autofillHints'.
      autofillHints: [AutofillHints.telephoneNumber],
      ^^^^^^^^^^^^^
/C:/user/Development/Flutter/flutter_windows_1.17.4-stable/flutter/packages/flutter/lib/src/material/text_form_field.dart:131:3: Context: Found this candidate, but the arguments don't match.
  TextFormField({
  ^^^^^^^^^^^^^
/C:/user/Development/Flutter/flutter_windows_1.17.4-stable/flutter/.pub-cache/hosted/pub.dartlang.org/sms_autofill-1.3.0/lib/sms_autofill.dart:414:37: Error: Getter not found: 'AutofillHints'.
      autofillHints: const <String>[AutofillHints.oneTimeCode],
                                    ^^^^^^^^^^^^^
/C:/user/Development/Flutter/flutter_windows_1.17.4-stable/flutter/.pub-cache/hosted/pub.dartlang.org/sms_autofill-1.3.0/lib/sms_autofill.dart:414:7: Error: No named parameter with the name 'autofillHints'.
      autofillHints: const <String>[AutofillHints.oneTimeCode],
      ^^^^^^^^^^^^^
/C:/user/Development/Flutter/flutter_windows_1.17.4-stable/flutter/packages/flutter/lib/src/material/text_field.dart:304:9: Context: Found this candidate, but the arguments don't match.
  const TextField({
        ^^^^^^^^^
/C:/user/Development/Flutter/flutter_windows_1.17.4-stable/flutter/.pub-cache/hosted/pub.dartlang.org/pin_input_text_field-3.3.0/lib/src/widget/pin_widget.dart:261:9: Error: No named parameter with the name 'autofillHints'.
        autofillHints: widget.autofillHints,
        ^^^^^^^^^^^^^
/C:/user/Development/Flutter/flutter_windows_1.17.4-stable/flutter/packages/flutter/lib/src/material/text_field.dart:304:9: Context: Found this candidate, but the arguments don't match.
  const TextField({
        ^^^^^^^^^
/C:/user/Development/Flutter/flutter_windows_1.17.4-stable/flutter/.pub-cache/hosted/pub.dartlang.org/pin_input_text_field-3.3.0/lib/src/widget/pin_widget.dart:402:5: Error: 'AutovalidateMode' isn't a type.
    AutovalidateMode autovalidateMode = AutovalidateMode.disabled,
    ^^^^^^^^^^^^^^^^
/C:/user/Development/Flutter/flutter_windows_1.17.4-stable/flutter/.pub-cache/hosted/pub.dartlang.org/pin_input_text_field-3.3.0/lib/src/widget/pin_widget.dart:402:41: Error: Getter not found: 'AutovalidateMode'.
    AutovalidateMode autovalidateMode = AutovalidateMode.disabled,
                                        ^^^^^^^^^^^^^^^^
/C:/user/Development/Flutter/flutter_windows_1.17.4-stable/flutter/.pub-cache/hosted/pub.dartlang.org/pin_input_text_field-3.3.0/lib/src/widget/pin_widget.dart:436:13: Error: No named parameter with the name 'autovalidateMode'.
            autovalidateMode: autovalidateMode,
            ^^^^^^^^^^^^^^^^

This is the code that I am calling this widget:


PinFieldAutoFill(
                decoration: UnderlineDecoration(
                  textStyle: TextStyle(fontSize: 20, color: Colors.black),
                  colorBuilder: FixedColorBuilder(Colors.black.withOpacity(0.3)),
                ),
                currentCode: "aa",

                onCodeSubmitted: (code) {},
                onCodeChanged: (code) {
                  if (code.length == 6) {

                    FocusScope.of(context).requestFocus(FocusNode());
                  }
                },
              ),
ShJavokhir commented 3 years ago

I solved this problem by upgrading flutter stable channel.