release 4.8.9

This commit is contained in:
2024-08-05 03:08:12 +09:00
parent 1e0af0b06b
commit 66ade1fe09
30 changed files with 1765 additions and 17646 deletions

View File

@ -34,13 +34,28 @@ class NewCategory {
id: json['id'] ?? 0,
categoryName: json['category_name'] ?? 'Unknown Category',
categoryNumber: json['category_number'] ?? 0,
duration: Duration(seconds: json['duration'] ?? 0),
duration: parseDuration(json['duration']),
numOfMember: json['num_of_member'] ?? 1,
family: json['family'] ?? false,
female: json['female'] ?? false,
);
}
static Duration parseDuration(String s) {
int hours = 0;
int minutes = 0;
int micros;
List<String> parts = s.split(':');
if (parts.length > 2) {
hours = int.parse(parts[parts.length - 3]);
}
if (parts.length > 1) {
minutes = int.parse(parts[parts.length - 2]);
}
micros = (double.parse(parts[parts.length - 1]) * 1000000).round();
return Duration(hours: hours, minutes: minutes, microseconds: micros);
}
Map<String, dynamic> toJson() {
return {
'id': id,