LoginStatus class

Status after an attempt to log in.

Typical JSON:

  • wrong user and/or password { "status":0, "status_verbose":"user not signed-in" }
  • successful login: { "status":1, "status_verbose":"user signed-in", "user_id":"gqwbgsvvod", "user":{ "name":"Mr. John Doe", "preferred_language":"fr", "cc":"be", "country":"en:belgium", "admin":0, "moderator":1 } }

Constructors

LoginStatus({required int status, required String statusVerbose, required String? userId, required String? cookie, required UserDetails userDetails})
LoginStatus.fromJson(Map<String, dynamic> json, [Map<String, String>? headers])
factory

Properties

The cookie is necessary for some GET requests that require an authenticated user.
final
country OpenFoodFactsCountry?
no setter
hashCode int
The hash code for this object.
no setterinherited
isAdmin bool?
no setter
isModerator bool?
no setter
preferredLanguage OpenFoodFactsLanguage?
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
status int
final
statusVerbose String
final
successful bool
Was the login successful?
no setter
userDetails UserDetails
final
userId String?
final
userName String?
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited