letsar / flutter_slidable

A Flutter implementation of slidable list item with directional slide actions.
MIT License
2.73k stars 592 forks source link

fix "A constant constructor can't call a non-constant super constructor." error #491

Open ryan-yuan-dev opened 3 months ago

ryan-yuan-dev commented 3 months ago

Working Environment:

Flutter 3.7.12-ohos • channel unknown • unknown source Framework • revision acd9aa9121 (35 hours ago) • 2024-08-06 10:37:13 +0800 Engine • revision 1a65d409c7 Tools • Dart 2.19.6 • DevTools 2.20.1

When integrating the library into the project and running it, the A constant constructor can't call a non-constant super constructor. error reported. It's easy to fix. Just remove const from the FlexExitTransition and FlexEntranceTransition classes.

ryan-yuan-dev commented 3 months ago

Although the problem is solved, this is not a good solution. A better way is to limit the Flutter SDK version in the pubspec.yaml. MultiChildRenderObjectWidget is not const in version 3.7.12, but it is in version 3.22.1.