mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-22 21:09:21 +00:00
Add an icon to the conversations windows
This commit is contained in:
parent
b020895a8c
commit
123eaad296
@ -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,
|
||||
|
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user