We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Error while compiling project

I'm using Flutter V2 with Dart v2.16.0, i'm trying to use syncfusion_flutter_datagrid: ^20.3.61 for a filtering purpose in my DataGrid, i'm getting errors when i try to add the import 'package:syncfusion_flutter_datagrid/datagrid.dart' even i'm not using it.

Latest version 19 (19.4.56) is working fine but it don't containin filtering. 

errors: 


.../syncfusion_flutter_datagrid-20.3.61/lib/src/datagrid_widget/sfdatagrid.dart:4237:29: Error: Method 'addPostFrameCallback' cannot be called on 'WidgetsBinding?' because it is potentially null.

 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/C:/src/flutter/packages/flutter/lib/src/widgets/binding.dart').

Try calling using ?. instead.

    WidgetsBinding.instance.addPostFrameCallback((Duration timeStamp) {

                            ^^^^^^^^^^^^^^^^^^^^

.../syncfusion_flutter_datagrid-20.3.61/lib/src/datagrid_widget/sfdatagrid.dart:4247:29: Error: Method 'addPostFrameCallback' cannot be called on 'WidgetsBinding?' because it is potentially null.

 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/C:/src/flutter/packages/flutter/lib/src/widgets/binding.dart').

Try calling using ?. instead.

    WidgetsBinding.instance.addPostFrameCallback((Duration timeStamp) {

                            ^^^^^^^^^^^^^^^^^^^^

.../syncfusion_flutter_datagrid-20.3.61/lib/src/datapager/sfdatapager.dart:547:33: Error: Method 'addPostFrameCallback' cannot be called on 'WidgetsBinding?' because it is potentially null.

 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/C:/src/flutter/packages/flutter/lib/src/widgets/binding.dart').

Try calling using ?. instead.

        WidgetsBinding.instance.addPostFrameCallback((Duration timeStamp) {

                                ^^^^^^^^^^^^^^^^^^^^

.../syncfusion_flutter_datagrid-20.3.61/lib/src/datapager/sfdatapager.dart:558:31: Error: Method 'addPostFrameCallback' cannot be called on 'WidgetsBinding?' because it is potentially null.

 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/C:/src/flutter/packages/flutter/lib/src/widgets/binding.dart').

Try calling using ?. instead.

      WidgetsBinding.instance.addPostFrameCallback((Duration timeStamp) {

                              ^^^^^^^^^^^^^^^^^^^^

.../syncfusion_flutter_datagrid-20.3.61/lib/src/datapager/sfdatapager.dart:1434:31: Error: Method 'addPostFrameCallback' cannot be called on 'WidgetsBinding?' because it is potentially null.

 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/C:/src/flutter/packages/flutter/lib/src/widgets/binding.dart').

Try calling using ?. instead.

      WidgetsBinding.instance.addPostFrameCallback((_) {

                              ^^^^^^^^^^^^^^^^^^^^

.../syncfusion_flutter_datagrid-20.3.61/lib/src/datagrid_widget/widgets/cell_widget.dart:704:11: Error: No named parameter with the name 'constraints'.

          constraints: const BoxConstraints(maxWidth: 274.0),

          ^^^^^^^^^^^

/C:/src/flutter/packages/flutter/lib/src/material/popup_menu.dart:863:12: Context: Found this candidate, but the arguments don't match.

Future<T?> showMenu<T>({

           ^^^^^^^^

.../syncfusion_flutter_datagrid-20.3.61/lib/src/datagrid_widget/widgets/scrollview_widget.dart:231:9: Error: No named parameter with the name 'thumbVisibility'.

        thumbVisibility: dataGridConfiguration.isScrollbarAlwaysShown,

        ^^^^^^^^^^^^^^^

/C:/src/flutter/packages/flutter/lib/src/material/scrollbar.dart:75:9: Context: Found this candidate, but the arguments don't match.

  const Scrollbar({

        ^^^^^^^^^

.../syncfusion_flutter_datagrid-20.3.61/lib/src/datagrid_widget/widgets/scrollview_widget.dart:226:7: Error: No named parameter with the name 'thumbVisibility'.

      thumbVisibility: dataGridConfiguration.isScrollbarAlwaysShown,

      ^^^^^^^^^^^^^^^

/C:/src/flutter/packages/flutter/lib/src/material/scrollbar.dart:75:9: Context: Found this candidate, but the arguments don't match.

  const Scrollbar({

        ^^^^^^^^^



FAILURE: Build failed with an exception.


* Where:

Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1102


* What went wrong:

Execution failed for task ':app:compileFlutterBuildDevDebug'.

> Process 'command 'C:\src\flutter\bin\flutter.bat'' finished with non-zero exit value 1


* Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.


* Get more help at https://help.gradle.org


BUILD FAILED in 26s

Exception: Gradle task assembleDevDebug failed with exit code 1





4 Replies 1 reply marked as answer

TP Tamilarasan Paranthaman Syncfusion Team January 5, 2023 12:13 PM UTC

Hi badreddine,


Based on the information you have provided, we suspect that you may be using an older version of the Flutter SDK. We have tested the DataGrid with the latest version (3.3.10) and were unable to reproduce the issue you have described.


To help resolve the issue you are experiencing, we recommend upgrading your Flutter SDK to the latest stable version (3.3.10). This may resolve the issue you are experiencing.


Regards,

Tamilarasan



BS badreddine saoudi replied to Tamilarasan Paranthaman January 5, 2023 12:38 PM UTC

Hello, thanks for your reply, 

the problem is i'm obliged to use Flutter V2, so is there any version of Datagrid library that support filtering and can work in Flutter V2 without errors? 


Best regards 

Badreddine SAOUDI.



TP Tamilarasan Paranthaman Syncfusion Team January 6, 2023 01:06 PM UTC

Badreddine SAOUDI,


Our DataGrid widget is compatible only with the latest stable version of Flutter. If you are using Flutter version 2, you will not be able to use our latest version of the DataGrid. To take advantage of all of the features and updates in our DataGrid, we recommend upgrading to the latest stable version of Flutter.


Marked as answer

NI Nick January 11, 2023 02:00 AM UTC

A business model is a framework that answers fundamental questions about a product, service, or solution. It distills the opportunity and potential of a company and sets a clear direction for success https://mlsdev.com .


Loader.
Up arrow icon