1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-12-25 12:28:50 +00:00

Add an icon to the conversations windows

This commit is contained in:
Pierre HUBERT 2020-05-09 10:26:15 +02:00
parent b020895a8c
commit 123eaad296
2 changed files with 6 additions and 0 deletions

View File

@ -74,6 +74,7 @@ class _ConversationWindowState extends SafeState<ConversationWindow> {
// In case of error
if (_error)
return ConversationWindowContainer(
icon: Icon(Icons.error),
title: Text(tr("Error")),
onClose: widget.onClose,
onToggleCollapse: _toggleVisibility,
@ -91,6 +92,7 @@ class _ConversationWindowState extends SafeState<ConversationWindow> {
// If it is still loading
if (_conversation == null)
return ConversationWindowContainer(
icon: Icon(Icons.message),
title: Text(tr("Loading...")),
onClose: widget.onClose,
onToggleCollapse: _toggleVisibility,
@ -99,6 +101,7 @@ class _ConversationWindowState extends SafeState<ConversationWindow> {
);
return ConversationWindowContainer(
icon: Icon(Icons.comment),
title: Text(_convTitle),
onClose: widget.onClose,
onToggleCollapse: _toggleVisibility,

View File

@ -7,6 +7,7 @@ import 'package:flutter/material.dart';
/// @author Pierre Hubert
class ConversationWindowContainer extends StatelessWidget {
final Widget icon;
final Widget title;
final void Function() onClose;
final void Function() onToggleCollapse;
@ -15,6 +16,7 @@ class ConversationWindowContainer extends StatelessWidget {
const ConversationWindowContainer({
Key key,
this.icon,
@required this.title,
@required this.onClose,
@required this.body,
@ -35,6 +37,7 @@ class ConversationWindowContainer extends StatelessWidget {
height: !isCollapsed ? 400 : 40,
child: Scaffold(
appBar: AppBar(
leading: icon,
title: GestureDetector(child: title, onTap: onToggleCollapse),
actions: <Widget>[
IconButton(icon: Icon(Icons.close), onPressed: onClose),