mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-27 23:09:35 +01:00
fix: Minor regressions
This commit is contained in:
parent
909f63dc0e
commit
93a6726aeb
@ -78,7 +78,7 @@ class _FluffyChatAppState extends State<FluffyChatApp> {
|
|||||||
builder: (theme, darkTheme) => LayoutBuilder(
|
builder: (theme, darkTheme) => LayoutBuilder(
|
||||||
builder: (context, constraints) {
|
builder: (context, constraints) {
|
||||||
var newColumns =
|
var newColumns =
|
||||||
(constraints.maxWidth / AppConfig.columnWidth).floor();
|
(constraints.maxWidth / FluffyThemes.columnWidth).floor();
|
||||||
if (newColumns > 3) newColumns = 3;
|
if (newColumns > 3) newColumns = 3;
|
||||||
columnMode ??= newColumns > 1;
|
columnMode ??= newColumns > 1;
|
||||||
_router ??= GlobalKey<VRouterState>();
|
_router ??= GlobalKey<VRouterState>();
|
||||||
|
@ -25,9 +25,7 @@ enum SelectMode { normal, share, select }
|
|||||||
enum PopupMenuAction { settings, invite, newGroup, setStatus, archive }
|
enum PopupMenuAction { settings, invite, newGroup, setStatus, archive }
|
||||||
|
|
||||||
class ChatList extends StatefulWidget {
|
class ChatList extends StatefulWidget {
|
||||||
final String activeChat;
|
const ChatList({Key key}) : super(key: key);
|
||||||
|
|
||||||
const ChatList({this.activeChat, Key key}) : super(key: key);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
ChatListController createState() => ChatListController();
|
ChatListController createState() => ChatListController();
|
||||||
@ -42,6 +40,8 @@ class ChatListController extends State<ChatList> {
|
|||||||
|
|
||||||
final selectedRoomIds = <String>{};
|
final selectedRoomIds = <String>{};
|
||||||
|
|
||||||
|
String get activeChat => VRouter.of(context).pathParameters['roomid'];
|
||||||
|
|
||||||
void _processIncomingSharedFiles(List<SharedMediaFile> files) {
|
void _processIncomingSharedFiles(List<SharedMediaFile> files) {
|
||||||
if (files?.isEmpty ?? true) return;
|
if (files?.isEmpty ?? true) return;
|
||||||
VRouter.of(context).push('/rooms');
|
VRouter.of(context).push('/rooms');
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import 'package:famedlysdk/famedlysdk.dart';
|
import 'package:famedlysdk/famedlysdk.dart';
|
||||||
|
import 'package:fluffychat/config/themes.dart';
|
||||||
import 'package:fluffychat/pages/chat_list.dart';
|
import 'package:fluffychat/pages/chat_list.dart';
|
||||||
import 'package:fluffychat/widgets/connection_status_header.dart';
|
import 'package:fluffychat/widgets/connection_status_header.dart';
|
||||||
import 'package:fluffychat/widgets/list_items/chat_list_item.dart';
|
import 'package:fluffychat/widgets/list_items/chat_list_item.dart';
|
||||||
@ -27,10 +28,10 @@ class ChatListView extends StatelessWidget {
|
|||||||
: SelectMode.select;
|
: SelectMode.select;
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
elevation:
|
elevation: MediaQuery.of(context).size.width >
|
||||||
MediaQuery.of(context).size.width > AppConfig.columnWidth * 2
|
FluffyThemes.columnWidth * 2
|
||||||
? 1
|
? 1
|
||||||
: null,
|
: null,
|
||||||
leading: selectMode == SelectMode.normal
|
leading: selectMode == SelectMode.normal
|
||||||
? null
|
? null
|
||||||
: IconButton(
|
: IconButton(
|
||||||
@ -210,7 +211,7 @@ class ChatListView extends StatelessWidget {
|
|||||||
onLongPress: () =>
|
onLongPress: () =>
|
||||||
controller.toggleSelection(rooms[i].id),
|
controller.toggleSelection(rooms[i].id),
|
||||||
activeChat:
|
activeChat:
|
||||||
controller.widget.activeChat == rooms[i].id,
|
controller.activeChat == rooms[i].id,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
@ -65,6 +65,7 @@ class ChatView extends StatelessWidget {
|
|||||||
tooltip: L10n.of(context).close,
|
tooltip: L10n.of(context).close,
|
||||||
)
|
)
|
||||||
: UnreadBadgeBackButton(roomId: controller.roomId),
|
: UnreadBadgeBackButton(roomId: controller.roomId),
|
||||||
|
titleSpacing: 0,
|
||||||
title: controller.selectedEvents.isEmpty
|
title: controller.selectedEvents.isEmpty
|
||||||
? StreamBuilder(
|
? StreamBuilder(
|
||||||
stream: controller.room.onUpdate.stream,
|
stream: controller.room.onUpdate.stream,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import 'package:fluffychat/config/app_config.dart';
|
import 'package:fluffychat/config/themes.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:vrouter/vrouter.dart';
|
import 'package:vrouter/vrouter.dart';
|
||||||
|
|
||||||
@ -15,7 +15,7 @@ class SideViewLayout extends StatelessWidget {
|
|||||||
final hideSideView = currentUrl.split('/').length == 4;
|
final hideSideView = currentUrl.split('/').length == 4;
|
||||||
return sideView == null
|
return sideView == null
|
||||||
? mainView
|
? mainView
|
||||||
: MediaQuery.of(context).size.width < AppConfig.columnWidth * 3 &&
|
: MediaQuery.of(context).size.width < FluffyThemes.columnWidth * 3 &&
|
||||||
!hideSideView
|
!hideSideView
|
||||||
? sideView
|
? sideView
|
||||||
: Row(
|
: Row(
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import 'package:fluffychat/config/app_config.dart';
|
import 'package:fluffychat/config/themes.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class TwoColumnLayout extends StatelessWidget {
|
class TwoColumnLayout extends StatelessWidget {
|
||||||
@ -10,7 +10,7 @@ class TwoColumnLayout extends StatelessWidget {
|
|||||||
: super(key: key);
|
: super(key: key);
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (MediaQuery.of(context).size.width <= AppConfig.columnWidth * 2) {
|
if (MediaQuery.of(context).size.width <= FluffyThemes.columnWidth * 2) {
|
||||||
return mainView;
|
return mainView;
|
||||||
}
|
}
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
|
Loading…
Reference in New Issue
Block a user