feat-tickets (#14)
Some checks failed
Deploy to Cloudflare Pages / build-and-deploy (push) Has been cancelled
Some checks failed
Deploy to Cloudflare Pages / build-and-deploy (push) Has been cancelled
Reviewed-on: #14 Co-authored-by: mark-cachy <marco@catelli.it> Co-committed-by: mark-cachy <marco@catelli.it>
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flux/core/blocs/session/session_cubit.dart';
|
||||
import 'package:flux/features/attachments/blocs/attachments_bloc.dart';
|
||||
import 'package:flux/features/operations/blocs/operations_cubit.dart';
|
||||
import 'package:flux/features/operations/models/operation_model.dart';
|
||||
import 'package:flux/features/operations/ui/widgets/customer_section.dart';
|
||||
import 'package:flux/core/widgets/shared_forms/customer_section.dart';
|
||||
import 'package:flux/features/operations/ui/widgets/details_section.dart';
|
||||
import 'package:flux/features/operations/ui/widgets/operation_files_section.dart';
|
||||
import 'package:flux/features/operations/ui/widgets/staff_section.dart';
|
||||
import 'package:get_it/get_it.dart'; // ASSICURATI DEL PATH
|
||||
// import 'package:flux/features/attachments/ui/operation_files_section.dart';
|
||||
import 'package:flux/core/widgets/shared_forms/attachments_section.dart';
|
||||
import 'package:flux/core/widgets/shared_forms/staff_section.dart';
|
||||
import 'package:get_it/get_it.dart';
|
||||
|
||||
class OperationFormScreen extends StatefulWidget {
|
||||
final String? operationId;
|
||||
@@ -216,8 +216,9 @@ class _OperationFormScreenState extends State<OperationFormScreen> {
|
||||
flex: 3,
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: OperationFilesSection(
|
||||
currentOp: state.currentOperation!,
|
||||
child: SharedAttachmentsSection(
|
||||
parentType: AttachmentParentType.operation,
|
||||
parentId: state.currentOperation?.id,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -317,10 +318,28 @@ class _OperationFormScreenState extends State<OperationFormScreen> {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
StaffSection(currentOp: currentOp),
|
||||
StaffSection(
|
||||
staffId: currentOp?.staffId,
|
||||
staffName: currentOp?.staffDisplayName,
|
||||
onStaffSelected: (staff) => {
|
||||
context.read<OperationsCubit>().updateOperationFields(
|
||||
staffId: staff.id,
|
||||
staffDisplayName: staff.name,
|
||||
),
|
||||
},
|
||||
),
|
||||
const Divider(height: 50),
|
||||
_buildSectionTitle('Cliente & Riferimento'),
|
||||
CustomerSection(currentOp: currentOp),
|
||||
SharedCustomerSection(
|
||||
customerId: currentOp?.customerId,
|
||||
customerName: currentOp?.customerDisplayName,
|
||||
onCustomerSelected: (customer) {
|
||||
context.read<OperationsCubit>().updateOperationFields(
|
||||
customerId: customer.id,
|
||||
customerDisplayName: customer.name,
|
||||
);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
TextFormField(
|
||||
controller: _referenceController,
|
||||
@@ -390,7 +409,12 @@ class _OperationFormScreenState extends State<OperationFormScreen> {
|
||||
),
|
||||
const Divider(height: 32),
|
||||
|
||||
if (showFiles) ...[OperationFilesSection(currentOp: currentOp!)],
|
||||
if (showFiles) ...[
|
||||
SharedAttachmentsSection(
|
||||
parentType: AttachmentParentType.operation,
|
||||
parentId: currentOp?.id,
|
||||
),
|
||||
],
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user