1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-29 16:26:27 +00:00
comunicmobile/lib/ui/routes/main_route/tablet_route.dart

104 lines
2.7 KiB
Dart

import 'package:comunic/ui/routes/main_route/main_route.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';
import 'package:comunic/ui/widgets/tablet_mode/tablet_appbar_widget.dart';
import 'package:flutter/material.dart';
/// Main tablet route
///
/// @author Pierre Hubert
class TabletRoute extends StatefulWidget implements MainRoute {
@override
_TabletRouteState createState() => _TabletRouteState();
}
class _TabletRouteState extends State<MainRoute> implements MainController {
final _conversationsKey = GlobalKey<ConversationsAreaWidgetState>();
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: _buildAppBar(),
body: _buildBody(),
);
}
Widget _buildAppBar() => ComunicTabletAppBarWidget();
Widget _buildBody() => Stack(
children: [
Row(children: <Widget>[_buildLeftPane(), _buildRightPane()]),
Positioned(
right: 0,
bottom: 0,
child: ConversationsAreaWidget(key: _conversationsKey),
)
],
);
Widget _buildLeftPane() => Theme(
data: Theme.of(context).copyWith(
textTheme: TextTheme(body1: TextStyle(color: Colors.white)),
iconTheme: IconThemeData(color: Colors.white),
),
child: Container(
width: 300,
color: Color(0xFF222D32),
child: Column(
children: <Widget>[
CurrentUserPanel(),
Container(height: 10),
GlobalSearchField(),
Container(height: 10),
Expanded(child: MembershipsPanel())
],
),
),
);
Widget _buildRightPane() => Container();
@override
void openConversation(int convID, {fullScreen = false}) {
_conversationsKey.currentState.openConversations(convID);
}
@override
void openGroup(int groupID) {
// TODO: implement openGroup
}
@override
void openUserAccessDeniedPage(int userID) {
// TODO: implement openUserAccessDeniedPage
}
@override
void openUserFriendsList(int userID) {
// TODO: implement openUserFriendsList
}
@override
void openUserPage(int userID) {
// TODO: implement openUserPage
}
@override
void popPage() {
// TODO: implement popPage
}
@override
void push(Widget w, {bool hideNavBar}) {
// TODO: implement push
}
@override
void startCall(int convID) {
// TODO: implement startCall
}
}