How to add Syncfusion DataGrid widget in FlutterFlow?
8 Jul 20263 minutes to read
Overview
FlutterFlow 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 widget collection. This article explains how to incorporate the SfDataGrid widget as a custom widget in FlutterFlow.
Note: You need an active FlutterFlow account and basic knowledge of Flutter development to follow this guide. Refer to the SDK version compatibility to ensure your FlutterFlow’s Flutter version is compatible with the Syncfusion Flutter DataGrid package.
Create a new project
Navigate to the FlutterFlow dashboard and click the + Create New button to create a new project.
Creating the custom widget
- Navigate to the
Custom Codesection in the left side navigation menu. - Click on the
+ Addbutton to open a dropdown menu, then selectWidget. - Update the widget name as desired.
- Click the
View Boilerplate Codebutton on the right side, represented by the code icon (</>). - A popup will appear with startup code. Locate the button labeled
</> Copy to Editorand click on it to load the boilerplate code into the editor. - Click
Saveto save the custom widget.

Add DataGrid widget as a dependency
- Click on
+ Add Dependency, a text editor will appear. - Navigate to the Syncfusion Flutter DataGrid package on pub.dev and copy the dependency name and version using the
Copy to Clipboardoption.
- Paste the copied dependency into the text editor, then click
RefreshandSaveit.
Note:
- If you need a specific version instead of the latest, remove the caret (^) prefix in the version number. For example, change
^21.3.0to21.3.0to lock to that exact version.- The SfDataGrid package depends on the Syncfusion Flutter Core package. Make sure to add it as a dependency using the same steps above.

Import the package
- Navigate to the Installing tab on the Syncfusion Flutter DataGrid package page. Under the Import it section, copy the package import statement.
- Paste the copied import statement into the code editor and click
Save.
Add widget code snippet in code editor
- Navigate to the Example tab in the Syncfusion Flutter DataGrid package page and copy the widget code example.
- Paste the copied code into the editor, click
Format Codeto format it to standard style, and then clickSave.
Compiling the code
- Click the Compile Code button located in the top right corner.
- Wait for the compilation to complete (typically 2-3 minutes). The status will display at the top of the editor.
- Once compilation succeeds, a confirmation message will appear. If errors occur, review the error messages, fix the code, and compile again.
- Click
Saveafter successful compilation.

Note: Compilation typically takes 2 to 3 minutes. The editor will display compilation status and any errors encountered during the build process.
Using the custom widget in your app
- Navigate to Widget Palette in the left side navigation menu.
- Click on the Components tab.
- Locate your custom widget under Custom Code Widgets. Drag and drop it onto your page.
- Configure the SfDataGrid properties and data source as needed. Refer to the SfDataGrid API documentation for detailed configuration options.
- Run your FlutterFlow app to verify the SfDataGrid widget displays correctly.
