tool method

String tool()

Implementation

String tool() {
  if (_tool != null) {
    return _tool!;
  }

  final root = path.dirname(pubspecYaml);

  final nestedLock = pubspecLock.findIn(root);

  final executables = Executables.fromJson(scriptsYaml.executables() ?? {});

  var tool = executables.dart ?? 'dart';

  final contents = findFile.retrieveContent(nestedLock ?? pubspecYaml);

  if (contents != null && contents.contains('flutter')) {
    tool = executables.flutter ?? 'flutter';
    _isFlutter = true;
    _isDart = false;
  }

  return _tool = tool;
}