Settings
This commit is contained in:
parent
ed271f6389
commit
4b699c792f
|
|
@ -55,7 +55,7 @@ class UserList extends StatelessWidget {
|
||||||
onEntityAction: viewModel.onEntityAction);
|
onEntityAction: viewModel.onEntityAction);
|
||||||
|
|
||||||
return UserListItem(
|
return UserListItem(
|
||||||
user: viewModel.userCompany.user,
|
user: user,
|
||||||
filter: viewModel.filter,
|
filter: viewModel.filter,
|
||||||
onTap: () => viewModel.onUserTap(context, user),
|
onTap: () => viewModel.onUserTap(context, user),
|
||||||
onEntityAction: (EntityAction action) {
|
onEntityAction: (EntityAction action) {
|
||||||
|
|
@ -72,99 +72,6 @@ class UserList extends StatelessWidget {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
/*
|
|
||||||
filteredClient != null
|
|
||||||
? Material(
|
|
||||||
color: Colors.orangeAccent,
|
|
||||||
elevation: 6.0,
|
|
||||||
child: InkWell(
|
|
||||||
onTap: () => viewModel.onViewEntityFilterPressed(context),
|
|
||||||
child: Row(
|
|
||||||
children: <Widget>[
|
|
||||||
SizedBox(width: 18.0),
|
|
||||||
Expanded(
|
|
||||||
child: Text(
|
|
||||||
'${localization.filteredBy} ${filteredClient.listDisplayName}',
|
|
||||||
style: TextStyle(
|
|
||||||
color: Colors.white,
|
|
||||||
fontSize: 16.0,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
IconButton(
|
|
||||||
icon: Icon(
|
|
||||||
Icons.close,
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
onPressed: () => viewModel.onClearEntityFilterPressed(),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
: Container(),
|
|
||||||
Expanded(
|
|
||||||
child: !viewModel.isLoaded
|
|
||||||
? LoadingIndicator()
|
|
||||||
: RefreshIndicator(
|
|
||||||
onRefresh: () => viewModel.onRefreshed(context),
|
|
||||||
child: viewModel.userList.isEmpty
|
|
||||||
? HelpText(AppLocalization.of(context).noRecordsFound)
|
|
||||||
: ListView.separated(
|
|
||||||
shrinkWrap: true,
|
|
||||||
separatorBuilder: (context, index) => ListDivider(),
|
|
||||||
itemCount: viewModel.userList.length,
|
|
||||||
itemBuilder: (BuildContext context, index) {
|
|
||||||
final user = viewModel.user;
|
|
||||||
final userId = viewModel.userList[index];
|
|
||||||
final user = viewModel.userMap[userId];
|
|
||||||
final client =
|
|
||||||
viewModel.clientMap[user.clientId] ??
|
|
||||||
ClientEntity();
|
|
||||||
|
|
||||||
|
|
||||||
void showDialog() => showEntityActionsDialog(
|
|
||||||
entity: user,
|
|
||||||
context: context,
|
|
||||||
user: user,
|
|
||||||
onEntityAction: viewModel.onEntityAction);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return UserListItem(
|
|
||||||
user: viewModel.user,
|
|
||||||
filter: viewModel.filter,
|
|
||||||
user: user,
|
|
||||||
client:
|
|
||||||
viewModel.clientMap[user.clientId] ??
|
|
||||||
ClientEntity(),
|
|
||||||
onTap: () =>
|
|
||||||
viewModel.onUserTap(context, user),
|
|
||||||
onEntityAction: (EntityAction action) {
|
|
||||||
if (action == EntityAction.more) {
|
|
||||||
showDialog();
|
|
||||||
} else {
|
|
||||||
viewModel.onEntityAction(
|
|
||||||
context, user, action);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLongPress: () async {
|
|
||||||
final longPressIsSelection =
|
|
||||||
store.state.uiState.longPressSelectionIsDefault ?? true;
|
|
||||||
if (longPressIsSelection && !isInMultiselect) {
|
|
||||||
viewModel.onEntityAction(
|
|
||||||
context, [user], EntityAction.toggleMultiselect);
|
|
||||||
} else {
|
|
||||||
showDialog();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
isChecked: isInMultiselect && listUIState.isSelected(user),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),*/
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -78,100 +78,6 @@ class StubList extends StatelessWidget {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
filteredClient != null
|
|
||||||
? Material(
|
|
||||||
color: Colors.orangeAccent,
|
|
||||||
elevation: 6.0,
|
|
||||||
child: InkWell(
|
|
||||||
onTap: () => viewModel.onViewEntityFilterPressed(context),
|
|
||||||
child: Row(
|
|
||||||
children: <Widget>[
|
|
||||||
SizedBox(width: 18.0),
|
|
||||||
Expanded(
|
|
||||||
child: Text(
|
|
||||||
'${localization.filteredBy} ${filteredClient.listDisplayName}',
|
|
||||||
style: TextStyle(
|
|
||||||
color: Colors.white,
|
|
||||||
fontSize: 16.0,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
IconButton(
|
|
||||||
icon: Icon(
|
|
||||||
Icons.close,
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
onPressed: () => viewModel.onClearEntityFilterPressed(),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
: Container(),
|
|
||||||
Expanded(
|
|
||||||
child: !viewModel.isLoaded
|
|
||||||
? LoadingIndicator()
|
|
||||||
: RefreshIndicator(
|
|
||||||
onRefresh: () => viewModel.onRefreshed(context),
|
|
||||||
child: viewModel.stubList.isEmpty
|
|
||||||
? HelpText(AppLocalization.of(context).noRecordsFound)
|
|
||||||
: ListView.separated(
|
|
||||||
shrinkWrap: true,
|
|
||||||
separatorBuilder: (context, index) => ListDivider(),
|
|
||||||
itemCount: viewModel.stubList.length,
|
|
||||||
itemBuilder: (BuildContext context, index) {
|
|
||||||
final user = viewModel.user;
|
|
||||||
final stubId = viewModel.stubList[index];
|
|
||||||
final stub = viewModel.stubMap[stubId];
|
|
||||||
final client =
|
|
||||||
viewModel.clientMap[stub.clientId] ??
|
|
||||||
ClientEntity();
|
|
||||||
|
|
||||||
|
|
||||||
void showDialog() => showEntityActionsDialog(
|
|
||||||
entity: stub,
|
|
||||||
context: context,
|
|
||||||
user: user,
|
|
||||||
onEntityAction: viewModel.onEntityAction);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return StubListItem(
|
|
||||||
user: viewModel.user,
|
|
||||||
filter: viewModel.filter,
|
|
||||||
stub: stub,
|
|
||||||
client:
|
|
||||||
viewModel.clientMap[stub.clientId] ??
|
|
||||||
ClientEntity(),
|
|
||||||
onTap: () =>
|
|
||||||
viewModel.onStubTap(context, stub),
|
|
||||||
onEntityAction: (EntityAction action) {
|
|
||||||
if (action == EntityAction.more) {
|
|
||||||
showDialog();
|
|
||||||
} else {
|
|
||||||
viewModel.onEntityAction(
|
|
||||||
context, stub, action);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLongPress: () async {
|
|
||||||
final longPressIsSelection =
|
|
||||||
store.state.uiState.longPressSelectionIsDefault ?? true;
|
|
||||||
if (longPressIsSelection && !isInMultiselect) {
|
|
||||||
viewModel.onEntityAction(
|
|
||||||
context, [stub], EntityAction.toggleMultiselect);
|
|
||||||
} else {
|
|
||||||
showDialog();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
isChecked: isInMultiselect && listUIState.isSelected(stub),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),*/
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue