mirror of
				https://gitlab.com/comunic/comunicmobile
				synced 2025-11-03 19:54:12 +00:00 
			
		
		
		
	Continue to fix issues
This commit is contained in:
		@@ -1,5 +1,3 @@
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/// Account image settings
 | 
			
		||||
///
 | 
			
		||||
/// @author Pierre Hubert
 | 
			
		||||
@@ -15,7 +13,5 @@ class AccountImageSettings {
 | 
			
		||||
    required this.hasImage,
 | 
			
		||||
    required this.imageURL,
 | 
			
		||||
    required this.visibility,
 | 
			
		||||
  })  : assert(hasImage != null),
 | 
			
		||||
        assert(imageURL != null),
 | 
			
		||||
        assert(visibility != null);
 | 
			
		||||
  });
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -38,15 +38,7 @@ class AdvancedUserInfo extends User implements LikeElement {
 | 
			
		||||
    required this.location,
 | 
			
		||||
    required this.userLike,
 | 
			
		||||
    required this.likes,
 | 
			
		||||
  })  : assert(publicNote != null),
 | 
			
		||||
        assert(canPostTexts != null),
 | 
			
		||||
        assert(isFriendsListPublic != null),
 | 
			
		||||
        assert(numberFriends != null),
 | 
			
		||||
        assert(accountCreationTime != null),
 | 
			
		||||
        assert(personalWebsite != null),
 | 
			
		||||
        assert(userLike != null),
 | 
			
		||||
        assert(likes != null),
 | 
			
		||||
        super(
 | 
			
		||||
  }) : super(
 | 
			
		||||
            id: id,
 | 
			
		||||
            firstName: firstName,
 | 
			
		||||
            lastName: lastName,
 | 
			
		||||
 
 | 
			
		||||
@@ -13,7 +13,5 @@ class ApplicationPreferences {
 | 
			
		||||
    required this.enableDarkMode,
 | 
			
		||||
    required this.forceMobileMode,
 | 
			
		||||
    required this.showPerformancesOverlay,
 | 
			
		||||
  })  : assert(enableDarkMode != null),
 | 
			
		||||
        assert(forceMobileMode != null),
 | 
			
		||||
        assert(showPerformancesOverlay != null);
 | 
			
		||||
  }) ;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -8,7 +8,5 @@ class AuthenticationDetails {
 | 
			
		||||
  final String email;
 | 
			
		||||
  final String password;
 | 
			
		||||
 | 
			
		||||
  const AuthenticationDetails({required this.email, required this.password})
 | 
			
		||||
      : assert(email != null),
 | 
			
		||||
        assert(password != null);
 | 
			
		||||
  const AuthenticationDetails({required this.email, required this.password});
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -7,7 +7,7 @@ import 'package:comunic/helpers/database/database_contract.dart';
 | 
			
		||||
abstract class CacheModel {
 | 
			
		||||
  final int id;
 | 
			
		||||
 | 
			
		||||
  const CacheModel({required this.id}) : assert(id != null);
 | 
			
		||||
  const CacheModel({required this.id});
 | 
			
		||||
 | 
			
		||||
  /// Initialize a CacheModel from a map
 | 
			
		||||
  CacheModel.fromMap(Map<String, dynamic> map)
 | 
			
		||||
 
 | 
			
		||||
@@ -14,8 +14,7 @@ class CallMember {
 | 
			
		||||
  CallMember({
 | 
			
		||||
    required this.userID,
 | 
			
		||||
    this.status = MemberStatus.JOINED,
 | 
			
		||||
  })  : assert(userID != null),
 | 
			
		||||
        assert(status != null);
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  bool get hasVideoStream =>
 | 
			
		||||
      stream != null && stream!.getVideoTracks().length > 0;
 | 
			
		||||
 
 | 
			
		||||
@@ -28,16 +28,9 @@ class Comment implements LikeElement {
 | 
			
		||||
    required this.imageURL,
 | 
			
		||||
    required this.likes,
 | 
			
		||||
    required this.userLike,
 | 
			
		||||
  })  : assert(id != null),
 | 
			
		||||
        assert(userID != null),
 | 
			
		||||
        assert(postID != null),
 | 
			
		||||
        assert(timeSent != null),
 | 
			
		||||
        assert(content != null),
 | 
			
		||||
        assert(likes != null),
 | 
			
		||||
        assert(userLike != null);
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  bool get hasContent =>
 | 
			
		||||
      content != null && !content.isNull && content.length > 0;
 | 
			
		||||
  bool get hasContent => !content.isNull && content.length > 0;
 | 
			
		||||
 | 
			
		||||
  bool get hasImage => imageURL != null;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -47,12 +47,7 @@ class Config {
 | 
			
		||||
    this.toursEntriesBuilder,
 | 
			
		||||
    this.additionalLoading,
 | 
			
		||||
    this.mainRouteBuilder,
 | 
			
		||||
  })  : assert(apiServerName != null),
 | 
			
		||||
        assert(apiServerUri != null),
 | 
			
		||||
        assert(apiServerSecure != null),
 | 
			
		||||
        assert(clientName != null),
 | 
			
		||||
        assert(splashBackgroundColor != null),
 | 
			
		||||
        assert(appName != null);
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  /// Get and set static configuration
 | 
			
		||||
  static Config? _config;
 | 
			
		||||
 
 | 
			
		||||
@@ -37,13 +37,7 @@ class Conversation extends SerializableElement<Conversation> {
 | 
			
		||||
    /*required*/ required bool this.canEveryoneAddMembers,
 | 
			
		||||
    this.callCapabilities = CallCapabilities.NONE,
 | 
			
		||||
    this.isHavingCall = false,
 | 
			
		||||
  })  : assert(id != null),
 | 
			
		||||
        assert(lastActivity != null),
 | 
			
		||||
        assert(members != null),
 | 
			
		||||
        assert(canEveryoneAddMembers != null),
 | 
			
		||||
        assert((groupID == null) == (groupMinMembershipLevel == null)),
 | 
			
		||||
        assert(callCapabilities != null),
 | 
			
		||||
        assert(isHavingCall != null);
 | 
			
		||||
  }) : assert((groupID == null) == (groupMinMembershipLevel == null));
 | 
			
		||||
 | 
			
		||||
  /// Check out whether a conversation has a fixed name or not
 | 
			
		||||
  bool get hasName => this.name != null;
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,3 @@
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/// Conversation member
 | 
			
		||||
///
 | 
			
		||||
/// @author Pierre Hubert
 | 
			
		||||
@@ -12,16 +10,12 @@ class ConversationMember {
 | 
			
		||||
  final bool isAdmin;
 | 
			
		||||
 | 
			
		||||
  const ConversationMember({
 | 
			
		||||
    /*required*/ required this.userID,
 | 
			
		||||
    /*required*/ required this.lastMessageSeen,
 | 
			
		||||
    /*required*/ required this.lastAccessTime,
 | 
			
		||||
    /*required*/ required this.following,
 | 
			
		||||
    /*required*/ required this.isAdmin,
 | 
			
		||||
  })  : assert(userID != null),
 | 
			
		||||
        assert(lastMessageSeen != null),
 | 
			
		||||
        assert(lastAccessTime != null),
 | 
			
		||||
        assert(following != null),
 | 
			
		||||
        assert(isAdmin != null);
 | 
			
		||||
    required this.userID,
 | 
			
		||||
    required this.lastMessageSeen,
 | 
			
		||||
    required this.lastAccessTime,
 | 
			
		||||
    required this.following,
 | 
			
		||||
    required this.isAdmin,
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  Map<String, dynamic> toJson() => {
 | 
			
		||||
        'userID': userID,
 | 
			
		||||
 
 | 
			
		||||
@@ -42,10 +42,7 @@ class ConversationMessageFile {
 | 
			
		||||
    required String this.name,
 | 
			
		||||
    required this.thumbnail,
 | 
			
		||||
    required String this.type,
 | 
			
		||||
  })  : assert(url != null),
 | 
			
		||||
        assert(size != null),
 | 
			
		||||
        assert(name != null),
 | 
			
		||||
        assert(type != null);
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  /// Get the type of file
 | 
			
		||||
  ConversationMessageFileType? get fileType {
 | 
			
		||||
@@ -140,8 +137,6 @@ class ConversationServerMessage {
 | 
			
		||||
          ..add(userWhoRemoved)
 | 
			
		||||
          ..add(userRemoved);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    throw Exception("Unsupported server message type!");
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  String? getText(UsersList? list) {
 | 
			
		||||
@@ -167,8 +162,6 @@ class ConversationServerMessage {
 | 
			
		||||
          "2": list.getUser(userRemoved).fullName,
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    throw Exception("Unsupported message type!");
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  Map<String, dynamic> toJson() => {
 | 
			
		||||
 
 | 
			
		||||
@@ -17,8 +17,6 @@ class NewConversation {
 | 
			
		||||
    required this.follow,
 | 
			
		||||
    required this.canEveryoneAddMembers,
 | 
			
		||||
    required this.color,
 | 
			
		||||
  })  : assert(members != null),
 | 
			
		||||
        assert(members.length > 0),
 | 
			
		||||
        assert(follow != null),
 | 
			
		||||
        assert(canEveryoneAddMembers != null);
 | 
			
		||||
  })  :
 | 
			
		||||
        assert(members.length > 0);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -12,28 +12,22 @@ import 'package:comunic/utils/ui_utils.dart';
 | 
			
		||||
 | 
			
		||||
class User implements SerializableElement<User> {
 | 
			
		||||
  final int id;
 | 
			
		||||
  final String? firstName;
 | 
			
		||||
  final String? lastName;
 | 
			
		||||
  final String firstName;
 | 
			
		||||
  final String lastName;
 | 
			
		||||
  final UserPageVisibility pageVisibility;
 | 
			
		||||
  final String? virtualDirectory;
 | 
			
		||||
  final String? accountImageURL;
 | 
			
		||||
  final String accountImageURL;
 | 
			
		||||
  final CustomEmojiesList customEmojies;
 | 
			
		||||
 | 
			
		||||
  const User({
 | 
			
		||||
    required int this.id,
 | 
			
		||||
    required String this.firstName,
 | 
			
		||||
    required String this.lastName,
 | 
			
		||||
    required this.id,
 | 
			
		||||
    required this.firstName,
 | 
			
		||||
    required this.lastName,
 | 
			
		||||
    required this.pageVisibility,
 | 
			
		||||
    required this.virtualDirectory,
 | 
			
		||||
    required String this.accountImageURL,
 | 
			
		||||
    required this.accountImageURL,
 | 
			
		||||
    required this.customEmojies,
 | 
			
		||||
  })  : assert(id != null),
 | 
			
		||||
        assert(id > 0),
 | 
			
		||||
        assert(firstName != null),
 | 
			
		||||
        assert(lastName != null),
 | 
			
		||||
        assert(pageVisibility != null),
 | 
			
		||||
        assert(accountImageURL != null),
 | 
			
		||||
        assert(customEmojies != null);
 | 
			
		||||
  }) : assert(id > 0);
 | 
			
		||||
 | 
			
		||||
  /// Get user full name
 | 
			
		||||
  String get fullName => firstName! + " " + lastName!;
 | 
			
		||||
@@ -68,5 +62,5 @@ class User implements SerializableElement<User> {
 | 
			
		||||
            jsonDecode(map["customEmojies"]));
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  int compareTo(User other) => id!.compareTo(other.id!);
 | 
			
		||||
  int compareTo(User other) => id.compareTo(other.id);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user