mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-04-29 22:27:24 +02:00

- add ravigation rail on large screens - refactor space hierarchy dummy code - add material 3 like radius to spaces drawer - rename column router to catch the application-specific code inside Signed-off-by: TheOneWithTheBraid <the-one@with-the-braid.cf>
53 lines
1.4 KiB
Dart
53 lines
1.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import 'package:vrouter/vrouter.dart';
|
|
|
|
/// displays a two-column layout with some FluffyChat specific patches
|
|
///
|
|
/// On huge screens width > 1024, the navigation rail for quick navigation is
|
|
/// rendered surround
|
|
class FluffyChatTwoColumnLayout extends StatelessWidget {
|
|
final Widget mainView;
|
|
final Widget sideView;
|
|
|
|
const FluffyChatTwoColumnLayout({
|
|
Key? key,
|
|
required this.mainView,
|
|
required this.sideView,
|
|
}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return ScaffoldMessenger(
|
|
child: Scaffold(
|
|
body: LayoutBuilder(builder: (context, constraints) {
|
|
final columnWidth = context.vRouter.path.startsWith('/rooms') &&
|
|
constraints.maxWidth > 1024
|
|
? 360.0 + 64
|
|
: 360.0;
|
|
|
|
return Row(
|
|
children: [
|
|
Container(
|
|
clipBehavior: Clip.antiAlias,
|
|
decoration: const BoxDecoration(),
|
|
width: columnWidth,
|
|
child: mainView,
|
|
),
|
|
Container(
|
|
width: 1.0,
|
|
color: Theme.of(context).dividerColor,
|
|
),
|
|
Expanded(
|
|
child: ClipRRect(
|
|
child: sideView,
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}),
|
|
),
|
|
);
|
|
}
|
|
}
|