1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-22 12:59:21 +00:00

Start to draw tablet mode

This commit is contained in:
Pierre HUBERT 2020-05-05 13:31:03 +02:00
parent 28451eddbd
commit d3132942bc
2 changed files with 44 additions and 1 deletions

View File

@ -0,0 +1,41 @@
import 'package:comunic/ui/routes/main_route/main_route.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<TabletRoute> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: _buildAppBar(),
body: _buildBody(),
);
}
Widget _buildAppBar() => AppBar(
title: Text("Comunic"),
actions: <Widget>[
IconButton(icon: Icon(Icons.notifications), onPressed: () {}),
IconButton(icon: Icon(Icons.message), onPressed: () {}),
PopupMenuButton(itemBuilder: (c) => []),
],
);
Widget _buildBody() => Row(
children: <Widget>[_buildLeftPane(), _buildRightPane()],
);
Widget _buildLeftPane() => Container(
width: 300,
color: Color(0xFF222D32),
);
Widget _buildRightPane() => Container();
}

View File

@ -2,8 +2,10 @@ import 'package:comunic/helpers/events_helper.dart';
import 'package:comunic/helpers/websocket_helper.dart';
import 'package:comunic/ui/routes/login_route.dart';
import 'package:comunic/ui/routes/main_route/smartphone_route.dart';
import 'package:comunic/ui/routes/main_route/tablet_route.dart';
import 'package:comunic/ui/widgets/safe_state.dart';
import 'package:comunic/utils/intl_utils.dart';
import 'package:comunic/utils/ui_utils.dart';
import 'package:flutter/material.dart';
/// Comunic account initialization widget
@ -75,7 +77,7 @@ class _InitializeWidgetState extends SafeState<InitializeWidget> {
@override
Widget build(BuildContext context) {
return !_error && WebSocketHelper.isConnected()
? SmartphoneMainRoute()
? (isTablet(context) ? TabletRoute() : SmartphoneMainRoute())
: _buildNonReadyWidget();
}