mirror of
https://gitlab.com/comunic/comunicmobile
synced 2025-06-19 16:25:17 +00:00
Ready to build conversation windows
This commit is contained in:
@ -0,0 +1,25 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Single conversation window
|
||||
///
|
||||
/// @author Pierre Hubert
|
||||
|
||||
class ConversationWindow extends StatefulWidget {
|
||||
final int convID;
|
||||
|
||||
const ConversationWindow({
|
||||
Key key,
|
||||
@required this.convID,
|
||||
}) : assert(convID != null),
|
||||
super(key: key);
|
||||
|
||||
@override
|
||||
_ConversationWindowState createState() => _ConversationWindowState();
|
||||
}
|
||||
|
||||
class _ConversationWindowState extends State<ConversationWindow> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Card();//TODO : continue here
|
||||
}
|
||||
}
|
@ -1,3 +1,4 @@
|
||||
import 'package:comunic/ui/widgets/tablet_mode/conversations/conversation_window.dart';
|
||||
import 'package:comunic/ui/widgets/tablet_mode/conversations/open_conversation_button_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
@ -8,19 +9,30 @@ import 'package:flutter/material.dart';
|
||||
/// @author Pierre
|
||||
|
||||
class ConversationsAreaWidget extends StatefulWidget {
|
||||
const ConversationsAreaWidget({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_ConversationsAreaWidgetState createState() =>
|
||||
_ConversationsAreaWidgetState();
|
||||
ConversationsAreaWidgetState createState() => ConversationsAreaWidgetState();
|
||||
}
|
||||
|
||||
class _ConversationsAreaWidgetState extends State<ConversationsAreaWidget> {
|
||||
class ConversationsAreaWidgetState extends State<ConversationsAreaWidget> {
|
||||
final _openConversations = Set<int>();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
children: <Widget>[_buildOpenButton()],
|
||||
children: _openConversations.map(_conversationWindow).toList()
|
||||
..add(_buildOpenButton()),
|
||||
);
|
||||
}
|
||||
|
||||
/// Add a button to open new conversations
|
||||
Widget _buildOpenButton() => OpenConversationButton();
|
||||
|
||||
/// Open a new conversation
|
||||
void openConversations(int convID) {
|
||||
setState(() => _openConversations.add(convID));
|
||||
}
|
||||
|
||||
Widget _conversationWindow(int convID) => ConversationWindow(convID: convID);
|
||||
}
|
||||
|
Reference in New Issue
Block a user