Intégration fonctionnalites V1
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
import '../../../core/router/app_router.dart';
|
||||
import '../../../core/theme/app_colors.dart';
|
||||
import '../../../core/time/server_time.dart';
|
||||
import '../../machines/data/machine_repository.dart';
|
||||
import '../../machines/domain/machine_detail.dart';
|
||||
import '../data/booking_repository.dart';
|
||||
@@ -118,7 +118,7 @@ class _BookingModifyScreenState extends ConsumerState<BookingModifyScreen> {
|
||||
),
|
||||
Text(
|
||||
booking.slotStart != null && booking.slotEnd != null
|
||||
? '${DateFormat('EEEE dd MMM · HH:mm', 'fr_FR').format(booking.slotStart!)} – ${DateFormat('HH:mm').format(booking.slotEnd!)}'
|
||||
? '${ServerTime.format(booking.slotStart, pattern: 'EEEE dd MMM · HH:mm')} – ${ServerTime.format(booking.slotEnd, pattern: 'HH:mm')}'
|
||||
: '—',
|
||||
style: const TextStyle(fontWeight: FontWeight.w600),
|
||||
),
|
||||
@@ -136,14 +136,14 @@ class _BookingModifyScreenState extends ConsumerState<BookingModifyScreen> {
|
||||
itemCount: 6,
|
||||
separatorBuilder: (_, __) => const SizedBox(width: 8),
|
||||
itemBuilder: (context, index) {
|
||||
final date = DateTime.now().add(Duration(days: index));
|
||||
final date = ServerTime.startOfToday().add(Duration(days: index));
|
||||
final normalized = DateTime(date.year, date.month, date.day);
|
||||
final isSelected = normalized.year == selectedDate.year &&
|
||||
normalized.month == selectedDate.month &&
|
||||
normalized.day == selectedDate.day;
|
||||
|
||||
return ChoiceChip(
|
||||
label: Text(DateFormat('EEE dd/MM', 'fr_FR').format(normalized)),
|
||||
label: Text(ServerTime.format(normalized, pattern: 'EEE dd/MM')),
|
||||
selected: isSelected,
|
||||
onSelected: (_) => setState(() {
|
||||
_selectedDate = normalized;
|
||||
@@ -172,7 +172,7 @@ class _BookingModifyScreenState extends ConsumerState<BookingModifyScreen> {
|
||||
runSpacing: 8,
|
||||
children: slots.map((slot) {
|
||||
final label =
|
||||
'${DateFormat('HH:mm').format(slot.start)} – ${DateFormat('HH:mm').format(slot.end)}';
|
||||
'${ServerTime.format(slot.start, pattern: 'HH:mm')} – ${ServerTime.format(slot.end, pattern: 'HH:mm')}';
|
||||
final isSelected = _selectedSlot?.start == slot.start;
|
||||
|
||||
return FilterChip(
|
||||
@@ -197,12 +197,6 @@ class _BookingModifyScreenState extends ConsumerState<BookingModifyScreen> {
|
||||
height: 56,
|
||||
child: ElevatedButton.icon(
|
||||
onPressed: _isSaving ? null : () => _confirmMove(booking),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: AppColors.primary,
|
||||
foregroundColor: Colors.white,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14)),
|
||||
textStyle: const TextStyle(fontSize: 17, fontWeight: FontWeight.w600),
|
||||
),
|
||||
icon: _isSaving
|
||||
? const SizedBox(
|
||||
width: 22,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
import '../../../core/router/app_router.dart';
|
||||
import '../../../core/time/server_time.dart';
|
||||
import '../../../core/theme/app_colors.dart';
|
||||
import '../../../core/widgets/empty_state.dart';
|
||||
import '../../../core/widgets/screen_header.dart';
|
||||
@@ -16,7 +16,7 @@ class BookingsScreen extends ConsumerWidget {
|
||||
|
||||
Future<void> _cancelBooking(BuildContext context, WidgetRef ref, Booking booking) async {
|
||||
final slotLabel = booking.slotStart != null
|
||||
? DateFormat('EEEE dd MMM à HH:mm', 'fr_FR').format(booking.slotStart!)
|
||||
? ServerTime.format(booking.slotStart, pattern: 'EEEE dd MMM à HH:mm')
|
||||
: 'ce créneau';
|
||||
|
||||
final confirmed = await showDialog<bool>(
|
||||
@@ -144,7 +144,7 @@ class _BookingCard extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final slotText = booking.slotStart != null
|
||||
? DateFormat('EEEE dd MMM · HH:mm', 'fr_FR').format(booking.slotStart!)
|
||||
? ServerTime.format(booking.slotStart, pattern: 'EEEE dd MMM · HH:mm')
|
||||
: 'Créneau à confirmer';
|
||||
|
||||
return Card(
|
||||
|
||||
Reference in New Issue
Block a user