Skip to content

Commit

Permalink
Feat issue #723 : Create a new column to show the current local versi…
Browse files Browse the repository at this point in the history
…on if the project has a local version configured (#733)
  • Loading branch information
digoreis committed Jun 4, 2024
1 parent 67672d9 commit c9c08de
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/src/commands/list_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -44,14 +45,16 @@ 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)
..insertColumn(header: 'Channel', alignment: TextAlignment.left)
..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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c9c08de

Please sign in to comment.