From bb6cc12ff02086c1e356e17a528e3a6bc91127ac Mon Sep 17 00:00:00 2001 From: Vincent Velociter Date: Thu, 19 Dec 2024 15:26:02 +0100 Subject: [PATCH] Fix default value of brightness --- CHANGELOG.md | 4 ++++ .../xcshareddata/xcschemes/Runner.xcscheme | 1 + example/pubspec.lock | 2 +- lib/src/board_settings.dart | 2 +- lib/src/widgets/board.dart | 12 +++++------- lib/src/widgets/board_editor.dart | 13 +++++-------- lib/src/widgets/static_board.dart | 14 ++++++-------- pubspec.yaml | 2 +- 8 files changed, 24 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b03a8b1..f5c32d5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.2.2 + +- Fix default value of brightness + ## 6.2.1 - Improved the color filter diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 5e31d3d3..c53e2b31 100644 --- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -48,6 +48,7 @@ ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" debugServiceExtension = "internal" + enableGPUValidationMode = "1" allowLocationSimulation = "YES"> diff --git a/example/pubspec.lock b/example/pubspec.lock index 1fbb53ba..e4a5a128 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -31,7 +31,7 @@ packages: path: ".." relative: true source: path - version: "6.2.1" + version: "6.2.2" clock: dependency: transitive description: diff --git a/lib/src/board_settings.dart b/lib/src/board_settings.dart index 51a0e49f..b45a1d76 100644 --- a/lib/src/board_settings.dart +++ b/lib/src/board_settings.dart @@ -95,7 +95,7 @@ class ChessboardSettings { this.border, this.borderRadius = BorderRadius.zero, this.boxShadow = const [], - this.brightness = 0.0, + this.brightness = 1.0, this.hue = 0.0, this.enableCoordinates = true, this.animationDuration = const Duration(milliseconds: 250), diff --git a/lib/src/widgets/board.dart b/lib/src/widgets/board.dart index 2fc44d63..b6106939 100644 --- a/lib/src/widgets/board.dart +++ b/lib/src/widgets/board.dart @@ -412,13 +412,11 @@ class _BoardState extends State { ) : board; - return widget.settings.hue != 0 || widget.settings.brightness != 0 - ? BrightnessHueFilter( - hue: widget.settings.hue, - brightness: widget.settings.brightness, - child: borderedChessboard, - ) - : borderedChessboard; + return BrightnessHueFilter( + hue: widget.settings.hue, + brightness: widget.settings.brightness, + child: borderedChessboard, + ); } @override diff --git a/lib/src/widgets/board_editor.dart b/lib/src/widgets/board_editor.dart index db64c2be..b23d517d 100644 --- a/lib/src/widgets/board_editor.dart +++ b/lib/src/widgets/board_editor.dart @@ -232,14 +232,11 @@ class _BoardEditorState extends State { ), ); - final coloredBoard = - widget.settings.hue != 0 || widget.settings.brightness != 0 - ? BrightnessHueFilter( - hue: widget.settings.hue, - brightness: widget.settings.brightness, - child: board, - ) - : board; + final coloredBoard = BrightnessHueFilter( + hue: widget.settings.hue, + brightness: widget.settings.brightness, + child: board, + ); if (widget.settings.border != null) { return BorderedChessboard( diff --git a/lib/src/widgets/static_board.dart b/lib/src/widgets/static_board.dart index 8b68d296..c0a9b2da 100644 --- a/lib/src/widgets/static_board.dart +++ b/lib/src/widgets/static_board.dart @@ -26,7 +26,7 @@ class StaticChessboard extends StatefulWidget with ChessboardGeometry { required this.fen, this.lastMove, this.colorScheme = ChessboardColorScheme.brown, - this.brightness = 0.0, + this.brightness = 1.0, this.hue = 0.0, this.pieceAssets = PieceSet.stauntyAssets, this.borderRadius = BorderRadius.zero, @@ -155,12 +155,10 @@ class _StaticChessboardState extends State { ), ); - return widget.hue != 0 || widget.brightness != 0 - ? BrightnessHueFilter( - hue: widget.hue, - brightness: widget.brightness, - child: board, - ) - : board; + return BrightnessHueFilter( + hue: widget.hue, + brightness: widget.brightness, + child: board, + ); } } diff --git a/pubspec.yaml b/pubspec.yaml index 90177143..b791f045 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: chessground description: Chess board UI developed for lichess.org. It has no chess logic inside so it can be used for chess variants. -version: 6.2.1 +version: 6.2.2 repository: https://github.com/lichess-org/flutter-chessground funding: - https://lichess.org/patron