Skip to content

Commit

Permalink
fix tomuss
Browse files Browse the repository at this point in the history
  • Loading branch information
hatch01 committed Feb 21, 2024
1 parent 167a2d7 commit 9e95143
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/lyon1tomussclient/lib/src/model/generated/url.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions packages/lyon1tomussclient/lib/src/model/url.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,19 @@ part 'generated/url.g.dart';
class URL extends TeachingUnitElement {
@HiveField(2, defaultValue: "")
late final String value;
@HiveField(3, defaultValue: false)
late final bool isModifiable;

URL.fromJSON(var id, Map json, var stats, var line, var column, String user)
: super.fromJson(id, json, stats, line, column, user) {
var props = line[id];
isModifiable = false;
if (props is List && props.isNotEmpty) {
value = props[0].toString();
} else if (json.containsKey("empty_is")) {
value = json["empty_is"];
} else if (json.containsKey("modifiable")) {
isModifiable = json["modifiable"] != 0;
} else {
throw ("Couldn't find url in URL object...");
}
Expand Down

0 comments on commit 9e95143

Please sign in to comment.