|
| 1 | +--- |
| 2 | +layout: post |
| 3 | +title: DateRangePicker widget in FlutterFlow framework | Syncfusion |
| 4 | +description: You can learn here all about adding Syncfusion Flutter DateRangePicker (SfDateRangePicker ) widget in FlutterFlow framework. |
| 5 | +platform: flutter |
| 6 | +control: SfDateRangePicker |
| 7 | +documentation: ug |
| 8 | +--- |
| 9 | + |
| 10 | +# How to add Syncfusion DateRangePicker widget in FlutterFlow? |
| 11 | + |
| 12 | +## Overview |
| 13 | + |
| 14 | +[FlutterFlow](https://app.flutterflow.io/dashboard) enables you to create native applications using its graphical interface, reducing the need to write extensive amounts of code. Additionally, it offers the capability to include custom widgets that are not included in the default [FlutterFlow](https://app.flutterflow.io/dashboard) widget collection. This article explains how to incorporate our SfDateRangePicker widget as a custom widget in [FlutterFlow](https://app.flutterflow.io/dashboard). |
| 15 | + |
| 16 | +### Create a new project |
| 17 | + |
| 18 | +Navigate to the [FlutterFlow dashboard](https://app.flutterflow.io/dashboard) and click the `+ Create New` button to create a new project. |
| 19 | + |
| 20 | +### Creating the custom widget |
| 21 | + |
| 22 | +1. Navigate to the `Custom Code` section in the left side navigation menu. |
| 23 | +2. Click on the `+ Add` button to open a dropdown menu. From there, select `Widget`. |
| 24 | +3. Update the widget name as desired. |
| 25 | +4. Click on the `View Boilerplate Code` button on the right side, represented by this icon `[</>]`. |
| 26 | +5. A popup will appear with startup code; locate the button labeled `</> Copy to Editor` and click on it. |
| 27 | +6. Save the widget. |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | +### Add DateRangePicker widget as a dependency |
| 32 | + |
| 33 | +1. Click on `+ Add Dependency`, a text editor will appear. |
| 34 | +2. Navigate to [Syncfusion Flutter DatePicker](https://pub.dev/packages/syncfusion_flutter_datepicker) in [pub.dev](https://pub.dev/) and copy the dependency name and version using the `Copy to Clipboard` option. |
| 35 | + |
| 36 | +3. Paste the copied dependency into the text editor, then click `Refresh` and `Save` it. |
| 37 | + |
| 38 | +>**Note**: The live version of [Syncfusion Flutter DatePicker](https://pub.dev/packages/syncfusion_flutter_datepicker) has been migrated to the latest version of Flutter SDK. To ensure compatibility, please check [FlutterFlow](https://app.flutterflow.io/dashboard)'s current Flutter version and obtain the corresponding version of [Syncfusion Flutter DatePicker](https://pub.dev/packages/syncfusion_flutter_datepicker) by referring to the [SDK compatibility](https://help.syncfusion.com/flutter/system-requirements#sdk-version-compatibility). |
| 39 | +
|
| 40 | + |
| 41 | + |
| 42 | +>**Note**: If you are using an older version of a dependency instead of the latest one, remove the caret symbol (^) prefix in the version number after pasting the dependency. For example, change `^21.3.0` to `21.3.0`. |
| 43 | +>**Note**: Since [Syncfusion Flutter DatePicker](https://pub.dev/packages/syncfusion_flutter_datepicker) depends on the [Syncfusion Flutter Core](https://pub.dev/packages/syncfusion_flutter_core) package, make sure to add it as a dependency following the same steps mentioned above. |
| 44 | +
|
| 45 | +### Import the package |
| 46 | + |
| 47 | +1. Navigate to the `Installing` tab on the [Syncfusion Flutter DatePicker](https://pub.dev/packages/syncfusion_flutter_datepicker) page. Under the `Import it` section, copy the package import statement. |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | +2. Paste the copied import statement into the code editor and then `Save` it. |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | +### Add widget code snippet in code editor |
| 56 | + |
| 57 | +1. Navigate to the [Example](https://pub.dev/packages/syncfusion_flutter_datepicker/example) tab in [Syncfusion Flutter DatePicker](https://pub.dev/packages/syncfusion_flutter_datepicker) and copy the widget specific codes. |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | +3. Paste the copied code snippet into the code editor, click `Format Code`, and `Save` it. |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | +### Compiling the codes |
| 66 | + |
| 67 | +1. Click on the 'Compile Code' button located in the top right corner. |
| 68 | +2. If there are no errors, save the process. If errors are present, fix them and compile the code again. Once the code has been successfully compiled, save the process. |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | +>**Note**: The compilation progress takes 2 to 3 minutes to complete. |
| 73 | +
|
| 74 | +### Utilizing the custom widget |
| 75 | + |
| 76 | +1. Navigate to `Widget Palette` located in the left side navigation menu. |
| 77 | +2. Click on the `Componenets` tab. |
| 78 | +3. Under `Custom Code Widgets`, your custom widget will be there. Now, the custom widget can be added to your page by drag-and-drop. |
| 79 | + |
| 80 | + |
0 commit comments