1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-29 16:26:27 +00:00
comunicmobile/lib/ui/widgets/tablet_mode/conversations/conversation_window_container.dart

64 lines
1.7 KiB
Dart
Raw Normal View History

import 'package:comunic/ui/widgets/custom_app_bar_size.dart';
2020-05-09 07:30:46 +00:00
import 'package:flutter/material.dart';
/// Conversation window
///
/// Simple container for a conversation
///
/// @author Pierre Hubert
class ConversationWindowContainer extends StatelessWidget {
final Color? appBarBgColor;
final Widget? icon;
2020-05-09 07:30:46 +00:00
final Widget title;
final void Function() onClose;
2020-05-09 08:20:44 +00:00
final void Function() onToggleCollapse;
2020-05-09 08:20:06 +00:00
final bool isCollapsed;
2020-05-09 07:30:46 +00:00
final Widget body;
final List<Widget>? action;
2020-05-09 07:30:46 +00:00
const ConversationWindowContainer({
Key? key,
this.appBarBgColor,
this.icon,
required this.title,
required this.onClose,
required this.body,
required this.onToggleCollapse,
required this.isCollapsed,
this.action,
2022-03-11 15:36:42 +00:00
}) : super(key: key);
2020-05-09 07:30:46 +00:00
@override
Widget build(BuildContext context) {
return Card(
child: Container(
width: 300,
2020-05-09 08:20:06 +00:00
height: !isCollapsed ? 400 : 40,
2020-05-09 07:30:46 +00:00
child: Scaffold(
appBar: AppBarWrapper(
height: 40,
appBar: AppBar(
backgroundColor: appBarBgColor,
leading: icon,
title: GestureDetector(child: title, onTap: onToggleCollapse),
actions: action ?? []
..add(
IconButton(icon: Icon(Icons.close), onPressed: onClose),
),
2021-12-28 14:33:27 +00:00
toolbarTextStyle:
TextTheme(headline6: TextStyle(fontSize: 15)).bodyText2,
titleTextStyle:
TextTheme(headline6: TextStyle(fontSize: 15)).headline6,
)),
2020-05-09 08:20:06 +00:00
body: Visibility(
child: body,
visible: !isCollapsed,
maintainState: true,
),
2020-05-09 07:30:46 +00:00
),
),
);
}
}