date picker decorations matched with design.

This commit is contained in:
Faris Armoush
2025-05-20 14:20:16 +03:00
parent 15343be258
commit 4c2802acfc
2 changed files with 55 additions and 33 deletions

View File

@ -178,7 +178,6 @@ class _MonthPickerWidgetState extends State<MonthPickerWidget> {
shrinkWrap: true,
itemCount: 12,
physics: const NeverScrollableScrollPhysics(),
padding: const EdgeInsets.all(8),
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
childAspectRatio: 2.5,
@ -191,6 +190,17 @@ class _MonthPickerWidgetState extends State<MonthPickerWidget> {
return InkWell(
onTap: isFutureMonth ? null : () => setState(() => _selectedMonth = index),
child: DecoratedBox(
decoration: BoxDecoration(
color: const Color(0xFFEDF2F7),
borderRadius: BorderRadius.only(
topLeft: index % 3 == 0 ? const Radius.circular(16) : Radius.zero,
bottomLeft: index % 3 == 0 ? const Radius.circular(16) : Radius.zero,
topRight: index % 3 == 2 ? const Radius.circular(16) : Radius.zero,
bottomRight:
index % 3 == 2 ? const Radius.circular(16) : Radius.zero,
),
),
child: Container(
alignment: Alignment.center,
decoration: BoxDecoration(
@ -215,6 +225,7 @@ class _MonthPickerWidgetState extends State<MonthPickerWidget> {
),
),
),
),
);
},
);

View File

@ -109,7 +109,6 @@ class _YearPickerWidgetState extends State<YearPickerWidget> {
shrinkWrap: true,
itemCount: years.length,
physics: const NeverScrollableScrollPhysics(),
padding: const EdgeInsets.all(8),
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
childAspectRatio: 2.5,
@ -120,6 +119,17 @@ class _YearPickerWidgetState extends State<YearPickerWidget> {
final isSelected = _currentYear == years[index];
return InkWell(
onTap: () => setState(() => _currentYear = years[index]),
child: DecoratedBox(
decoration: BoxDecoration(
color: const Color(0xFFEDF2F7),
borderRadius: BorderRadius.only(
topLeft: index % 3 == 0 ? const Radius.circular(16) : Radius.zero,
bottomLeft: index % 3 == 0 ? const Radius.circular(16) : Radius.zero,
topRight: index % 3 == 2 ? const Radius.circular(16) : Radius.zero,
bottomRight:
index % 3 == 2 ? const Radius.circular(16) : Radius.zero,
),
),
child: Container(
alignment: Alignment.center,
decoration: BoxDecoration(
@ -140,6 +150,7 @@ class _YearPickerWidgetState extends State<YearPickerWidget> {
),
),
),
),
);
},
);