mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 15:17:31 +00:00
date picker decorations matched with design.
This commit is contained in:
@ -178,7 +178,6 @@ class _MonthPickerWidgetState extends State<MonthPickerWidget> {
|
|||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
itemCount: 12,
|
itemCount: 12,
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
padding: const EdgeInsets.all(8),
|
|
||||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
crossAxisCount: 3,
|
crossAxisCount: 3,
|
||||||
childAspectRatio: 2.5,
|
childAspectRatio: 2.5,
|
||||||
@ -191,6 +190,17 @@ class _MonthPickerWidgetState extends State<MonthPickerWidget> {
|
|||||||
|
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: isFutureMonth ? null : () => setState(() => _selectedMonth = index),
|
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(
|
child: Container(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
@ -215,6 +225,7 @@ class _MonthPickerWidgetState extends State<MonthPickerWidget> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
@ -109,7 +109,6 @@ class _YearPickerWidgetState extends State<YearPickerWidget> {
|
|||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
itemCount: years.length,
|
itemCount: years.length,
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
padding: const EdgeInsets.all(8),
|
|
||||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
crossAxisCount: 3,
|
crossAxisCount: 3,
|
||||||
childAspectRatio: 2.5,
|
childAspectRatio: 2.5,
|
||||||
@ -120,6 +119,17 @@ class _YearPickerWidgetState extends State<YearPickerWidget> {
|
|||||||
final isSelected = _currentYear == years[index];
|
final isSelected = _currentYear == years[index];
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () => setState(() => _currentYear = years[index]),
|
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(
|
child: Container(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
@ -140,6 +150,7 @@ class _YearPickerWidgetState extends State<YearPickerWidget> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user