Documents
This commit is contained in:
parent
2306da7e3d
commit
77407f1810
|
|
@ -486,6 +486,9 @@ abstract class CompanyEntity extends Object
|
||||||
|
|
||||||
String get displayName => settings.name ?? '';
|
String get displayName => settings.name ?? '';
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool get isActive => true;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool matchesFilter(String filter) {
|
bool matchesFilter(String filter) {
|
||||||
for (final user in users) {
|
for (final user in users) {
|
||||||
|
|
@ -753,6 +756,7 @@ abstract class CompanyEntity extends Object
|
||||||
|
|
||||||
// ignore: unused_element
|
// ignore: unused_element
|
||||||
static void _initializeBuilder(CompanyEntityBuilder builder) => builder
|
static void _initializeBuilder(CompanyEntityBuilder builder) => builder
|
||||||
|
..entityType = EntityType.company
|
||||||
..calculateExpenseTaxByAmount = false
|
..calculateExpenseTaxByAmount = false
|
||||||
..enableProductDiscount = false
|
..enableProductDiscount = false
|
||||||
..defaultTaskIsDateBased = false
|
..defaultTaskIsDateBased = false
|
||||||
|
|
|
||||||
|
|
@ -483,7 +483,7 @@ abstract class BaseEntity implements SelectableEntity {
|
||||||
ClientEntity client,
|
ClientEntity client,
|
||||||
bool includeEdit = false,
|
bool includeEdit = false,
|
||||||
bool multiselect = false}) {
|
bool multiselect = false}) {
|
||||||
if (isNew) {
|
if (isNew || entityType == EntityType.company) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -83,12 +83,15 @@ class _EntityListTileState extends State<EntityListTile> {
|
||||||
final trailing = widget.entity.createdAt == 0
|
final trailing = widget.entity.createdAt == 0
|
||||||
? null
|
? null
|
||||||
: IgnorePointer(
|
: IgnorePointer(
|
||||||
ignoring: !isHovered || widget.isFilter,
|
ignoring: !isHovered ||
|
||||||
|
widget.isFilter ||
|
||||||
|
widget.entity.entityType == EntityType.company,
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
icon: Icon(isHovered ||
|
icon: Icon(widget.entity.entityType != EntityType.company &&
|
||||||
widget.isFilter ||
|
(isHovered ||
|
||||||
isMobile(context) ||
|
widget.isFilter ||
|
||||||
state.uiState.previewStack.isNotEmpty
|
isMobile(context) ||
|
||||||
|
state.uiState.previewStack.isNotEmpty)
|
||||||
? Icons.chevron_right
|
? Icons.chevron_right
|
||||||
: Icons.filter_list),
|
: Icons.filter_list),
|
||||||
onPressed: () => viewEntity(
|
onPressed: () => viewEntity(
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ class EntityPresenter {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ([
|
if ([
|
||||||
|
EntityType.company,
|
||||||
EntityType.client,
|
EntityType.client,
|
||||||
EntityType.vendor,
|
EntityType.vendor,
|
||||||
EntityType.project,
|
EntityType.project,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
// Flutter imports:
|
// Flutter imports:
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:invoiceninja_flutter/ui/app/entities/entity_list_tile.dart';
|
||||||
|
import 'package:invoiceninja_flutter/ui/app/lists/list_divider.dart';
|
||||||
|
|
||||||
// Project imports:
|
// Project imports:
|
||||||
import 'package:invoiceninja_flutter/ui/app/loading_indicator.dart';
|
import 'package:invoiceninja_flutter/ui/app/loading_indicator.dart';
|
||||||
|
|
@ -26,17 +28,25 @@ class _DocumentViewState extends State<DocumentView> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final viewModel = widget.viewModel;
|
final viewModel = widget.viewModel;
|
||||||
|
final state = viewModel.state;
|
||||||
final document = viewModel.document;
|
final document = viewModel.document;
|
||||||
|
final entity = state.getEntity(document.parentType, document.parentId);
|
||||||
|
|
||||||
return ViewScaffold(
|
return ViewScaffold(
|
||||||
isFilter: widget.isFilter,
|
isFilter: widget.isFilter,
|
||||||
entity: document,
|
entity: document,
|
||||||
body: Column(children: [
|
body: Column(
|
||||||
document.data == null
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
? LoadingIndicator()
|
children: [
|
||||||
: SizedBox(
|
ListDivider(),
|
||||||
height: 600,
|
EntityListTile(
|
||||||
child: document.isImage
|
isFilter: widget.isFilter,
|
||||||
|
entity: entity,
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: document.data == null
|
||||||
|
? LoadingIndicator()
|
||||||
|
: document.isImage
|
||||||
? PinchZoom(
|
? PinchZoom(
|
||||||
child: Image.memory(document.data),
|
child: Image.memory(document.data),
|
||||||
)
|
)
|
||||||
|
|
@ -48,8 +58,9 @@ class _DocumentViewState extends State<DocumentView> {
|
||||||
allowSharing: false,
|
allowSharing: false,
|
||||||
canDebug: false,
|
canDebug: false,
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
]),
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -195,6 +195,8 @@ IconData getEntityIcon(EntityType entityType) {
|
||||||
return Icons.schedule;
|
return Icons.schedule;
|
||||||
case EntityType.document:
|
case EntityType.document:
|
||||||
return Icons.photo;
|
return Icons.photo;
|
||||||
|
case EntityType.company:
|
||||||
|
return Icons.business;
|
||||||
default:
|
default:
|
||||||
return MdiIcons.crosshairsQuestion;
|
return MdiIcons.crosshairsQuestion;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue