|
|
|
|
@ -19,7 +19,11 @@ class ADatePicker extends StatelessWidget {
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: context.isDark?AppColor.neutral50:Colors.white,
|
|
|
|
|
color: context.isDark && (enable == false)
|
|
|
|
|
? AppColor.neutral60
|
|
|
|
|
: (enable == false)
|
|
|
|
|
? AppColor.neutral40
|
|
|
|
|
: Theme.of(context).cardColor,
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
border: Border.all(width: 1, color: Theme.of(context).scaffoldBackgroundColor),
|
|
|
|
|
boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.05), blurRadius: 10)],
|
|
|
|
|
@ -27,16 +31,18 @@ class ADatePicker extends StatelessWidget {
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth, vertical: 8.toScreenHeight),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
label.tinyFont(context),
|
|
|
|
|
((date?.toIso8601String()?.split("T")?.first) ?? context.translation.pickADate).bodyText(context).custom(color: context.isDark?AppColor.neutral10: AppColor.neutral50),
|
|
|
|
|
],
|
|
|
|
|
).expanded,
|
|
|
|
|
16.width,
|
|
|
|
|
"calender".toSvgAsset(width: 20, color: context.isDark? AppColor.neutral10:null),
|
|
|
|
|
enable
|
|
|
|
|
? Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
label.tinyFont(context),
|
|
|
|
|
((date?.toIso8601String()?.split("T")?.first) ?? context.translation.pickADate).bodyText(context).custom(color: context.isDark ? AppColor.neutral10 : AppColor.neutral50),
|
|
|
|
|
],
|
|
|
|
|
).expanded
|
|
|
|
|
: label.bodyText(context).paddingOnly(top: 8, bottom: 8),
|
|
|
|
|
enable ? 16.width : const Spacer(),
|
|
|
|
|
"calender".toSvgAsset(width: 20, color: context.isDark ? AppColor.neutral10 : null),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
).onPress(enable
|
|
|
|
|
|