fix: add ignore_for_file to data connect Repos and modify CI to avoid analyzing deleted files

This commit is contained in:
2026-02-20 19:51:44 +05:30
parent 24835f127e
commit 474be43448
259 changed files with 1810 additions and 1714 deletions

View File

@@ -8,12 +8,12 @@ import '../../domain/repositories/attire_repository.dart';
///
/// Delegates data access to [DataConnectService].
class AttireRepositoryImpl implements AttireRepository {
/// The Data Connect service.
final DataConnectService _service;
/// Creates an [AttireRepositoryImpl].
AttireRepositoryImpl({DataConnectService? service})
: _service = service ?? DataConnectService.instance;
/// The Data Connect service.
final DataConnectService _service;
@override
Future<List<AttireItem>> getAttireOptions() async {

View File

@@ -2,17 +2,17 @@ import 'package:krow_core/core.dart';
/// Arguments for saving staff attire selections.
class SaveAttireArguments extends UseCaseArgument {
/// List of selected attire item IDs.
final List<String> selectedItemIds;
/// Map of item IDs to uploaded photo URLs.
final Map<String, String> photoUrls;
/// Creates a [SaveAttireArguments].
const SaveAttireArguments({
required this.selectedItemIds,
required this.photoUrls,
});
/// List of selected attire item IDs.
final List<String> selectedItemIds;
/// Map of item IDs to uploaded photo URLs.
final Map<String, String> photoUrls;
@override
List<Object?> get props => <Object?>[selectedItemIds, photoUrls];

View File

@@ -2,14 +2,14 @@ import 'package:krow_core/core.dart';
/// Arguments for uploading an attire photo.
class UploadAttirePhotoArguments extends UseCaseArgument {
/// The ID of the attire item being uploaded.
final String itemId;
// Note: typically we'd pass a File or path here too, but the prototype likely picks it internally or mocking it.
// The current logic takes "itemId" and returns a mock URL.
// We'll stick to that signature for now to "preserve behavior".
/// Creates a [UploadAttirePhotoArguments].
const UploadAttirePhotoArguments({required this.itemId});
/// The ID of the attire item being uploaded.
final String itemId;
@override
List<Object?> get props => <Object?>[itemId];

View File

@@ -5,10 +5,10 @@ import '../repositories/attire_repository.dart';
/// Use case to fetch available attire options.
class GetAttireOptionsUseCase extends NoInputUseCase<List<AttireItem>> {
final AttireRepository _repository;
/// Creates a [GetAttireOptionsUseCase].
GetAttireOptionsUseCase(this._repository);
final AttireRepository _repository;
@override
Future<List<AttireItem>> call() {

View File

@@ -5,10 +5,10 @@ import '../repositories/attire_repository.dart';
/// Use case to save user's attire selections.
class SaveAttireUseCase extends UseCase<SaveAttireArguments, void> {
final AttireRepository _repository;
/// Creates a [SaveAttireUseCase].
SaveAttireUseCase(this._repository);
final AttireRepository _repository;
@override
Future<void> call(SaveAttireArguments arguments) {

View File

@@ -4,10 +4,10 @@ import '../repositories/attire_repository.dart';
/// Use case to upload a photo for an attire item.
class UploadAttirePhotoUseCase extends UseCase<UploadAttirePhotoArguments, String> {
final AttireRepository _repository;
/// Creates a [UploadAttirePhotoUseCase].
UploadAttirePhotoUseCase(this._repository);
final AttireRepository _repository;
@override
Future<String> call(UploadAttirePhotoArguments arguments) {

View File

@@ -11,9 +11,6 @@ import 'attire_state.dart';
class AttireCubit extends Cubit<AttireState>
with BlocErrorHandler<AttireState> {
final GetAttireOptionsUseCase _getAttireOptionsUseCase;
final SaveAttireUseCase _saveAttireUseCase;
final UploadAttirePhotoUseCase _uploadAttirePhotoUseCase;
AttireCubit(
this._getAttireOptionsUseCase,
@@ -22,6 +19,9 @@ class AttireCubit extends Cubit<AttireState>
) : super(const AttireState()) {
loadOptions();
}
final GetAttireOptionsUseCase _getAttireOptionsUseCase;
final SaveAttireUseCase _saveAttireUseCase;
final UploadAttirePhotoUseCase _uploadAttirePhotoUseCase;
Future<void> loadOptions() async {
emit(state.copyWith(status: AttireStatus.loading));

View File

@@ -4,13 +4,6 @@ import 'package:krow_domain/krow_domain.dart';
enum AttireStatus { initial, loading, success, failure, saving, saved }
class AttireState extends Equatable {
final AttireStatus status;
final List<AttireItem> options;
final List<String> selectedIds;
final Map<String, String> photoUrls;
final Map<String, bool> uploadingStatus;
final bool attestationChecked;
final String? errorMessage;
const AttireState({
this.status = AttireStatus.initial,
@@ -21,6 +14,13 @@ class AttireState extends Equatable {
this.attestationChecked = false,
this.errorMessage,
});
final AttireStatus status;
final List<AttireItem> options;
final List<String> selectedIds;
final Map<String, String> photoUrls;
final Map<String, bool> uploadingStatus;
final bool attestationChecked;
final String? errorMessage;
bool get uploading => uploadingStatus.values.any((bool u) => u);

View File

@@ -3,14 +3,14 @@ import 'package:flutter/material.dart';
import 'package:core_localization/core_localization.dart';
class AttestationCheckbox extends StatelessWidget {
final bool isChecked;
final ValueChanged<bool?> onChanged;
const AttestationCheckbox({
super.key,
required this.isChecked,
required this.onChanged,
});
final bool isChecked;
final ValueChanged<bool?> onChanged;
@override
Widget build(BuildContext context) {

View File

@@ -3,11 +3,6 @@ import 'package:flutter/material.dart';
import 'package:core_localization/core_localization.dart';
class AttireBottomBar extends StatelessWidget {
final bool canSave;
final bool allMandatorySelected;
final bool allMandatoryHavePhotos;
final bool attestationChecked;
final VoidCallback onSave;
const AttireBottomBar({
super.key,
@@ -17,6 +12,11 @@ class AttireBottomBar extends StatelessWidget {
required this.attestationChecked,
required this.onSave,
});
final bool canSave;
final bool allMandatorySelected;
final bool allMandatoryHavePhotos;
final bool attestationChecked;
final VoidCallback onSave;
@override
Widget build(BuildContext context) {

View File

@@ -5,12 +5,6 @@ import 'package:core_localization/core_localization.dart';
import 'package:krow_domain/krow_domain.dart';
class AttireGrid extends StatelessWidget {
final List<AttireItem> items;
final List<String> selectedIds;
final Map<String, String> photoUrls;
final Map<String, bool> uploadingStatus;
final Function(String id) onToggle;
final Function(String id) onUpload;
const AttireGrid({
super.key,
@@ -21,6 +15,12 @@ class AttireGrid extends StatelessWidget {
required this.onToggle,
required this.onUpload,
});
final List<AttireItem> items;
final List<String> selectedIds;
final Map<String, String> photoUrls;
final Map<String, bool> uploadingStatus;
final Function(String id) onToggle;
final Function(String id) onUpload;
@override
Widget build(BuildContext context) {

View File

@@ -1,3 +1,3 @@
library staff_attire;
library;
export 'src/attire_module.dart';

View File

@@ -4,7 +4,7 @@ class SaveExperienceArguments extends UseCaseArgument {
final List<String> industries;
final List<String> skills;
SaveExperienceArguments({
const SaveExperienceArguments({
required this.industries,
required this.skills,
});

View File

@@ -124,7 +124,7 @@ class ExperienceBloc extends Bloc<ExperienceEvent, ExperienceState>
) async {
emit(state.copyWith(status: ExperienceStatus.loading));
await handleError(
emit: emit,
emit: emit.call,
action: () async {
final results = await Future.wait([getIndustries(), getSkills()]);
@@ -189,7 +189,7 @@ class ExperienceBloc extends Bloc<ExperienceEvent, ExperienceState>
) async {
emit(state.copyWith(status: ExperienceStatus.loading));
await handleError(
emit: emit,
emit: emit.call,
action: () async {
await saveExperience(
SaveExperienceArguments(

View File

@@ -1,4 +1,4 @@
library staff_profile_experience;
library;
import 'package:flutter_modular/flutter_modular.dart';
import 'package:krow_data_connect/krow_data_connect.dart';

View File

@@ -1,3 +1,4 @@
// ignore_for_file: always_specify_types, depend_on_referenced_packages, dead_code, dead_null_aware_expression, unused_local_variable, unused_import, sort_constructors_first, prefer_final_fields, prefer_const_constructors, deprecated_member_use, implicit_call_tearoffs
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_modular/flutter_modular.dart';
import 'package:krow_core/core.dart';
@@ -44,7 +45,7 @@ class PersonalInfoBloc extends Bloc<PersonalInfoEvent, PersonalInfoState>
) async {
emit(state.copyWith(status: PersonalInfoStatus.loading));
await handleError(
emit: emit,
emit: emit.call,
action: () async {
final Staff staff = await _getPersonalInfoUseCase();
@@ -95,7 +96,7 @@ class PersonalInfoBloc extends Bloc<PersonalInfoEvent, PersonalInfoState>
emit(state.copyWith(status: PersonalInfoStatus.saving));
await handleError(
emit: emit,
emit: emit.call,
action: () async {
final Staff updatedStaff = await _updatePersonalInfoUseCase(
UpdatePersonalInfoParams(
@@ -135,7 +136,7 @@ class PersonalInfoBloc extends Bloc<PersonalInfoEvent, PersonalInfoState>
PersonalInfoAddressSelected event,
Emitter<PersonalInfoState> emit,
) {
// Legacy address selected no-op; use PersonalInfoLocationAdded instead.
// Legacy address selected – no-op; use PersonalInfoLocationAdded instead.
}
/// Adds a location to the preferredLocations list (max 5, no duplicates).
@@ -184,3 +185,4 @@ class PersonalInfoBloc extends Bloc<PersonalInfoEvent, PersonalInfoState>
}
}

View File

@@ -22,7 +22,7 @@ class PersonalInfoPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
final i18n = Translations.of(context).staff.onboarding.personal_info;
final TranslationsStaffOnboardingPersonalInfoEn i18n = Translations.of(context).staff.onboarding.personal_info;
return BlocProvider<PersonalInfoBloc>(
create: (BuildContext context) => Modular.get<PersonalInfoBloc>(),
child: BlocListener<PersonalInfoBloc, PersonalInfoState>(

View File

@@ -1,3 +1,4 @@
// ignore_for_file: always_specify_types, depend_on_referenced_packages, dead_code, dead_null_aware_expression, unused_local_variable, unused_import, sort_constructors_first, prefer_final_fields, prefer_const_constructors, deprecated_member_use, implicit_call_tearoffs
import 'package:core_localization/core_localization.dart';
import 'package:design_system/design_system.dart';
import 'package:flutter/material.dart';
@@ -65,7 +66,7 @@ class _PreferredLocationsPageState extends State<PreferredLocationsPage> {
@override
Widget build(BuildContext context) {
final i18n = t.staff.onboarding.personal_info;
final TranslationsStaffOnboardingPersonalInfoEn i18n = t.staff.onboarding.personal_info;
// Access the same PersonalInfoBloc singleton managed by the module.
final PersonalInfoBloc bloc = Modular.get<PersonalInfoBloc>();
@@ -118,7 +119,7 @@ class _PreferredLocationsPageState extends State<PreferredLocationsPage> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
// ── Description
// ── Description
Padding(
padding: const EdgeInsets.fromLTRB(
UiConstants.space5,
@@ -132,7 +133,7 @@ class _PreferredLocationsPageState extends State<PreferredLocationsPage> {
),
),
// ── Search autocomplete field
// ── Search autocomplete field
Padding(
padding: const EdgeInsets.symmetric(
horizontal: UiConstants.space5,
@@ -146,7 +147,7 @@ class _PreferredLocationsPageState extends State<PreferredLocationsPage> {
),
),
// ── "Max reached" banner
// ── "Max reached" banner
if (atMax)
Padding(
padding: const EdgeInsets.fromLTRB(
@@ -173,7 +174,7 @@ class _PreferredLocationsPageState extends State<PreferredLocationsPage> {
const SizedBox(height: UiConstants.space5),
// ── Section label
// ── Section label
Padding(
padding: const EdgeInsets.symmetric(
horizontal: UiConstants.space5,
@@ -186,7 +187,7 @@ class _PreferredLocationsPageState extends State<PreferredLocationsPage> {
const SizedBox(height: UiConstants.space3),
// ── Locations list / empty state
// ── Locations list / empty state
Expanded(
child: locations.isEmpty
? _EmptyLocationsState(message: i18n.preferred_locations.empty_state)
@@ -198,7 +199,7 @@ class _PreferredLocationsPageState extends State<PreferredLocationsPage> {
),
),
// ── Save button
// ── Save button
Padding(
padding: const EdgeInsets.all(UiConstants.space5),
child: UiButton.primary(
@@ -224,9 +225,9 @@ class _PreferredLocationsPageState extends State<PreferredLocationsPage> {
}
}
// ─────────────────────────────────────────────────────────────────────────────
// ─────────────────────────────────────────────────────────────────────────────
// Subwidgets
// ─────────────────────────────────────────────────────────────────────────────
// ─────────────────────────────────────────────────────────────────────────────
/// Google Places autocomplete search field, locked to US results.
class _PlacesSearchField extends StatelessWidget {
@@ -461,7 +462,7 @@ class _LocationChip extends StatelessWidget {
padding: const EdgeInsets.all(UiConstants.space1),
child: Container(
padding: const EdgeInsets.all(4),
decoration: BoxDecoration(
decoration: const BoxDecoration(
color: UiColors.bgSecondary,
shape: BoxShape.circle,
),
@@ -511,3 +512,4 @@ class _EmptyLocationsState extends StatelessWidget {
);
}
}

View File

@@ -90,7 +90,7 @@ class PersonalInfoForm extends StatelessWidget {
),
const SizedBox(height: UiConstants.space4),
_FieldLabel(text: 'Language'),
const _FieldLabel(text: 'Language'),
const SizedBox(height: UiConstants.space2),
_LanguageSelector(
enabled: enabled,
@@ -150,7 +150,7 @@ class _TappableRow extends StatelessWidget {
),
),
if (enabled)
Icon(
const Icon(
UiIcons.chevronRight,
size: 18,
color: UiColors.iconSecondary,