1import 'package:easy_localization/easy_localization.dart';
2import 'package:flutter/material.dart';
3import 'package:flutter_bloc/flutter_bloc.dart';
4import 'package:flutter_screenutil/flutter_screenutil.dart';
5import 'package:go_router/go_router.dart';
6import 'package:lottie/lottie.dart';
8import '../../../../../core/constants/assets.dart';
9import '../../../../../core/ui/theme/color_palette.dart';
10import '../../../../../core/ui/widgets/custom_scaffold.dart';
11import '../../../../../core/services/service_locator.dart';
12import '../../../../../core/router/routes.dart';
13import '../../../../auth/presentation/bloc/authentication_bloc/authentication_bloc.dart';
14import '../../../domain/usecases/validate_scheduler_usecase.dart';
21 _ScheduleConfirmationScreenState();
24class _ScheduleConfirmationScreenState
25 extends State<ScheduleConfirmationScreen> {
34 final authState = context.read<AuthenticationBloc>().state;
35 if (authState is! AuthenticatedState) {
40 final now = DateTime.now();
41 final dateString =
'${now.day.toString().padLeft(2, '0
')}/${now.month.toString().padLeft(2, '0
')}/${now.year}';
45 timeStringValue: dateString,
46 driverId: authState.session.uid ?? 0,
51 ScaffoldMessenger.of(context).showSnackBar(
60 ScaffoldMessenger.of(context).showSnackBar(
62 content:
Text(
'scheduling.schedule_confirmed'.tr()),
67 context.pushReplacement(
Routes.homeScreen.route);
73 Widget
build(BuildContext context) {
76 child: CustomScaffold(
77 isLeadingVisible:
false,
78 title:
'scheduling.confirm_schedule'.tr(),
80 padding:
const EdgeInsets.all(16.0),
82 crossAxisAlignment: CrossAxisAlignment.start,
86 'scheduling.confirmation_text'.tr(),
87 style: Theme.of(context).textTheme.bodyMedium?.copyWith(
101 width:
double.infinity,
102 child: ElevatedButton(
104 style: ElevatedButton.styleFrom(
106 foregroundColor: Colors.white,
107 padding:
const EdgeInsets.symmetric(vertical: 14),
112 child: CircularProgressIndicator(
113 strokeWidth: 2,
color: Colors.white,
115 ) :
Text(
'scheduling.Confirm'.tr()),
class App extends StatefulWidget build(BuildContext context)
sealed class AuthenticationState extends Equatable failure
static const String successLottie
Future< void > _submit() async
class ScheduleConfirmationScreen extends StatefulWidget _isSubmitting
style Text( '${ 'scheduling.reference'.tr()}:${collection.internalCode}', style:Theme.of(context).textTheme.bodySmall,)
style SizedBox(height:2.h)
style Column(crossAxisAlignment:CrossAxisAlignment.end, children:[Container(padding:EdgeInsets.symmetric(horizontal:8.w, vertical:4.h), decoration:BoxDecoration(color:ColorPalette.tiffanyBlue.withValues(alpha:0.1), borderRadius:BorderRadius.circular(12),), child:Text(collection.type ?? '', style:Theme.of(context).textTheme.bodySmall?.copyWith(color:ColorPalette.tiffanyBlue, fontWeight:FontWeight.bold,),),),],)