Skip to content

Commit

Permalink
Added private constructors, and small arg tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
leoafarias committed Apr 10, 2021
1 parent ed859af commit 82f23a5
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 20 deletions.
2 changes: 1 addition & 1 deletion lib/src/commands/install_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class InstallCommand extends BaseCommand {
@override
Future<int> run() async {
CacheVersion cacheVersion;
final skipSetup = argResults['skip-setup'] == true;
final skipSetup = boolArg('skip-setup');
String version;

// If no version was passed as argument check project config.
Expand Down
1 change: 0 additions & 1 deletion lib/src/runner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import 'commands/spawn_command.dart';
import 'commands/use_command.dart';
import 'commands/which_command.dart';
import 'utils/logger.dart';
import 'utils/logger.dart' show logger;
import 'utils/pubdev.dart';
import 'version.dart';

Expand Down
3 changes: 2 additions & 1 deletion lib/src/services/cache_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ import 'context.dart';
import 'flutter_tools.dart';
import 'git_tools.dart';

// ignore: avoid_classes_with_only_static_members
/// Service to interact with FVM Cache
class CacheService {
CacheService._();

/// Directory where local versions are cached
/// Returns a [CacheVersion] from a [versionName]
Expand Down
2 changes: 2 additions & 0 deletions lib/src/services/config_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import '../utils/helpers.dart';

/// Helpers and tools for the FVM config within a project
class ConfigService {
ConfigService._();

/// Returns a [FvmConfig] from within a [directory]
static Future<FvmConfig> read(Directory directory) async {
final configDir = Directory(join(directory.path, kFvmDirName));
Expand Down
2 changes: 2 additions & 0 deletions lib/src/services/flutter_tools.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import 'releases_service/releases_client.dart';

/// Helpers and tools to interact with Flutter sdk
class FlutterTools {
FlutterTools._();

/// Upgrades a cached channel
static Future<void> upgradeChannel(CacheVersion version) async {
if (version.isChannel) {
Expand Down
3 changes: 2 additions & 1 deletion lib/src/services/git_tools.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ import '../utils/logger.dart';
import 'context.dart';
import 'settings_service.dart';

// ignore: avoid_classes_with_only_static_members
/// Tools and helpers used for interacting with git
class GitTools {
GitTools._();

/// Check if Git is installed
static Future<void> canRun() async {
try {
Expand Down
2 changes: 2 additions & 0 deletions lib/src/services/project_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import 'config_service.dart';
/// Flutter Project Services
/// APIs for interacting with local Flutter projects
class ProjectService {
ProjectService._();

/// Returns projects by providing a [directory]
static Future<Project> getByDirectory(Directory directory) async {
final pubspec = await _getPubspec(directory);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/services/settings_service.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import '../../fvm.dart';
import 'context.dart';

// ignore: avoid_classes_with_only_static_members
/// Service for FVM settings
class SettingsService {
SettingsService._();
static FvmSettings _settings;

/// Returns [FvmSettings]
Expand Down
28 changes: 13 additions & 15 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: fvm
description: A simple cli to manage Flutter SDK versions per project. Support channels, releases, and local cache for fast switching between versions.
description: A simple cli to manage Flutter SDK versions per project. Support
channels, releases, and local cache for fast switching between versions.
version: 2.0.0-dev.4
homepage: https://github.com/leoafarias/fvm

Expand All @@ -10,28 +11,25 @@ executables:
fvm: main

dependencies:
meta: ^1.3.0
pubspec_yaml: ^2.0.1+1
args: ^1.6.0
cli_util: ^0.3.0
console: ^3.1.0
date_format: ^2.0.2
http: ^0.12.2
io: ^0.3.4
meta: ^1.3.0
path: ^1.7.0
process_run: ^0.11.2+8
http: ^0.12.2
date_format: ^2.0.2
version: ^2.0.0
pub_api_client: ^1.0.9

pubspec_yaml: ^2.0.1+1
version: ^2.0.0

dev_dependencies:
effective_dart: ^1.3.1
test: ^1.15.7
test_coverage: ^0.5.0
build_runner: ^1.10.0
build_version: ^2.0.2
build_test: ^1.2.2
grinder: ^0.8.6
build_version: ^2.0.2
cli_pkg: ^1.2.0



effective_dart: ^1.3.1
grinder: ^0.8.6
test: ^1.15.7
test_coverage: ^0.5.0

0 comments on commit 82f23a5

Please sign in to comment.