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

Facing issue with scrolling months. #5

Open
Aryan2892 opened this issue Jun 12, 2024 · 1 comment · May be fixed by #6
Open

Facing issue with scrolling months. #5

Aryan2892 opened this issue Jun 12, 2024 · 1 comment · May be fixed by #6

Comments

@Aryan2892
Copy link

Aryan2892 commented Jun 12, 2024

I am facing issue when I scroll the months tab in the date picker. Also the months are not being shown as three letters. Months are being shown as full length.

  final DateTime currentDate = DateTime.now();
  final DateTime firstDate = DateTime(1990, 1, 1);

  DateTime? _selectedDate;
ScrollWheelDatePicker(
  initialDate: DateTime(1995, 1, 1),
  startDate: firstDate,
  lastDate: currentDate,
  theme: CurveDatePickerTheme(
    wheelPickerHeight: 200.0,
    overlay: ScrollWheelDatePickerOverlay.highlight,
    itemTextStyle: GoogleFonts.urbanist(
      color: Theme.of(context).colorScheme.secondary,
      fontSize: 30,
      fontWeight: FontWeight.w800,
    ),
    monthFormat: MonthFormat.threeLetters,
    overlayColor: Theme.of(context).colorScheme.primary,
    overAndUnderCenterOpacity: 0.2,
  ),
  onSelectedItemChanged: (value) {
    Logger().d('Selected date: $value');
    setState(() {
      _selectedDate = value;
    });
  },
),

CustomButton(
                onPressed: () {
                  if (_selectedDate != null) {
                    final formattedDate =
                        DateFormat('yyyy-MM-dd').format(_selectedDate!);
                    pickBirthday(formattedDate.toString());
                  }
                },
                buttonText: tr('continue'),
                assetPath: 'assets/img/arrow.png',
              ),

This is the what is shown in debug

  final List<DiagnosticsNode> information = <DiagnosticsNode>[
       ErrorSummary('setState() or markNeedsBuild() called during build.'),
       ErrorDescription(
         'This ${widget.runtimeType} widget cannot be marked as needing to build because the framework '
         'is already in the process of building widgets. A widget can be marked as '
         'needing to be built during the build phase only if one of its ancestors '
         'is currently building. This exception is allowed because the framework '
         'builds parent widgets before children, which means a dirty descendant '
         'will always be built. Otherwise, the framework might not visit this '
         'widget during this build phase.',
       ),
       describeElement('The widget on which setState() or markNeedsBuild() was called was'),
     ];
     if (owner!._debugCurrentBuildTarget != null) {
       information.add(owner!._debugCurrentBuildTarget!.describeWidget('The widget which was currently being built when the offending call was made was'));
     }
     throw FlutterError.fromParts(information);
   } 

Please let me know if there is any initialization error or if there is any error with the way I am coding.

@kunit1
Copy link

kunit1 commented Sep 1, 2024

I have the same exact issue. @Fingertips18 Would you be able to help?

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

Successfully merging a pull request may close this issue.

2 participants