Skip to content

[syncfusion_flutter_datepicker] specifying image in cellDecoration property of DateRangePickerMonthCellStyle gives error #28

Closed
@vaibhav891

Description

@vaibhav891

I am facing an issue when using the datepicker package.
If I try to give an image to the cell decoration property, i get the following error.

"The following assertion was thrown during paint():
'package:flutter/src/painting/box_decoration.dart': Failed assertion: line 378 pos 12: 'onChanged != null || image == null': is not true."

This is how I am using it -
`
SfDateRangePicker(
minDate: DateTime(DateTime.now().year, DateTime.now().month),
maxDate: DateTime(DateTime.now().year, DateTime.now().month + 1, 0),
selectionTextStyle: TextStyle(color: AppColor.white),
monthViewSettings: DateRangePickerMonthViewSettings(
specialDates: leaveDays,

                        ),
                        monthCellStyle: DateRangePickerMonthCellStyle(
                          cellDecoration: BoxDecoration(
                            image: DecorationImage(
                              image: AssetImage('assets/icons/icon.png'),
                            ),
                          ),
                          specialDatesDecoration: BoxDecoration(
                            color: AppColor.saffron,
                            border: Border.all(color: AppColor.saffron, width: 1),
                            shape: BoxShape.circle,
                          ),
                        ),
                      ),

`

flutter doctor output -

[✓] Flutter (Channel stable, 1.22.1, on Mac OS X 10.15.6 19G2021, locale en-IN)
• Flutter version 1.22.1 at /Users/vaibhav/Documents/flutter
• Framework revision f30b7f4db9 (2 weeks ago), 2020-10-08 10:06:30 -0700
• Engine revision 75bef9f6c8
• Dart version 2.10.1

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
• Android SDK at /Users/vaibhav/Library/Android/sdk
• Platform android-30, build-tools 30.0.1
• ANDROID_HOME = /Users/vaibhav/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.0)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.0, Build version 12A7209
• CocoaPods version 1.9.3

[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 46.0.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.50.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.15.1

[✓] Connected device (2 available)
• Android SDK built for x86 (mobile) • emulator-5554 • android-x86 • Android 7.1.1 (API 25) (emulator)
• iPhone 11 (mobile) • D1539A6B-139F-4F52-A9E9-6A051D602C62 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-0 (simulator)

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions