This commit is contained in:
2026-05-06 12:40:27 +02:00
parent bdde092976
commit d15d7e458b
7 changed files with 528 additions and 40 deletions

View File

@@ -1,12 +1,13 @@
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/core/widgets/shared_forms/customer_section.dart';
import 'package:flux/core/widgets/shared_forms/shared_customer_section.dart';
import 'package:flux/features/operations/ui/widgets/details_section.dart';
import 'package:flux/core/widgets/shared_forms/operation_files_section.dart';
import 'package:flux/core/widgets/shared_forms/staff_section.dart';
import 'package:flux/core/widgets/shared_forms/shared_attachments_section.dart';
import 'package:flux/core/widgets/shared_forms/shared_staff_section.dart';
import 'package:get_it/get_it.dart';
class OperationFormScreen extends StatefulWidget {
@@ -215,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,
),
),
),
@@ -327,7 +329,7 @@ class _OperationFormScreenState extends State<OperationFormScreen> {
),
const Divider(height: 50),
_buildSectionTitle('Cliente & Riferimento'),
CustomerSection(
SharedCustomerSection(
currentOp: currentOp,
onCustomerSelected: (customer) {
context.read<OperationsCubit>().updateOperationFields(
@@ -405,7 +407,12 @@ class _OperationFormScreenState extends State<OperationFormScreen> {
),
const Divider(height: 32),
if (showFiles) ...[OperationFilesSection(currentOp: currentOp!)],
if (showFiles) ...[
SharedAttachmentsSection(
parentType: AttachmentParentType.operation,
parentId: currentOp?.id,
),
],
],
);
}