title: LateInitializationError: Field 'annotationAst' has not been initialized
body: <p>I upgrade my packages using <code>dart pub outdated --mode=null-safety</code> command. after updating my packages I got this error while running <code>dart migrate</code> to migrate my code to null-safety.
  also when I tried to run <code> flutter pub run build_runner build --delete-conflicting-outputs</code> command for <code>moor</code> database.</p>
  <p>I have no clue where this error is coming from and my codebase is really big to search for any initialization or annotation</p>
  <p>Why does this issue happen and How can I solve that?</p>
  <pre><code>
  LateInitializationError: Field 'annotationAst' has not been initialized.
  #0      ElementAnnotationImpl.annotationAst (package:analyzer/src/dart/element/element.dart)
  #1      ConstantEvaluationEngine.computeDependencies (package:analyzer/src/dart/constant/evaluation.dart:336:39)
  #2      _ConstantWalker._computeDependencies (package:analyzer/src/dart/constant/compute.dart:75:22)
  #3      _ConstantNode.computeDependencies (package:analyzer/src/dart/constant/compute.dart:43:19)
  #4      Node.getDependencies (package:analyzer/src/summary/link.dart:148:40)
  #5      DependencyWalker.walk.strongConnect (package:analyzer/src/summary/link.dart:53:40)
  #6      DependencyWalker.walk (package:analyzer/src/summary/link.dart:119:18)
  #7      computeConstants (package:analyzer/src/dart/constant/compute.dart:26:14)
  #8      LibraryAnalyzer._computeConstants (package:analyzer/src/dart/analysis/library_analyzer.dart:250:5)
  #9      LibraryAnalyzer.analyzeSync (package:analyzer/src/dart/analysis/library_analyzer.dart:135:5)
  #10     LibraryAnalyzer.analyze (package:analyzer/src/dart/analysis/library_analyzer.dart:103:12)
  #11     AnalysisDriver._computeAnalysisResult.&lt;anonymous closure&gt; (package:analyzer/src/dart/analysis/driver.dart:1624:63)
  #12     PerformanceLog.run (package:analyzer/src/dart/analysis/performance_logger.dart:32:15)
  #13     AnalysisDriver._computeAnalysisResult (package:analyzer/src/dart/analysis/driver.dart:1600:20)
  #14     AnalysisDriver._computeErrors (package:analyzer/src/dart/analysis/driver.dart:1678:26)
  #15     AnalysisDriver.performWork (package:analyzer/src/dart/analysis/driver.dart:1301:20)
  #16     AnalysisDriverScheduler._run (package:analyzer/src/dart/analysis/driver.dart:2334:24)
  </code></pre>