mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-26 14:59:22 +00:00
Start to draw tablet mode
This commit is contained in:
parent
28451eddbd
commit
d3132942bc
41
lib/ui/routes/main_route/tablet_route.dart
Normal file
41
lib/ui/routes/main_route/tablet_route.dart
Normal 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();
|
||||||
|
}
|
@ -2,8 +2,10 @@ import 'package:comunic/helpers/events_helper.dart';
|
|||||||
import 'package:comunic/helpers/websocket_helper.dart';
|
import 'package:comunic/helpers/websocket_helper.dart';
|
||||||
import 'package:comunic/ui/routes/login_route.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/smartphone_route.dart';
|
||||||
|
import 'package:comunic/ui/routes/main_route/tablet_route.dart';
|
||||||
import 'package:comunic/ui/widgets/safe_state.dart';
|
import 'package:comunic/ui/widgets/safe_state.dart';
|
||||||
import 'package:comunic/utils/intl_utils.dart';
|
import 'package:comunic/utils/intl_utils.dart';
|
||||||
|
import 'package:comunic/utils/ui_utils.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
/// Comunic account initialization widget
|
/// Comunic account initialization widget
|
||||||
@ -75,7 +77,7 @@ class _InitializeWidgetState extends SafeState<InitializeWidget> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return !_error && WebSocketHelper.isConnected()
|
return !_error && WebSocketHelper.isConnected()
|
||||||
? SmartphoneMainRoute()
|
? (isTablet(context) ? TabletRoute() : SmartphoneMainRoute())
|
||||||
: _buildNonReadyWidget();
|
: _buildNonReadyWidget();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user