mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-24 22:09:21 +00:00
Progressing with null safety migration
This commit is contained in:
parent
2424fd38d6
commit
ab2c5da0da
@ -9,6 +9,7 @@ import 'package:connectivity_plus_web/connectivity_plus_web.dart';
|
|||||||
import 'package:file_picker/_internal/file_picker_web.dart';
|
import 'package:file_picker/_internal/file_picker_web.dart';
|
||||||
import 'package:firebase_core_web/firebase_core_web.dart';
|
import 'package:firebase_core_web/firebase_core_web.dart';
|
||||||
import 'package:firebase_messaging_web/firebase_messaging_web.dart';
|
import 'package:firebase_messaging_web/firebase_messaging_web.dart';
|
||||||
|
import 'package:flutter_web_plugins/flutter_web_plugins.dart';
|
||||||
import 'package:image_picker_for_web/image_picker_for_web.dart';
|
import 'package:image_picker_for_web/image_picker_for_web.dart';
|
||||||
import 'package:package_info_plus_web/package_info_plus_web.dart';
|
import 'package:package_info_plus_web/package_info_plus_web.dart';
|
||||||
import 'package:shared_preferences_web/shared_preferences_web.dart';
|
import 'package:shared_preferences_web/shared_preferences_web.dart';
|
||||||
@ -16,8 +17,6 @@ import 'package:url_launcher_web/url_launcher_web.dart';
|
|||||||
import 'package:video_player_web/video_player_web.dart';
|
import 'package:video_player_web/video_player_web.dart';
|
||||||
import 'package:wakelock_web/wakelock_web.dart';
|
import 'package:wakelock_web/wakelock_web.dart';
|
||||||
|
|
||||||
import 'package:flutter_web_plugins/flutter_web_plugins.dart';
|
|
||||||
|
|
||||||
// ignore: public_member_api_docs
|
// ignore: public_member_api_docs
|
||||||
void registerPlugins(Registrar registrar) {
|
void registerPlugins(Registrar registrar) {
|
||||||
ConnectivityPlusPlugin.registerWith(registrar);
|
ConnectivityPlusPlugin.registerWith(registrar);
|
||||||
|
@ -71,7 +71,7 @@ class ConversationsHelper {
|
|||||||
/// Update admin status of a user in a conversation
|
/// Update admin status of a user in a conversation
|
||||||
///
|
///
|
||||||
/// Throws in case of failure
|
/// Throws in case of failure
|
||||||
static Future<void> setAdmin(int convID, int userID, bool admin) async =>
|
static Future<void> setAdmin(int/*!*/ convID, int/*!*/ userID, bool admin) async =>
|
||||||
await APIRequest.withLogin("conversations/setAdmin")
|
await APIRequest.withLogin("conversations/setAdmin")
|
||||||
.addInt("convID", convID)
|
.addInt("convID", convID)
|
||||||
.addInt("userID", userID)
|
.addInt("userID", userID)
|
||||||
|
@ -7,9 +7,9 @@ import 'package:flutter/widgets.dart';
|
|||||||
enum AccountImageVisibilityLevels { EVERYONE, COMUNIC_USERS, FRIENDS_ONLY }
|
enum AccountImageVisibilityLevels { EVERYONE, COMUNIC_USERS, FRIENDS_ONLY }
|
||||||
|
|
||||||
class AccountImageSettings {
|
class AccountImageSettings {
|
||||||
final bool hasImage;
|
final bool/*!*/ hasImage;
|
||||||
final String imageURL;
|
final String/*!*/ imageURL;
|
||||||
final AccountImageVisibilityLevels visibility;
|
final AccountImageVisibilityLevels/*!*/ visibility;
|
||||||
|
|
||||||
const AccountImageSettings({
|
const AccountImageSettings({
|
||||||
@required this.hasImage,
|
@required this.hasImage,
|
||||||
|
@ -17,7 +17,7 @@ class AdvancedGroupInfo extends Group implements LikeElement {
|
|||||||
int likes;
|
int likes;
|
||||||
bool userLike;
|
bool userLike;
|
||||||
List<Conversation> conversations;
|
List<Conversation> conversations;
|
||||||
bool isForezGroup;
|
bool/*!*/ isForezGroup;
|
||||||
|
|
||||||
AdvancedGroupInfo({
|
AdvancedGroupInfo({
|
||||||
@required int id,
|
@required int id,
|
||||||
|
@ -11,15 +11,15 @@ import 'package:meta/meta.dart';
|
|||||||
|
|
||||||
class AdvancedUserInfo extends User implements LikeElement {
|
class AdvancedUserInfo extends User implements LikeElement {
|
||||||
final String emailAddress;
|
final String emailAddress;
|
||||||
final String publicNote;
|
final String/*!*/ publicNote;
|
||||||
final bool canPostTexts;
|
final bool/*!*/ canPostTexts;
|
||||||
final bool isFriendsListPublic;
|
final bool/*!*/ isFriendsListPublic;
|
||||||
final int numberFriends;
|
final int/*!*/ numberFriends;
|
||||||
final int accountCreationTime;
|
final int/*!*/ accountCreationTime;
|
||||||
final String personalWebsite;
|
final String/*!*/ personalWebsite;
|
||||||
final String location;
|
final String location;
|
||||||
bool userLike;
|
bool/*!*/ userLike;
|
||||||
int likes;
|
int/*!*/ likes;
|
||||||
|
|
||||||
AdvancedUserInfo({
|
AdvancedUserInfo({
|
||||||
@required int id,
|
@required int id,
|
||||||
|
@ -25,8 +25,8 @@ class BytesFile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class APIRequest {
|
class APIRequest {
|
||||||
final String uri;
|
final String/*!*/ uri;
|
||||||
final bool needLogin;
|
final bool/*!*/ needLogin;
|
||||||
ProgressCallback progressCallback;
|
ProgressCallback progressCallback;
|
||||||
CancelToken cancelToken;
|
CancelToken cancelToken;
|
||||||
Map<String, String> args;
|
Map<String, String> args;
|
||||||
|
@ -5,7 +5,7 @@ import 'dart:convert';
|
|||||||
/// @author Pierre HUBERT
|
/// @author Pierre HUBERT
|
||||||
|
|
||||||
class APIResponse {
|
class APIResponse {
|
||||||
final int code;
|
final int/*!*/ code;
|
||||||
final String content;
|
final String content;
|
||||||
|
|
||||||
const APIResponse(this.code, this.content) : assert(code != null);
|
const APIResponse(this.code, this.content) : assert(code != null);
|
||||||
|
@ -5,9 +5,9 @@ import 'package:flutter/cupertino.dart';
|
|||||||
/// @author Pierre Hubert
|
/// @author Pierre Hubert
|
||||||
|
|
||||||
class ApplicationPreferences {
|
class ApplicationPreferences {
|
||||||
bool enableDarkMode;
|
bool/*!*/ enableDarkMode;
|
||||||
bool forceMobileMode;
|
bool/*!*/ forceMobileMode;
|
||||||
bool showPerformancesOverlay;
|
bool/*!*/ showPerformancesOverlay;
|
||||||
|
|
||||||
ApplicationPreferences({
|
ApplicationPreferences({
|
||||||
@required this.enableDarkMode,
|
@required this.enableDarkMode,
|
||||||
|
@ -5,8 +5,8 @@ import 'package:meta/meta.dart';
|
|||||||
/// @author Pierre HUBERT
|
/// @author Pierre HUBERT
|
||||||
|
|
||||||
class AuthenticationDetails {
|
class AuthenticationDetails {
|
||||||
final String email;
|
final String/*!*/ email;
|
||||||
final String password;
|
final String/*!*/ password;
|
||||||
|
|
||||||
const AuthenticationDetails({@required this.email, @required this.password})
|
const AuthenticationDetails({@required this.email, @required this.password})
|
||||||
: assert(email != null),
|
: assert(email != null),
|
||||||
|
@ -6,7 +6,7 @@ import 'package:meta/meta.dart';
|
|||||||
/// @author Pierre HUBERT
|
/// @author Pierre HUBERT
|
||||||
|
|
||||||
abstract class CacheModel {
|
abstract class CacheModel {
|
||||||
final int id;
|
final int/*!*/ id;
|
||||||
|
|
||||||
const CacheModel({@required this.id}) : assert(id != null);
|
const CacheModel({@required this.id}) : assert(id != null);
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ import 'package:flutter/material.dart';
|
|||||||
/// @author Pierre Hubert
|
/// @author Pierre Hubert
|
||||||
|
|
||||||
class CallConfig {
|
class CallConfig {
|
||||||
final List<String> iceServers;
|
final List<String>/*!*/ iceServers;
|
||||||
|
|
||||||
const CallConfig({
|
const CallConfig({
|
||||||
@required this.iceServers,
|
@required this.iceServers,
|
||||||
|
@ -8,8 +8,8 @@ import 'package:flutter_webrtc/flutter_webrtc.dart';
|
|||||||
enum MemberStatus { JOINED, READY }
|
enum MemberStatus { JOINED, READY }
|
||||||
|
|
||||||
class CallMember {
|
class CallMember {
|
||||||
final int userID;
|
final int/*!*/ userID;
|
||||||
MemberStatus status;
|
MemberStatus/*!*/ status;
|
||||||
MediaStream stream;
|
MediaStream stream;
|
||||||
|
|
||||||
CallMember({
|
CallMember({
|
||||||
|
@ -11,14 +11,14 @@ import 'package:meta/meta.dart';
|
|||||||
/// @author Pierre HUBERT
|
/// @author Pierre HUBERT
|
||||||
|
|
||||||
class Comment implements LikeElement {
|
class Comment implements LikeElement {
|
||||||
final int id;
|
final int/*!*/ id;
|
||||||
final int userID;
|
final int/*!*/ userID;
|
||||||
final int postID;
|
final int/*!*/ postID;
|
||||||
final int timeSent;
|
final int/*!*/ timeSent;
|
||||||
DisplayedString content;
|
DisplayedString/*!*/ content;
|
||||||
final String imageURL;
|
final String imageURL;
|
||||||
int likes;
|
int/*!*/ likes;
|
||||||
bool userLike;
|
bool/*!*/ userLike;
|
||||||
|
|
||||||
Comment({
|
Comment({
|
||||||
@required this.id,
|
@required this.id,
|
||||||
|
@ -55,7 +55,7 @@ class Config {
|
|||||||
assert(appName != null);
|
assert(appName != null);
|
||||||
|
|
||||||
/// Get and set static configuration
|
/// Get and set static configuration
|
||||||
static Config _config;
|
static Config/*?*/ _config;
|
||||||
|
|
||||||
static Config get() {
|
static Config get() {
|
||||||
return _config;
|
return _config;
|
||||||
@ -67,6 +67,6 @@ class Config {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Get the current configuration of the application
|
/// Get the current configuration of the application
|
||||||
Config config() {
|
Config/*!*/ config() {
|
||||||
return Config.get();
|
return Config.get();
|
||||||
}
|
}
|
||||||
|
@ -25,15 +25,15 @@ class Conversation extends SerializableElement<Conversation> {
|
|||||||
final bool isHavingCall;
|
final bool isHavingCall;
|
||||||
|
|
||||||
Conversation({
|
Conversation({
|
||||||
@required this.id,
|
/*required*/ @required this.id,
|
||||||
@required this.lastActivity,
|
/*required*/ @required this.lastActivity,
|
||||||
@required this.name,
|
@required this.name,
|
||||||
@required this.color,
|
@required this.color,
|
||||||
@required this.logoURL,
|
@required this.logoURL,
|
||||||
@required this.groupID,
|
@required this.groupID,
|
||||||
@required this.groupMinMembershipLevel,
|
@required this.groupMinMembershipLevel,
|
||||||
@required this.members,
|
/*required*/ @required this.members,
|
||||||
@required this.canEveryoneAddMembers,
|
/*required*/ @required this.canEveryoneAddMembers,
|
||||||
this.callCapabilities = CallCapabilities.NONE,
|
this.callCapabilities = CallCapabilities.NONE,
|
||||||
this.isHavingCall = false,
|
this.isHavingCall = false,
|
||||||
}) : assert(id != null),
|
}) : assert(id != null),
|
||||||
|
@ -5,18 +5,18 @@ import 'package:flutter/widgets.dart';
|
|||||||
/// @author Pierre Hubert
|
/// @author Pierre Hubert
|
||||||
|
|
||||||
class ConversationMember {
|
class ConversationMember {
|
||||||
final int userID;
|
final int/*!*/ userID;
|
||||||
final int lastMessageSeen;
|
final int/*!*/ lastMessageSeen;
|
||||||
final int lastAccessTime;
|
final int/*!*/ lastAccessTime;
|
||||||
final bool following;
|
final bool/*!*/ following;
|
||||||
final bool isAdmin;
|
final bool/*!*/ isAdmin;
|
||||||
|
|
||||||
const ConversationMember({
|
const ConversationMember({
|
||||||
@required this.userID,
|
/*required*/ @required this.userID,
|
||||||
@required this.lastMessageSeen,
|
/*required*/ @required this.lastMessageSeen,
|
||||||
@required this.lastAccessTime,
|
/*required*/ @required this.lastAccessTime,
|
||||||
@required this.following,
|
/*required*/ @required this.following,
|
||||||
@required this.isAdmin,
|
/*required*/ @required this.isAdmin,
|
||||||
}) : assert(userID != null),
|
}) : assert(userID != null),
|
||||||
assert(lastMessageSeen != null),
|
assert(lastMessageSeen != null),
|
||||||
assert(lastAccessTime != null),
|
assert(lastAccessTime != null),
|
||||||
|
@ -14,7 +14,7 @@ enum GroupMembershipLevel {
|
|||||||
VISITOR
|
VISITOR
|
||||||
}
|
}
|
||||||
|
|
||||||
String membershipToText(GroupMembershipLevel level) {
|
String/*!*/ membershipToText(GroupMembershipLevel level) {
|
||||||
switch (level) {
|
switch (level) {
|
||||||
case GroupMembershipLevel.ADMINISTRATOR:
|
case GroupMembershipLevel.ADMINISTRATOR:
|
||||||
return tr("Administrator");
|
return tr("Administrator");
|
||||||
|
@ -50,7 +50,7 @@ String tr(String string, {Map<String, String> args}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Get current lang, in format aa_BB
|
/// Get current lang, in format aa_BB
|
||||||
String get lang => _currLang != null ? _currLang : "en_US";
|
String/*!*/ get lang => _currLang != null ? _currLang : "en_US";
|
||||||
|
|
||||||
|
|
||||||
/// Get short lang format, in format aa
|
/// Get short lang format, in format aa
|
||||||
|
Loading…
Reference in New Issue
Block a user