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:
parent
b0fd0d7d51
commit
fe17f81a40
@ -1,5 +1,5 @@
|
||||
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/global_search_field.dart';
|
||||
import 'package:comunic/ui/widgets/tablet_mode/memberships_panel.dart';
|
||||
|
@ -1,3 +1,4 @@
|
||||
import 'package:comunic/ui/widgets/tablet_mode/conversations/open_conversation_button_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Conversations area widget
|
||||
@ -21,11 +22,5 @@ class _ConversationsAreaWidgetState extends State<ConversationsAreaWidget> {
|
||||
}
|
||||
|
||||
/// Add a button to open new conversations
|
||||
Widget _buildOpenButton() => Padding(
|
||||
padding: const EdgeInsets.all(15.0),
|
||||
child: FloatingActionButton(
|
||||
onPressed: () {},
|
||||
child: Icon(Icons.message),
|
||||
),
|
||||
);
|
||||
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(),
|
||||
));
|
||||
}
|
Loading…
Reference in New Issue
Block a user