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

Error: Cannot invoke a non-'const' constructor where a const expression is expected. #13

Closed
therasuldev opened this issue Jul 6, 2023 · 4 comments · Fixed by #26
Closed
Assignees
Labels
bug Something isn't working

Comments

@therasuldev
Copy link

: Error: Cannot invoke a non-'const' constructor where a const expression is expected.
bottom_bar.dart:421
Try using a constructor or factory that is 'const'.
? const Flex(
^^^^
Target kernel_snapshot failed: Exception
2

FAILURE: Build failed with an exception.

@MarsadMaqsood
Copy link
Owner

can you share the relevant code to reproduce this error?

@ilkerx
Copy link

ilkerx commented Jul 24, 2023

The same issue for me, just pasted the example code and it gave the same error. This is the exact text of the error:

/C:/Users/....../AppData/Local/Pub/Cache/hosted/pub.dev/stylish_bottom_bar-1.0.3/lib/src/bottom_bar.dart:421:21: Error: Cannot invoke a non-'const' constructor where a const expression is expected.
Try using a constructor or factory that is 'const'.
? const Flex(
^^^^

@MarsadMaqsood MarsadMaqsood self-assigned this Jul 24, 2023
@ThisIsMonta
Copy link
Contributor

I've made a pull request with a solved version, @MarsadMaqsood can you merge that ? just to pass into the production version

@asergenalkan
Copy link

Hi there! Same issue with me.
When I try to build iOS app I'm facing with this issue. It's started to happen after lastest Xcode and cocoapods updates etc.
Here is log;

../../../../../.pub-cache/hosted/pub.dev/stylish_bottom_bar-1.0.3/lib/src/bottom_bar.dart:421:21: Error: Cannot invoke a non-'const' constructor where a const expression is expected.

How can I fix this ?

@MarsadMaqsood MarsadMaqsood added the bug Something isn't working label Oct 26, 2023
@MarsadMaqsood MarsadMaqsood mentioned this issue Apr 1, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants