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.
uco-mobile-poc/lib/app/models/UserActivity.dart

49 lines
1.2 KiB
Dart

class UserActivity {
int id;
String porOrgacode;
String cmpCustcode;
DateTime date;
String channel;
String deviceName;
String activity;
UserActivity({
required this.id,
required this.porOrgacode,
required this.cmpCustcode,
required this.date,
required this.channel,
required this.deviceName,
required this.activity,
});
Map<String, dynamic> toMap() {
return {
'id': id,
'porOrgacode': porOrgacode,
'cmpCustcode': cmpCustcode,
'date': date.toIso8601String(),
'channel': channel,
'deviceName': deviceName,
'activity': activity,
};
}
factory UserActivity.fromMap(Map<String, dynamic> map) {
return UserActivity(
id: map['id'] ?? '',
porOrgacode: map['porOrgacode'] ?? '',
cmpCustcode: map['cmpCustcode'] ?? '',
date: DateTime.parse(map['date'] ?? ''),
channel: map['channel'] ?? '01',
deviceName: map['deviceName'] ?? '',
activity: map['activity'] ?? '',
);
}
@override
String toString() {
return 'LoginActivity{id: $id, porOrgacode: $porOrgacode, cmpCustcode: $cmpCustcode, date: $date, channel: $channel, deviceName: $deviceName, activity: $activity}';
}
}