Make it build again #38

Merged
konrad merged 20 commits from fix/updated-fixes into master 2020-01-12 12:59:29 +00:00
3 changed files with 8 additions and 12 deletions
Showing only changes of commit 4d61a6e918 - Show all commits

View File

@ -120,9 +120,9 @@ class VikunjaGlobalState extends State<VikunjaGlobal> {
});
return;
}
loadedCurrentUser = User(int.tryParse(currentUser), "", "");
loadedCurrentUser = User(int.tryParse(currentUser), "", "", "");
} catch (otherExceptions) {
loadedCurrentUser = User(int.tryParse(currentUser), "", "");
loadedCurrentUser = User(int.tryParse(currentUser), "", "", "");
}
setState(() {
_client = client;

View File

@ -1,22 +1,18 @@
import 'package:crypto/crypto.dart';
class User {
final int id;
final String email, username;
final String email, username, avatarHash;
User(this.id, this.email, this.username);
User(this.id, this.email, this.username, this.avatarHash);
User.fromJson(Map<String, dynamic> json)
: id = json['id'],
email = json['email'],
username = json['username'];
username = json['username'],
avatarHash = json['avatarUrl'];
toJSON() => {"id": this.id, "email": this.email, "username": this.username};
String avatarUrl() {
return "https://secure.gravatar.com/avatar/" +
md5
.convert((this.email ?? "").trim().toLowerCase().codeUnits)
.toString();
return "https://secure.gravatar.com/avatar/" + this.avatarHash;
}
}

View File

@ -7,7 +7,7 @@ import 'package:vikunja_app/models/user.dart';
import 'package:vikunja_app/service/services.dart';
// Data for mocked services
var _users = {1: User(1, 'test@testuser.org', 'test1')};
var _users = {1: User(1, 'test@testuser.org', 'test1', '')};
var _namespaces = {
1: Namespace(