More redux work. User creation/retrieve

This commit is contained in:
vjrj 2018-06-27 19:46:02 +02:00
parent 2c67b68512
commit 2dfa745c6a
16 changed files with 212 additions and 110 deletions

29
lib/models/user.dart Normal file
View file

@ -0,0 +1,29 @@
import 'package:meta/meta.dart';
import 'package:comunes_flutter/comunes_flutter.dart';
@immutable
class User {
final String userId;
final String lang;
final String token;
const User.initial()
: this.userId = null,
lang = null,
token = null;
User({this.userId, this.lang, this.token});
User copyWith({String userId, String lang, String token}) {
return new User(
userId: userId ?? this.userId,
token: token ?? this.token,
lang: lang ?? this.lang);
}
@override
String toString() {
return 'User {userId: $userId, lang: $lang, token: ${ellipse(token)}';
}
}