From b0fd0d7d5129d447a124eb1ed86a99b623c7b570 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 9 May 2020 06:49:05 +0200 Subject: [PATCH] Add button to open new conversations --- lib/ui/routes/main_route/tablet_route.dart | 8 +++-- .../conversations_area_widget.dart | 31 +++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 lib/ui/widgets/tablet_mode/conversations_area_widget.dart diff --git a/lib/ui/routes/main_route/tablet_route.dart b/lib/ui/routes/main_route/tablet_route.dart index ac6baef..1eb02d7 100644 --- a/lib/ui/routes/main_route/tablet_route.dart +++ b/lib/ui/routes/main_route/tablet_route.dart @@ -1,4 +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/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'; @@ -25,8 +26,11 @@ class _TabletRouteState extends State { Widget _buildAppBar() => ComunicTabletAppBarWidget(); - Widget _buildBody() => Row( - children: [_buildLeftPane(), _buildRightPane()], + Widget _buildBody() => Stack( + children: [ + Row(children: [_buildLeftPane(), _buildRightPane()]), + Positioned(right: 0, bottom: 0, child: ConversationsAreaWidget()) + ], ); Widget _buildLeftPane() => Theme( diff --git a/lib/ui/widgets/tablet_mode/conversations_area_widget.dart b/lib/ui/widgets/tablet_mode/conversations_area_widget.dart new file mode 100644 index 0000000..32e7766 --- /dev/null +++ b/lib/ui/widgets/tablet_mode/conversations_area_widget.dart @@ -0,0 +1,31 @@ +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 { + @override + Widget build(BuildContext context) { + return Row( + children: [_buildOpenButton()], + ); + } + + /// Add a button to open new conversations + Widget _buildOpenButton() => Padding( + padding: const EdgeInsets.all(15.0), + child: FloatingActionButton( + onPressed: () {}, + child: Icon(Icons.message), + ), + ); +}