From ebc9ed28681f839578ace6476beffb438082fb58 Mon Sep 17 00:00:00 2001 From: Rodrigo Reis Date: Tue, 4 Jun 2024 12:43:09 +0100 Subject: [PATCH] Feat issue #723 : Create a new column to show the current local version if the project has a local version configured --- lib/src/commands/list_command.dart | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/src/commands/list_command.dart b/lib/src/commands/list_command.dart index 5182c386..639309ed 100644 --- a/lib/src/commands/list_command.dart +++ b/lib/src/commands/list_command.dart @@ -3,6 +3,7 @@ import 'package:mason_logger/mason_logger.dart'; import '../services/cache_service.dart'; import '../services/global_version_service.dart'; +import '../services/project_service.dart'; import '../services/logger_service.dart'; import '../services/releases_service/models/version_model.dart'; import '../services/releases_service/releases_client.dart'; @@ -44,6 +45,7 @@ class ListCommand extends BaseCommand { final releases = await FlutterReleasesClient.getReleases(); final globalVersion = GlobalVersionService.fromContext.getGlobal(); + final localVersion = ProjectService.fromContext.findVersion(); final table = Table() ..insertColumn(header: 'Version', alignment: TextAlignment.left) @@ -51,7 +53,8 @@ class ListCommand extends BaseCommand { ..insertColumn(header: 'Flutter Version', alignment: TextAlignment.left) ..insertColumn(header: 'Dart Version', alignment: TextAlignment.left) ..insertColumn(header: 'Release Date', alignment: TextAlignment.left) - ..insertColumn(header: 'Global', alignment: TextAlignment.left); + ..insertColumn(header: 'Global', alignment: TextAlignment.left) + ..insertColumn(header: 'Local', alignment: TextAlignment.left); for (var version in cacheVersions) { var printVersion = version.name; @@ -99,6 +102,9 @@ class ListCommand extends BaseCommand { version.dartSdkVersion ?? '', releaseDate, globalVersion == version ? green.wrap(dot)! : '', + localVersion == printVersion && localVersion != null + ? green.wrap(dot)! + : '', ], ]) ..borderStyle = BorderStyle.square