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, String? userEmail, String? userName, String? userId, OpenFoodFactsLanguage? preferredLanguage, OpenFoodFactsCountry? country, bool? isModerator, bool? isAdmin, String? cookie})
-
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?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isAdmin → bool?
-
final
- isModerator → bool?
-
final
- preferredLanguage → OpenFoodFactsLanguage?
-
final
- 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
- userId → String?
-
final
- userName → String?
-
final
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