diff --git a/development_status.md b/development_status.md index 60533f3..7f45726 100644 --- a/development_status.md +++ b/development_status.md @@ -1,11 +1,11 @@ # UTO Manager — Development Status -_Last updated: 2026-08-09_ +_Last updated: 2026-08-09 (fix/phase-4-analyzer-errors)_ --- ## Current Branch -`main` (feature/phase-4-reporting-analytics merged) +`main` (fix/phase-4-analyzer-errors merged) ## Overall Progress diff --git a/lib/domain/services/command_event_store.dart b/lib/domain/services/command_event_store.dart index b825378..114014c 100644 --- a/lib/domain/services/command_event_store.dart +++ b/lib/domain/services/command_event_store.dart @@ -34,6 +34,17 @@ class CommandEvent { this.isSynced = false, }); + /// Deserializes a [CommandEvent] from a JSON-compatible map. + factory CommandEvent.fromJson(Map map) { + return CommandEvent( + eventId: map['eventId'] as String, + type: CommandEventType.values.firstWhere((t) => t.name == map['type']), + payload: map['payload'] as Map, + occurredAt: DateTime.parse(map['occurredAt'] as String), + isSynced: map['isSynced'] as bool? ?? false, + ); + } + /// Unique identifier for this event (UUID v4). final String eventId; @@ -58,17 +69,6 @@ class CommandEvent { 'isSynced': isSynced, }; - /// Deserializes a [CommandEvent] from a JSON-compatible map. - factory CommandEvent.fromJson(Map map) { - return CommandEvent( - eventId: map['eventId'] as String, - type: CommandEventType.values.firstWhere((t) => t.name == map['type']), - payload: (map['payload'] as Map), - occurredAt: DateTime.parse(map['occurredAt'] as String), - isSynced: map['isSynced'] as bool? ?? false, - ); - } - @override String toString() => 'CommandEvent(id: $eventId, type: ${type.name}, synced: $isSynced)'; } @@ -236,7 +236,6 @@ class DeltaSynchronizer { /// Sets the connectivity state. When set to true, [syncIfOnline] will /// attempt to transmit pending events. - // ignore: avoid_setters_without_getters set isOnline(bool value) => _isOnline = value; /// Returns true if the synchronizer believes it has network connectivity. diff --git a/lib/domain/services/unit_tree_service.dart b/lib/domain/services/unit_tree_service.dart index cb28d2e..52285fb 100644 --- a/lib/domain/services/unit_tree_service.dart +++ b/lib/domain/services/unit_tree_service.dart @@ -92,7 +92,7 @@ class UnitTreeService { } else { final parent = nodeMap[unit.parentUnitId]; if (parent != null) { - (parent.children as List).add(nodeMap[unit.unitId]!); + parent.children.add(nodeMap[unit.unitId]!); } } } diff --git a/lib/infrastructure/codecs/pdf_chart_exporter.dart b/lib/infrastructure/codecs/pdf_chart_exporter.dart index c63d18f..30492e9 100644 --- a/lib/infrastructure/codecs/pdf_chart_exporter.dart +++ b/lib/infrastructure/codecs/pdf_chart_exporter.dart @@ -43,17 +43,6 @@ extension _PdfPageSizeExt on PdfPageSize { return 1224; } } - - String get displayName { - switch (this) { - case PdfPageSize.letter: - return 'Letter (8.5×11)'; - case PdfPageSize.a4: - return 'A4 (210×297mm)'; - case PdfPageSize.tabloid: - return 'Tabloid/A3 (11×17)'; - } - } } // --------------------------------------------------------------------------- @@ -265,8 +254,6 @@ class _PdfBuilder { stream.writeln('BT /F1 10 Tf ${cx - 40} ${h - 20} Td ($classification) Tj ET'); stream.writeln('BT /F1 10 Tf ${cx - 40} 10 Td ($classification) Tj ET'); - final unitById = {for (final u in units) u.unitId: u}; - // Draw connector lines first (behind boxes). for (final unit in units) { if (unit.parentUnitId == null) continue; diff --git a/lib/infrastructure/codecs/protobuf_codec.dart b/lib/infrastructure/codecs/protobuf_codec.dart index 261f949..64c5fe6 100644 --- a/lib/infrastructure/codecs/protobuf_codec.dart +++ b/lib/infrastructure/codecs/protobuf_codec.dart @@ -36,7 +36,7 @@ class ProtobufCodec { static const int _magic = 0x55544F42; // "UTOB" static const int _version = 1; - final _jsonCodec = const UnitTreeCodec(); + UnitTreeCodec get _jsonCodec => const UnitTreeCodec(); // --------------------------------------------------------------------------- // Encode diff --git a/lib/presentation/screens/home_screen.dart b/lib/presentation/screens/home_screen.dart index 198e62d..592f513 100644 --- a/lib/presentation/screens/home_screen.dart +++ b/lib/presentation/screens/home_screen.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:uto_manager/application/blocs/personnel_cubit.dart'; -import 'package:uto_manager/application/blocs/template_cubit.dart'; import 'package:uto_manager/application/blocs/unit_tree_cubit.dart'; import 'package:uto_manager/application/blocs/validation_cubit.dart'; import 'package:uto_manager/domain/entities/personnel_record.dart'; diff --git a/test/widget_test.dart b/test/widget_test.dart index eaefb8e..77eb3a4 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -1,4 +1,3 @@ -import 'package:drift/drift.dart'; import 'package:drift/native.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart';