fix: add ignore_for_file to data connect Repos and modify CI to avoid analyzing deleted files
This commit is contained in:
@@ -10,12 +10,6 @@ import 'profile_state.dart';
|
||||
/// Handles loading profile data and user sign-out actions.
|
||||
class ProfileCubit extends Cubit<ProfileState>
|
||||
with BlocErrorHandler<ProfileState> {
|
||||
final GetStaffProfileUseCase _getProfileUseCase;
|
||||
final SignOutStaffUseCase _signOutUseCase;
|
||||
final GetPersonalInfoCompletionUseCase _getPersonalInfoCompletionUseCase;
|
||||
final GetEmergencyContactsCompletionUseCase _getEmergencyContactsCompletionUseCase;
|
||||
final GetExperienceCompletionUseCase _getExperienceCompletionUseCase;
|
||||
final GetTaxFormsCompletionUseCase _getTaxFormsCompletionUseCase;
|
||||
|
||||
/// Creates a [ProfileCubit] with the required use cases.
|
||||
ProfileCubit(
|
||||
@@ -26,6 +20,12 @@ class ProfileCubit extends Cubit<ProfileState>
|
||||
this._getExperienceCompletionUseCase,
|
||||
this._getTaxFormsCompletionUseCase,
|
||||
) : super(const ProfileState());
|
||||
final GetStaffProfileUseCase _getProfileUseCase;
|
||||
final SignOutStaffUseCase _signOutUseCase;
|
||||
final GetPersonalInfoCompletionUseCase _getPersonalInfoCompletionUseCase;
|
||||
final GetEmergencyContactsCompletionUseCase _getEmergencyContactsCompletionUseCase;
|
||||
final GetExperienceCompletionUseCase _getExperienceCompletionUseCase;
|
||||
final GetTaxFormsCompletionUseCase _getTaxFormsCompletionUseCase;
|
||||
|
||||
/// Loads the staff member's profile.
|
||||
///
|
||||
|
||||
@@ -24,6 +24,16 @@ enum ProfileStatus {
|
||||
/// Contains the current profile data and loading status.
|
||||
/// Uses the [Staff] entity directly from domain layer.
|
||||
class ProfileState extends Equatable {
|
||||
|
||||
const ProfileState({
|
||||
this.status = ProfileStatus.initial,
|
||||
this.profile,
|
||||
this.errorMessage,
|
||||
this.personalInfoComplete,
|
||||
this.emergencyContactsComplete,
|
||||
this.experienceComplete,
|
||||
this.taxFormsComplete,
|
||||
});
|
||||
/// Current status of the profile feature
|
||||
final ProfileStatus status;
|
||||
|
||||
@@ -45,16 +55,6 @@ class ProfileState extends Equatable {
|
||||
/// Whether tax forms are complete
|
||||
final bool? taxFormsComplete;
|
||||
|
||||
const ProfileState({
|
||||
this.status = ProfileStatus.initial,
|
||||
this.profile,
|
||||
this.errorMessage,
|
||||
this.personalInfoComplete,
|
||||
this.emergencyContactsComplete,
|
||||
this.experienceComplete,
|
||||
this.taxFormsComplete,
|
||||
});
|
||||
|
||||
/// Creates a copy of this state with updated values.
|
||||
ProfileState copyWith({
|
||||
ProfileStatus? status,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'package:core_localization/core_localization.dart';
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
|
||||
/// A bottom sheet that allows the user to select their preferred language.
|
||||
@@ -15,8 +14,8 @@ class LanguageSelectorBottomSheet extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
padding: EdgeInsets.all(UiConstants.space6),
|
||||
decoration: BoxDecoration(
|
||||
padding: const EdgeInsets.all(UiConstants.space6),
|
||||
decoration: const BoxDecoration(
|
||||
color: UiColors.background,
|
||||
borderRadius: BorderRadius.vertical(top: Radius.circular(UiConstants.radiusBase)),
|
||||
),
|
||||
@@ -24,25 +23,25 @@ class LanguageSelectorBottomSheet extends StatelessWidget {
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Text(
|
||||
t.settings.change_language,
|
||||
style: UiTypography.headline4m,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
SizedBox(height: UiConstants.space6),
|
||||
const SizedBox(height: UiConstants.space6),
|
||||
_buildLanguageOption(
|
||||
context,
|
||||
label: 'English',
|
||||
locale: AppLocale.en,
|
||||
),
|
||||
SizedBox(height: UiConstants.space4),
|
||||
const SizedBox(height: UiConstants.space4),
|
||||
_buildLanguageOption(
|
||||
context,
|
||||
label: 'Español',
|
||||
locale: AppLocale.es,
|
||||
),
|
||||
SizedBox(height: UiConstants.space6),
|
||||
const SizedBox(height: UiConstants.space6),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -73,7 +72,7 @@ class LanguageSelectorBottomSheet extends StatelessWidget {
|
||||
},
|
||||
borderRadius: BorderRadius.circular(UiConstants.radiusMdValue),
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: UiConstants.space4,
|
||||
horizontal: UiConstants.space4,
|
||||
),
|
||||
@@ -87,7 +86,7 @@ class LanguageSelectorBottomSheet extends StatelessWidget {
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Text(
|
||||
label,
|
||||
style: isSelected
|
||||
@@ -95,7 +94,7 @@ class LanguageSelectorBottomSheet extends StatelessWidget {
|
||||
: UiTypography.body1r,
|
||||
),
|
||||
if (isSelected)
|
||||
Icon(
|
||||
const Icon(
|
||||
UiIcons.check,
|
||||
color: UiColors.primary,
|
||||
size: 24.0,
|
||||
|
||||
@@ -4,14 +4,14 @@ import 'package:design_system/design_system.dart';
|
||||
/// Lays out a list of widgets (intended for [ProfileMenuItem]s) in a responsive grid.
|
||||
/// It uses [Wrap] and manually calculates item width based on the screen size.
|
||||
class ProfileMenuGrid extends StatelessWidget {
|
||||
final int crossAxisCount;
|
||||
final List<Widget> children;
|
||||
|
||||
const ProfileMenuGrid({
|
||||
super.key,
|
||||
required this.children,
|
||||
this.crossAxisCount = 2,
|
||||
});
|
||||
final int crossAxisCount;
|
||||
final List<Widget> children;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -19,17 +19,17 @@ class ProfileMenuGrid extends StatelessWidget {
|
||||
const double spacing = UiConstants.space3;
|
||||
|
||||
return LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
final totalWidth = constraints.maxWidth;
|
||||
final totalSpacingWidth = spacing * (crossAxisCount - 1);
|
||||
final itemWidth = (totalWidth - totalSpacingWidth) / crossAxisCount;
|
||||
builder: (BuildContext context, BoxConstraints constraints) {
|
||||
final double totalWidth = constraints.maxWidth;
|
||||
final double totalSpacingWidth = spacing * (crossAxisCount - 1);
|
||||
final double itemWidth = (totalWidth - totalSpacingWidth) / crossAxisCount;
|
||||
|
||||
return Wrap(
|
||||
spacing: spacing,
|
||||
runSpacing: spacing,
|
||||
alignment: WrapAlignment.start,
|
||||
crossAxisAlignment: WrapCrossAlignment.start,
|
||||
children: children.map((child) {
|
||||
children: children.map((Widget child) {
|
||||
return SizedBox(
|
||||
width: itemWidth,
|
||||
child: child,
|
||||
|
||||
@@ -6,17 +6,17 @@ import 'package:design_system/design_system.dart';
|
||||
///
|
||||
/// Uses design system tokens for all colors, typography, and spacing.
|
||||
class ReliabilityScoreBar extends StatelessWidget {
|
||||
final int? reliabilityScore;
|
||||
|
||||
const ReliabilityScoreBar({
|
||||
super.key,
|
||||
this.reliabilityScore,
|
||||
});
|
||||
final int? reliabilityScore;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final i18n = t.staff.profile.reliability_score;
|
||||
final score = (reliabilityScore ?? 0) / 100;
|
||||
final TranslationsStaffProfileReliabilityScoreEn i18n = t.staff.profile.reliability_score;
|
||||
final double score = (reliabilityScore ?? 0) / 100;
|
||||
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(UiConstants.space4),
|
||||
@@ -26,10 +26,10 @@ class ReliabilityScoreBar extends StatelessWidget {
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Text(
|
||||
i18n.title,
|
||||
style: UiTypography.body2m.primary,
|
||||
|
||||
@@ -5,11 +5,6 @@ import 'package:flutter/material.dart';
|
||||
///
|
||||
/// Uses design system tokens for all colors, typography, spacing, and icons.
|
||||
class ReliabilityStatsCard extends StatelessWidget {
|
||||
final int? totalShifts;
|
||||
final double? averageRating;
|
||||
final int? onTimeRate;
|
||||
final int? noShowCount;
|
||||
final int? cancellationCount;
|
||||
|
||||
const ReliabilityStatsCard({
|
||||
super.key,
|
||||
@@ -19,6 +14,11 @@ class ReliabilityStatsCard extends StatelessWidget {
|
||||
this.noShowCount,
|
||||
this.cancellationCount,
|
||||
});
|
||||
final int? totalShifts;
|
||||
final double? averageRating;
|
||||
final int? onTimeRate;
|
||||
final int? noShowCount;
|
||||
final int? cancellationCount;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -28,7 +28,7 @@ class ReliabilityStatsCard extends StatelessWidget {
|
||||
color: UiColors.bgPopup,
|
||||
borderRadius: UiConstants.radiusLg,
|
||||
border: Border.all(color: UiColors.border),
|
||||
boxShadow: [
|
||||
boxShadow: <BoxShadow>[
|
||||
BoxShadow(
|
||||
color: UiColors.foreground.withValues(alpha: 0.05),
|
||||
blurRadius: 4,
|
||||
@@ -38,7 +38,7 @@ class ReliabilityStatsCard extends StatelessWidget {
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
children: <Widget>[
|
||||
_buildStatItem(
|
||||
context,
|
||||
UiIcons.briefcase,
|
||||
@@ -82,7 +82,7 @@ class ReliabilityStatsCard extends StatelessWidget {
|
||||
) {
|
||||
return Expanded(
|
||||
child: Column(
|
||||
children: [
|
||||
children: <Widget>[
|
||||
Container(
|
||||
width: UiConstants.space10,
|
||||
height: UiConstants.space10,
|
||||
|
||||
@@ -5,9 +5,9 @@ import 'package:design_system/design_system.dart';
|
||||
///
|
||||
/// Uses design system tokens for typography, colors, and spacing.
|
||||
class SectionTitle extends StatelessWidget {
|
||||
final String title;
|
||||
|
||||
const SectionTitle(this.title, {super.key});
|
||||
final String title;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
Reference in New Issue
Block a user