1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-12-27 21:38:51 +00:00
comunicmobile/lib/models/friend.dart

30 lines
712 B
Dart

import 'package:comunic/utils/date_utils.dart';
import 'package:meta/meta.dart';
/// Single user Friend information
///
/// @author Pierre HUBERT
class Friend {
final int id;
final bool accepted;
final int lastActive;
final bool following;
final bool canPostTexts;
Friend({
@required this.id,
@required this.accepted,
@required this.lastActive,
@required this.following,
@required this.canPostTexts,
}) : assert(id != null),
assert(accepted != null),
assert(lastActive != null),
assert(following != null),
assert(canPostTexts != null);
/// Check out whether friend is connected or not
bool get isConnected => time() - 30 < lastActive;
}