Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DefaultValue not working #3

Open
Azzen-V opened this issue Mar 12, 2022 · 1 comment
Open

DefaultValue not working #3

Azzen-V opened this issue Mar 12, 2022 · 1 comment

Comments

@Azzen-V
Copy link

Azzen-V commented Mar 12, 2022

Hey, I really love your date picker but the default value is not working. There is no date selected even if I specified a default value. This is my code:
CoolDatepicker( onSelected: widget.onSelected, maxYear: 2222, minYear: 2019, calendarSize: 350, firstWeekDay: 1, format: 'dd.mm.yyyy', defaultValue: [DateTime.now()], monthLabelList: const [ 'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember', ], isYearMonthDropdownReverse: true, isResultLabel: true, resultWidth: 300, resultBD: BoxDecoration( color: Theme.of(context).colorScheme.background, border: Border( bottom: BorderSide( color: Theme.of(context).colorScheme.secondary, ), ), ), resultTS: TextStyle( fontSize: 20, color: Theme.of(context).colorScheme.onSecondary, ), placeholder: s.lblDate, headerColor: Theme.of(context).colorScheme.secondary, arrowIconAreaColor: Theme.of(context).colorScheme.secondary, selectedCircleColor: Theme.of(context).colorScheme.secondary, selectedBetweenAreaColor: Theme.of(context).colorScheme.secondary, cancelFontColor: Theme.of(context).colorScheme.secondary, cancelBtnLabel: 'Abbrechen', okButtonColor: LinearGradient(colors: [ Theme.of(context).colorScheme.secondary, Theme.of(context).colorScheme.secondary, ]), bottomSelectedBorderColor: Theme.of(context).colorScheme.secondary, isDark: true, )
Did I do something wrong?

@joo6077
Copy link
Owner

joo6077 commented Mar 13, 2022

image

CoolDatepicker(
onSelected: (_) {},
maxYear: 2222,
minYear: 2019,
calendarSize: 350,
firstWeekDay: 1,
format: 'dd.mm.yyyy',
placeholder: 'dd.mm.yyyy',
defaultValue: [DateTime.now()],
monthLabelList: const [
'Januar',
'Februar',
'März',
'April',
'Mai',
'Juni',
'Juli',
'August',
'September',
'Oktober',
'November',
'Dezember',
],
isYearMonthDropdownReverse: true,
isResultLabel: true,
resultWidth: 300,
resultBD: BoxDecoration(
color: Theme.of(context).colorScheme.background,
border: Border(
bottom: BorderSide(
color: Theme.of(context).colorScheme.secondary,
),
),
),
resultTS: TextStyle(
fontSize: 20,
color: Theme.of(context).colorScheme.onSecondary,
),
headerColor: Theme.of(context).colorScheme.secondary,
arrowIconAreaColor: Theme.of(context).colorScheme.secondary,
selectedCircleColor: Theme.of(context).colorScheme.secondary,
selectedBetweenAreaColor:
Theme.of(context).colorScheme.secondary,
cancelFontColor: Theme.of(context).colorScheme.secondary,
cancelBtnLabel: 'Abbrechen',
okButtonColor: LinearGradient(colors: [
Theme.of(context).colorScheme.secondary,
Theme.of(context).colorScheme.secondary,
]),
bottomSelectedBorderColor:
Theme.of(context).colorScheme.secondary,
isDark: true,
)

It works well for me, I just modified placeholder and onSelected options in your code.
There is no any errors or specific problems?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants