From 0a1a2ffde521e82c31b11024889483d3460f899b Mon Sep 17 00:00:00 2001 From: Dayron Date: Sat, 1 Nov 2025 16:29:37 +0100 Subject: [PATCH] feat: Add library directive to multiple BLoC and service files for improved organization --- .metadata | 15 --------------- lib/blocs/account/account_bloc.dart | 1 + lib/blocs/account/account_state.dart | 1 + lib/blocs/auth/auth_bloc.dart | 1 + lib/blocs/balance/balance_bloc.dart | 1 + lib/blocs/group/group_bloc.dart | 1 + lib/blocs/group/group_event.dart | 1 + lib/blocs/group/group_state.dart | 1 + lib/blocs/message/message_bloc.dart | 1 + lib/blocs/message/message_event.dart | 1 + lib/blocs/message/message_state.dart | 1 + lib/blocs/trip/trip_bloc.dart | 1 + lib/blocs/trip/trip_event.dart | 1 + lib/blocs/trip/trip_state.dart | 1 + lib/components/account/account_content.dart | 1 + lib/components/account/add_expense_dialog.dart | 1 + lib/components/account/balances_tab.dart | 1 + lib/components/account/expense_detail_dialog.dart | 1 + lib/services/balance_service.dart | 1 + lib/services/storage_service.dart | 1 + lib/services/trip_service.dart | 1 + 21 files changed, 20 insertions(+), 15 deletions(-) diff --git a/.metadata b/.metadata index 84f56b1..1eb916f 100644 --- a/.metadata +++ b/.metadata @@ -18,21 +18,6 @@ migration: - platform: android create_revision: d693b4b9dbac2acd4477aea4555ca6dcbea44ba2 base_revision: d693b4b9dbac2acd4477aea4555ca6dcbea44ba2 - - platform: ios - create_revision: d693b4b9dbac2acd4477aea4555ca6dcbea44ba2 - base_revision: d693b4b9dbac2acd4477aea4555ca6dcbea44ba2 - - platform: linux - create_revision: d693b4b9dbac2acd4477aea4555ca6dcbea44ba2 - base_revision: d693b4b9dbac2acd4477aea4555ca6dcbea44ba2 - - platform: macos - create_revision: d693b4b9dbac2acd4477aea4555ca6dcbea44ba2 - base_revision: d693b4b9dbac2acd4477aea4555ca6dcbea44ba2 - - platform: web - create_revision: d693b4b9dbac2acd4477aea4555ca6dcbea44ba2 - base_revision: d693b4b9dbac2acd4477aea4555ca6dcbea44ba2 - - platform: windows - create_revision: d693b4b9dbac2acd4477aea4555ca6dcbea44ba2 - base_revision: d693b4b9dbac2acd4477aea4555ca6dcbea44ba2 # User provided section diff --git a/lib/blocs/account/account_bloc.dart b/lib/blocs/account/account_bloc.dart index a31e25e..4ea2bba 100644 --- a/lib/blocs/account/account_bloc.dart +++ b/lib/blocs/account/account_bloc.dart @@ -21,6 +21,7 @@ /// ```dart /// accountBloc.close(); /// ``` +library; import 'dart:async'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:travel_mate/services/error_service.dart'; diff --git a/lib/blocs/account/account_state.dart b/lib/blocs/account/account_state.dart index e67a8b5..9db4555 100644 --- a/lib/blocs/account/account_state.dart +++ b/lib/blocs/account/account_state.dart @@ -4,6 +4,7 @@ /// instances. Subclasses should provide the relevant properties by /// overriding `props` so that the bloc can correctly determine whether /// the state has changed. +library; /// Represents the initial state of the account feature. /// diff --git a/lib/blocs/auth/auth_bloc.dart b/lib/blocs/auth/auth_bloc.dart index 56be1b1..baa3dfa 100644 --- a/lib/blocs/auth/auth_bloc.dart +++ b/lib/blocs/auth/auth_bloc.dart @@ -19,6 +19,7 @@ /// - [AuthAppleSignInRequested]: Processes Apple authentication /// - [AuthSignOutRequested]: Processes user sign-out /// - [AuthPasswordResetRequested]: Processes password reset requests +library; import 'package:flutter_bloc/flutter_bloc.dart'; import '../../repositories/auth_repository.dart'; import 'auth_event.dart'; diff --git a/lib/blocs/balance/balance_bloc.dart b/lib/blocs/balance/balance_bloc.dart index b952c31..d726970 100644 --- a/lib/blocs/balance/balance_bloc.dart +++ b/lib/blocs/balance/balance_bloc.dart @@ -31,6 +31,7 @@ /// amount: 50.0, /// )); /// ``` +library; import 'package:flutter_bloc/flutter_bloc.dart'; import '../../repositories/balance_repository.dart'; import '../../repositories/expense_repository.dart'; diff --git a/lib/blocs/group/group_bloc.dart b/lib/blocs/group/group_bloc.dart index cedddb8..3e8d0ae 100644 --- a/lib/blocs/group/group_bloc.dart +++ b/lib/blocs/group/group_bloc.dart @@ -31,6 +31,7 @@ /// members: [member1, member2], /// )); /// ``` +library; import 'dart:async'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:travel_mate/services/error_service.dart'; diff --git a/lib/blocs/group/group_event.dart b/lib/blocs/group/group_event.dart index e394f40..a5a88dc 100644 --- a/lib/blocs/group/group_event.dart +++ b/lib/blocs/group/group_event.dart @@ -12,6 +12,7 @@ /// /// All events extend [GroupEvent] and implement [Equatable] for proper /// equality comparison in the BLoC pattern. +library; import 'package:equatable/equatable.dart'; import '../../models/group.dart'; import '../../models/group_member.dart'; diff --git a/lib/blocs/group/group_state.dart b/lib/blocs/group/group_state.dart index 165fd24..f7ea520 100644 --- a/lib/blocs/group/group_state.dart +++ b/lib/blocs/group/group_state.dart @@ -12,6 +12,7 @@ /// /// All states extend [GroupState] and implement [Equatable] for proper /// equality comparison and state change detection in the BLoC pattern. +library; import 'package:equatable/equatable.dart'; import '../../models/group.dart'; diff --git a/lib/blocs/message/message_bloc.dart b/lib/blocs/message/message_bloc.dart index 9b6822f..8ddee00 100644 --- a/lib/blocs/message/message_bloc.dart +++ b/lib/blocs/message/message_bloc.dart @@ -39,6 +39,7 @@ /// reaction: '👍', /// )); /// ``` +library; import 'dart:async'; import 'package:flutter_bloc/flutter_bloc.dart'; import '../../models/message.dart'; diff --git a/lib/blocs/message/message_event.dart b/lib/blocs/message/message_event.dart index 5a0c278..79a4e12 100644 --- a/lib/blocs/message/message_event.dart +++ b/lib/blocs/message/message_event.dart @@ -14,6 +14,7 @@ /// /// All events extend [MessageEvent] and implement [Equatable] for proper /// equality comparison in the BLoC pattern. +library; import 'package:equatable/equatable.dart'; /// Base class for all message-related events. diff --git a/lib/blocs/message/message_state.dart b/lib/blocs/message/message_state.dart index 1656bd5..7b5b08a 100644 --- a/lib/blocs/message/message_state.dart +++ b/lib/blocs/message/message_state.dart @@ -15,6 +15,7 @@ /// /// All states extend [MessageState] and implement [Equatable] for proper /// equality comparison and state change detection in the BLoC pattern. +library; import 'package:equatable/equatable.dart'; import '../../models/message.dart'; diff --git a/lib/blocs/trip/trip_bloc.dart b/lib/blocs/trip/trip_bloc.dart index 9609121..9ce4c68 100644 --- a/lib/blocs/trip/trip_bloc.dart +++ b/lib/blocs/trip/trip_bloc.dart @@ -35,6 +35,7 @@ /// // Delete a trip /// tripBloc.add(TripDeleteRequested(tripId: 'tripId456')); /// ``` +library; import 'dart:async'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:travel_mate/models/trip.dart'; diff --git a/lib/blocs/trip/trip_event.dart b/lib/blocs/trip/trip_event.dart index e7391ef..4239990 100644 --- a/lib/blocs/trip/trip_event.dart +++ b/lib/blocs/trip/trip_event.dart @@ -14,6 +14,7 @@ /// /// All events extend [TripEvent] and implement [Equatable] for proper /// equality comparison in the BLoC pattern. +library; import 'package:equatable/equatable.dart'; import '../../models/trip.dart'; diff --git a/lib/blocs/trip/trip_state.dart b/lib/blocs/trip/trip_state.dart index d5d4032..fb5defd 100644 --- a/lib/blocs/trip/trip_state.dart +++ b/lib/blocs/trip/trip_state.dart @@ -15,6 +15,7 @@ /// /// All states extend [TripState] and implement [Equatable] for proper /// equality comparison and state change detection in the BLoC pattern. +library; import 'package:equatable/equatable.dart'; import '../../models/trip.dart'; diff --git a/lib/components/account/account_content.dart b/lib/components/account/account_content.dart index 7ac1a06..1abefc3 100644 --- a/lib/components/account/account_content.dart +++ b/lib/components/account/account_content.dart @@ -18,6 +18,7 @@ /// /// The component automatically loads account data when initialized and /// provides a clean interface for managing group-based expenses. +library; import 'package:flutter/material.dart'; import 'package:travel_mate/blocs/user/user_bloc.dart'; import '../../models/account.dart'; diff --git a/lib/components/account/add_expense_dialog.dart b/lib/components/account/add_expense_dialog.dart index 68df00c..f50c6fc 100644 --- a/lib/components/account/add_expense_dialog.dart +++ b/lib/components/account/add_expense_dialog.dart @@ -55,6 +55,7 @@ /// - Expense /// - Group /// - ExpenseBloc +library; import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; diff --git a/lib/components/account/balances_tab.dart b/lib/components/account/balances_tab.dart index aa4b3ac..dba1e63 100644 --- a/lib/components/account/balances_tab.dart +++ b/lib/components/account/balances_tab.dart @@ -3,6 +3,7 @@ /// the amount they owe, and their overall balance status (to pay, to receive, or balanced). /// /// The widget handles both light and dark themes and provides a fallback UI for empty balance lists. +library; import 'package:flutter/material.dart'; import '../../models/user_balance.dart'; diff --git a/lib/components/account/expense_detail_dialog.dart b/lib/components/account/expense_detail_dialog.dart index 7a800e5..c40cf69 100644 --- a/lib/components/account/expense_detail_dialog.dart +++ b/lib/components/account/expense_detail_dialog.dart @@ -5,6 +5,7 @@ /// The dialog is highly interactive and adapts its UI based on the current user's permissions and the state /// of the expense. It also integrates with BLoC for state management and supports features like receipt display /// and split payment marking. +library; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; diff --git a/lib/services/balance_service.dart b/lib/services/balance_service.dart index 278576a..dad46ea 100644 --- a/lib/services/balance_service.dart +++ b/lib/services/balance_service.dart @@ -31,6 +31,7 @@ /// - [GroupBalance] for the complete balance structure /// - [Settlement] for individual payment recommendations /// - [UserBalance] for per-user balance information +library; import '../models/group_balance.dart'; import '../models/expense.dart'; import '../models/group_statistics.dart'; diff --git a/lib/services/storage_service.dart b/lib/services/storage_service.dart index c0710f7..a9d587e 100644 --- a/lib/services/storage_service.dart +++ b/lib/services/storage_service.dart @@ -24,6 +24,7 @@ /// // Delete a file /// await storageService.deleteFile(fileUrl); /// ``` +library; import 'dart:io'; import 'dart:typed_data'; import 'package:firebase_storage/firebase_storage.dart'; diff --git a/lib/services/trip_service.dart b/lib/services/trip_service.dart index 1ee7652..cd84b56 100644 --- a/lib/services/trip_service.dart +++ b/lib/services/trip_service.dart @@ -24,6 +24,7 @@ /// // Calculate trip statistics /// final stats = await tripService.getTripStatistics(tripId); /// ``` +library; import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:travel_mate/services/error_service.dart'; import '../models/trip.dart';