maxim-saplin / data_table_2

In-place substitute for Flutter's DataTable and PaginatedDataTable with fixed/sticky header and extra features
https://pub.dev/packages/data_table_2
BSD 3-Clause "New" or "Revised" License
202 stars 135 forks source link

Error: Type 'WidgetStateProperty' not found. #291

Closed JubileusDeus closed 1 month ago

JubileusDeus commented 1 month ago

Hello. I recently updated my version of data table 2 and I keep getting this error. I use flutter 3.19.6 (Stable channel) and my project is a flutter web project.

Here is the log :

/C:/Users/user_name/AppData/Local/Pub/Cache/hosted/pub.dev/data_table_2-2.5.15/lib/src/data_table_2.dart:90:5: Error: Type 'WidgetStateProperty' not found. WidgetStateProperty<Color?>? color, ^^^^^^^^^^^^^^^^^^^ /C:/Users/user_name/AppData/Local/Pub/Cache/hosted/pub.dev/data_table_2-2.5.15/lib/src/data_table_2.dart:362:16: Error: Type 'WidgetStateProperty' not found. required WidgetStateProperty<Color?>? overlayColor, ^^^^^^^^^^^^^^^^^^^ /C:/Users/user_name/AppData/Local/Pub/Cache/hosted/pub.dev/data_table_2-2.5.15/lib/src/data_table_2.dart:419:16: Error: Type 'WidgetStateProperty' not found. required WidgetStateProperty<Color?>? overlayColor}) { ^^^^^^^^^^^^^^^^^^^ /C:/Users/user_name/AppData/Local/Pub/Cache/hosted/pub.dev/data_table_2-2.5.15/lib/src/data_table_2.dart:491:16: Error: Type 'WidgetStateProperty' not found. required WidgetStateProperty<Color?>? overlayColor}) { ^^^^^^^^^^^^^^^^^^^ /C:/Users/user_name/AppData/Local/Pub/Cache/hosted/pub.dev/data_table_2-2.5.15/lib/src/data_table_2.dart:1161:7: Error: Type 'WidgetStateProperty' not found. WidgetStateProperty<Color?>? effectiveDataRowColor) { ^^^^^^^^^^^^^^^^^^^ /C:/Users/user_name/AppData/Local/Pub/Cache/hosted/pub.dev/data_table_2-2.5.15/lib/src/data_table_2.dart:1329:7: Error: Type 'WidgetStateProperty' not found. WidgetStateProperty<Color?>? effectiveDataRowColor, ^^^^^^^^^^^^^^^^^^^ /C:/Users/user_name/AppData/Local/Pub/Cache/hosted/pub.dev/data_table_2-2.5.15/lib/src/data_table_2.dart:1333:7: Error: Type 'WidgetStateProperty' not found. WidgetStateProperty<Color?> defaultRowColor, ^^^^^^^^^^^^^^^^^^^ /C:/Users/user_name/AppData/Local/Pub/Cache/hosted/pub.dev/data_table_2-2.5.15/lib/src/data_table_2.dart:1399:7: Error: Type 'WidgetStateProperty' not found. WidgetStateProperty<Color?>? effectiveHeadingRowColor, int numberOfCols) { ^^^^^^^^^^^^^^^^^^^ /C:/Users/user_name/AppData/Local/Pub/Cache/hosted/pub.dev/data_table_2-2.5.15/lib/src/paginated_data_table_2.dart:350:9: Error: Type 'WidgetStateProperty' not found. final WidgetStateProperty<Color?>? headingRowColor; ^^^^^^^^^^^^^^^^^^^ /C:/Users/user_name/AppData/Local/Pub/Cache/hosted/pub.dev/data_table_2-2.5.15/lib/src/data_table_2.dart:90:5: Error: 'WidgetStateProperty' isn't a type. WidgetStateProperty<Color?>? color, ^^^^^^^^^^^^^^^^^^^ /C:/Users/user_name/AppData/Local/Pub/Cache/hosted/pub.dev/data_table_2-2.5.15/lib/src/data_table_2.dart:362:16: Error: 'WidgetStateProperty' isn't a type. required WidgetStateProperty<Color?>? overlayColor, ^^^^^^^^^^^^^^^^^^^ /C:/Users/user_name/AppData/Local/Pub/Cache/hosted/pub.dev/data_table_2-2.5.15/lib/src/data_table_2.dart:419:16: Error: 'WidgetStateProperty' isn't a type. required WidgetStateProperty<Color?>? overlayColor}) { ^^^^^^^^^^^^^^^^^^^ /C:/Users/user_name/AppData/Local/Pub/Cache/hosted/pub.dev/data_table_2-2.5.15/lib/src/data_table_2.dart:491:16: Error: 'WidgetStateProperty' isn't a type. required WidgetStateProperty<Color?>? overlayColor}) { ^^^^^^^^^^^^^^^^^^^ /C:/Users/user_name/AppData/Local/Pub/Cache/hosted/pub.dev/data_table_2-2.5.15/lib/src/data_table_2.dart:590:12: Error: 'WidgetState' isn't a type. (Set states) { ^^^^^^^^^^^ /C:/Users/user_name/AppData/Local/Pub/Cache/hosted/pub.dev/data_table_2-2.5.15/lib/src/data_table_2.dart:589:29: Error: The getter 'WidgetStateProperty' isn't defined for the class 'DataTable2'.

chloethhsu commented 1 month ago

same issue

maxim-saplin commented 1 month ago

You need to upgrade Flutter via flutter upgrade - as of today 3.22.2 is the most recent version. In the above logs older Flutter is used.

Or you can downgrade the data_table_2 version in pub spec.yaml to 2.5.12