fluttercandies / extended_text

A powerful extended official text for Flutter, which supports Speical Text(Image,@somebody), Custom Background, Custom overFlow, Text Selection.
MIT License
664 stars 134 forks source link

使用flutter2时编译报错 #98

Closed mojerro closed 3 years ago

mojerro commented 3 years ago

报错如下

G:\Projects\flutter\naturec_flutter>flutter run
Launching lib\main.dart on VIE AL10 in debug mode...
/D:/ProgramData/flutter/.pub-cache/hosted/pub.flutter-io.cn/extended_text-5.0.5/lib/src/selection/extended_text_selection.dart:131:7: Error: The non-abstract class 'ExtendedTextSelectionState' is missing implementations for these members:
 - TextSelectionDelegate.userUpdateTextEditingValue
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 ExtendedTextSelectionState extends State<ExtendedTextSelection>   
      ^^^^^^^^^^^^^^^^^^^^^^^^^^
/D:/ProgramData/flutter/packages/flutter/lib/src/services/text_input.dart:822:8: Context: 'TextSelectionDelegate.userUpdateTextEditingValue' is defined here.
  void userUpdateTextEditingValue(TextEditingValue value, SelectionChangedCause cause);
       ^^^^^^^^^^^^^^^^^^^^^^^^^^
/D:/ProgramData/flutter/.pub-cache/hosted/pub.flutter-io.cn/extended_text-5.0.5/lib/src/selection/extended_text_selection.dart:434:8: Error: The method 'ExtendedTextSelectionState.hideToolbar' has fewer positional arguments than those of overridden method 'TextSelectionDelegate.hideToolbar'.
  void hideToolbar() {
       ^
/D:/ProgramData/flutter/packages/flutter/lib/src/services/text_input.dart:829:8: Context: This is the overridden method ('hideToolbar').
  void hideToolbar([bool hideHandles = true]);
       ^

FAILURE: Build failed with an exception.

* Where:
Script 'D:\ProgramData\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1029

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'D:\ProgramData\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 18s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done                        19.0s
Exception: Gradle task assembleDebug failed with exit code 1

使用的包是extended_text: ^5.0.5,看这个报错,没太懂是我需要实现这个类,还是包本身缺少了这个类的实现。主要是编辑器环境也没报错

mojerro commented 3 years ago

我看这个issue和我的报错是相似的,但是并不能提供有效的参考 #93

zmtzawqlp commented 3 years ago

确保 Flutter 2.0,最新版本只是适配的,你如果是master branch的话,也许不支持

mojerro commented 3 years ago

了解了,我现在用的是beta channel,我试试stable

zmtzawqlp commented 3 years ago

只支持stable,没那么多时间维护,beta,dev,master是经常有api变动

mojerro commented 3 years ago

感谢大佬,stable是没问题的。主要是之前的beta channel一直用着没问题就没注意