refactor: Add more stricter lints
This commit is contained in:
parent
c59031c44c
commit
5283d0fcc8
15 changed files with 66 additions and 60 deletions
|
|
@ -26,41 +26,41 @@ String commandExample(String command) {
|
|||
|
||||
String commandHint(L10n l10n, String command) {
|
||||
switch (command) {
|
||||
case "ban":
|
||||
case 'ban':
|
||||
return l10n.commandHint_ban;
|
||||
case "clearcache":
|
||||
case 'clearcache':
|
||||
return l10n.commandHint_clearcache;
|
||||
case "create":
|
||||
case 'create':
|
||||
return l10n.commandHint_create;
|
||||
case "discardsession":
|
||||
case 'discardsession':
|
||||
return l10n.commandHint_discardsession;
|
||||
case "dm":
|
||||
case 'dm':
|
||||
return l10n.commandHint_dm;
|
||||
case "html":
|
||||
case 'html':
|
||||
return l10n.commandHint_html;
|
||||
case "invite":
|
||||
case 'invite':
|
||||
return l10n.commandHint_invite;
|
||||
case "join":
|
||||
case 'join':
|
||||
return l10n.commandHint_join;
|
||||
case "kick":
|
||||
case 'kick':
|
||||
return l10n.commandHint_kick;
|
||||
case "leave":
|
||||
case 'leave':
|
||||
return l10n.commandHint_leave;
|
||||
case "me":
|
||||
case 'me':
|
||||
return l10n.commandHint_me;
|
||||
case "myroomavatar":
|
||||
case 'myroomavatar':
|
||||
return l10n.commandHint_myroomavatar;
|
||||
case "myroomnick":
|
||||
case 'myroomnick':
|
||||
return l10n.commandHint_myroomnick;
|
||||
case "op":
|
||||
case 'op':
|
||||
return l10n.commandHint_op;
|
||||
case "plain":
|
||||
case 'plain':
|
||||
return l10n.commandHint_plain;
|
||||
case "react":
|
||||
case 'react':
|
||||
return l10n.commandHint_react;
|
||||
case "send":
|
||||
case 'send':
|
||||
return l10n.commandHint_send;
|
||||
case "unban":
|
||||
case 'unban':
|
||||
return l10n.commandHint_unban;
|
||||
case 'markasdm':
|
||||
return l10n.commandHint_markasdm;
|
||||
|
|
@ -85,6 +85,6 @@ String commandHint(L10n l10n, String command) {
|
|||
case 'logoutall':
|
||||
return l10n.commandHint_logoutall;
|
||||
default:
|
||||
return "";
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -253,9 +253,8 @@ class HtmlMessage extends StatelessWidget {
|
|||
: checkboxCheckedEvents?.firstWhereOrNull(
|
||||
(event) => event.checkedCheckboxId == checkboxIndex,
|
||||
);
|
||||
final staticallyChecked = !isCheckbox
|
||||
? false
|
||||
: node.children.first.attributes['checked'] == 'true';
|
||||
final staticallyChecked =
|
||||
isCheckbox && node.children.first.attributes['checked'] == 'true';
|
||||
|
||||
return WidgetSpan(
|
||||
child: Padding(
|
||||
|
|
|
|||
|
|
@ -56,9 +56,9 @@ class ChatListItem extends StatelessWidget {
|
|||
return const SizedBox.shrink();
|
||||
}
|
||||
|
||||
final needLastEventSender = lastEvent == null
|
||||
? false
|
||||
: room.getState(EventTypes.RoomMember, lastEvent.senderId) == null;
|
||||
final needLastEventSender =
|
||||
lastEvent != null &&
|
||||
room.getState(EventTypes.RoomMember, lastEvent.senderId) == null;
|
||||
final space = this.space;
|
||||
|
||||
return Padding(
|
||||
|
|
|
|||
|
|
@ -55,9 +55,9 @@ class ChatSearchFilesTab extends StatelessWidget {
|
|||
'UNKNOWN');
|
||||
final sizeString = event.sizeString;
|
||||
final prevEvent = i > 0 ? events[i - 1] : null;
|
||||
final sameEnvironment = prevEvent == null
|
||||
? false
|
||||
: prevEvent.originServerTs.sameEnvironment(event.originServerTs);
|
||||
final sameEnvironment =
|
||||
prevEvent != null &&
|
||||
prevEvent.originServerTs.sameEnvironment(event.originServerTs);
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ class LoginController extends State<Login> {
|
|||
final data = <String, dynamic>{
|
||||
'new_password': password,
|
||||
'logout_devices': false,
|
||||
"auth": AuthenticationThreePidCreds(
|
||||
'auth': AuthenticationThreePidCreds(
|
||||
type: AuthenticationTypes.emailIdentity,
|
||||
threepidCreds: ThreepidCreds(
|
||||
sid: response.result!.sid,
|
||||
|
|
|
|||
|
|
@ -234,9 +234,9 @@ class EmotesSettingsController extends State<EmotesSettings> {
|
|||
?.tryGetMap<String, Object?>(stateKey ?? '') !=
|
||||
null;
|
||||
|
||||
bool get readonly => room == null
|
||||
? false
|
||||
: room?.canChangeStateEvent('im.ponies.room_emotes') == false;
|
||||
bool get readonly =>
|
||||
room != null &&
|
||||
room?.canChangeStateEvent('im.ponies.room_emotes') == false;
|
||||
|
||||
void resetAction() {
|
||||
setState(() {
|
||||
|
|
|
|||
|
|
@ -117,6 +117,6 @@ extension PushRuleKindLocal on PushRuleKind {
|
|||
|
||||
extension on String {
|
||||
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 =
|
||||
(PlatformInfos.isMobile || PlatformInfos.isWeb || PlatformInfos.isMacOS)
|
||||
? Uri.parse(redirectUrl).scheme
|
||||
: "http://localhost:3001";
|
||||
: 'http://localhost:3001';
|
||||
final result = await FlutterWebAuth2.authenticate(
|
||||
url: url.toString(),
|
||||
callbackUrlScheme: urlScheme,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue