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
Hi badreddine,
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
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.
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.
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 .