Quiz-App-Flutter icon indicating copy to clipboard operation
Quiz-App-Flutter copied to clipboard

Why is the VSCode report an error "Evaluation of this constant expression throws an exception."

Open cn1001wang opened this issue 4 years ago • 1 comments

I'm a beginner of flutter. download from git . after run "flutter pub get" ,the VsCode report an error “Evaluation of this constant expression throws an exception.“

image

cn1001wang avatar Jan 29 '21 01:01 cn1001wang

It's because you defined kPrimaryGradient as constant. Generally, in order to have a widget that is compile-time constant, all of its properties should also be compile-time constants.

ashutosh-mulik avatar Jul 16 '21 03:07 ashutosh-mulik