Merge pull request #2597 from krille-chan/krille/stricter-linting-rules
refactor: Add more stricter lints
This commit is contained in:
commit
84993dec59
27 changed files with 85 additions and 92 deletions
|
|
@ -2,7 +2,6 @@ include: package:flutter_lints/flutter.yaml
|
||||||
|
|
||||||
linter:
|
linter:
|
||||||
rules:
|
rules:
|
||||||
- camel_case_types
|
|
||||||
- avoid_print
|
- avoid_print
|
||||||
- constant_identifier_names
|
- constant_identifier_names
|
||||||
- prefer_final_locals
|
- prefer_final_locals
|
||||||
|
|
@ -10,6 +9,16 @@ linter:
|
||||||
- sort_pub_dependencies
|
- sort_pub_dependencies
|
||||||
- require_trailing_commas
|
- require_trailing_commas
|
||||||
- omit_local_variable_types
|
- omit_local_variable_types
|
||||||
|
- cancel_subscriptions
|
||||||
|
- always_declare_return_types
|
||||||
|
- no_adjacent_strings_in_list
|
||||||
|
- test_types_in_equals
|
||||||
|
- throw_in_finally
|
||||||
|
- unnecessary_statements
|
||||||
|
- avoid_bool_literals_in_conditional_expressions
|
||||||
|
- prefer_single_quotes
|
||||||
|
- prefer_const_declarations
|
||||||
|
- unnecessary_lambdas
|
||||||
|
|
||||||
analyzer:
|
analyzer:
|
||||||
plugins:
|
plugins:
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// ignore: constant_identifier_names
|
// ignore: constant_identifier_names
|
||||||
const String ISRG_X1 = """-----BEGIN CERTIFICATE-----
|
const String ISRG_X1 = '''-----BEGIN CERTIFICATE-----
|
||||||
MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAw
|
MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAw
|
||||||
TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh
|
TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh
|
||||||
cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMTUwNjA0MTEwNDM4
|
cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMTUwNjA0MTEwNDM4
|
||||||
|
|
@ -29,4 +29,4 @@ oyi3B43njTOQ5yOf+1CceWxG1bQVs5ZufpsMljq4Ui0/1lvh+wjChP4kqKOJ2qxq
|
||||||
4RgqsahDYVvTH9w7jXbyLeiNdd8XM2w9U/t7y0Ff/9yi0GE44Za4rF2LN9d11TPA
|
4RgqsahDYVvTH9w7jXbyLeiNdd8XM2w9U/t7y0Ff/9yi0GE44Za4rF2LN9d11TPA
|
||||||
mRGunUHBcnWEvgJBQl9nJEiU0Zsnvgc/ubhPgXRR4Xq37Z0j4r7g1SgEEzwxA57d
|
mRGunUHBcnWEvgJBQl9nJEiU0Zsnvgc/ubhPgXRR4Xq37Z0j4r7g1SgEEzwxA57d
|
||||||
emyPxgcYxn/eR44/KJ4EBs+lVDR3veyJm+kXQ99b21/+jh5Xos1AnX5iItreGCc=
|
emyPxgcYxn/eR44/KJ4EBs+lVDR3veyJm+kXQ99b21/+jh5Xos1AnX5iItreGCc=
|
||||||
-----END CERTIFICATE-----""";
|
-----END CERTIFICATE-----''';
|
||||||
|
|
|
||||||
|
|
@ -155,8 +155,7 @@ class ChatEventList extends StatelessWidget {
|
||||||
highlightMarker:
|
highlightMarker:
|
||||||
controller.scrollToEventIdMarker == event.eventId,
|
controller.scrollToEventIdMarker == event.eventId,
|
||||||
onSelect: controller.onSelectMessage,
|
onSelect: controller.onSelectMessage,
|
||||||
scrollToEventId: (String eventId) =>
|
scrollToEventId: controller.scrollToEventId,
|
||||||
controller.scrollToEventId(eventId),
|
|
||||||
longPressSelect: controller.selectedEvents.isNotEmpty,
|
longPressSelect: controller.selectedEvents.isNotEmpty,
|
||||||
selected: controller.selectedEvents.any(
|
selected: controller.selectedEvents.any(
|
||||||
(e) => e.eventId == event.eventId,
|
(e) => e.eventId == event.eventId,
|
||||||
|
|
@ -164,7 +163,7 @@ class ChatEventList extends StatelessWidget {
|
||||||
singleSelected:
|
singleSelected:
|
||||||
controller.selectedEvents.singleOrNull?.eventId ==
|
controller.selectedEvents.singleOrNull?.eventId ==
|
||||||
event.eventId,
|
event.eventId,
|
||||||
onEdit: () => controller.editSelectedEventAction(),
|
onEdit: controller.editSelectedEventAction,
|
||||||
timeline: timeline,
|
timeline: timeline,
|
||||||
displayReadMarker:
|
displayReadMarker:
|
||||||
i > 0 && controller.readMarkerEventId == event.eventId,
|
i > 0 && controller.readMarkerEventId == event.eventId,
|
||||||
|
|
|
||||||
|
|
@ -26,41 +26,41 @@ String commandExample(String command) {
|
||||||
|
|
||||||
String commandHint(L10n l10n, String command) {
|
String commandHint(L10n l10n, String command) {
|
||||||
switch (command) {
|
switch (command) {
|
||||||
case "ban":
|
case 'ban':
|
||||||
return l10n.commandHint_ban;
|
return l10n.commandHint_ban;
|
||||||
case "clearcache":
|
case 'clearcache':
|
||||||
return l10n.commandHint_clearcache;
|
return l10n.commandHint_clearcache;
|
||||||
case "create":
|
case 'create':
|
||||||
return l10n.commandHint_create;
|
return l10n.commandHint_create;
|
||||||
case "discardsession":
|
case 'discardsession':
|
||||||
return l10n.commandHint_discardsession;
|
return l10n.commandHint_discardsession;
|
||||||
case "dm":
|
case 'dm':
|
||||||
return l10n.commandHint_dm;
|
return l10n.commandHint_dm;
|
||||||
case "html":
|
case 'html':
|
||||||
return l10n.commandHint_html;
|
return l10n.commandHint_html;
|
||||||
case "invite":
|
case 'invite':
|
||||||
return l10n.commandHint_invite;
|
return l10n.commandHint_invite;
|
||||||
case "join":
|
case 'join':
|
||||||
return l10n.commandHint_join;
|
return l10n.commandHint_join;
|
||||||
case "kick":
|
case 'kick':
|
||||||
return l10n.commandHint_kick;
|
return l10n.commandHint_kick;
|
||||||
case "leave":
|
case 'leave':
|
||||||
return l10n.commandHint_leave;
|
return l10n.commandHint_leave;
|
||||||
case "me":
|
case 'me':
|
||||||
return l10n.commandHint_me;
|
return l10n.commandHint_me;
|
||||||
case "myroomavatar":
|
case 'myroomavatar':
|
||||||
return l10n.commandHint_myroomavatar;
|
return l10n.commandHint_myroomavatar;
|
||||||
case "myroomnick":
|
case 'myroomnick':
|
||||||
return l10n.commandHint_myroomnick;
|
return l10n.commandHint_myroomnick;
|
||||||
case "op":
|
case 'op':
|
||||||
return l10n.commandHint_op;
|
return l10n.commandHint_op;
|
||||||
case "plain":
|
case 'plain':
|
||||||
return l10n.commandHint_plain;
|
return l10n.commandHint_plain;
|
||||||
case "react":
|
case 'react':
|
||||||
return l10n.commandHint_react;
|
return l10n.commandHint_react;
|
||||||
case "send":
|
case 'send':
|
||||||
return l10n.commandHint_send;
|
return l10n.commandHint_send;
|
||||||
case "unban":
|
case 'unban':
|
||||||
return l10n.commandHint_unban;
|
return l10n.commandHint_unban;
|
||||||
case 'markasdm':
|
case 'markasdm':
|
||||||
return l10n.commandHint_markasdm;
|
return l10n.commandHint_markasdm;
|
||||||
|
|
@ -85,6 +85,6 @@ String commandHint(L10n l10n, String command) {
|
||||||
case 'logoutall':
|
case 'logoutall':
|
||||||
return l10n.commandHint_logoutall;
|
return l10n.commandHint_logoutall;
|
||||||
default:
|
default:
|
||||||
return "";
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -253,9 +253,8 @@ class HtmlMessage extends StatelessWidget {
|
||||||
: checkboxCheckedEvents?.firstWhereOrNull(
|
: checkboxCheckedEvents?.firstWhereOrNull(
|
||||||
(event) => event.checkedCheckboxId == checkboxIndex,
|
(event) => event.checkedCheckboxId == checkboxIndex,
|
||||||
);
|
);
|
||||||
final staticallyChecked = !isCheckbox
|
final staticallyChecked =
|
||||||
? false
|
isCheckbox && node.children.first.attributes['checked'] == 'true';
|
||||||
: node.children.first.attributes['checked'] == 'true';
|
|
||||||
|
|
||||||
return WidgetSpan(
|
return WidgetSpan(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
|
|
|
||||||
|
|
@ -207,7 +207,7 @@ class MessageContent extends StatelessWidget {
|
||||||
.split(';')
|
.split(';')
|
||||||
.first
|
.first
|
||||||
.split(',')
|
.split(',')
|
||||||
.map((s) => double.tryParse(s))
|
.map(double.tryParse)
|
||||||
.toList();
|
.toList();
|
||||||
if (latlong.length == 2 &&
|
if (latlong.length == 2 &&
|
||||||
latlong.first != null &&
|
latlong.first != null &&
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ class MessageReactions extends StatelessWidget {
|
||||||
if (evt != null) {
|
if (evt != null) {
|
||||||
showFutureLoadingDialog(
|
showFutureLoadingDialog(
|
||||||
context: context,
|
context: context,
|
||||||
future: () => evt.redactEvent(),
|
future: evt.redactEvent,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ class PollWidget extends StatelessWidget {
|
||||||
});
|
});
|
||||||
|
|
||||||
void _endPoll(BuildContext context) =>
|
void _endPoll(BuildContext context) =>
|
||||||
showFutureLoadingDialog(context: context, future: () => event.endPoll());
|
showFutureLoadingDialog(context: context, future: event.endPoll);
|
||||||
|
|
||||||
void _toggleVote(BuildContext context, String answerId, int maxSelection) {
|
void _toggleVote(BuildContext context, String answerId, int maxSelection) {
|
||||||
final userId = event.room.client.userID!;
|
final userId = event.room.client.userID!;
|
||||||
|
|
|
||||||
|
|
@ -145,9 +145,7 @@ class RecordingViewModelState extends State<RecordingViewModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
void cancel() {
|
void cancel() {
|
||||||
setState(() {
|
setState(_reset);
|
||||||
_reset();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void pause() {
|
void pause() {
|
||||||
|
|
|
||||||
|
|
@ -181,9 +181,7 @@ class ChatAccessSettingsPageView extends StatelessWidget {
|
||||||
return const SizedBox.shrink();
|
return const SizedBox.shrink();
|
||||||
}
|
}
|
||||||
localAddresses.remove(room.canonicalAlias);
|
localAddresses.remove(room.canonicalAlias);
|
||||||
localAddresses.removeWhere(
|
localAddresses.removeWhere(altAliases.contains);
|
||||||
(alias) => altAliases.contains(alias),
|
|
||||||
);
|
|
||||||
return Column(
|
return Column(
|
||||||
mainAxisSize: .min,
|
mainAxisSize: .min,
|
||||||
children: localAddresses
|
children: localAddresses
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ class ChatListViewBody extends StatelessWidget {
|
||||||
key: ValueKey(activeSpace),
|
key: ValueKey(activeSpace),
|
||||||
spaceId: activeSpace,
|
spaceId: activeSpace,
|
||||||
onBack: controller.clearActiveSpace,
|
onBack: controller.clearActiveSpace,
|
||||||
onChatTab: (room) => controller.onChatTap(room),
|
onChatTab: controller.onChatTap,
|
||||||
activeChat: controller.activeChat,
|
activeChat: controller.activeChat,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -123,7 +123,7 @@ class ChatListViewBody extends StatelessWidget {
|
||||||
if (!controller.isSearchMode &&
|
if (!controller.isSearchMode &&
|
||||||
AppSettings.showPresences.value)
|
AppSettings.showPresences.value)
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onLongPress: () => controller.dismissStatusList(),
|
onLongPress: controller.dismissStatusList,
|
||||||
child: StatusMessageList(
|
child: StatusMessageList(
|
||||||
onStatusEdit: controller.setStatus,
|
onStatusEdit: controller.setStatus,
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -56,9 +56,9 @@ class ChatListItem extends StatelessWidget {
|
||||||
return const SizedBox.shrink();
|
return const SizedBox.shrink();
|
||||||
}
|
}
|
||||||
|
|
||||||
final needLastEventSender = lastEvent == null
|
final needLastEventSender =
|
||||||
? false
|
lastEvent != null &&
|
||||||
: room.getState(EventTypes.RoomMember, lastEvent.senderId) == null;
|
room.getState(EventTypes.RoomMember, lastEvent.senderId) == null;
|
||||||
final space = this.space;
|
final space = this.space;
|
||||||
|
|
||||||
return Padding(
|
return Padding(
|
||||||
|
|
|
||||||
|
|
@ -55,9 +55,9 @@ class ChatSearchFilesTab extends StatelessWidget {
|
||||||
'UNKNOWN');
|
'UNKNOWN');
|
||||||
final sizeString = event.sizeString;
|
final sizeString = event.sizeString;
|
||||||
final prevEvent = i > 0 ? events[i - 1] : null;
|
final prevEvent = i > 0 ? events[i - 1] : null;
|
||||||
final sameEnvironment = prevEvent == null
|
final sameEnvironment =
|
||||||
? false
|
prevEvent != null &&
|
||||||
: prevEvent.originServerTs.sameEnvironment(event.originServerTs);
|
prevEvent.originServerTs.sameEnvironment(event.originServerTs);
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
|
|
|
||||||
|
|
@ -194,9 +194,7 @@ class MyCallingPage extends State<Calling> {
|
||||||
call.onCallStateChanged.stream.listen(_handleCallState);
|
call.onCallStateChanged.stream.listen(_handleCallState);
|
||||||
call.onCallEventChanged.stream.listen((event) {
|
call.onCallEventChanged.stream.listen((event) {
|
||||||
if (event == CallStateChange.kFeedsChanged) {
|
if (event == CallStateChange.kFeedsChanged) {
|
||||||
setState(() {
|
setState(call.tryRemoveStopedStreams);
|
||||||
call.tryRemoveStopedStreams();
|
|
||||||
});
|
|
||||||
} else if (event == CallStateChange.kLocalHoldUnhold ||
|
} else if (event == CallStateChange.kLocalHoldUnhold ||
|
||||||
event == CallStateChange.kRemoteHoldUnhold) {
|
event == CallStateChange.kRemoteHoldUnhold) {
|
||||||
setState(() {});
|
setState(() {});
|
||||||
|
|
|
||||||
|
|
@ -207,7 +207,7 @@ class LoginController extends State<Login> {
|
||||||
final data = <String, dynamic>{
|
final data = <String, dynamic>{
|
||||||
'new_password': password,
|
'new_password': password,
|
||||||
'logout_devices': false,
|
'logout_devices': false,
|
||||||
"auth": AuthenticationThreePidCreds(
|
'auth': AuthenticationThreePidCreds(
|
||||||
type: AuthenticationTypes.emailIdentity,
|
type: AuthenticationTypes.emailIdentity,
|
||||||
threepidCreds: ThreepidCreds(
|
threepidCreds: ThreepidCreds(
|
||||||
sid: response.result!.sid,
|
sid: response.result!.sid,
|
||||||
|
|
|
||||||
|
|
@ -234,9 +234,9 @@ class EmotesSettingsController extends State<EmotesSettings> {
|
||||||
?.tryGetMap<String, Object?>(stateKey ?? '') !=
|
?.tryGetMap<String, Object?>(stateKey ?? '') !=
|
||||||
null;
|
null;
|
||||||
|
|
||||||
bool get readonly => room == null
|
bool get readonly =>
|
||||||
? false
|
room != null &&
|
||||||
: room?.canChangeStateEvent('im.ponies.room_emotes') == false;
|
room?.canChangeStateEvent('im.ponies.room_emotes') == false;
|
||||||
|
|
||||||
void resetAction() {
|
void resetAction() {
|
||||||
setState(() {
|
setState(() {
|
||||||
|
|
|
||||||
|
|
@ -117,6 +117,6 @@ extension PushRuleKindLocal on PushRuleKind {
|
||||||
|
|
||||||
extension on String {
|
extension on String {
|
||||||
String capitalize() {
|
String capitalize() {
|
||||||
return "${this[0].toUpperCase()}${substring(1).toLowerCase()}";
|
return '${this[0].toUpperCase()}${substring(1).toLowerCase()}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ Future<void> ssoLoginFlow(
|
||||||
final urlScheme =
|
final urlScheme =
|
||||||
(PlatformInfos.isMobile || PlatformInfos.isWeb || PlatformInfos.isMacOS)
|
(PlatformInfos.isMobile || PlatformInfos.isWeb || PlatformInfos.isMacOS)
|
||||||
? Uri.parse(redirectUrl).scheme
|
? Uri.parse(redirectUrl).scheme
|
||||||
: "http://localhost:3001";
|
: 'http://localhost:3001';
|
||||||
final result = await FlutterWebAuth2.authenticate(
|
final result = await FlutterWebAuth2.authenticate(
|
||||||
url: url.toString(),
|
url: url.toString(),
|
||||||
callbackUrlScheme: urlScheme,
|
callbackUrlScheme: urlScheme,
|
||||||
|
|
|
||||||
|
|
@ -231,7 +231,7 @@ class BackgroundPush {
|
||||||
currentPushers.first.data.format ==
|
currentPushers.first.data.format ==
|
||||||
AppSettings.pushNotificationsPusherFormat.value &&
|
AppSettings.pushNotificationsPusherFormat.value &&
|
||||||
mapEquals(currentPushers.single.data.additionalProperties, {
|
mapEquals(currentPushers.single.data.additionalProperties, {
|
||||||
"data_message": pusherDataMessageFormat,
|
'data_message': pusherDataMessageFormat,
|
||||||
})) {
|
})) {
|
||||||
Logs().i('[Push] Pusher already set');
|
Logs().i('[Push] Pusher already set');
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -269,7 +269,7 @@ class BackgroundPush {
|
||||||
data: PusherData(
|
data: PusherData(
|
||||||
url: Uri.parse(gatewayUrl!),
|
url: Uri.parse(gatewayUrl!),
|
||||||
format: AppSettings.pushNotificationsPusherFormat.value,
|
format: AppSettings.pushNotificationsPusherFormat.value,
|
||||||
additionalProperties: {"data_message": pusherDataMessageFormat},
|
additionalProperties: {'data_message': pusherDataMessageFormat},
|
||||||
),
|
),
|
||||||
kind: 'http',
|
kind: 'http',
|
||||||
),
|
),
|
||||||
|
|
@ -290,7 +290,7 @@ class BackgroundPush {
|
||||||
static bool _wentToRoomOnStartup = false;
|
static bool _wentToRoomOnStartup = false;
|
||||||
|
|
||||||
Future<void> setupPush() async {
|
Future<void> setupPush() async {
|
||||||
Logs().d("SetupPush");
|
Logs().d('SetupPush');
|
||||||
if (client.onLoginStateChanged.value != LoginState.loggedIn ||
|
if (client.onLoginStateChanged.value != LoginState.loggedIn ||
|
||||||
!PlatformInfos.isMobile ||
|
!PlatformInfos.isMobile ||
|
||||||
matrix == null) {
|
matrix == null) {
|
||||||
|
|
@ -371,7 +371,7 @@ class BackgroundPush {
|
||||||
Future<void> setupUp() async {
|
Future<void> setupUp() async {
|
||||||
await UnifiedPushUi(
|
await UnifiedPushUi(
|
||||||
context: matrix!.context,
|
context: matrix!.context,
|
||||||
instances: ["default"],
|
instances: ['default'],
|
||||||
unifiedPushFunctions: UPFunctions(),
|
unifiedPushFunctions: UPFunctions(),
|
||||||
showNoDistribDialog: false,
|
showNoDistribDialog: false,
|
||||||
onNoDistribDialogDismissed: () {}, // TODO: Implement me
|
onNoDistribDialogDismissed: () {}, // TODO: Implement me
|
||||||
|
|
|
||||||
|
|
@ -15,11 +15,11 @@ class ErrorReporter {
|
||||||
const ErrorReporter(this.context, [this.message]);
|
const ErrorReporter(this.context, [this.message]);
|
||||||
|
|
||||||
static const Set<String> ingoredTypes = {
|
static const Set<String> ingoredTypes = {
|
||||||
"IOException",
|
'IOException',
|
||||||
"ClientException",
|
'ClientException',
|
||||||
"SocketException",
|
'SocketException',
|
||||||
"TlsException",
|
'TlsException',
|
||||||
"HandshakeException",
|
'HandshakeException',
|
||||||
};
|
};
|
||||||
|
|
||||||
void onErrorCallback(Object error, [StackTrace? stackTrace]) {
|
void onErrorCallback(Object error, [StackTrace? stackTrace]) {
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,10 @@ import 'package:matrix/matrix.dart';
|
||||||
|
|
||||||
IconData _getIconFromName(String displayname) {
|
IconData _getIconFromName(String displayname) {
|
||||||
final name = displayname.toLowerCase();
|
final name = displayname.toLowerCase();
|
||||||
if ({'android'}.any((s) => name.contains(s))) {
|
if ({'android'}.any(name.contains)) {
|
||||||
return Icons.phone_android_outlined;
|
return Icons.phone_android_outlined;
|
||||||
}
|
}
|
||||||
if ({'ios', 'ipad', 'iphone', 'ipod'}.any((s) => name.contains(s))) {
|
if ({'ios', 'ipad', 'iphone', 'ipod'}.any(name.contains)) {
|
||||||
return Icons.phone_iphone_outlined;
|
return Icons.phone_iphone_outlined;
|
||||||
}
|
}
|
||||||
if ({
|
if ({
|
||||||
|
|
@ -19,16 +19,10 @@ IconData _getIconFromName(String displayname) {
|
||||||
'/_matrix',
|
'/_matrix',
|
||||||
'safari',
|
'safari',
|
||||||
'opera',
|
'opera',
|
||||||
}.any((s) => name.contains(s))) {
|
}.any(name.contains)) {
|
||||||
return Icons.web_outlined;
|
return Icons.web_outlined;
|
||||||
}
|
}
|
||||||
if ({
|
if ({'desktop', 'windows', 'macos', 'linux', 'ubuntu'}.any(name.contains)) {
|
||||||
'desktop',
|
|
||||||
'windows',
|
|
||||||
'macos',
|
|
||||||
'linux',
|
|
||||||
'ubuntu',
|
|
||||||
}.any((s) => name.contains(s))) {
|
|
||||||
return Icons.desktop_mac_outlined;
|
return Icons.desktop_mac_outlined;
|
||||||
}
|
}
|
||||||
return Icons.device_unknown_outlined;
|
return Icons.device_unknown_outlined;
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ extension StreamExtension on Stream {
|
||||||
};
|
};
|
||||||
final subscription = listen(
|
final subscription = listen(
|
||||||
(_) => onMessage?.call(),
|
(_) => onMessage?.call(),
|
||||||
onDone: () => controller.close(),
|
onDone: controller.close,
|
||||||
onError: (e, s) => controller.addError(e, s),
|
onError: (e, s) => controller.addError(e, s),
|
||||||
);
|
);
|
||||||
// add proper cleanup to the subscription and the controller, to not memory leak
|
// add proper cleanup to the subscription and the controller, to not memory leak
|
||||||
|
|
|
||||||
|
|
@ -105,9 +105,7 @@ extension UiaRequestManager on MatrixState {
|
||||||
|
|
||||||
launchUrl(url, mode: LaunchMode.inAppBrowserView);
|
launchUrl(url, mode: LaunchMode.inAppBrowserView);
|
||||||
final completer = Completer();
|
final completer = Completer();
|
||||||
final listener = AppLifecycleListener(
|
final listener = AppLifecycleListener(onResume: completer.complete);
|
||||||
onResume: () => completer.complete(),
|
|
||||||
);
|
|
||||||
await completer.future;
|
await completer.future;
|
||||||
listener.dispose();
|
listener.dispose();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ class UrlLauncher {
|
||||||
.split(';')
|
.split(';')
|
||||||
.first
|
.first
|
||||||
.split(',')
|
.split(',')
|
||||||
.map((s) => double.tryParse(s))
|
.map(double.tryParse)
|
||||||
.toList();
|
.toList();
|
||||||
if (latlong.length == 2 &&
|
if (latlong.length == 2 &&
|
||||||
latlong.first != null &&
|
latlong.first != null &&
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,7 @@ class VoipPlugin with WidgetsBindingObserver implements WebRTCDelegate {
|
||||||
FlutterForegroundTask.setOnLockScreenVisibility(false);
|
FlutterForegroundTask.setOnLockScreenVisibility(false);
|
||||||
FlutterForegroundTask.stopService();
|
FlutterForegroundTask.stopService();
|
||||||
final wasForeground = matrix.store.getString('wasForeground');
|
final wasForeground = matrix.store.getString('wasForeground');
|
||||||
wasForeground == 'false' ? FlutterForegroundTask.minimizeApp() : null;
|
if (wasForeground == 'false') FlutterForegroundTask.minimizeApp();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,7 @@ extension LocalNotificationsExtension on MatrixState {
|
||||||
var action = DesktopNotificationActions.values.singleWhereOrNull(
|
var action = DesktopNotificationActions.values.singleWhereOrNull(
|
||||||
(a) => a.name == actionStr,
|
(a) => a.name == actionStr,
|
||||||
);
|
);
|
||||||
if (action == null && actionStr == "default") {
|
if (action == null && actionStr == 'default') {
|
||||||
action = DesktopNotificationActions.openChat;
|
action = DesktopNotificationActions.openChat;
|
||||||
}
|
}
|
||||||
switch (action!) {
|
switch (action!) {
|
||||||
|
|
|
||||||
24
pubspec.lock
24
pubspec.lock
|
|
@ -165,10 +165,10 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: characters
|
name: characters
|
||||||
sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b
|
sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.4.1"
|
version: "1.4.0"
|
||||||
charcode:
|
charcode:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
@ -1112,18 +1112,18 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: matcher
|
name: matcher
|
||||||
sha256: "12956d0ad8390bbcc63ca2e1469c0619946ccb52809807067a7020d57e647aa6"
|
sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.12.18"
|
version: "0.12.17"
|
||||||
material_color_utilities:
|
material_color_utilities:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: material_color_utilities
|
name: material_color_utilities
|
||||||
sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b"
|
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.13.0"
|
version: "0.11.1"
|
||||||
matrix:
|
matrix:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|
@ -1869,26 +1869,26 @@ packages:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: test
|
name: test
|
||||||
sha256: "54c516bbb7cee2754d327ad4fca637f78abfc3cbcc5ace83b3eda117e42cd71a"
|
sha256: "75906bf273541b676716d1ca7627a17e4c4070a3a16272b7a3dc7da3b9f3f6b7"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.29.0"
|
version: "1.26.3"
|
||||||
test_api:
|
test_api:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: test_api
|
name: test_api
|
||||||
sha256: "93167629bfc610f71560ab9312acdda4959de4df6fac7492c89ff0d3886f6636"
|
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.7.9"
|
version: "0.7.7"
|
||||||
test_core:
|
test_core:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: test_core
|
name: test_core
|
||||||
sha256: "394f07d21f0f2255ec9e3989f21e54d3c7dc0e6e9dbce160e5a9c1a6be0e2943"
|
sha256: "0cc24b5ff94b38d2ae73e1eb43cc302b77964fbf67abad1e296025b78deb53d0"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.6.15"
|
version: "0.6.12"
|
||||||
timezone:
|
timezone:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue