mirror of
				https://gitlab.com/comunic/comunicmobile
				synced 2025-11-04 04:04:18 +00:00 
			
		
		
		
	Add an icon to the conversations windows
This commit is contained in:
		@@ -74,6 +74,7 @@ class _ConversationWindowState extends SafeState<ConversationWindow> {
 | 
				
			|||||||
    // In case of error
 | 
					    // In case of error
 | 
				
			||||||
    if (_error)
 | 
					    if (_error)
 | 
				
			||||||
      return ConversationWindowContainer(
 | 
					      return ConversationWindowContainer(
 | 
				
			||||||
 | 
					        icon: Icon(Icons.error),
 | 
				
			||||||
        title: Text(tr("Error")),
 | 
					        title: Text(tr("Error")),
 | 
				
			||||||
        onClose: widget.onClose,
 | 
					        onClose: widget.onClose,
 | 
				
			||||||
        onToggleCollapse: _toggleVisibility,
 | 
					        onToggleCollapse: _toggleVisibility,
 | 
				
			||||||
@@ -91,6 +92,7 @@ class _ConversationWindowState extends SafeState<ConversationWindow> {
 | 
				
			|||||||
    // If it is still loading
 | 
					    // If it is still loading
 | 
				
			||||||
    if (_conversation == null)
 | 
					    if (_conversation == null)
 | 
				
			||||||
      return ConversationWindowContainer(
 | 
					      return ConversationWindowContainer(
 | 
				
			||||||
 | 
					        icon: Icon(Icons.message),
 | 
				
			||||||
        title: Text(tr("Loading...")),
 | 
					        title: Text(tr("Loading...")),
 | 
				
			||||||
        onClose: widget.onClose,
 | 
					        onClose: widget.onClose,
 | 
				
			||||||
        onToggleCollapse: _toggleVisibility,
 | 
					        onToggleCollapse: _toggleVisibility,
 | 
				
			||||||
@@ -99,6 +101,7 @@ class _ConversationWindowState extends SafeState<ConversationWindow> {
 | 
				
			|||||||
      );
 | 
					      );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return ConversationWindowContainer(
 | 
					    return ConversationWindowContainer(
 | 
				
			||||||
 | 
					      icon: Icon(Icons.comment),
 | 
				
			||||||
      title: Text(_convTitle),
 | 
					      title: Text(_convTitle),
 | 
				
			||||||
      onClose: widget.onClose,
 | 
					      onClose: widget.onClose,
 | 
				
			||||||
      onToggleCollapse: _toggleVisibility,
 | 
					      onToggleCollapse: _toggleVisibility,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,6 +7,7 @@ import 'package:flutter/material.dart';
 | 
				
			|||||||
/// @author Pierre Hubert
 | 
					/// @author Pierre Hubert
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class ConversationWindowContainer extends StatelessWidget {
 | 
					class ConversationWindowContainer extends StatelessWidget {
 | 
				
			||||||
 | 
					  final Widget icon;
 | 
				
			||||||
  final Widget title;
 | 
					  final Widget title;
 | 
				
			||||||
  final void Function() onClose;
 | 
					  final void Function() onClose;
 | 
				
			||||||
  final void Function() onToggleCollapse;
 | 
					  final void Function() onToggleCollapse;
 | 
				
			||||||
@@ -15,6 +16,7 @@ class ConversationWindowContainer extends StatelessWidget {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  const ConversationWindowContainer({
 | 
					  const ConversationWindowContainer({
 | 
				
			||||||
    Key key,
 | 
					    Key key,
 | 
				
			||||||
 | 
					    this.icon,
 | 
				
			||||||
    @required this.title,
 | 
					    @required this.title,
 | 
				
			||||||
    @required this.onClose,
 | 
					    @required this.onClose,
 | 
				
			||||||
    @required this.body,
 | 
					    @required this.body,
 | 
				
			||||||
@@ -35,6 +37,7 @@ class ConversationWindowContainer extends StatelessWidget {
 | 
				
			|||||||
        height: !isCollapsed ? 400 : 40,
 | 
					        height: !isCollapsed ? 400 : 40,
 | 
				
			||||||
        child: Scaffold(
 | 
					        child: Scaffold(
 | 
				
			||||||
          appBar: AppBar(
 | 
					          appBar: AppBar(
 | 
				
			||||||
 | 
					            leading: icon,
 | 
				
			||||||
            title: GestureDetector(child: title, onTap: onToggleCollapse),
 | 
					            title: GestureDetector(child: title, onTap: onToggleCollapse),
 | 
				
			||||||
            actions: <Widget>[
 | 
					            actions: <Widget>[
 | 
				
			||||||
              IconButton(icon: Icon(Icons.close), onPressed: onClose),
 | 
					              IconButton(icon: Icon(Icons.close), onPressed: onClose),
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user