Flutter gives error by using Drift after Moor

Viewed 469

I had tried flutter clean but error did not go.I used Moor 4.6.1 version and after that this error occured

C:\Users\LENOVO\development\projects\ToDo_App>flutter packages run build_runner build

[SEVERE] drift_dev:drift_dev on lib/custom_widget/tasks_tile.dart (cached):

InconsistentAnalysisException: Requested result might be inconsistent with previously ret
urned results

[SEVERE] drift_dev:drift_dev on lib/modals/task.dart (cached):

InconsistentAnalysisException: Requested result might be inconsistent with previously ret
urned results

[SEVERE] drift_dev:drift_dev on lib/custom_widget/tasks_list.dart (cached):

InconsistentAnalysisException: Requested result might be inconsistent with previously ret
urned results

[SEVERE] Failed after 11.5s
pub finished with exit code 1
1 Answers

There are two things to do: First: downgrade the build_runner version to 2.1.6 or 2.1.5

dev_dependencies:
    build_runner: 2.1.6

Second: also downgrade the analyzer version

dependency_overrides:
  analyzer: 3.3.1
Related