Settings
This commit is contained in:
parent
141866fb89
commit
08009c190f
|
|
@ -264,6 +264,8 @@ class CustomFieldType {
|
|||
static const String invoice2 = 'invoice_text2';
|
||||
static const String surcharge1 = 'invoice1';
|
||||
static const String surcharge2 = 'invoice2';
|
||||
static const String group1 = 'group1';
|
||||
static const String group2 = 'group2';
|
||||
}
|
||||
|
||||
abstract class DashboardEntity
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class ViewGroup implements PersistUI {
|
|||
this.force = false,
|
||||
});
|
||||
|
||||
final int groupId;
|
||||
final String groupId;
|
||||
final BuildContext context;
|
||||
final bool force;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@ class GroupList extends StatelessWidget {
|
|||
void showDialog() => showEntityActionsDialog(
|
||||
entity: group,
|
||||
context: context,
|
||||
user: user,
|
||||
onEntityAction: viewModel.onEntityAction);
|
||||
|
||||
return GroupListItem(
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import 'package:invoiceninja_flutter/data/models/group_model.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/entity_state_label.dart';
|
||||
import 'package:invoiceninja_flutter/utils/formatting.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
|
@ -6,7 +7,6 @@ import 'package:invoiceninja_flutter/data/models/models.dart';
|
|||
import 'package:invoiceninja_flutter/ui/app/dismissible_entity.dart';
|
||||
|
||||
class GroupListItem extends StatelessWidget {
|
||||
|
||||
const GroupListItem({
|
||||
@required this.user,
|
||||
@required this.onEntityAction,
|
||||
|
|
@ -35,7 +35,6 @@ class GroupListItem extends StatelessWidget {
|
|||
final subtitle = filterMatch;
|
||||
|
||||
return DismissibleEntity(
|
||||
user: user,
|
||||
entity: group,
|
||||
onEntityAction: onEntityAction,
|
||||
child: ListTile(
|
||||
|
|
@ -70,12 +69,13 @@ class GroupListItem extends StatelessWidget {
|
|||
subtitle: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
subtitle != null && subtitle.isNotEmpty ?
|
||||
Text(
|
||||
subtitle,
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
) : Container(),
|
||||
subtitle != null && subtitle.isNotEmpty
|
||||
? Text(
|
||||
subtitle,
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
)
|
||||
: Container(),
|
||||
EntityStateLabel(group),
|
||||
],
|
||||
),
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ class GroupListVM {
|
|||
}
|
||||
|
||||
final UserEntity user;
|
||||
final List<int> groupList;
|
||||
final List<String> groupList;
|
||||
final BuiltMap<String, GroupEntity> groupMap;
|
||||
final ListUIState listState;
|
||||
final String filter;
|
||||
|
|
|
|||
|
|
@ -20,59 +20,58 @@ class GroupScreen extends StatelessWidget {
|
|||
final store = StoreProvider.of<AppState>(context);
|
||||
final state = store.state;
|
||||
final company = state.selectedCompany;
|
||||
final user = company.user;
|
||||
final localization = AppLocalization.of(context);
|
||||
|
||||
return AppScaffold(
|
||||
appBarTitle: ListFilter(
|
||||
key: ValueKey(state.groupListState.filterClearedAt),
|
||||
entityType: EntityType.group,
|
||||
onFilterChanged: (value) {
|
||||
store.dispatch(FilterGroups(value));
|
||||
},
|
||||
),
|
||||
appBarActions: [
|
||||
ListFilterButton(
|
||||
entityType: EntityType.group,
|
||||
onFilterPressed: (String value) {
|
||||
store.dispatch(FilterGroups(value));
|
||||
},
|
||||
),
|
||||
],
|
||||
body: GroupListBuilder(),
|
||||
bottomNavigationBar: AppBottomBar(
|
||||
entityType: EntityType.group,
|
||||
onSelectedSortField: (value) => store.dispatch(SortGroups(value)),
|
||||
customValues1: company.getCustomFieldValues(CustomFieldType.group1,
|
||||
excludeBlank: true),
|
||||
customValues2: company.getCustomFieldValues(CustomFieldType.group2,
|
||||
excludeBlank: true),
|
||||
onSelectedCustom1: (value) =>
|
||||
store.dispatch(FilterGroupsByCustom1(value)),
|
||||
onSelectedCustom2: (value) =>
|
||||
store.dispatch(FilterGroupsByCustom2(value)),
|
||||
sortFields: [
|
||||
GroupFields.updatedAt,
|
||||
],
|
||||
onSelectedState: (EntityState state, value) {
|
||||
store.dispatch(FilterGroupsByState(state));
|
||||
},
|
||||
),
|
||||
floatingActionButton: user.canCreate(EntityType.group)
|
||||
? FloatingActionButton(
|
||||
heroTag: 'group_fab',
|
||||
backgroundColor: Theme.of(context).primaryColorDark,
|
||||
onPressed: () {
|
||||
store.dispatch(
|
||||
EditGroup(group: GroupEntity(), context: context));
|
||||
},
|
||||
child: Icon(
|
||||
Icons.add,
|
||||
color: Colors.white,
|
||||
),
|
||||
tooltip: localization.newGroup,
|
||||
)
|
||||
: null,
|
||||
);
|
||||
appBarTitle: ListFilter(
|
||||
key: ValueKey(state.groupListState.filterClearedAt),
|
||||
entityType: EntityType.group,
|
||||
onFilterChanged: (value) {
|
||||
store.dispatch(FilterGroups(value));
|
||||
},
|
||||
),
|
||||
appBarActions: [
|
||||
ListFilterButton(
|
||||
entityType: EntityType.group,
|
||||
onFilterPressed: (String value) {
|
||||
store.dispatch(FilterGroups(value));
|
||||
},
|
||||
),
|
||||
],
|
||||
body: GroupListBuilder(),
|
||||
bottomNavigationBar: AppBottomBar(
|
||||
entityType: EntityType.group,
|
||||
onSelectedSortField: (value) => store.dispatch(SortGroups(value)),
|
||||
customValues1: company.getCustomFieldValues(CustomFieldType.group1,
|
||||
excludeBlank: true),
|
||||
customValues2: company.getCustomFieldValues(CustomFieldType.group2,
|
||||
excludeBlank: true),
|
||||
onSelectedCustom1: (value) =>
|
||||
store.dispatch(FilterGroupsByCustom1(value)),
|
||||
onSelectedCustom2: (value) =>
|
||||
store.dispatch(FilterGroupsByCustom2(value)),
|
||||
sortFields: [
|
||||
GroupFields.updatedAt,
|
||||
],
|
||||
onSelectedState: (EntityState state, value) {
|
||||
store.dispatch(FilterGroupsByState(state));
|
||||
},
|
||||
),
|
||||
floatingActionButton: user.canCreate(EntityType.group)
|
||||
? FloatingActionButton(
|
||||
heroTag: 'group_fab',
|
||||
backgroundColor: Theme.of(context).primaryColorDark,
|
||||
onPressed: () {
|
||||
store.dispatch(
|
||||
EditGroup(group: GroupEntity(), context: context));
|
||||
},
|
||||
child: Icon(
|
||||
Icons.add,
|
||||
color: Colors.white,
|
||||
),
|
||||
tooltip: localization.newGroup,
|
||||
)
|
||||
: null,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@ class StubList extends StatelessWidget {
|
|||
void showDialog() => showEntityActionsDialog(
|
||||
entity: stub,
|
||||
context: context,
|
||||
user: user,
|
||||
onEntityAction: viewModel.onEntityAction);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import 'package:invoiceninja_flutter/data/models/stub_model.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/entity_state_label.dart';
|
||||
import 'package:invoiceninja_flutter/utils/formatting.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
|
@ -35,7 +36,6 @@ class StubListItem extends StatelessWidget {
|
|||
final subtitle = filterMatch;
|
||||
|
||||
return DismissibleEntity(
|
||||
user: user,
|
||||
entity: stub,
|
||||
onEntityAction: onEntityAction,
|
||||
child: ListTile(
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ class StubListVM {
|
|||
}
|
||||
|
||||
final UserEntity user;
|
||||
final List<int> stubList;
|
||||
final List<String> stubList;
|
||||
final BuiltMap<String, StubEntity> stubMap;
|
||||
final ListUIState listState;
|
||||
final String filter;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ class StubScreen extends StatelessWidget {
|
|||
final store = StoreProvider.of<AppState>(context);
|
||||
final state = store.state;
|
||||
final company = state.selectedCompany;
|
||||
final user = company.user;
|
||||
final localization = AppLocalization.of(context);
|
||||
|
||||
return AppScaffold(
|
||||
|
|
|
|||
Loading…
Reference in New Issue