diff --git a/lib/src/view/analysis/analysis_screen.dart b/lib/src/view/analysis/analysis_screen.dart index 005bdced4a..d57d9d3cc4 100644 --- a/lib/src/view/analysis/analysis_screen.dart +++ b/lib/src/view/analysis/analysis_screen.dart @@ -308,13 +308,40 @@ class _Board extends ConsumerWidget { bestMoves != null ? ISet( bestMoves.where((move) => move != null).mapIndexed( - (i, move) => cg.Arrow( - color: - const Color(0x40003088).withOpacity(0.4 - 0.15 * i), - orig: move!.cg.from, - dest: move.cg.to, - ), - ), + (i, move) { + switch (move!) { + case NormalMove( + from: _, + to: _, + promotion: final promRole + ): + return [ + cg.Arrow( + color: const Color(0x40003088) + .withOpacity(0.4 - 0.15 * i), + orig: move.cg.from, + dest: move.cg.to, + ), + if (promRole != null) + cg.PieceShape( + color: const Color(0x40003088) + .withOpacity(0.4 - 0.15 * i), + orig: move.cg.to, + role: promRole.cg, + ), + ]; + case DropMove(role: final role, to: _): + return [ + cg.PieceShape( + color: const Color(0x40003088) + .withOpacity(0.4 - 0.15 * i), + orig: move.cg.to, + role: role.cg, + ), + ]; + } + }, + ).expand((e) => e), ) : null, annotations: sanMove != null && annotation != null diff --git a/pubspec.lock b/pubspec.lock index 1a2a1c579e..2298a70746 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -181,10 +181,10 @@ packages: dependency: "direct main" description: name: chessground - sha256: "64a68714ab0da717c8e1268e1a0cce143818897f3dc2327c52dfa4f61b7a8b22" + sha256: "5d8969f5f05aae3ca54edf7365c86701b1ca40bc67ef12c53724ab06f7f84c94" url: "https://pub.dev" source: hosted - version: "2.4.1" + version: "2.5.0" ci: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 4d703f65e2..081bed7610 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ environment: dependencies: async: ^2.10.0 cached_network_image: ^3.2.2 - chessground: ^2.4.0 + chessground: ^2.5.0 collection: ^1.17.0 connectivity_plus: ^5.0.0 crypto: ^3.0.3