Flutter: The non-abstract class ‘InternalSelectableMathState’ is missing implementations for these members

Link Copied To Clipboard !

flutter-math-fork-update-issue-v2.8.0 Flutter

A recent update of flutter 2.8 has caused this issue to many developers. Even though there is no problem with other plugins installed, it arises from nowhere just after upgrading to flutter v2.8.0. The error seems to have come from internal flutter implementations not from our side.

The exact stack trace of error looks something like below:

../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/flutter_math_fork-0.3.3+1/lib/src/widgets/selectable.dart:407:7: Error: The non-abstract class 'InternalSelectableMathState' is missing implementations for these members:
 - TextSelectionDelegate.copySelection
 - TextSelectionDelegate.cutSelection
 - TextSelectionDelegate.pasteText
 - TextSelectionDelegate.selectAll
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 InternalSelectableMathState extends State<InternalSelectableMath>
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^
/somedirectory/flutter/packages/flutter/lib/src/services/text_input.dart:985:8: Context: 'TextSelectionDelegate.copySelection' is defined here.
  void copySelection(SelectionChangedCause cause);
       ^^^^^^^^^^^^^
/somedirectory/flutter/packages/flutter/lib/src/services/text_input.dart:965:8: Context: 'TextSelectionDelegate.cutSelection' is defined here.
  void cutSelection(SelectionChangedCause cause);
       ^^^^^^^^^^^^
/somedirectory/flutter/packages/flutter/lib/src/services/text_input.dart:973:16: Context: 'TextSelectionDelegate.pasteText' is defined here.
  Future<void> pasteText(SelectionChangedCause cause);
               ^^^^^^^^^
/somedirectory/flutter/packages/flutter/lib/src/services/text_input.dart:979:8: Context: 'TextSelectionDelegate.selectAll' is defined here.
  void selectAll(SelectionChangedCause cause);
       ^^^^^^^^^


FAILURE: Build failed with an exception.

* Where:
Script 'somedirectory\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1070

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'somedirectory\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 8m 5s
Exception: Gradle task assembleDebug failed with exit code 1

Looking at above stacktrace, it seems the problem is with flutter_math_fork which is third party library. Since you might not have used it in your app, it must have been included by flutter itself. Now, let’s talk about how we can fix it.

How to fix the non-abstract class ‘InternalSelectableMathState’ is missing implementations for these members in flutter ?

Since the problem is with package flutter_math_fork, a quick fix would be to update this package by adding it in pubspec dependency.

flutter_math_fork: ^0.5.0

You might have to run flutter clean before running flutter build or flutter run.

The best fix

Since, this is the problem with flutter internal implementation, flutter should fix it in next update. So, try upgrading your flutter version to latest by executing the following command.

flutter upgrade

You May Also Like

News Letter