rupinderjeet
rupinderjeet

Reputation: 2838

What does '!const' do in Dart?

I came across documentation wiki for @pragma("vm:entry-point") on Github. It mentions following code snippet:

@pragma("vm:entry-point")
@pragma("vm:entry-point", true/false)
@pragma("vm:entry-point", !const bool.fromEnvironment("dart.vm.product"))
class C { ... }

I know about const keyword in Dart. But, what does !const do? Is it just to declare that the property is not a constant? Where can I read about its usage and functionality in official documentation?

Upvotes: 0

Views: 85

Answers (1)

My Car
My Car

Reputation: 4556

I think it means the following:

!(const bool.fromEnvironment("dart.vm.product"))

I think it means the negative of the bool result.

Two examples:

Code:

print(!true);

Result:

false

Code:

print(!false);

Result:

true

Upvotes: 4

Related Questions