-
Notifications
You must be signed in to change notification settings - Fork 50
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
Error: Cannot invoke a non-'const' #52
Comments
environment: |
@MrErkinjon Hi, thanks for reporting. I can't repro it. I put your (slightly modified) code into the example app and it worked without problems. |
Hey guys! I rushed over the same problem here. I also get the same error. I guess you are using Flutter 3.7.0 or lower. The Problem here is, that Columns are not const for Flutter 3.7 and lower. I just tried it out with a project where I have the a newer Version (3.13.9). So I just looked up and found that columns are const since 3.10 To solve your problem, downgrade to easy_image_viewer: 1.3.2 |
@DerJojo11 Another Johannes :) Thanks so much for the feedback, that's very helpful. I'll work on a fix. |
Also fix the const Column issue (GH-52). Flutter 3.7.0 is over one year old. Supporting even older versions would be too much effort. One year seems reasonable.
* Adjust GitHub Actions to run tests on multiple versions of Flutter The reason is to be better equipped to catch issues that only happen on older or newer versions of Flutter. * Switch to flutter-action@v2 * Downgrade flutter_lints to 2.0.3 to support testing on older Flutter versions Installing deps was failing for older supported Flutter/Dart versions because flutter_lints 3 needs at least Dart 3. * Raise min version to Flutter 3.0 and Dart 2.17 * Downgrade flutter_lints to 2.0.1 to make it compatible with Dart 2.17.0 We are trying to keep it backwards-compatible to Dart 2.17 and Flutter 3.0.0. * Raise min Flutter to 3.7.0 and Dart to 2.19.0 Also fix the const Column issue (GH-52). Flutter 3.7.0 is over one year old. Supporting even older versions would be too much effort. One year seems reasonable. * Bump version to 1.4.1
Fixed in 1.4.1, closing this ticket. |
Describe the Issue
../../../.pub-cache/hosted/pub.dev/easy_image_viewer-1.4.0/lib/src/easy_image_provider.dart:85:14: Error: Cannot invoke a non-'const' constructor where a const expression is expected.
Try using a constructor or factory that is 'const'.
child: Column(
^^^^^^
Todo
InkWell(
onTap: () {
showImageViewer(
context,
(workItem.image != "")
? Image.network(
"${BASE_URL_WORK_IMAGE}${workItem.image}")
.image
: Image.network(
"https://t3.ftcdn.net/jpg/04/34/72/82/360_F_434728286_OWQQvAFoXZLdGHlObozsolNeuSxhpr84.jpg")
.image,
swipeDismissible: true,
doubleTapZoomable: true,
useSafeArea: true,
immersive: false);
},
child:Icon(Icons.add)
);
The text was updated successfully, but these errors were encountered: