Add designs templates

This commit is contained in:
Hillel Coren 2023-11-09 18:17:02 +02:00
parent 911c95bd0a
commit 589e9483a4
2 changed files with 26 additions and 1 deletions

View File

@ -1,5 +1,6 @@
// Package imports: // Package imports:
import 'package:built_collection/built_collection.dart'; import 'package:built_collection/built_collection.dart';
import 'package:flutter/foundation.dart';
import 'package:memoize/memoize.dart'; import 'package:memoize/memoize.dart';
// Project imports: // Project imports:
@ -101,6 +102,10 @@ String? getDesignIdForVendorByEntity(
bool hasDesignTemplatesForEntityType( bool hasDesignTemplatesForEntityType(
BuiltMap<String, DesignEntity> designMap, EntityType entityType) { BuiltMap<String, DesignEntity> designMap, EntityType entityType) {
if (!kReleaseMode) {
return true;
}
var hasMatch = false; var hasMatch = false;
designMap.forEach((designId, design) { designMap.forEach((designId, design) {

View File

@ -432,7 +432,27 @@ class _ClientPdfViewState extends State<ClientPdfView> {
sectionPicker, sectionPicker,
], ],
) )
: Placeholder(), : Column(
children: [
Row(
children: [
datePicker,
SizedBox(width: 16),
statusPicker,
],
),
Row(
children: [
if (hasDesignTemplatesForEntityType(
state.designState.map, EntityType.client)) ...[
designPicker,
SizedBox(width: 16),
],
sectionPicker,
],
),
],
),
), ),
), ),
if (_dateRange == DateRange.custom) if (_dateRange == DateRange.custom)