dart format
This commit is contained in:
+29
-10
@@ -38,7 +38,11 @@ class AppRoutes {
|
||||
pushScreen(context, withNavBar: false, screen: Files(path: path));
|
||||
}
|
||||
|
||||
static void openFileViewer(BuildContext context, String localPath, {bool openExternal = false}) {
|
||||
static void openFileViewer(
|
||||
BuildContext context,
|
||||
String localPath, {
|
||||
bool openExternal = false,
|
||||
}) {
|
||||
pushScreen(
|
||||
context,
|
||||
withNavBar: false,
|
||||
@@ -50,7 +54,11 @@ class AppRoutes {
|
||||
pushScreen(context, withNavBar: false, screen: const CustomEventsView());
|
||||
}
|
||||
|
||||
static void openMarianumMessage(BuildContext context, String basePath, MarianumMessage message) {
|
||||
static void openMarianumMessage(
|
||||
BuildContext context,
|
||||
String basePath,
|
||||
MarianumMessage message,
|
||||
) {
|
||||
pushScreen(
|
||||
context,
|
||||
withNavBar: false,
|
||||
@@ -82,7 +90,11 @@ class AppRoutes {
|
||||
pushScreen(context, withNavBar: false, screen: const Roomplan());
|
||||
}
|
||||
|
||||
static void openMessageReactions(BuildContext context, String token, int messageId) {
|
||||
static void openMessageReactions(
|
||||
BuildContext context,
|
||||
String token,
|
||||
int messageId,
|
||||
) {
|
||||
pushScreen(
|
||||
context,
|
||||
withNavBar: false,
|
||||
@@ -113,7 +125,9 @@ class AppRoutes {
|
||||
try {
|
||||
context.read<ChatListBloc>().refresh();
|
||||
} catch (e) {
|
||||
if (kDebugMode) debugPrint('openChatByToken: ChatListBloc refresh failed: $e');
|
||||
if (kDebugMode) {
|
||||
debugPrint('openChatByToken: ChatListBloc refresh failed: $e');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,7 +144,10 @@ class AppRoutes {
|
||||
if (room == null) return null;
|
||||
|
||||
final isGroup = room.type != GetRoomResponseObjectConversationType.oneToOne;
|
||||
final avatar = UserAvatar(id: isGroup ? room.token : room.name, isGroup: isGroup);
|
||||
final avatar = UserAvatar(
|
||||
id: isGroup ? room.token : room.name,
|
||||
isGroup: isGroup,
|
||||
);
|
||||
return ResolvedPendingChat(
|
||||
room: room,
|
||||
selfId: AccountData().getUsername(),
|
||||
@@ -138,7 +155,10 @@ class AppRoutes {
|
||||
);
|
||||
}
|
||||
|
||||
static GetRoomResponseObject? _findRoomByToken(GetRoomResponse? rooms, String token) {
|
||||
static GetRoomResponseObject? _findRoomByToken(
|
||||
GetRoomResponse? rooms,
|
||||
String token,
|
||||
) {
|
||||
if (rooms == null) return null;
|
||||
for (final room in rooms.data) {
|
||||
if (room.token == token) return room;
|
||||
@@ -155,10 +175,9 @@ class AppRoutes {
|
||||
/// Switches the bottom navigation to [module]. Returns false when the
|
||||
/// module is not currently in the bottom bar.
|
||||
static bool goToTab(BuildContext context, Modules module) {
|
||||
final index = AppModule.getBottomBarModules(context)
|
||||
.map((e) => e.module)
|
||||
.toList()
|
||||
.indexOf(module);
|
||||
final index = AppModule.getBottomBarModules(
|
||||
context,
|
||||
).map((e) => e.module).toList().indexOf(module);
|
||||
if (index == -1) return false;
|
||||
Main.bottomNavigator.jumpToTab(index);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user