mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-12-20 20:22:35 +01:00
46 lines
1.0 KiB
Dart
46 lines
1.0 KiB
Dart
//@dart=2.12
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:fluffychat/config/themes.dart';
|
|
|
|
class TwoColumnLayout extends StatelessWidget {
|
|
final Widget mainView;
|
|
final Widget sideView;
|
|
|
|
const TwoColumnLayout({
|
|
Key? key,
|
|
required this.mainView,
|
|
required this.sideView,
|
|
}) : super(key: key);
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
if (MediaQuery.of(context).size.width <= FluffyThemes.columnWidth * 2) {
|
|
return mainView;
|
|
}
|
|
return ScaffoldMessenger(
|
|
child: Scaffold(
|
|
body: Row(
|
|
children: [
|
|
Container(
|
|
clipBehavior: Clip.antiAlias,
|
|
decoration: const BoxDecoration(),
|
|
width: 360.0,
|
|
child: mainView,
|
|
),
|
|
Container(
|
|
width: 1.0,
|
|
color: Theme.of(context).dividerColor,
|
|
),
|
|
Expanded(
|
|
child: ClipRRect(
|
|
child: sideView,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|