You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.2 KiB
Dart
48 lines
1.2 KiB
Dart
class SwipeTransaction {
|
|
final int ?id;
|
|
final String? swipeTypeName;
|
|
final String ?userName;
|
|
final String? siteName;
|
|
final String? pointName;
|
|
final DateTime? swipeTime;
|
|
final bool? isSuccess;
|
|
final String? errorMessage;
|
|
|
|
SwipeTransaction({
|
|
this.id,
|
|
this.swipeTypeName,
|
|
this.userName,
|
|
this.siteName,
|
|
this.pointName,
|
|
this.swipeTime,
|
|
this.isSuccess,
|
|
this.errorMessage,
|
|
});
|
|
|
|
factory SwipeTransaction.fromJson(Map<String, dynamic> json) {
|
|
return SwipeTransaction(
|
|
id: json['id'] as int,
|
|
swipeTypeName: json['swipeTypeName'] ,
|
|
userName: json['userName'] ,
|
|
siteName: json['siteName'] ,
|
|
pointName: json['pointName'] ,
|
|
swipeTime: DateTime.parse(json['swipeTime']),
|
|
isSuccess: json['isSuccess'] ,
|
|
errorMessage: json['errorMessage'] ,
|
|
);
|
|
}
|
|
|
|
// Map<String, dynamic> toJson() {
|
|
// return {
|
|
// 'id': id,
|
|
// 'swipeTypeName': swipeTypeName,
|
|
// 'userName': userName,
|
|
// 'siteName': siteName,
|
|
// 'pointName': pointName,
|
|
// 'swipeTime': swipeTime.toIso8601String(),
|
|
// 'isSuccess': isSuccess,
|
|
// 'errorMessage': errorMessage,
|
|
// };
|
|
// }
|
|
}
|