From 123eaad29691dd81c3e4f0c181a85afd1bc89b3b Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 9 May 2020 10:26:15 +0200 Subject: [PATCH] Add an icon to the conversations windows --- .../widgets/tablet_mode/conversations/conversation_window.dart | 3 +++ .../conversations/conversation_window_container.dart | 3 +++ 2 files changed, 6 insertions(+) diff --git a/lib/ui/widgets/tablet_mode/conversations/conversation_window.dart b/lib/ui/widgets/tablet_mode/conversations/conversation_window.dart index 0b8dc5d..1e8ec9f 100644 --- a/lib/ui/widgets/tablet_mode/conversations/conversation_window.dart +++ b/lib/ui/widgets/tablet_mode/conversations/conversation_window.dart @@ -74,6 +74,7 @@ class _ConversationWindowState extends SafeState { // 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 { // 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 { ); return ConversationWindowContainer( + icon: Icon(Icons.comment), title: Text(_convTitle), onClose: widget.onClose, onToggleCollapse: _toggleVisibility, diff --git a/lib/ui/widgets/tablet_mode/conversations/conversation_window_container.dart b/lib/ui/widgets/tablet_mode/conversations/conversation_window_container.dart index deb269d..35156b6 100644 --- a/lib/ui/widgets/tablet_mode/conversations/conversation_window_container.dart +++ b/lib/ui/widgets/tablet_mode/conversations/conversation_window_container.dart @@ -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: [ IconButton(icon: Icon(Icons.close), onPressed: onClose),