mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-22 21:09:21 +00:00
30 lines
712 B
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;
|
||
|
}
|