chore: refactor UI consistency using design system tokens and remove LucideIcons

This commit is contained in:
2026-02-12 18:37:31 +05:30
parent d7d9a34f07
commit ad6db7d851
62 changed files with 397 additions and 370 deletions

View File

@@ -44,7 +44,7 @@ class CertificatesPage extends StatelessWidget {
? translateErrorKey(state.errorMessage!)
: 'Error loading certificates',
textAlign: TextAlign.center,
style: const TextStyle(color: UiColors.textSecondary),
style: UiTypography.body2r.textSecondary,
),
),
),

View File

@@ -74,7 +74,7 @@ class CertificateCard extends StatelessWidget {
size: 16,
color: UiColors.textPrimary,
),
const SizedBox(width: 8),
const SizedBox(width: UiConstants.space2),
Text(
isExpired
? t.staff_certificates.card.expired
@@ -198,7 +198,7 @@ class CertificateCard extends StatelessWidget {
size: 16,
color: UiColors.white,
),
const SizedBox(width: 8),
const SizedBox(width: UiConstants.space2),
Text(
t.staff_certificates.card.upload_button,
style: UiTypography.body2m.white,
@@ -265,14 +265,14 @@ class CertificateCard extends StatelessWidget {
Row(
children: <Widget>[
Container(
width: 8,
height: 8,
width: UiConstants.space2,
height: UiConstants.space2,
decoration: const BoxDecoration(
color: UiColors.primary,
shape: BoxShape.circle,
),
),
const SizedBox(width: 8),
const SizedBox(width: UiConstants.space2),
Text(
t.staff_certificates.card.verified,
style: UiTypography.body2m.textPrimary,
@@ -305,7 +305,7 @@ class CertificateCard extends StatelessWidget {
shape: BoxShape.circle,
),
),
const SizedBox(width: 8),
const SizedBox(width: UiConstants.space2),
Text(
t.staff_certificates.card.expiring_soon,
style: UiTypography.body2m.copyWith(
@@ -329,7 +329,7 @@ class CertificateCard extends StatelessWidget {
Row(
children: <Widget>[
_buildIconButton(UiIcons.eye, onView),
const SizedBox(width: 8),
const SizedBox(width: UiConstants.space2),
_buildSmallOutlineButton(
t.staff_certificates.card.renew,
onUpload,
@@ -349,9 +349,9 @@ class CertificateCard extends StatelessWidget {
height: 32,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.transparent,
color: UiColors.transparent,
border: Border.all(
color: Colors.transparent,
color: UiColors.transparent,
),
),
child: Center(
@@ -365,8 +365,10 @@ class CertificateCard extends StatelessWidget {
return OutlinedButton(
onPressed: onTap,
style: OutlinedButton.styleFrom(
side: const BorderSide(color: Color(0x660A39DF)), // Primary with opacity
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
side: BorderSide(color: UiColors.primary.withValues(alpha: 0.4)), // Primary with opacity
shape: RoundedRectangleBorder(
borderRadius: UiConstants.radiusFull,
),
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 0),
minimumSize: const Size(0, 32),
),
@@ -397,11 +399,11 @@ class CertificateCard extends StatelessWidget {
_CertificateUiProps _getUiProps(String id) {
switch (id) {
case 'background':
return _CertificateUiProps(UiIcons.fileCheck, const Color(0xFF0A39DF));
return _CertificateUiProps(UiIcons.fileCheck, UiColors.primary);
case 'food_handler':
return _CertificateUiProps(UiIcons.utensils, const Color(0xFF0A39DF));
return _CertificateUiProps(UiIcons.utensils, UiColors.primary);
case 'rbs':
return _CertificateUiProps(UiIcons.wine, const Color(0xFF121826));
return _CertificateUiProps(UiIcons.wine, UiColors.foreground);
default:
// Default generic icon
return _CertificateUiProps(UiIcons.award, UiColors.primary);

View File

@@ -22,19 +22,19 @@ class CertificatesHeader extends StatelessWidget {
return Container(
padding: const EdgeInsets.fromLTRB(
UiConstants.space5,
60,
UiConstants.space15,
UiConstants.space5,
80,
UiConstants.space20,
),
// Keeping gradient as per prototype layout requirement
decoration: const BoxDecoration(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: <Color>[
UiColors.primary,
Color(0xFF1E40AF),
], // Using Primary and a darker shade
UiColors.primary.withValues(alpha: 0.8),
],
),
),
child: Column(
@@ -44,16 +44,16 @@ class CertificatesHeader extends StatelessWidget {
GestureDetector(
onTap: () => Modular.to.pop(),
child: Container(
width: 40,
height: 40,
width: UiConstants.space10,
height: UiConstants.space10,
decoration: BoxDecoration(
color: UiColors.white.withValues(alpha: 0.1),
shape: BoxShape.circle,
),
child: const Icon(
UiIcons.chevronLeft, // Swapped LucideIcons
UiIcons.chevronLeft,
color: UiColors.white,
size: 20,
size: UiConstants.iconMd,
),
),
),
@@ -98,7 +98,7 @@ class CertificatesHeader extends StatelessWidget {
t.staff_certificates.progress.title,
style: UiTypography.body1b.white,
),
const SizedBox(height: 4),
const SizedBox(height: UiConstants.space1),
Text(
t.staff_certificates.progress.verified_count(
completed: completedCount, total: totalCount),
@@ -112,9 +112,9 @@ class CertificatesHeader extends StatelessWidget {
const Icon(
UiIcons.shield,
color: UiColors.accent,
size: 16,
size: UiConstants.iconSm,
),
const SizedBox(width: 8),
const SizedBox(width: UiConstants.space2),
Text(
t.staff_certificates.progress.active,
style: UiTypography.body3m.accent,

View File

@@ -53,7 +53,7 @@ class DocumentsPage extends StatelessWidget {
if (state.status == DocumentsStatus.failure) {
return Center(
child: Padding(
padding: const EdgeInsets.all(16.0),
padding: const EdgeInsets.all(UiConstants.space4),
child: Text(
state.errorMessage != null
? (state.errorMessage!.contains('errors.')
@@ -76,14 +76,17 @@ class DocumentsPage extends StatelessWidget {
}
return ListView(
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 24),
padding: const EdgeInsets.symmetric(
horizontal: UiConstants.space5,
vertical: UiConstants.space6,
),
children: <Widget>[
DocumentsProgressCard(
completedCount: state.completedCount,
totalCount: state.totalCount,
progress: state.progress,
),
const SizedBox(height: 16),
const SizedBox(height: UiConstants.space4),
...state.documents.map(
(StaffDocument doc) => DocumentCard(
document: doc,

View File

@@ -32,7 +32,7 @@ class DocumentCard extends StatelessWidget {
height: 40,
decoration: BoxDecoration(
color: UiColors.primary.withValues(alpha: 0.1),
borderRadius: BorderRadius.circular(8),
borderRadius: BorderRadius.circular(UiConstants.space2),
),
child: const Center(
child: Icon(
@@ -57,7 +57,7 @@ class DocumentCard extends StatelessWidget {
_getStatusIcon(document.status),
],
),
const SizedBox(height: 2),
const SizedBox(height: UiConstants.space1 / 2),
if (document.description != null)
Text(
document.description!,
@@ -139,7 +139,7 @@ class DocumentCard extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 2),
decoration: BoxDecoration(
color: bg,
borderRadius: BorderRadius.circular(12),
borderRadius: UiConstants.radiusFull,
),
child: Text(
label,
@@ -154,7 +154,7 @@ class DocumentCard extends StatelessWidget {
final bool isVerified = status == DocumentStatus.verified;
return InkWell(
onTap: onTap,
borderRadius: BorderRadius.circular(4),
borderRadius: UiConstants.radiusSm,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
child: Row(

View File

@@ -48,12 +48,12 @@ class DocumentsProgressCard extends StatelessWidget {
),
],
),
const SizedBox(height: 8),
const SizedBox(height: UiConstants.space2),
ClipRRect(
borderRadius: BorderRadius.circular(4),
borderRadius: UiConstants.radiusSm,
child: LinearProgressIndicator(
value: progress,
minHeight: 8,
minHeight: UiConstants.space2,
backgroundColor: UiColors.border,
valueColor: const AlwaysStoppedAnimation<Color>(
UiColors.primary,

View File

@@ -15,7 +15,6 @@ dependencies:
bloc: ^8.1.0
flutter_modular: ^6.3.0
equatable: ^2.0.5
lucide_icons: ^0.257.0
firebase_auth: ^6.1.4
firebase_data_connect: ^0.2.2+2

View File

@@ -97,7 +97,11 @@ class _FormI9PageState extends State<FormI9Page> {
context,
message: translateErrorKey(state.errorMessage ?? 'An error occurred'),
type: UiSnackbarType.error,
margin: const EdgeInsets.only(left: 16, right: 16, bottom: 100),
margin: const EdgeInsets.only(
left: UiConstants.space4,
right: UiConstants.space4,
bottom: 120,
),
);
}
},
@@ -137,7 +141,7 @@ class _FormI9PageState extends State<FormI9Page> {
padding: const EdgeInsets.all(UiConstants.space8),
decoration: BoxDecoration(
color: UiColors.bgPopup,
borderRadius: BorderRadius.circular(24),
borderRadius: UiConstants.radiusLg,
border: Border.all(color: UiColors.border),
),
child: Column(
@@ -257,7 +261,7 @@ class _FormI9PageState extends State<FormI9Page> {
color: idx <= state.currentStep
? UiColors.white
: UiColors.white.withValues(alpha: 0.3),
borderRadius: BorderRadius.circular(2),
borderRadius: UiConstants.radiusXs,
),
),
),
@@ -331,7 +335,7 @@ class _FormI9PageState extends State<FormI9Page> {
fontWeight: FontWeight.w500,
),
),
const SizedBox(height: 6),
const SizedBox(height: UiConstants.space1 + 2),
TextField(
controller: TextEditingController(text: value)
..selection = TextSelection.fromPosition(
@@ -342,7 +346,7 @@ class _FormI9PageState extends State<FormI9Page> {
style: UiTypography.body2r.textPrimary,
decoration: InputDecoration(
hintText: placeholder,
hintStyle: const TextStyle(color: UiColors.textPlaceholder),
hintStyle: UiTypography.body2r.textPlaceholder,
filled: true,
fillColor: UiColors.bgPopup,
contentPadding: const EdgeInsets.symmetric(
@@ -384,7 +388,7 @@ class _FormI9PageState extends State<FormI9Page> {
placeholder: i18n.fields.hints.first_name,
),
),
const SizedBox(width: 12),
const SizedBox(width: UiConstants.space3),
Expanded(
child: _buildTextField(
i18n.fields.last_name,
@@ -395,7 +399,7 @@ class _FormI9PageState extends State<FormI9Page> {
),
],
),
const SizedBox(height: 16),
const SizedBox(height: UiConstants.space4),
Row(
children: <Widget>[
Expanded(
@@ -406,7 +410,7 @@ class _FormI9PageState extends State<FormI9Page> {
placeholder: i18n.fields.hints.middle_initial,
),
),
const SizedBox(width: 12),
const SizedBox(width: UiConstants.space3),
Expanded(
flex: 2,
child: _buildTextField(
@@ -418,7 +422,7 @@ class _FormI9PageState extends State<FormI9Page> {
),
],
),
const SizedBox(height: 16),
const SizedBox(height: UiConstants.space4),
_buildTextField(
i18n.fields.dob,
value: state.dob,
@@ -426,7 +430,7 @@ class _FormI9PageState extends State<FormI9Page> {
placeholder: i18n.fields.hints.dob,
keyboardType: TextInputType.datetime,
),
const SizedBox(height: 16),
const SizedBox(height: UiConstants.space4),
_buildTextField(
i18n.fields.ssn,
value: state.ssn,
@@ -438,7 +442,7 @@ class _FormI9PageState extends State<FormI9Page> {
context.read<FormI9Cubit>().ssnChanged(text);
},
),
const SizedBox(height: 16),
const SizedBox(height: UiConstants.space4),
_buildTextField(
i18n.fields.email,
value: state.email,
@@ -446,7 +450,7 @@ class _FormI9PageState extends State<FormI9Page> {
keyboardType: TextInputType.emailAddress,
placeholder: i18n.fields.hints.email,
),
const SizedBox(height: 16),
const SizedBox(height: UiConstants.space4),
_buildTextField(
i18n.fields.phone,
value: state.phone,
@@ -471,14 +475,14 @@ class _FormI9PageState extends State<FormI9Page> {
onChanged: (String val) => context.read<FormI9Cubit>().addressChanged(val),
placeholder: i18n.fields.hints.address,
),
const SizedBox(height: 16),
const SizedBox(height: UiConstants.space4),
_buildTextField(
i18n.fields.apt,
value: state.aptNumber,
onChanged: (String val) => context.read<FormI9Cubit>().aptNumberChanged(val),
placeholder: i18n.fields.hints.apt,
),
const SizedBox(height: 16),
const SizedBox(height: UiConstants.space4),
Row(
children: <Widget>[
Expanded(
@@ -490,7 +494,7 @@ class _FormI9PageState extends State<FormI9Page> {
placeholder: i18n.fields.hints.city,
),
),
const SizedBox(width: 12),
const SizedBox(width: UiConstants.space3),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@@ -501,7 +505,7 @@ class _FormI9PageState extends State<FormI9Page> {
fontWeight: FontWeight.w500,
),
),
const SizedBox(height: 6),
const SizedBox(height: UiConstants.space1 + 2),
DropdownButtonFormField<String>(
value: state.state.isEmpty ? null : state.state,
onChanged: (String? val) =>
@@ -533,7 +537,7 @@ class _FormI9PageState extends State<FormI9Page> {
),
],
),
const SizedBox(height: 16),
const SizedBox(height: UiConstants.space4),
_buildTextField(
i18n.fields.zip,
value: state.zipCode,
@@ -564,14 +568,14 @@ class _FormI9PageState extends State<FormI9Page> {
'CITIZEN',
i18n.fields.citizen,
),
const SizedBox(height: 12),
const SizedBox(height: UiConstants.space3),
_buildRadioOption(
context,
state,
'NONCITIZEN',
i18n.fields.noncitizen,
),
const SizedBox(height: 12),
const SizedBox(height: UiConstants.space3),
_buildRadioOption(
context,
state,
@@ -579,7 +583,7 @@ class _FormI9PageState extends State<FormI9Page> {
i18n.fields.permanent_resident,
child: state.citizenshipStatus == 'PERMANENT_RESIDENT'
? Padding(
padding: const EdgeInsets.only(top: 12),
padding: const EdgeInsets.only(top: UiConstants.space3),
child: _buildTextField(
i18n.fields.uscis_number_label,
value: state.uscisNumber,
@@ -589,7 +593,7 @@ class _FormI9PageState extends State<FormI9Page> {
)
: null,
),
const SizedBox(height: 12),
const SizedBox(height: UiConstants.space3),
_buildRadioOption(
context,
state,
@@ -597,7 +601,7 @@ class _FormI9PageState extends State<FormI9Page> {
i18n.fields.alien,
child: state.citizenshipStatus == 'ALIEN'
? Padding(
padding: const EdgeInsets.only(top: 12),
padding: const EdgeInsets.only(top: UiConstants.space3),
child: Column(
children: <Widget>[
_buildTextField(
@@ -605,13 +609,13 @@ class _FormI9PageState extends State<FormI9Page> {
value: state.admissionNumber,
onChanged: (String val) => context.read<FormI9Cubit>().admissionNumberChanged(val),
),
const SizedBox(height: 12),
const SizedBox(height: UiConstants.space3),
_buildTextField(
i18n.fields.passport,
value: state.passportNumber,
onChanged: (String val) => context.read<FormI9Cubit>().passportNumberChanged(val),
),
const SizedBox(height: 12),
const SizedBox(height: UiConstants.space3),
_buildTextField(
i18n.fields.country,
value: state.countryIssuance,
@@ -657,7 +661,7 @@ class _FormI9PageState extends State<FormI9Page> {
shape: BoxShape.circle,
border: Border.all(
color: isSelected ? UiColors.primary : UiColors.border,
width: isSelected ? 6 : 2,
width: isSelected ? UiConstants.radiusMdValue : 2,
),
),
),
@@ -744,7 +748,7 @@ class _FormI9PageState extends State<FormI9Page> {
i18n.fields.signature_label,
style: UiTypography.body3m.textSecondary,
),
const SizedBox(height: 6),
const SizedBox(height: UiConstants.space1 + 2),
TextField(
controller: TextEditingController(text: state.signature)
..selection = TextSelection.fromPosition(
@@ -780,7 +784,7 @@ class _FormI9PageState extends State<FormI9Page> {
i18n.fields.date_label,
style: UiTypography.body3m.textSecondary,
),
const SizedBox(height: 6),
const SizedBox(height: UiConstants.space1 + 2),
Container(
width: double.infinity,
padding: const EdgeInsets.symmetric(
@@ -794,7 +798,7 @@ class _FormI9PageState extends State<FormI9Page> {
),
child: Text(
DateTime.now().toString().split(' ')[0],
style: const TextStyle(color: UiColors.textPrimary),
style: UiTypography.body1r.textPrimary,
),
),
],
@@ -878,7 +882,7 @@ class _FormI9PageState extends State<FormI9Page> {
size: 16,
color: UiColors.textPrimary,
),
const SizedBox(width: 8),
const SizedBox(width: UiConstants.space2),
Text(
i18n.back,
style: UiTypography.body2r.textPrimary,
@@ -926,7 +930,7 @@ class _FormI9PageState extends State<FormI9Page> {
: i18n.kContinue,
),
if (state.currentStep < steps.length - 1) ...<Widget>[
const SizedBox(width: 8),
const SizedBox(width: UiConstants.space2),
const Icon(UiIcons.arrowRight, size: 16, color: UiColors.white),
],
],

View File

@@ -145,7 +145,11 @@ class _FormW4PageState extends State<FormW4Page> {
context,
message: translateErrorKey(state.errorMessage ?? 'An error occurred'),
type: UiSnackbarType.error,
margin: const EdgeInsets.only(left: 16, right: 16, bottom: 100),
margin: const EdgeInsets.only(
left: UiConstants.space4,
right: UiConstants.space4,
bottom: 100,
),
);
}
},
@@ -185,7 +189,7 @@ class _FormW4PageState extends State<FormW4Page> {
padding: const EdgeInsets.all(UiConstants.space8),
decoration: BoxDecoration(
color: UiColors.bgPopup,
borderRadius: BorderRadius.circular(24),
borderRadius: UiConstants.radiusLg,
border: Border.all(color: UiColors.border),
),
child: Column(
@@ -305,7 +309,7 @@ class _FormW4PageState extends State<FormW4Page> {
color: idx <= state.currentStep
? UiColors.white
: UiColors.white.withValues(alpha: 0.3),
borderRadius: BorderRadius.circular(2),
borderRadius: UiConstants.radiusXs,
),
),
),
@@ -380,7 +384,7 @@ class _FormW4PageState extends State<FormW4Page> {
fontWeight: FontWeight.w500,
),
),
const SizedBox(height: 6),
const SizedBox(height: UiConstants.space1 + 2),
TextField(
controller: TextEditingController(text: value)
..selection = TextSelection.fromPosition(
@@ -391,7 +395,7 @@ class _FormW4PageState extends State<FormW4Page> {
style: UiTypography.body2r.textPrimary,
decoration: InputDecoration(
hintText: placeholder,
hintStyle: const TextStyle(color: UiColors.textPlaceholder),
hintStyle: UiTypography.body2r.textPlaceholder,
filled: true,
fillColor: UiColors.bgPopup,
contentPadding: const EdgeInsets.symmetric(
@@ -433,7 +437,7 @@ class _FormW4PageState extends State<FormW4Page> {
placeholder: i18n.fields.placeholder_john,
),
),
const SizedBox(width: 12),
const SizedBox(width: UiConstants.space3),
Expanded(
child: _buildTextField(
i18n.fields.last_name,
@@ -444,7 +448,7 @@ class _FormW4PageState extends State<FormW4Page> {
),
],
),
const SizedBox(height: 16),
const SizedBox(height: UiConstants.space4),
_buildTextField(
i18n.fields.ssn,
value: state.ssn,
@@ -456,14 +460,14 @@ class _FormW4PageState extends State<FormW4Page> {
context.read<FormW4Cubit>().ssnChanged(text);
},
),
const SizedBox(height: 16),
const SizedBox(height: UiConstants.space4),
_buildTextField(
i18n.fields.address,
value: state.address,
onChanged: (String val) => context.read<FormW4Cubit>().addressChanged(val),
placeholder: i18n.fields.placeholder_address,
),
const SizedBox(height: 16),
const SizedBox(height: UiConstants.space4),
_buildTextField(
i18n.fields.city_state_zip,
value: state.cityStateZip,
@@ -508,7 +512,7 @@ class _FormW4PageState extends State<FormW4Page> {
i18n.fields.single,
null,
),
const SizedBox(height: 12),
const SizedBox(height: UiConstants.space3),
_buildRadioOption(
context,
state,
@@ -516,7 +520,7 @@ class _FormW4PageState extends State<FormW4Page> {
i18n.fields.married,
null,
),
const SizedBox(height: 12),
const SizedBox(height: UiConstants.space3),
_buildRadioOption(
context,
state,
@@ -559,7 +563,7 @@ class _FormW4PageState extends State<FormW4Page> {
shape: BoxShape.circle,
border: Border.all(
color: isSelected ? UiColors.primary : UiColors.border,
width: isSelected ? 6 : 2,
width: isSelected ? UiConstants.radiusMdValue : 2,
),
),
),
@@ -650,7 +654,7 @@ class _FormW4PageState extends State<FormW4Page> {
height: 24,
decoration: BoxDecoration(
color: state.multipleJobs ? UiColors.primary : UiColors.bgPopup,
borderRadius: BorderRadius.circular(6),
borderRadius: UiConstants.radiusMd,
border: Border.all(
color: state.multipleJobs ? UiColors.primary : UiColors.border,
),
@@ -684,7 +688,7 @@ class _FormW4PageState extends State<FormW4Page> {
),
),
),
const SizedBox(height: 16),
const SizedBox(height: UiConstants.space4),
Text(
i18n.fields.multiple_jobs_not_apply,
textAlign: TextAlign.center,
@@ -754,11 +758,11 @@ class _FormW4PageState extends State<FormW4Page> {
),
),
if (_totalCredits(state) > 0) ...<Widget>[
const SizedBox(height: 16),
const SizedBox(height: UiConstants.space4),
Container(
padding: const EdgeInsets.all(UiConstants.space4),
decoration: BoxDecoration(
color: const Color(0xFFDCFCE7),
color: UiColors.tagSuccess,
borderRadius: UiConstants.radiusLg,
),
child: Row(
@@ -766,17 +770,12 @@ class _FormW4PageState extends State<FormW4Page> {
children: <Widget>[
Text(
i18n.fields.total_credits,
style: const TextStyle(
fontWeight: FontWeight.w500,
color: Color(0xFF166534),
),
style: UiTypography.body2m.textSuccess,
),
Text(
'\$${_totalCredits(state)}',
style: const TextStyle(
fontWeight: FontWeight.bold,
style: UiTypography.body2b.success.copyWith(
fontSize: 18,
color: Color(0xFF15803D),
),
),
],
@@ -821,7 +820,7 @@ class _FormW4PageState extends State<FormW4Page> {
),
],
),
const SizedBox(height: 12),
const SizedBox(height: UiConstants.space3),
Row(
children: <Widget>[
_buildCircleBtn(
@@ -833,7 +832,7 @@ class _FormW4PageState extends State<FormW4Page> {
child: Text(
value.toString(),
textAlign: TextAlign.center,
style: const TextStyle(
style: UiTypography.headline3m.textPrimary.copyWith(
fontSize: 20,
fontWeight: FontWeight.bold,
),
@@ -877,7 +876,7 @@ class _FormW4PageState extends State<FormW4Page> {
i18n.fields.adjustments_info,
style: UiTypography.body2r.textSecondary,
),
const SizedBox(height: 24),
const SizedBox(height: UiConstants.space6),
_buildTextField(
i18n.fields.other_income,
value: state.otherIncome,
@@ -948,7 +947,7 @@ class _FormW4PageState extends State<FormW4Page> {
i18n.fields.summary_title,
style: UiTypography.headline4m.copyWith(fontSize: 14),
),
const SizedBox(height: 12),
const SizedBox(height: UiConstants.space3),
_buildSummaryRow(
i18n.fields.summary_name,
'${state.firstName} ${state.lastName}',
@@ -965,12 +964,12 @@ class _FormW4PageState extends State<FormW4Page> {
_buildSummaryRow(
i18n.fields.summary_credits,
'\$${_totalCredits(state)}',
valueColor: Colors.green[700],
valueColor: UiColors.textSuccess,
),
],
),
),
const SizedBox(height: 24),
const SizedBox(height: UiConstants.space6),
Container(
padding: const EdgeInsets.all(UiConstants.space4),
decoration: BoxDecoration(
@@ -1037,7 +1036,7 @@ class _FormW4PageState extends State<FormW4Page> {
),
child: Text(
DateTime.now().toString().split(' ')[0],
style: const TextStyle(color: UiColors.textPrimary),
style: UiTypography.body2r.textPrimary,
),
),
],
@@ -1118,7 +1117,7 @@ class _FormW4PageState extends State<FormW4Page> {
size: 16,
color: UiColors.textPrimary,
),
const SizedBox(width: 8),
const SizedBox(width: UiConstants.space2),
Text(
i18n.fields.back,
style: UiTypography.body2r.textPrimary,
@@ -1166,7 +1165,7 @@ class _FormW4PageState extends State<FormW4Page> {
: i18n.fields.kContinue,
),
if (state.currentStep < steps.length - 1) ...<Widget>[
const SizedBox(width: 8),
const SizedBox(width: UiConstants.space2),
const Icon(UiIcons.arrowRight, size: 16, color: UiColors.white),
],
],

View File

@@ -15,7 +15,6 @@ dependencies:
bloc: ^8.1.0
flutter_modular: ^6.3.0
equatable: ^2.0.5
lucide_icons: ^0.257.0
firebase_auth: ^6.1.4
firebase_data_connect: ^0.2.2+2

View File

@@ -52,7 +52,11 @@ class BankAccountPage extends StatelessWidget {
context,
message: strings.account_added_success,
type: UiSnackbarType.success,
margin: const EdgeInsets.only(bottom: 120, left: 16, right: 16),
margin: const EdgeInsets.only(
bottom: 120,
left: UiConstants.space4,
right: UiConstants.space4,
),
);
}
// Error is already shown on the page itself (lines 73-85), no need for snackbar
@@ -65,7 +69,7 @@ class BankAccountPage extends StatelessWidget {
if (state.status == BankAccountStatus.error) {
return Center(
child: Padding(
padding: const EdgeInsets.all(16.0),
padding: const EdgeInsets.all(UiConstants.space4),
child: Text(
state.errorMessage != null
? translateErrorKey(state.errorMessage!)
@@ -95,7 +99,7 @@ class BankAccountPage extends StatelessWidget {
...state.accounts.map((BankAccount a) => _buildAccountCard(a, strings)), // Added type
// Add extra padding at bottom
const SizedBox(height: 80),
const SizedBox(height: UiConstants.space20),
],
),
),
@@ -115,7 +119,7 @@ class BankAccountPage extends StatelessWidget {
context: context,
builder: (BuildContext context) {
return Dialog(
backgroundColor: Colors.transparent,
backgroundColor: UiColors.transparent,
child: AddAccountForm(
strings: strings,
onSubmit: (String bankName, String routing, String account, String type) {
@@ -166,7 +170,7 @@ class BankAccountPage extends StatelessWidget {
strings.secure_title,
style: UiTypography.body2m.textPrimary,
),
const SizedBox(height: 2),
const SizedBox(height: UiConstants.space1 - 2), // 2px
Text(
strings.secure_subtitle,
style: UiTypography.body3r.textSecondary,
@@ -210,7 +214,7 @@ class BankAccountPage extends StatelessWidget {
child: Icon(
UiIcons.building,
color: primaryColor,
size: 24,
size: UiConstants.iconLg,
),
),
),
@@ -236,15 +240,18 @@ class BankAccountPage extends StatelessWidget {
),
if (isPrimary)
Container(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
padding: const EdgeInsets.symmetric(
horizontal: UiConstants.space2,
vertical: UiConstants.space1,
),
decoration: BoxDecoration(
color: primaryColor.withValues(alpha: 0.15),
borderRadius: BorderRadius.circular(20),
borderRadius: UiConstants.radiusFull,
),
child: Row(
children: <Widget>[
const Icon(UiIcons.check, size: 12, color: primaryColor),
const SizedBox(width: 4),
const Icon(UiIcons.check, size: UiConstants.iconXs, color: primaryColor),
const SizedBox(width: UiConstants.space1),
Text(
strings.primary,
style: UiTypography.body3m.primary,

View File

@@ -139,7 +139,7 @@ class _AddAccountFormState extends State<AddAccountForm> {
return GestureDetector(
onTap: () => setState(() => _selectedType = type),
child: Container(
padding: const EdgeInsets.symmetric(vertical: 12),
padding: const EdgeInsets.symmetric(vertical: UiConstants.space3),
decoration: BoxDecoration(
color: isSelected
? UiColors.primary.withValues(alpha: 0.05)

View File

@@ -15,7 +15,6 @@ dependencies:
bloc: ^8.1.0
flutter_modular: ^6.3.0
equatable: ^2.0.5
lucide_icons: ^0.257.0
firebase_auth: ^6.1.4
firebase_data_connect: ^0.2.2+2

View File

@@ -64,7 +64,7 @@ class _TimeCardPageState extends State<TimeCardPage> {
} else if (state is TimeCardError) {
return Center(
child: Padding(
padding: const EdgeInsets.all(16.0),
padding: const EdgeInsets.all(UiConstants.space4),
child: Text(
translateErrorKey(state.message),
textAlign: TextAlign.center,

View File

@@ -14,7 +14,6 @@ dependencies:
flutter_modular: ^6.3.2
flutter_bloc: ^8.1.3
equatable: ^2.0.5
lucide_icons: ^0.257.0
intl: ^0.20.0
design_system:
path: ../../../../../design_system

View File

@@ -46,7 +46,11 @@ class AttirePage extends StatelessWidget {
context,
message: translateErrorKey(state.errorMessage ?? 'Error'),
type: UiSnackbarType.error,
margin: const EdgeInsets.only(bottom: 150, left: 16, right: 16),
margin: const EdgeInsets.only(
bottom: 150,
left: UiConstants.space4,
right: UiConstants.space4,
),
);
}
if (state.status == AttireStatus.saved) {
@@ -80,7 +84,7 @@ class AttirePage extends StatelessWidget {
isChecked: state.attestationChecked,
onChanged: (bool? val) => cubit.toggleAttestation(val ?? false),
),
const SizedBox(height: 80),
const SizedBox(height: UiConstants.space20),
],
),
),

View File

@@ -1,6 +1,6 @@
import 'package:design_system/design_system.dart';
import 'package:flutter/material.dart';
import 'package:lucide_icons/lucide_icons.dart';
import 'package:core_localization/core_localization.dart';
import 'package:krow_domain/krow_domain.dart';
@@ -221,19 +221,19 @@ class AttireGrid extends StatelessWidget {
IconData _getIcon(String? name) {
switch (name) {
case 'footprints':
return LucideIcons.footprints;
return UiIcons.footprints;
case 'scissors':
return LucideIcons.scissors;
return UiIcons.scissors;
case 'user':
return LucideIcons.user;
return UiIcons.user;
case 'shirt':
return LucideIcons.shirt;
return UiIcons.shirt;
case 'hardHat':
return LucideIcons.hardHat;
return UiIcons.hardHat;
case 'chefHat':
return LucideIcons.chefHat;
return UiIcons.chefHat;
default:
return LucideIcons.helpCircle;
return UiIcons.help;
}
}
}

View File

@@ -1,6 +1,5 @@
import 'package:design_system/design_system.dart';
import 'package:flutter/material.dart';
import 'package:lucide_icons/lucide_icons.dart';
import 'package:core_localization/core_localization.dart';
class AttireInfoCard extends StatelessWidget {
@@ -17,8 +16,7 @@ class AttireInfoCard extends StatelessWidget {
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
// Using LucideIcons for domain specific content icon not in UiIcons
const Icon(LucideIcons.shirt, color: UiColors.primary, size: 24),
const Icon(UiIcons.shirt, color: UiColors.primary, size: 24),
const SizedBox(width: UiConstants.space3),
Expanded(
child: Column(

View File

@@ -160,7 +160,7 @@ class EmergencyContactFormItem extends StatelessWidget {
style: UiTypography.body1r.textPrimary,
decoration: InputDecoration(
hintText: hint,
hintStyle: const TextStyle(color: UiColors.textPlaceholder),
hintStyle: UiTypography.body1r.textPlaceholder,
prefixIcon: Icon(icon, color: UiColors.textSecondary, size: 20.0),
filled: true,
fillColor: UiColors.bgPopup,

View File

@@ -62,7 +62,11 @@ class ExperiencePage extends StatelessWidget {
context,
message: 'Experience saved successfully',
type: UiSnackbarType.success,
margin: const EdgeInsets.only(bottom: 120, left: 16, right: 16),
margin: const EdgeInsets.only(
bottom: 120,
left: UiConstants.space4,
right: UiConstants.space4,
),
);
Modular.to.pop();
} else if (state.status == ExperienceStatus.failure) {
@@ -72,7 +76,11 @@ class ExperiencePage extends StatelessWidget {
? translateErrorKey(state.errorMessage!)
: 'An error occurred',
type: UiSnackbarType.error,
margin: const EdgeInsets.only(bottom: 120, left: 16, right: 16),
margin: const EdgeInsets.only(
bottom: 120,
left: UiConstants.space4,
right: UiConstants.space4,
),
);
}
},
@@ -202,8 +210,8 @@ class ExperiencePage extends StatelessWidget {
: i18n.save_button,
child: state.status == ExperienceStatus.loading
? const SizedBox(
height: 20.0,
width: 20.0,
height: UiConstants.iconMd,
width: UiConstants.iconMd,
child: CircularProgressIndicator(
strokeWidth: 2,
valueColor: AlwaysStoppedAnimation<Color>(