findVersion method

String? findVersion()

Search for version configured

This method searches for the version of the Flutter SDK that is configured for the current project. It uses the findAncestor method to find the project directory.

Returns the pinned Flutter SDK version for the project, or null if no version is configured.

Implementation

String? findVersion() {
  final project = findAncestor();

  return project.pinnedVersion?.name;
}