Update login

This commit is contained in:
Hillel Coren 2020-08-23 10:20:27 +03:00
parent fc5c734d5e
commit 157bdfb685
4 changed files with 21 additions and 3 deletions

View File

@ -472,7 +472,7 @@ class _LoginState extends State<LoginView> {
: AutofillHints.password
],
),
if (_isSelfHosted)
if (_isSelfHosted || viewModel.state.isDemo)
TextFormField(
controller: _urlController,
key: ValueKey(localization.url),

View File

@ -38,6 +38,7 @@ class LoginScreen extends StatelessWidget {
class LoginVM {
LoginVM({
@required this.state,
@required this.isLoading,
@required this.authState,
@required this.onLoginPressed,
@ -47,6 +48,7 @@ class LoginVM {
@required this.onGoogleSignUpPressed,
});
AppState state;
bool isLoading;
AuthState authState;
@ -109,6 +111,7 @@ class LoginVM {
}
return LoginVM(
state: store.state,
isLoading: store.state.isLoading,
authState: store.state.authState,
onGoogleLoginPressed: (

View File

@ -71,6 +71,7 @@ class _DashboardScreenState extends State<DashboardScreen>
ScrollController(initialScrollOffset: index * kDashboardPanelHeight)
..addListener(onScrollListener);
/*
//if ((state.company.settings.name ?? '').isEmpty && state.companies.length == 1) {
if (kDebugMode) {
WidgetsBinding.instance.addPostFrameCallback((duration) {
@ -82,6 +83,7 @@ class _DashboardScreenState extends State<DashboardScreen>
});
});
}
*/
}
void onScrollListener() {

View File

@ -17,6 +17,7 @@ class InvoiceViewContacts extends StatelessWidget {
children: invoice.invitations
.map((invitation) => _InvitationListTile(
invitation: invitation,
viewModel: viewModel,
))
.toList(),
);
@ -24,12 +25,24 @@ class InvoiceViewContacts extends StatelessWidget {
}
class _InvitationListTile extends StatelessWidget {
const _InvitationListTile({@required this.invitation});
const _InvitationListTile(
{@required this.invitation, @required this.viewModel});
final InvitationEntity invitation;
final EntityViewVM viewModel;
@override
Widget build(BuildContext context) {
return Text('$invitation');
final state = viewModel.state;
final client = state.clientState.get(viewModel.invoice.clientId);
final contact = client.contacts.firstWhere(
(contact) => contact.id == invitation.contactId,
orElse: null);
return ListTile(
title: Text(
contact.fullName.isEmpty ? client.displayName : contact.fullName),
leading: Icon(Icons.contacts),
);
}
}