1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-25 22:39:22 +00:00

Display the list of conversation to open one

This commit is contained in:
Pierre HUBERT 2020-05-09 07:07:14 +02:00
parent b0fd0d7d51
commit fe17f81a40
3 changed files with 46 additions and 8 deletions

View File

@ -1,5 +1,5 @@
import 'package:comunic/ui/routes/main_route/main_route.dart'; import 'package:comunic/ui/routes/main_route/main_route.dart';
import 'package:comunic/ui/widgets/tablet_mode/conversations_area_widget.dart'; import 'package:comunic/ui/widgets/tablet_mode/conversations/conversations_area_widget.dart';
import 'package:comunic/ui/widgets/tablet_mode/current_user_panel.dart'; import 'package:comunic/ui/widgets/tablet_mode/current_user_panel.dart';
import 'package:comunic/ui/widgets/tablet_mode/global_search_field.dart'; import 'package:comunic/ui/widgets/tablet_mode/global_search_field.dart';
import 'package:comunic/ui/widgets/tablet_mode/memberships_panel.dart'; import 'package:comunic/ui/widgets/tablet_mode/memberships_panel.dart';

View File

@ -1,3 +1,4 @@
import 'package:comunic/ui/widgets/tablet_mode/conversations/open_conversation_button_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
/// Conversations area widget /// Conversations area widget
@ -21,11 +22,5 @@ class _ConversationsAreaWidgetState extends State<ConversationsAreaWidget> {
} }
/// Add a button to open new conversations /// Add a button to open new conversations
Widget _buildOpenButton() => Padding( Widget _buildOpenButton() => OpenConversationButton();
padding: const EdgeInsets.all(15.0),
child: FloatingActionButton(
onPressed: () {},
child: Icon(Icons.message),
),
);
} }

View File

@ -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(),
));
}