refactor: Enable more strict lints
This commit is contained in:
parent
f797bce8d0
commit
28af7bb0c7
65 changed files with 170 additions and 146 deletions
|
|
@ -78,7 +78,7 @@ class ChatListController extends State<ChatList>
|
|||
String? _activeSpaceId;
|
||||
String? get activeSpaceId => _activeSpaceId;
|
||||
|
||||
void setActiveSpace(String spaceId) async {
|
||||
Future<void> setActiveSpace(String spaceId) async {
|
||||
await Matrix.of(context).client.getRoomById(spaceId)!.postLoad();
|
||||
|
||||
setState(() {
|
||||
|
|
@ -90,7 +90,7 @@ class ChatListController extends State<ChatList>
|
|||
_activeSpaceId = null;
|
||||
});
|
||||
|
||||
void onChatTap(Room room) async {
|
||||
Future<void> onChatTap(Room room) async {
|
||||
if (room.membership == Membership.invite) {
|
||||
final joinResult = await showFutureLoadingDialog(
|
||||
context: context,
|
||||
|
|
@ -156,7 +156,7 @@ class ChatListController extends State<ChatList>
|
|||
bool isSearching = false;
|
||||
static const String _serverStoreNamespace = 'im.fluffychat.search.server';
|
||||
|
||||
void setServer() async {
|
||||
Future<void> setServer() async {
|
||||
final newServer = await showTextInputDialog(
|
||||
useRootNavigator: false,
|
||||
title: L10n.of(context).changeTheHomeserver,
|
||||
|
|
@ -184,7 +184,7 @@ class ChatListController extends State<ChatList>
|
|||
final TextEditingController searchController = TextEditingController();
|
||||
final FocusNode searchFocusNode = FocusNode();
|
||||
|
||||
void _search() async {
|
||||
Future<void> _search() async {
|
||||
final client = Matrix.of(context).client;
|
||||
if (!isSearching) {
|
||||
setState(() {
|
||||
|
|
@ -292,7 +292,7 @@ class ChatListController extends State<ChatList>
|
|||
}
|
||||
}
|
||||
|
||||
void editSpace(BuildContext context, String spaceId) async {
|
||||
Future<void> editSpace(BuildContext context, String spaceId) async {
|
||||
await Matrix.of(context).client.getRoomById(spaceId)!.postLoad();
|
||||
if (mounted) {
|
||||
context.push('/rooms/$spaceId/details');
|
||||
|
|
@ -326,7 +326,7 @@ class ChatListController extends State<ChatList>
|
|||
);
|
||||
}
|
||||
|
||||
void _processIncomingUris(Uri? uri) async {
|
||||
Future<void> _processIncomingUris(Uri? uri) async {
|
||||
if (uri == null) return;
|
||||
context.go('/rooms');
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
|
|
@ -399,7 +399,7 @@ class ChatListController extends State<ChatList>
|
|||
super.dispose();
|
||||
}
|
||||
|
||||
void chatContextAction(
|
||||
Future<void> chatContextAction(
|
||||
Room room,
|
||||
BuildContext posContext, [
|
||||
Room? space,
|
||||
|
|
@ -671,7 +671,7 @@ class ChatListController extends State<ChatList>
|
|||
}
|
||||
}
|
||||
|
||||
void dismissStatusList() async {
|
||||
Future<void> dismissStatusList() async {
|
||||
final result = await showOkCancelAlertDialog(
|
||||
title: L10n.of(context).hidePresences,
|
||||
context: context,
|
||||
|
|
@ -682,7 +682,7 @@ class ChatListController extends State<ChatList>
|
|||
}
|
||||
}
|
||||
|
||||
void setStatus() async {
|
||||
Future<void> setStatus() async {
|
||||
final client = Matrix.of(context).client;
|
||||
final currentPresence = await client.fetchCurrentPresence(client.userID!);
|
||||
final input = await showTextInputDialog(
|
||||
|
|
@ -793,7 +793,10 @@ class ChatListController extends State<ChatList>
|
|||
});
|
||||
}
|
||||
|
||||
void editBundlesForAccount(String? userId, String? activeBundle) async {
|
||||
Future<void> editBundlesForAccount(
|
||||
String? userId,
|
||||
String? activeBundle,
|
||||
) async {
|
||||
final l10n = L10n.of(context);
|
||||
final client = Matrix.of(
|
||||
context,
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ class ClientChooserButton extends StatelessWidget {
|
|||
);
|
||||
}
|
||||
|
||||
void _clientSelected(Object object, BuildContext context) async {
|
||||
Future<void> _clientSelected(Object object, BuildContext context) async {
|
||||
if (object is Client) {
|
||||
controller.setActiveClient(object);
|
||||
} else if (object is String) {
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ class SearchTitle extends StatelessWidget {
|
|||
Expanded(
|
||||
child: Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: trailing!,
|
||||
child: trailing,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ class _SpaceViewState extends State<SpaceView> {
|
|||
super.initState();
|
||||
}
|
||||
|
||||
void _loadHierarchy() async {
|
||||
Future<void> _loadHierarchy() async {
|
||||
final matrix = Matrix.of(context);
|
||||
final room = matrix.client.getRoomById(widget.spaceId);
|
||||
if (room == null) return;
|
||||
|
|
@ -127,7 +127,7 @@ class _SpaceViewState extends State<SpaceView> {
|
|||
}
|
||||
}
|
||||
|
||||
void _joinChildRoom(SpaceRoomsChunk$2 item) async {
|
||||
Future<void> _joinChildRoom(SpaceRoomsChunk$2 item) async {
|
||||
final client = Matrix.of(context).client;
|
||||
final space = client.getRoomById(widget.spaceId);
|
||||
final via = space?.spaceChildren
|
||||
|
|
@ -146,7 +146,7 @@ class _SpaceViewState extends State<SpaceView> {
|
|||
if (room != null) widget.onChatTab(room);
|
||||
}
|
||||
|
||||
void _onSpaceAction(SpaceActions action) async {
|
||||
Future<void> _onSpaceAction(SpaceActions action) async {
|
||||
final space = Matrix.of(context).client.getRoomById(widget.spaceId);
|
||||
|
||||
switch (action) {
|
||||
|
|
@ -184,7 +184,7 @@ class _SpaceViewState extends State<SpaceView> {
|
|||
}
|
||||
}
|
||||
|
||||
void _addChatOrSubspace(AddRoomType roomType) async {
|
||||
Future<void> _addChatOrSubspace(AddRoomType roomType) async {
|
||||
final names = await showTextInputDialog(
|
||||
context: context,
|
||||
title: roomType == AddRoomType.subspace
|
||||
|
|
@ -261,7 +261,10 @@ class _SpaceViewState extends State<SpaceView> {
|
|||
_loadHierarchy();
|
||||
}
|
||||
|
||||
void _showSpaceChildEditMenu(BuildContext posContext, String roomId) async {
|
||||
Future<void> _showSpaceChildEditMenu(
|
||||
BuildContext posContext,
|
||||
String roomId,
|
||||
) async {
|
||||
final overlay =
|
||||
Overlay.of(posContext).context.findRenderObject() as RenderBox;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue