1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-23 05:19:22 +00:00
comunicmobile/lib/models/advanced_group_info.dart

59 lines
1.7 KiB
Dart
Raw Normal View History

2020-04-15 17:23:08 +00:00
import 'package:comunic/enums/likes_type.dart';
2021-04-06 15:04:55 +00:00
import 'package:comunic/models/conversation.dart';
2020-04-15 17:23:08 +00:00
import 'package:comunic/models/like_element.dart';
2020-04-15 16:06:20 +00:00
import 'package:flutter/material.dart';
import 'group.dart';
/// Advanced group information
///
/// @author Pierre Hubert
2020-04-15 17:23:08 +00:00
class AdvancedGroupInfo extends Group implements LikeElement {
bool isMembersListPublic;
2020-04-15 16:06:20 +00:00
final int timeCreate;
2020-05-01 18:30:26 +00:00
String description;
2020-05-01 18:19:22 +00:00
String url;
2020-04-15 17:23:08 +00:00
int likes;
bool userLike;
2021-04-06 15:04:55 +00:00
List<Conversation> conversations;
2020-04-15 16:06:20 +00:00
AdvancedGroupInfo({
@required int id,
@required String name,
@required String iconURL,
@required int numberMembers,
@required GroupMembershipLevel membershipLevel,
@required GroupVisibilityLevel visibilityLevel,
@required GroupRegistrationLevel registrationLevel,
@required GroupPostCreationLevel postCreationLevel,
@required String virtualDirectory,
@required bool following,
@required this.isMembersListPublic,
2020-04-15 16:06:20 +00:00
@required this.timeCreate,
@required this.description,
@required this.url,
2020-04-15 17:23:08 +00:00
@required this.likes,
@required this.userLike,
2021-04-06 15:40:13 +00:00
@required this.conversations,
2020-04-15 16:06:20 +00:00
}) : super(
id: id,
name: name,
iconURL: iconURL,
numberMembers: numberMembers,
membershipLevel: membershipLevel,
visibilityLevel: visibilityLevel,
registrationLevel: registrationLevel,
postCreationLevel: postCreationLevel,
virtualDirectory: virtualDirectory,
following: following);
2020-04-15 17:23:08 +00:00
@override
LikesType likeType = LikesType.GROUP;
2021-03-16 18:01:50 +00:00
get hasURL => url != null && url.isNotEmpty && url != "null";
get hasDescription =>
description != null && description.isNotEmpty && description != "null";
2020-04-15 16:06:20 +00:00
}