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

The non-abstract class 'ExtendedEditableTextState' is missing implementations for these members: - TextInputClient.showAutocorrectionPromptRect #64

Closed
fym201 opened this issue Apr 14, 2020 · 10 comments

Comments

@fym201
Copy link

fym201 commented Apr 14, 2020

The non-abstract class 'ExtendedEditableTextState' is missing implementations for these members: - TextInputClient.showAutocorrectionPromptRect

[✓] Flutter (Channel master, v1.18.0-6.0.pre.19, on Mac OS X 10.15.4 19E287, locale en-CN)

@pratheeshrussell
Copy link

I got the same error in android


Compiler message:
../../flutter/.pub-cache/hosted/pub.dartlang.org/extended_text_field-0.4.9/lib/src/extended_editable_text.dart:743:7: Error: The non-abstract class 'ExtendedEditableTextState' is missing implementations for these members:
 - TextInputClient.currentAutofillScope
 - TextInputClient.showAutocorrectionPromptRect
Try to either
 - provide an implementation,
 - inherit an implementation from a superclass or mixin,
 - mark the class as abstract, or
 - provide a 'noSuchMethod' implementation.
class ExtendedEditableTextState extends State<ExtendedEditableText>
      ^^^^^^^^^^^^^^^^^^^^^^^^^
../../flutter/packages/flutter/lib/src/services/text_input.dart:769:21: Context: 'TextInputClient.currentAutofillScope' is defined here.
  AutofillScope get currentAutofillScope;
                    ^^^^^^^^^^^^^^^^^^^^
../../flutter/packages/flutter/lib/src/services/text_input.dart:784:8: Context: 'TextInputClient.showAutocorrectionPromptRect' is defined here.
  void showAutocorrectionPromptRect(int start, int end);
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/extended_text_field-0.4.9/lib/src/extended_editable_text.dart:1772:29: Error: Getter not found: 'obscuringCharacter'.
      text = RenderEditable.obscuringCharacter * text.length;
                            ^^^^^^^^^^^^^^^^^^

Compiler message:
../../flutter/.pub-cache/hosted/pub.dartlang.org/extended_text_field-0.4.9/lib/src/extended_editable_text.dart:743:7: Error: The non-abstract class 'ExtendedEditableTextState' is missing implementations for these members:
 - TextInputClient.currentAutofillScope
 - TextInputClient.showAutocorrectionPromptRect
Try to either
 - provide an implementation,
 - inherit an implementation from a superclass or mixin,
 - mark the class as abstract, or
 - provide a 'noSuchMethod' implementation.

class ExtendedEditableTextState extends State<ExtendedEditableText>
      ^^^^^^^^^^^^^^^^^^^^^^^^^
../../flutter/packages/flutter/lib/src/services/text_input.dart:769:21: Context: 'TextInputClient.currentAutofillScope' is defined here.
  AutofillScope get currentAutofillScope;
                    ^^^^^^^^^^^^^^^^^^^^
../../flutter/packages/flutter/lib/src/services/text_input.dart:784:8: Context: 'TextInputClient.showAutocorrectionPromptRect' is defined here.
  void showAutocorrectionPromptRect(int start, int end);
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/extended_text_field-0.4.9/lib/src/extended_editable_text.dart:1772:29: Error: Getter not found: 'obscuringCharacter'.
      text = RenderEditable.obscuringCharacter * text.length;
                            ^^^^^^^^^^^^^^^^^^
Target kernel_snapshot failed: Exception: Errors during snapshot creation: null
build failed.

FAILURE: Build failed with an exception.

* Where:
Script 'F:\AgileCyberSol\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 883

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'F:\AgileCyberSol\flutter\bin\flutter.bat'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org
BUILD FAILED in 1m 44s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

Main.dart file

import 'package:extended_text_field/extended_text_field.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
   EmailSpanBuilder _emailSpanBuilder;
   TextEditingController controller = TextEditingController();
  @override
  void initState() {
    //_emailSpanBuilder = EmailSpanBuilder(controller, context);
    super.initState();
  }
  
  @override
  Widget build(BuildContext context) {
    
    return Scaffold(
      appBar: AppBar(
        title: Text("Demo"),
      ),
      body: Center(
       child: ExtendedTextField(
                  controller: controller,
                 // specialTextSpanBuilder: _emailSpanBuilder,
                  maxLines: null,)
      ),
    );
  }
}

class EmailSpanBuilder extends SpecialTextSpanBuilder {
  final TextEditingController controller;
  final BuildContext context;
  EmailSpanBuilder(this.controller, this.context);
  @override
  SpecialText createSpecialText(String flag,
      {TextStyle textStyle, onTap, int index}) {
    if (flag == null || flag == "") return null;

    if (!flag.startsWith(" ") && !flag.startsWith("@")) {
      return EmailText(textStyle, onTap,
          start: index,
          context: context,
          controller: controller,
          startFlag: flag);
    }
    return null;
  }
}

class EmailText extends SpecialText {
  final TextEditingController controller;
  final int start;
  final BuildContext context;
  EmailText(TextStyle textStyle, SpecialTextGestureTapCallback onTap,
      {this.start, this.controller, this.context, String startFlag})
      : super(startFlag, " ", textStyle, onTap: onTap);

  @override
  bool isEnd(String value) {
    var index = value.indexOf("@");
    var index1 = value.indexOf(".");

    return index >= 0 &&
        index1 >= 0 &&
        index1 > index + 1 &&
        super.isEnd(value);
  }

  @override
  InlineSpan finishText() {
    final String text = toString();

    return ExtendedWidgetSpan(
      actualText: text,
      start: start,
     // alignment: ui.PlaceholderAlignment.middle,
      child: GestureDetector(
        child: Padding(
          padding: EdgeInsets.only(right: 5.0, top: 2.0, bottom: 2.0),
          child: ClipRRect(
              borderRadius: BorderRadius.all(Radius.circular(5.0)),
              child: Container(
                padding: EdgeInsets.all(5.0),
                color: Colors.orange,
                child: Row(
                  mainAxisAlignment: MainAxisAlignment.start,
                  mainAxisSize: MainAxisSize.min,
                  children: <Widget>[
                    Text(
                      text.trim(),
                      //style: textStyle?.copyWith(color: Colors.orange),
                    ),
                    SizedBox(
                      width: 5.0,
                    ),
                    InkWell(
                      child: Icon(
                        Icons.close,
                        size: 15.0,
                      ),
                      onTap: () {
                        controller.value = controller.value.copyWith(
                            text: controller.text
                                .replaceRange(start, start + text.length, ""),
                            selection: TextSelection.fromPosition(
                                TextPosition(offset: start)));
                      },
                    )
                  ],
                ),
              )),
        ),
        onTap: () {
          showDialog(
              context: context,
              barrierDismissible: true,
              builder: (c) {
                TextEditingController textEditingController =
                    TextEditingController()..text = text.trim();
                return Column(
                  children: <Widget>[
                    Expanded(
                      child: Container(),
                    ),
                    Material(
                        child: Padding(
                      padding: EdgeInsets.all(10.0),
                      child: TextField(
                        controller: textEditingController,
                        decoration: InputDecoration(
                            suffixIcon: FlatButton(
                          child: Text("OK"),
                          onPressed: () {
                            controller.value = controller.value.copyWith(
                                text: controller.text.replaceRange(
                                    start,
                                    start + text.length,
                                    textEditingController.text + " "),
                                selection: TextSelection.fromPosition(
                                    TextPosition(
                                        offset: start +
                                            (textEditingController.text + " ")
                                                .length)));

                            Navigator.pop(context);
                          },
                        )),
                      ),
                    )),
                    Expanded(
                      child: Container(),
                    )
                  ],
                );
              });
        },
      ),
      deleteAll: true,
    );
  }
}

in pubsec added extended_text_field: 0.4.9
flutter version: Flutter - Channel master, v1.18.0-10.0.pre, Microsoft Windows [Version 10.0.18362.778]

@zmtzawqlp
Copy link
Member

any error in stable 1.17.0?

@pratheeshrussell
Copy link

pratheeshrussell commented May 9, 2020

any error in stable 1.17.0?

No error in stable.

@venliong
Copy link

venliong commented May 19, 2020

I'm using 1.17.1 beta.

open <flutterSDK>/.pub-cache/hosted/pub.flutter-io.cn/extended_text_field-0.5.0/lib/src/extended_editable_text.dart and add the missing implementations :

@override AutofillScope get currentAutofillScope => null;

@override
showAutocorrectionPromptRect(int start,int end){

 }

@Wing-Li
Copy link

Wing-Li commented May 23, 2020

There are still problems, it can't be used at all

@zmtzawqlp
Copy link
Member

we focus on Flutter Stable Branch , api changes frequently in beta/dev/master

@ismilesky
Copy link

how to solve ? change stable channel? @zmtzawqlp

@zmtzawqlp
Copy link
Member

how to solve ? change stable channel? @zmtzawqlp

yes, or you can fork it and change it at your side

@johngithubby
Copy link

It also fails for Flutter 1.20, package ver 3.0.1

../dev/flutter/.pub-cache/hosted/pub.dartlang.org/extended_text_field-3.0.1/lib/src/extended_editable_text.dart:759:7: Error: The non-abstract class 'ExtendedEditableTextState' is missing implementations for these members:

  • TextInputClient.currentAutofillScope
  • TextInputClient.showAutocorrectionPromptRect
    Try to either
  • provide an implementation,
  • inherit an implementation from a superclass or mixin,
  • mark the class as abstract, or
  • provide a 'noSuchMethod' implementation.

@zmtzawqlp
Copy link
Member

the same as #80

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

7 participants