Tablet layout
This commit is contained in:
parent
83a7e840ec
commit
dea34b26de
|
|
@ -62,7 +62,10 @@ Middleware<AppState> _viewClient() {
|
||||||
next(action);
|
next(action);
|
||||||
|
|
||||||
store.dispatch(UpdateCurrentRoute(ClientViewScreen.route));
|
store.dispatch(UpdateCurrentRoute(ClientViewScreen.route));
|
||||||
Navigator.of(action.context).pushNamed(ClientViewScreen.route);
|
|
||||||
|
if (action.context != null && isMobile(action.context)) {
|
||||||
|
Navigator.of(action.context).pushNamed(ClientViewScreen.route);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -72,8 +75,10 @@ Middleware<AppState> _viewClientList() {
|
||||||
|
|
||||||
store.dispatch(UpdateCurrentRoute(ClientScreen.route));
|
store.dispatch(UpdateCurrentRoute(ClientScreen.route));
|
||||||
|
|
||||||
Navigator.of(action.context).pushNamedAndRemoveUntil(
|
if (action.context != null && isMobile(action.context)) {
|
||||||
ClientScreen.route, (Route<dynamic> route) => false);
|
Navigator.of(action.context).pushNamedAndRemoveUntil(
|
||||||
|
ClientScreen.route, (Route<dynamic> route) => false);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,26 +1,61 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_redux/flutter_redux.dart';
|
||||||
|
import 'package:invoiceninja_flutter/ui/client/edit/client_edit_vm.dart';
|
||||||
|
import 'package:invoiceninja_flutter/ui/client/view/client_view_vm.dart';
|
||||||
|
import 'package:redux/redux.dart';
|
||||||
|
import 'package:invoiceninja_flutter/data/models/entities.dart';
|
||||||
|
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/app_drawer_vm.dart';
|
import 'package:invoiceninja_flutter/ui/app/app_drawer_vm.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/invoice/edit/invoice_edit_vm.dart';
|
import 'package:invoiceninja_flutter/ui/client/client_screen.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/invoice/invoice_screen.dart';
|
import 'package:invoiceninja_flutter/ui/dashboard/dashboard_screen.dart';
|
||||||
|
|
||||||
class MainScreen extends StatelessWidget {
|
class MainScreen extends StatelessWidget {
|
||||||
static const String route = '/main';
|
static const String route = '/main';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Row(
|
return StoreBuilder(builder: (BuildContext context, Store<AppState> store) {
|
||||||
children: <Widget>[
|
final route = store.state.uiState.currentRoute;
|
||||||
AppDrawerBuilder(),
|
final parts = route.split('/').where((part) => part.isNotEmpty).toList();
|
||||||
//Expanded(child: DashboardScreen()),
|
final mainRoute = parts[0];
|
||||||
Expanded(
|
|
||||||
flex: 3,
|
int index = 0;
|
||||||
child: InvoiceScreen(),
|
if (mainRoute == EntityType.client.name) {
|
||||||
),
|
index = 1;
|
||||||
Expanded(
|
}
|
||||||
flex: 5,
|
|
||||||
child: InvoiceEditScreen(),
|
return Row(
|
||||||
),
|
children: <Widget>[
|
||||||
],
|
AppDrawerBuilder(),
|
||||||
);
|
Expanded(
|
||||||
|
child: IndexedStack(
|
||||||
|
index: index,
|
||||||
|
key: ValueKey(index),
|
||||||
|
children: <Widget>[
|
||||||
|
DashboardScreen(),
|
||||||
|
Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
child: ClientScreen(),
|
||||||
|
flex: 3,
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 5,
|
||||||
|
child: IndexedStack(
|
||||||
|
index: 0,
|
||||||
|
children: <Widget>[
|
||||||
|
ClientViewScreen(),
|
||||||
|
ClientEditScreen(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue