mirror of
https://github.com/go-vikunja/app
synced 2024-06-06 12:39:51 +00:00
ee99869cf6
* Ran make format Signed-off-by: Timo Reichl <timo.reichl@mailbox.org> * Add VS Code launch config Signed-off-by: Timo Reichl <timo.reichl@mailbox.org> * pages/list/list.dart: Stop spinning wheel after adding a task Signed-off-by: Timo Reichl <timo.reichl@mailbox.org> * stores/list_store.dart: Fix updateTask() not being a future Signed-off-by: Timo Reichl <timo.reichl@mailbox.org> * Replace FlatButton with TextButton widgets Signed-off-by: Timo Reichl <timo.reichl@mailbox.org> * components/TaskTile.dart: Remove dead code Signed-off-by: Timo Reichl <timo.reichl@mailbox.org> * theme/theme.dart: Fix accentColor deprecation Signed-off-by: Timo Reichl <timo.reichl@mailbox.org> * pages/list/list_edit.dart: Fix SnackBar.hideCurrentSnackBar() deprecation Signed-off-by: Timo Reichl <timo.reichl@mailbox.org> * Remove unused folder lib/managers Signed-off-by: Timo Reichl <timo.reichl@mailbox.org>
26 lines
674 B
Dart
26 lines
674 B
Dart
import 'package:flutter/cupertino.dart';
|
|
import 'package:vikunja_app/global.dart';
|
|
|
|
class User {
|
|
final int id;
|
|
final String email, username;
|
|
|
|
User(this.id, this.email, this.username);
|
|
User.fromJson(Map<String, dynamic> json)
|
|
: id = json['id'],
|
|
email = json.containsKey('email') ? json['email'] : '',
|
|
username = json['username'];
|
|
|
|
toJSON() => {"id": this.id, "email": this.email, "username": this.username};
|
|
|
|
String avatarUrl(BuildContext context) {
|
|
return VikunjaGlobal.of(context).client.base + "/avatar/${this.username}";
|
|
}
|
|
}
|
|
|
|
class UserTokenPair {
|
|
final User user;
|
|
final String token;
|
|
UserTokenPair(this.user, this.token);
|
|
}
|