57 lines
1.4 KiB
Dart
57 lines
1.4 KiB
Dart
// To parse this JSON data, do
|
|
//
|
|
// final jwtDecodedData = jwtDecodedDataFromJson(jsonString);
|
|
|
|
import 'dart:convert';
|
|
|
|
JwtDecodedData jwtDecodedDataFromJson(String str) =>
|
|
JwtDecodedData.fromJson(json.decode(str));
|
|
|
|
String jwtDecodedDataToJson(JwtDecodedData data) => json.encode(data.toJson());
|
|
|
|
class JwtDecodedData {
|
|
String? authType;
|
|
String? deviceCode;
|
|
int? deviceId;
|
|
String? deviceRole;
|
|
String? eventName;
|
|
double? oId;
|
|
List<double>? oIds;
|
|
double? organizerId;
|
|
|
|
JwtDecodedData({
|
|
this.authType,
|
|
this.deviceCode,
|
|
this.deviceId,
|
|
this.deviceRole,
|
|
this.eventName,
|
|
this.oId,
|
|
this.oIds,
|
|
this.organizerId,
|
|
});
|
|
|
|
factory JwtDecodedData.fromJson(Map<String, dynamic> json) => JwtDecodedData(
|
|
authType: json["authType"],
|
|
deviceCode: json["deviceCode"],
|
|
deviceId: json["deviceId"],
|
|
deviceRole: json["deviceRole"],
|
|
eventName: json["eventName"],
|
|
oId: json["oId"]?.toDouble(),
|
|
oIds: json["oIds"] == null
|
|
? []
|
|
: List<double>.from(json["oIds"]!.map((x) => x?.toDouble())),
|
|
organizerId: json["organizerId"]?.toDouble(),
|
|
);
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
"authType": authType,
|
|
"deviceCode": deviceCode,
|
|
"deviceId": deviceId,
|
|
"deviceRole": deviceRole,
|
|
"eventName": eventName,
|
|
"oId": oId,
|
|
"oIds": oIds == null ? [] : List<dynamic>.from(oIds!.map((x) => x)),
|
|
"organizerId": organizerId,
|
|
};
|
|
}
|