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, value: chatModel,
child: Container( child: Container(
color: Theme.of(context).scaffoldBackgroundColor, 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>( child: Consumer<ChatModel>(
builder: (context, chatModel, child) { builder: (context, chatModel, child) {
final currentUser = chatModel.currentUser; final currentUser = chatModel.currentUser;

View File

@ -81,14 +81,7 @@ class _DesktopServerPageState extends State<DesktopServerPage>
border: Border.all(color: MyTheme.color(context).border!)), border: Border.all(color: MyTheme.color(context).border!)),
child: Scaffold( child: Scaffold(
backgroundColor: Theme.of(context).scaffoldBackgroundColor, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: Center( body: ConnectionManager(),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(child: ConnectionManager()),
],
),
),
), ),
), ),
), ),
@ -171,10 +164,21 @@ class ConnectionManagerState extends State<ConnectionManager> {
children: [ children: [
Consumer<ChatModel>( Consumer<ChatModel>(
builder: (_, model, child) => model.isShowCMChatPage builder: (_, model, child) => model.isShowCMChatPage
? Container( ? Expanded(
width: 400, child: Scaffold(body: ChatPage())) child: ChatPage(),
: Offstage()), flex: (kConnectionManagerWindowSizeOpenChat.width -
Expanded(child: pageView), 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 { class _AppIcon extends StatelessWidget {