From c827f6e47514d84675dd963fe5f6f5fc7431da5f Mon Sep 17 00:00:00 2001 From: kolo Date: Sat, 21 Mar 2026 00:45:32 +0300 Subject: [PATCH] update --- lib/features/add_transaction/screen.dart | 135 ++++++++++++++--------- 1 file changed, 81 insertions(+), 54 deletions(-) diff --git a/lib/features/add_transaction/screen.dart b/lib/features/add_transaction/screen.dart index 2641492..7abb124 100644 --- a/lib/features/add_transaction/screen.dart +++ b/lib/features/add_transaction/screen.dart @@ -163,6 +163,8 @@ class _AddTransactionScreenState extends ConsumerState } Future _pickDate() async { + // Note: Using showDatePicker (system bottom sheet) which cannot be resized from Flutter. + // The calendar height is controlled by the system and varies by platform. final picked = await showDatePicker( context: context, initialDate: _selectedDate, @@ -358,78 +360,103 @@ class _AddTransactionScreenState extends ConsumerState ), const SizedBox(height: 20), - _SectionLabel('Date'), - const SizedBox(height: 8), Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ // DATE column Expanded( - child: GestureDetector( - onTap: _pickDate, - child: Container( - padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14), - decoration: BoxDecoration( - color: Theme.of(context).colorScheme.surface, - borderRadius: BorderRadius.circular(12), - border: isDark - ? null - : Border.all(color: const Color(0xFFCCCCDD), width: 1), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Date', + style: Theme.of(context).textTheme.bodySmall?.copyWith( + color: Theme.of(context).colorScheme.onSurface.withOpacity(0.6), + fontWeight: FontWeight.w500, + ), ), - child: Row( - children: [ - Icon( - Icons.calendar_today_rounded, - size: 16, - color: Theme.of(context).colorScheme.onSurface.withOpacity(0.6), + const SizedBox(height: 6), + GestureDetector( + onTap: _pickDate, + child: Container( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14), + decoration: BoxDecoration( + color: Theme.of(context).colorScheme.surface, + borderRadius: BorderRadius.circular(12), + border: isDark + ? null + : Border.all(color: const Color(0xFFCCCCDD), width: 1), ), - const SizedBox(width: 8), - Expanded( - child: Text( - DateFormat('MMM d, yyyy').format(_selectedDate), - style: Theme.of(context).textTheme.bodyMedium?.copyWith( - color: Theme.of(context).colorScheme.onSurface, - fontWeight: FontWeight.w500, + child: Row( + children: [ + Icon( + Icons.calendar_today_rounded, + size: 16, + color: Theme.of(context).colorScheme.onSurface.withOpacity(0.6), ), - overflow: TextOverflow.ellipsis, - ), + const SizedBox(width: 8), + Expanded( + child: Text( + DateFormat('MMM d, yyyy').format(_selectedDate), + style: Theme.of(context).textTheme.bodyMedium?.copyWith( + color: Theme.of(context).colorScheme.onSurface, + fontWeight: FontWeight.w500, + ), + overflow: TextOverflow.ellipsis, + ), + ), + ], ), - ], + ), ), - ), + ], ), ), const SizedBox(width: 12), // TIME column Expanded( - child: GestureDetector( - onTap: _pickTime, - child: Container( - padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14), - decoration: BoxDecoration( - color: Theme.of(context).colorScheme.surface, - borderRadius: BorderRadius.circular(12), - border: isDark - ? null - : Border.all(color: const Color(0xFFCCCCDD), width: 1), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Time', + style: Theme.of(context).textTheme.bodySmall?.copyWith( + color: Theme.of(context).colorScheme.onSurface.withOpacity(0.6), + fontWeight: FontWeight.w500, + ), ), - child: Row( - children: [ - Icon( - Icons.access_time_rounded, - size: 16, - color: Theme.of(context).colorScheme.onSurface.withOpacity(0.6), + const SizedBox(height: 6), + GestureDetector( + onTap: _pickTime, + child: Container( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14), + decoration: BoxDecoration( + color: Theme.of(context).colorScheme.surface, + borderRadius: BorderRadius.circular(12), + border: isDark + ? null + : Border.all(color: const Color(0xFFCCCCDD), width: 1), ), - const SizedBox(width: 8), - Text( - _selectedTime.format(context), - style: Theme.of(context).textTheme.bodyMedium?.copyWith( - color: Theme.of(context).colorScheme.onSurface, - fontWeight: FontWeight.w500, - ), + child: Row( + children: [ + Icon( + Icons.access_time_rounded, + size: 16, + color: Theme.of(context).colorScheme.onSurface.withOpacity(0.6), + ), + const SizedBox(width: 8), + Text( + _selectedTime.format(context), + style: Theme.of(context).textTheme.bodyMedium?.copyWith( + color: Theme.of(context).colorScheme.onSurface, + fontWeight: FontWeight.w500, + ), + ), + ], ), - ], + ), ), - ), + ], ), ), ],