mirror of
				https://gitlab.com/comunic/comunicmobile
				synced 2025-11-04 04:04:18 +00:00 
			
		
		
		
	Display the list of conversation to open one
This commit is contained in:
		@@ -0,0 +1,26 @@
 | 
			
		||||
import 'package:comunic/ui/widgets/tablet_mode/conversations/open_conversation_button_widget.dart';
 | 
			
		||||
import 'package:flutter/material.dart';
 | 
			
		||||
 | 
			
		||||
/// Conversations area widget
 | 
			
		||||
///
 | 
			
		||||
/// This widget allow floating conversations in tablet mode
 | 
			
		||||
///
 | 
			
		||||
/// @author Pierre
 | 
			
		||||
 | 
			
		||||
class ConversationsAreaWidget extends StatefulWidget {
 | 
			
		||||
  @override
 | 
			
		||||
  _ConversationsAreaWidgetState createState() =>
 | 
			
		||||
      _ConversationsAreaWidgetState();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
class _ConversationsAreaWidgetState extends State<ConversationsAreaWidget> {
 | 
			
		||||
  @override
 | 
			
		||||
  Widget build(BuildContext context) {
 | 
			
		||||
    return Row(
 | 
			
		||||
      children: <Widget>[_buildOpenButton()],
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /// Add a button to open new conversations
 | 
			
		||||
  Widget _buildOpenButton() => OpenConversationButton();
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,43 @@
 | 
			
		||||
import 'package:comunic/ui/screens/conversations_list_screen.dart';
 | 
			
		||||
import 'package:flutter/material.dart';
 | 
			
		||||
 | 
			
		||||
/// This buttons open a menu
 | 
			
		||||
/// to choose a conversation to open
 | 
			
		||||
///
 | 
			
		||||
/// @author Pierre Hubert
 | 
			
		||||
 | 
			
		||||
class OpenConversationButton extends StatefulWidget {
 | 
			
		||||
  @override
 | 
			
		||||
  _OpenConversationButtonState createState() => _OpenConversationButtonState();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
class _OpenConversationButtonState extends State<OpenConversationButton> {
 | 
			
		||||
  bool _showConversationsList = false;
 | 
			
		||||
 | 
			
		||||
  void _setShowConversationsList(bool s) =>
 | 
			
		||||
      setState(() => _showConversationsList = s);
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  Widget build(BuildContext context) {
 | 
			
		||||
    return Padding(
 | 
			
		||||
      padding: const EdgeInsets.all(10.0),
 | 
			
		||||
      child: Column(
 | 
			
		||||
        crossAxisAlignment: CrossAxisAlignment.end,
 | 
			
		||||
        children: <Widget>[
 | 
			
		||||
          _showConversationsList ? _buildConversationsList() : Container(),
 | 
			
		||||
          FloatingActionButton(
 | 
			
		||||
            onPressed: () => _setShowConversationsList(!_showConversationsList),
 | 
			
		||||
            child: Icon(_showConversationsList ? Icons.close : Icons.message),
 | 
			
		||||
          )
 | 
			
		||||
        ],
 | 
			
		||||
      ),
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  Widget _buildConversationsList() => Container(
 | 
			
		||||
      width: 300,
 | 
			
		||||
      height: 500,
 | 
			
		||||
      child: Card(
 | 
			
		||||
        child: ConversationsListScreen(),
 | 
			
		||||
      ));
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user