Compare commits
2 Commits
5d79692766
...
cd5cfedb2f
Author | SHA1 | Date | |
---|---|---|---|
cd5cfedb2f | |||
28c0094837 |
@ -21,8 +21,9 @@ linter:
|
|||||||
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
|
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
|
||||||
# producing the lint.
|
# producing the lint.
|
||||||
rules:
|
rules:
|
||||||
# avoid_print: false # Uncomment to disable the `avoid_print` rule
|
lines_longer_than_80_chars: false
|
||||||
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
|
avoid_print: false # Uncomment to disable the `avoid_print` rule
|
||||||
|
prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
|
||||||
|
|
||||||
# Additional information about this file can be found at
|
# Additional information about this file can be found at
|
||||||
# https://dart.dev/guides/language/analysis-options
|
# https://dart.dev/guides/language/analysis-options
|
||||||
|
@ -16,6 +16,8 @@
|
|||||||
"confirmation": "Confirmation",
|
"confirmation": "Confirmation",
|
||||||
"confirmCancel": "Not sure",
|
"confirmCancel": "Not sure",
|
||||||
"confirmOkay": "OK",
|
"confirmOkay": "OK",
|
||||||
|
"email": "Email Address",
|
||||||
|
"nickname": "Nickname",
|
||||||
"username": "Username",
|
"username": "Username",
|
||||||
"password": "Password",
|
"password": "Password",
|
||||||
"next": "Next",
|
"next": "Next",
|
||||||
|
@ -16,6 +16,8 @@
|
|||||||
"confirmation": "确认",
|
"confirmation": "确认",
|
||||||
"confirmCancel": "不太确定",
|
"confirmCancel": "不太确定",
|
||||||
"confirmOkay": "确定",
|
"confirmOkay": "确定",
|
||||||
|
"email": "邮箱地址",
|
||||||
|
"nickname": "显示名",
|
||||||
"username": "用户名",
|
"username": "用户名",
|
||||||
"password": "密码",
|
"password": "密码",
|
||||||
"next": "下一步",
|
"next": "下一步",
|
||||||
|
@ -25,28 +25,29 @@ class Call {
|
|||||||
});
|
});
|
||||||
|
|
||||||
factory Call.fromJson(Map<String, dynamic> json) => Call(
|
factory Call.fromJson(Map<String, dynamic> json) => Call(
|
||||||
id: json["id"],
|
id: json["id"],
|
||||||
createdAt: DateTime.parse(json["created_at"]),
|
createdAt: DateTime.parse(json["created_at"]),
|
||||||
updatedAt: DateTime.parse(json["updated_at"]),
|
updatedAt: DateTime.parse(json["updated_at"]),
|
||||||
deletedAt: json["deleted_at"],
|
deletedAt: json["deleted_at"],
|
||||||
endedAt: json["ended_at"] != null ? DateTime.parse(json["ended_at"]) : null,
|
endedAt:
|
||||||
externalId: json["external_id"],
|
json["ended_at"] != null ? DateTime.parse(json["ended_at"]) : null,
|
||||||
founderId: json["founder_id"],
|
externalId: json["external_id"],
|
||||||
channelId: json["channel_id"],
|
founderId: json["founder_id"],
|
||||||
channel: Channel.fromJson(json["channel"]),
|
channelId: json["channel_id"],
|
||||||
);
|
channel: Channel.fromJson(json["channel"]),
|
||||||
|
);
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => {
|
Map<String, dynamic> toJson() => {
|
||||||
"id": id,
|
"id": id,
|
||||||
"created_at": createdAt.toIso8601String(),
|
"created_at": createdAt.toIso8601String(),
|
||||||
"updated_at": updatedAt.toIso8601String(),
|
"updated_at": updatedAt.toIso8601String(),
|
||||||
"deleted_at": deletedAt,
|
"deleted_at": deletedAt,
|
||||||
"ended_at": endedAt?.toIso8601String(),
|
"ended_at": endedAt?.toIso8601String(),
|
||||||
"external_id": externalId,
|
"external_id": externalId,
|
||||||
"founder_id": founderId,
|
"founder_id": founderId,
|
||||||
"channel_id": channelId,
|
"channel_id": channelId,
|
||||||
"channel": channel.toJson(),
|
"channel": channel.toJson(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
enum ParticipantStatsType {
|
enum ParticipantStatsType {
|
||||||
@ -60,9 +61,9 @@ enum ParticipantStatsType {
|
|||||||
class ParticipantTrack {
|
class ParticipantTrack {
|
||||||
ParticipantTrack(
|
ParticipantTrack(
|
||||||
{required this.participant,
|
{required this.participant,
|
||||||
required this.videoTrack,
|
required this.videoTrack,
|
||||||
required this.isScreenShare});
|
required this.isScreenShare});
|
||||||
VideoTrack? videoTrack;
|
VideoTrack? videoTrack;
|
||||||
Participant participant;
|
Participant participant;
|
||||||
bool isScreenShare;
|
bool isScreenShare;
|
||||||
}
|
}
|
||||||
|
@ -32,36 +32,36 @@ class Channel {
|
|||||||
});
|
});
|
||||||
|
|
||||||
factory Channel.fromJson(Map<String, dynamic> json) => Channel(
|
factory Channel.fromJson(Map<String, dynamic> json) => Channel(
|
||||||
id: json["id"],
|
id: json["id"],
|
||||||
createdAt: DateTime.parse(json["created_at"]),
|
createdAt: DateTime.parse(json["created_at"]),
|
||||||
updatedAt: DateTime.parse(json["updated_at"]),
|
updatedAt: DateTime.parse(json["updated_at"]),
|
||||||
deletedAt: json["deleted_at"],
|
deletedAt: json["deleted_at"],
|
||||||
alias: json["alias"],
|
alias: json["alias"],
|
||||||
name: json["name"],
|
name: json["name"],
|
||||||
description: json["description"],
|
description: json["description"],
|
||||||
members: json["members"],
|
members: json["members"],
|
||||||
calls: json["calls"],
|
calls: json["calls"],
|
||||||
type: json["type"],
|
type: json["type"],
|
||||||
account: Account.fromJson(json["account"]),
|
account: Account.fromJson(json["account"]),
|
||||||
accountId: json["account_id"],
|
accountId: json["account_id"],
|
||||||
realmId: json["realm_id"],
|
realmId: json["realm_id"],
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => {
|
Map<String, dynamic> toJson() => {
|
||||||
"id": id,
|
"id": id,
|
||||||
"created_at": createdAt.toIso8601String(),
|
"created_at": createdAt.toIso8601String(),
|
||||||
"updated_at": updatedAt.toIso8601String(),
|
"updated_at": updatedAt.toIso8601String(),
|
||||||
"deleted_at": deletedAt,
|
"deleted_at": deletedAt,
|
||||||
"alias": alias,
|
"alias": alias,
|
||||||
"name": name,
|
"name": name,
|
||||||
"description": description,
|
"description": description,
|
||||||
"members": members,
|
"members": members,
|
||||||
"calls": calls,
|
"calls": calls,
|
||||||
"type": type,
|
"type": type,
|
||||||
"account": account,
|
"account": account,
|
||||||
"account_id": accountId,
|
"account_id": accountId,
|
||||||
"realm_id": realmId,
|
"realm_id": realmId,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
class ChannelMember {
|
class ChannelMember {
|
||||||
@ -86,24 +86,24 @@ class ChannelMember {
|
|||||||
});
|
});
|
||||||
|
|
||||||
factory ChannelMember.fromJson(Map<String, dynamic> json) => ChannelMember(
|
factory ChannelMember.fromJson(Map<String, dynamic> json) => ChannelMember(
|
||||||
id: json["id"],
|
id: json["id"],
|
||||||
createdAt: DateTime.parse(json["created_at"]),
|
createdAt: DateTime.parse(json["created_at"]),
|
||||||
updatedAt: DateTime.parse(json["updated_at"]),
|
updatedAt: DateTime.parse(json["updated_at"]),
|
||||||
deletedAt: json["deleted_at"],
|
deletedAt: json["deleted_at"],
|
||||||
channelId: json["channel_id"],
|
channelId: json["channel_id"],
|
||||||
accountId: json["account_id"],
|
accountId: json["account_id"],
|
||||||
account: Account.fromJson(json["account"]),
|
account: Account.fromJson(json["account"]),
|
||||||
notify: json["notify"],
|
notify: json["notify"],
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => {
|
Map<String, dynamic> toJson() => {
|
||||||
"id": id,
|
"id": id,
|
||||||
"created_at": createdAt.toIso8601String(),
|
"created_at": createdAt.toIso8601String(),
|
||||||
"updated_at": updatedAt.toIso8601String(),
|
"updated_at": updatedAt.toIso8601String(),
|
||||||
"deleted_at": deletedAt,
|
"deleted_at": deletedAt,
|
||||||
"channel_id": channelId,
|
"channel_id": channelId,
|
||||||
"account_id": accountId,
|
"account_id": accountId,
|
||||||
"account": account.toJson(),
|
"account": account.toJson(),
|
||||||
"notify": notify,
|
"notify": notify,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -26,30 +26,30 @@ class Friendship {
|
|||||||
});
|
});
|
||||||
|
|
||||||
factory Friendship.fromJson(Map<String, dynamic> json) => Friendship(
|
factory Friendship.fromJson(Map<String, dynamic> json) => Friendship(
|
||||||
id: json["id"],
|
id: json["id"],
|
||||||
createdAt: DateTime.parse(json["created_at"]),
|
createdAt: DateTime.parse(json["created_at"]),
|
||||||
updatedAt: DateTime.parse(json["updated_at"]),
|
updatedAt: DateTime.parse(json["updated_at"]),
|
||||||
deletedAt: json["deleted_at"],
|
deletedAt: json["deleted_at"],
|
||||||
accountId: json["account_id"],
|
accountId: json["account_id"],
|
||||||
relatedId: json["related_id"],
|
relatedId: json["related_id"],
|
||||||
blockedBy: json["blocked_by"],
|
blockedBy: json["blocked_by"],
|
||||||
account: Account.fromJson(json["account"]),
|
account: Account.fromJson(json["account"]),
|
||||||
related: Account.fromJson(json["related"]),
|
related: Account.fromJson(json["related"]),
|
||||||
status: json["status"],
|
status: json["status"],
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => {
|
Map<String, dynamic> toJson() => {
|
||||||
"id": id,
|
"id": id,
|
||||||
"created_at": createdAt.toIso8601String(),
|
"created_at": createdAt.toIso8601String(),
|
||||||
"updated_at": updatedAt.toIso8601String(),
|
"updated_at": updatedAt.toIso8601String(),
|
||||||
"deleted_at": deletedAt,
|
"deleted_at": deletedAt,
|
||||||
"account_id": accountId,
|
"account_id": accountId,
|
||||||
"related_id": relatedId,
|
"related_id": relatedId,
|
||||||
"blocked_by": blockedBy,
|
"blocked_by": blockedBy,
|
||||||
"account": account.toJson(),
|
"account": account.toJson(),
|
||||||
"related": related.toJson(),
|
"related": related.toJson(),
|
||||||
"status": status,
|
"status": status,
|
||||||
};
|
};
|
||||||
|
|
||||||
Account getOtherside(int selfId) {
|
Account getOtherside(int selfId) {
|
||||||
if (accountId != selfId) {
|
if (accountId != selfId) {
|
||||||
@ -58,4 +58,4 @@ class Friendship {
|
|||||||
return related;
|
return related;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,11 +43,15 @@ class Message {
|
|||||||
content: json["content"],
|
content: json["content"],
|
||||||
metadata: json["metadata"],
|
metadata: json["metadata"],
|
||||||
type: json["type"],
|
type: json["type"],
|
||||||
attachments: List<Attachment>.from(json["attachments"]?.map((x) => Attachment.fromJson(x)) ?? List.empty()),
|
attachments: List<Attachment>.from(
|
||||||
|
json["attachments"]?.map((x) => Attachment.fromJson(x)) ??
|
||||||
|
List.empty()),
|
||||||
channel: Channel.fromJson(json["channel"]),
|
channel: Channel.fromJson(json["channel"]),
|
||||||
sender: Sender.fromJson(json["sender"]),
|
sender: Sender.fromJson(json["sender"]),
|
||||||
replyId: json["reply_id"],
|
replyId: json["reply_id"],
|
||||||
replyTo: json["reply_to"] != null ? Message.fromJson(json["reply_to"]) : null,
|
replyTo: json["reply_to"] != null
|
||||||
|
? Message.fromJson(json["reply_to"])
|
||||||
|
: null,
|
||||||
channelId: json["channel_id"],
|
channelId: json["channel_id"],
|
||||||
senderId: json["sender_id"],
|
senderId: json["sender_id"],
|
||||||
);
|
);
|
||||||
@ -60,7 +64,8 @@ class Message {
|
|||||||
"content": content,
|
"content": content,
|
||||||
"metadata": metadata,
|
"metadata": metadata,
|
||||||
"type": type,
|
"type": type,
|
||||||
"attachments": List<dynamic>.from(attachments?.map((x) => x.toJson()) ?? List.empty()),
|
"attachments": List<dynamic>.from(
|
||||||
|
attachments?.map((x) => x.toJson()) ?? List.empty()),
|
||||||
"channel": channel?.toJson(),
|
"channel": channel?.toJson(),
|
||||||
"sender": sender.toJson(),
|
"sender": sender.toJson(),
|
||||||
"reply_id": replyId,
|
"reply_id": replyId,
|
||||||
|
@ -34,7 +34,9 @@ class Notification {
|
|||||||
deletedAt: json["deleted_at"],
|
deletedAt: json["deleted_at"],
|
||||||
subject: json["subject"],
|
subject: json["subject"],
|
||||||
content: json["content"],
|
content: json["content"],
|
||||||
links: json["links"] != null ? List<Link>.from(json["links"].map((x) => Link.fromJson(x))) : List.empty(),
|
links: json["links"] != null
|
||||||
|
? List<Link>.from(json["links"].map((x) => Link.fromJson(x)))
|
||||||
|
: List.empty(),
|
||||||
isImportant: json["is_important"],
|
isImportant: json["is_important"],
|
||||||
isRealtime: json["is_realtime"],
|
isRealtime: json["is_realtime"],
|
||||||
readAt: json["read_at"],
|
readAt: json["read_at"],
|
||||||
@ -49,7 +51,9 @@ class Notification {
|
|||||||
"deleted_at": deletedAt,
|
"deleted_at": deletedAt,
|
||||||
"subject": subject,
|
"subject": subject,
|
||||||
"content": content,
|
"content": content,
|
||||||
"links": links != null ? List<dynamic>.from(links!.map((x) => x.toJson())) : List.empty(),
|
"links": links != null
|
||||||
|
? List<dynamic>.from(links!.map((x) => x.toJson()))
|
||||||
|
: List.empty(),
|
||||||
"is_important": isImportant,
|
"is_important": isImportant,
|
||||||
"is_realtime": isRealtime,
|
"is_realtime": isRealtime,
|
||||||
"read_at": readAt,
|
"read_at": readAt,
|
||||||
|
@ -10,14 +10,14 @@ class NetworkPackage {
|
|||||||
});
|
});
|
||||||
|
|
||||||
factory NetworkPackage.fromJson(Map<String, dynamic> json) => NetworkPackage(
|
factory NetworkPackage.fromJson(Map<String, dynamic> json) => NetworkPackage(
|
||||||
method: json["w"],
|
method: json["w"],
|
||||||
message: json["m"],
|
message: json["m"],
|
||||||
payload: json["p"],
|
payload: json["p"],
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => {
|
Map<String, dynamic> toJson() => {
|
||||||
"w": method,
|
"w": method,
|
||||||
"m": message,
|
"m": message,
|
||||||
"p": payload,
|
"p": payload,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,8 @@ import 'package:solian/utils/service_url.dart';
|
|||||||
class AuthProvider extends ChangeNotifier {
|
class AuthProvider extends ChangeNotifier {
|
||||||
AuthProvider();
|
AuthProvider();
|
||||||
|
|
||||||
final deviceEndpoint = getRequestUri('passport', '/api/notifications/subscribe');
|
final deviceEndpoint =
|
||||||
|
getRequestUri('passport', '/api/notifications/subscribe');
|
||||||
final tokenEndpoint = getRequestUri('passport', '/api/auth/token');
|
final tokenEndpoint = getRequestUri('passport', '/api/auth/token');
|
||||||
final userinfoEndpoint = getRequestUri('passport', '/api/users/me');
|
final userinfoEndpoint = getRequestUri('passport', '/api/users/me');
|
||||||
final redirectUrl = Uri.parse('solian://auth');
|
final redirectUrl = Uri.parse('solian://auth');
|
||||||
@ -26,11 +27,13 @@ class AuthProvider extends ChangeNotifier {
|
|||||||
|
|
||||||
DateTime? lastRefreshedAt;
|
DateTime? lastRefreshedAt;
|
||||||
|
|
||||||
Future<bool> pickClient() async {
|
Future<bool> loadClient() async {
|
||||||
if (await storage.containsKey(key: storageKey)) {
|
if (await storage.containsKey(key: storageKey)) {
|
||||||
try {
|
try {
|
||||||
final credentials = oauth2.Credentials.fromJson((await storage.read(key: storageKey))!);
|
final credentials =
|
||||||
client = oauth2.Client(credentials, identifier: clientId, secret: clientSecret);
|
oauth2.Credentials.fromJson((await storage.read(key: storageKey))!);
|
||||||
|
client = oauth2.Client(credentials,
|
||||||
|
identifier: clientId, secret: clientSecret);
|
||||||
await fetchProfiles();
|
await fetchProfiles();
|
||||||
return true;
|
return |