mirror of
https://github.com/koloideal/Casha.git
synced 2026-06-10 10:25:28 +03:00
update
This commit is contained in:
@@ -163,6 +163,8 @@ class _AddTransactionScreenState extends ConsumerState<AddTransactionScreen>
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _pickDate() async {
|
Future<void> _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(
|
final picked = await showDatePicker(
|
||||||
context: context,
|
context: context,
|
||||||
initialDate: _selectedDate,
|
initialDate: _selectedDate,
|
||||||
@@ -358,78 +360,103 @@ class _AddTransactionScreenState extends ConsumerState<AddTransactionScreen>
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
|
|
||||||
_SectionLabel('Date'),
|
|
||||||
const SizedBox(height: 8),
|
|
||||||
Row(
|
Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
// DATE column
|
// DATE column
|
||||||
Expanded(
|
Expanded(
|
||||||
child: GestureDetector(
|
child: Column(
|
||||||
onTap: _pickDate,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
child: Container(
|
children: [
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
|
Text(
|
||||||
decoration: BoxDecoration(
|
'Date',
|
||||||
color: Theme.of(context).colorScheme.surface,
|
style: Theme.of(context).textTheme.bodySmall?.copyWith(
|
||||||
borderRadius: BorderRadius.circular(12),
|
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.6),
|
||||||
border: isDark
|
fontWeight: FontWeight.w500,
|
||||||
? null
|
),
|
||||||
: Border.all(color: const Color(0xFFCCCCDD), width: 1),
|
|
||||||
),
|
),
|
||||||
child: Row(
|
const SizedBox(height: 6),
|
||||||
children: [
|
GestureDetector(
|
||||||
Icon(
|
onTap: _pickDate,
|
||||||
Icons.calendar_today_rounded,
|
child: Container(
|
||||||
size: 16,
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
|
||||||
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.6),
|
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),
|
child: Row(
|
||||||
Expanded(
|
children: [
|
||||||
child: Text(
|
Icon(
|
||||||
DateFormat('MMM d, yyyy').format(_selectedDate),
|
Icons.calendar_today_rounded,
|
||||||
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
size: 16,
|
||||||
color: Theme.of(context).colorScheme.onSurface,
|
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.6),
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
),
|
),
|
||||||
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),
|
const SizedBox(width: 12),
|
||||||
// TIME column
|
// TIME column
|
||||||
Expanded(
|
Expanded(
|
||||||
child: GestureDetector(
|
child: Column(
|
||||||
onTap: _pickTime,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
child: Container(
|
children: [
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
|
Text(
|
||||||
decoration: BoxDecoration(
|
'Time',
|
||||||
color: Theme.of(context).colorScheme.surface,
|
style: Theme.of(context).textTheme.bodySmall?.copyWith(
|
||||||
borderRadius: BorderRadius.circular(12),
|
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.6),
|
||||||
border: isDark
|
fontWeight: FontWeight.w500,
|
||||||
? null
|
),
|
||||||
: Border.all(color: const Color(0xFFCCCCDD), width: 1),
|
|
||||||
),
|
),
|
||||||
child: Row(
|
const SizedBox(height: 6),
|
||||||
children: [
|
GestureDetector(
|
||||||
Icon(
|
onTap: _pickTime,
|
||||||
Icons.access_time_rounded,
|
child: Container(
|
||||||
size: 16,
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
|
||||||
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.6),
|
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),
|
child: Row(
|
||||||
Text(
|
children: [
|
||||||
_selectedTime.format(context),
|
Icon(
|
||||||
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
Icons.access_time_rounded,
|
||||||
color: Theme.of(context).colorScheme.onSurface,
|
size: 16,
|
||||||
fontWeight: FontWeight.w500,
|
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,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user