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