mirror of
				https://gitlab.com/comunic/comunicmobile
				synced 2025-10-31 10:14:50 +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;
 | |
| }
 |