Chapmacl
Chapmacl

Reputation: 181

Flutter Web check if cookies are enabled?

According to Dart, there is a method that exists called "cookieEnabled" which returns a bool depending on whether cookies are enabled or not. All well and good except I cannot figure out how to use it.

I have tried:

if (html.Navigator.cookieEnabled)

but this says "member cannot be accessed using static access.

Is there a way to do this?

Upvotes: 1

Views: 537

Answers (1)

Alex Radzishevsky
Alex Radzishevsky

Reputation: 3768

You should obtain instance of navigator first, as cookieEnabled is not static getter:

if (html.window.navigator.cookieEnabled)

Upvotes: 2

Related Questions