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; }