You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
624 B
26 lines
624 B
import 'package:json_annotation/json_annotation.dart';
|
|
|
|
part 'user_status.g.dart';
|
|
|
|
@JsonSerializable()
|
|
class UserStatus {
|
|
UserStatus(this.code, this.shortMessage, this.longMessage);
|
|
|
|
final int statusCodeOk = 0;
|
|
final int statusCodeNotLoggedIn = 1;
|
|
@JsonKey(name: 'code')
|
|
final int code;
|
|
@JsonKey(name: 'short_text')
|
|
final String shortMessage;
|
|
@JsonKey(name: 'long_text')
|
|
final String longMessage;
|
|
|
|
bool isLoggedIn() {
|
|
return code == 0;
|
|
}
|
|
|
|
factory UserStatus.fromJson(Map<String, dynamic> json) =>
|
|
_$UserStatusFromJson(json);
|
|
|
|
Map<String, dynamic> toJson() => _$UserStatusToJson(this);
|
|
}
|
|
|