2021-05-23 20:13:10 +02:00
|
|
|
import 'package:fluffychat/config/themes.dart';
|
2021-05-23 13:11:55 +02:00
|
|
|
import 'package:flutter/material.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) {
|
2021-05-23 20:13:10 +02:00
|
|
|
if (MediaQuery.of(context).size.width <= FluffyThemes.columnWidth * 2) {
|
2021-05-23 13:11:55 +02:00
|
|
|
return mainView;
|
|
|
|
}
|
|
|
|
return Scaffold(
|
|
|
|
body: ScaffoldMessenger(
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
clipBehavior: Clip.antiAlias,
|
|
|
|
decoration: BoxDecoration(),
|
|
|
|
width: 360.0,
|
|
|
|
child: mainView,
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
width: 1.0,
|
|
|
|
color: Theme.of(context).dividerColor,
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: ClipRRect(
|
|
|
|
child: sideView,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|