feat: Implement notice and file types banners for attire upload and enhance incomplete profile messaging
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
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';
|
||||
import 'package:krow_core/core.dart';
|
||||
import 'package:geolocator/geolocator.dart';
|
||||
import 'package:krow_domain/krow_domain.dart';
|
||||
import 'package:core_localization/core_localization.dart';
|
||||
|
||||
import '../../blocs/shifts/shifts_bloc.dart';
|
||||
import '../my_shift_card.dart';
|
||||
import '../shared/empty_state_view.dart';
|
||||
import 'package:geolocator/geolocator.dart';
|
||||
|
||||
class FindShiftsTab extends StatefulWidget {
|
||||
final List<Shift> availableJobs;
|
||||
@@ -316,11 +315,21 @@ class _FindShiftsTabState extends State<FindShiftsTab> {
|
||||
children: [
|
||||
// Incomplete profile banner
|
||||
if (!widget.profileComplete) ...[
|
||||
_IncompleteProfileBanner(
|
||||
title: context.t.staff_shifts.find_shifts.incomplete_profile_banner_title,
|
||||
message: context.t.staff_shifts.find_shifts.incomplete_profile_banner_message,
|
||||
ctaText: context.t.staff_shifts.find_shifts.incomplete_profile_cta,
|
||||
onCtaPressed: () => Modular.to.toProfile(),
|
||||
Container(
|
||||
padding: const EdgeInsets.all(UiConstants.space4),
|
||||
child: UiNoticeBanner(
|
||||
icon: UiIcons.sparkles,
|
||||
title: context
|
||||
.t
|
||||
.staff_shifts
|
||||
.find_shifts
|
||||
.incomplete_profile_banner_title,
|
||||
description: context
|
||||
.t
|
||||
.staff_shifts
|
||||
.find_shifts
|
||||
.incomplete_profile_banner_message,
|
||||
),
|
||||
),
|
||||
],
|
||||
// Search and Filters
|
||||
@@ -462,9 +471,7 @@ class _FindShiftsTabState extends State<FindShiftsTab> {
|
||||
? () {
|
||||
BlocProvider.of<ShiftsBloc>(
|
||||
context,
|
||||
).add(
|
||||
AcceptShiftEvent(shift.id),
|
||||
);
|
||||
).add(AcceptShiftEvent(shift.id));
|
||||
UiSnackbar.show(
|
||||
context,
|
||||
message: context
|
||||
@@ -488,54 +495,3 @@ class _FindShiftsTabState extends State<FindShiftsTab> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// Banner shown when the worker's profile is incomplete.
|
||||
class _IncompleteProfileBanner extends StatelessWidget {
|
||||
const _IncompleteProfileBanner({
|
||||
required this.title,
|
||||
required this.message,
|
||||
required this.ctaText,
|
||||
required this.onCtaPressed,
|
||||
});
|
||||
|
||||
final String title;
|
||||
final String message;
|
||||
final String ctaText;
|
||||
final VoidCallback onCtaPressed;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
margin: const EdgeInsets.all(UiConstants.space5),
|
||||
padding: const EdgeInsets.all(UiConstants.space4),
|
||||
decoration: BoxDecoration(
|
||||
color: UiColors.tagPending,
|
||||
borderRadius: BorderRadius.circular(UiConstants.radiusBase),
|
||||
border: Border.all(
|
||||
color: UiColors.textWarning.withValues(alpha: 0.5),
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
title,
|
||||
style: UiTypography.body2b.textPrimary,
|
||||
),
|
||||
const SizedBox(height: UiConstants.space2),
|
||||
Text(
|
||||
message,
|
||||
style: UiTypography.body3r.textSecondary,
|
||||
),
|
||||
const SizedBox(height: UiConstants.space4),
|
||||
UiButton.primary(
|
||||
text: ctaText,
|
||||
onPressed: onCtaPressed,
|
||||
size: UiButtonSize.small,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user