replaced hardcoded chatpage size with expanded, alignment adjustments

This commit is contained in:
NicKoehler 2023-05-21 10:20:40 +02:00
parent 717a7e9e03
commit 9374188ea9
No known key found for this signature in database
GPG Key ID: 0EC502B679A11DD1
2 changed files with 36 additions and 31 deletions

View File

@ -48,7 +48,7 @@ class ChatPage extends StatelessWidget implements PageShape {
value: chatModel,
child: Container(
color: Theme.of(context).scaffoldBackgroundColor,
padding: EdgeInsets.all(20.0),
padding: EdgeInsets.only(top: 14.0, bottom: 14.0, left: 14.0),
child: Consumer<ChatModel>(
builder: (context, chatModel, child) {
final currentUser = chatModel.currentUser;

View File

@ -81,14 +81,7 @@ class _DesktopServerPageState extends State<DesktopServerPage>
border: Border.all(color: MyTheme.color(context).border!)),
child: Scaffold(
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(child: ConnectionManager()),
],
),
),
body: ConnectionManager(),
),
),
),
@ -171,10 +164,21 @@ class ConnectionManagerState extends State<ConnectionManager> {
children: [
Consumer<ChatModel>(
builder: (_, model, child) => model.isShowCMChatPage
? Container(
width: 400, child: Scaffold(body: ChatPage()))
: Offstage()),
Expanded(child: pageView),
? Expanded(
child: ChatPage(),
flex: (kConnectionManagerWindowSizeOpenChat.width -
kConnectionManagerWindowSizeClosedChat
.width)
.toInt(),
)
: Offstage(),
),
Expanded(
child: pageView,
flex: kConnectionManagerWindowSizeClosedChat.width
.toInt() -
4 // prevent stretch of the page view when chat is open,
),
],
),
),
@ -262,7 +266,8 @@ Widget buildConnectionCard(Client client) {
),
)
],
).paddingSymmetric(vertical: 8.0, horizontal: 8.0));
).paddingSymmetric(vertical: 4.0, horizontal: 8.0),
);
}
class _AppIcon extends StatelessWidget {