Skip to content

Commit

Permalink
Fix default value of brightness
Browse files Browse the repository at this point in the history
  • Loading branch information
veloce committed Dec 19, 2024
1 parent 22424bb commit bb6cc12
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 26 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 6.2.2

- Fix default value of brightness

## 6.2.1

- Improved the color filter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
enableGPUValidationMode = "1"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ packages:
path: ".."
relative: true
source: path
version: "6.2.1"
version: "6.2.2"
clock:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion lib/src/board_settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class ChessboardSettings {
this.border,
this.borderRadius = BorderRadius.zero,
this.boxShadow = const <BoxShadow>[],
this.brightness = 0.0,
this.brightness = 1.0,
this.hue = 0.0,
this.enableCoordinates = true,
this.animationDuration = const Duration(milliseconds: 250),
Expand Down
12 changes: 5 additions & 7 deletions lib/src/widgets/board.dart
Original file line number Diff line number Diff line change
Expand Up @@ -412,13 +412,11 @@ class _BoardState extends State<Chessboard> {
)
: 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
Expand Down
13 changes: 5 additions & 8 deletions lib/src/widgets/board_editor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,11 @@ class _BoardEditorState extends State<ChessboardEditor> {
),
);

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(
Expand Down
14 changes: 6 additions & 8 deletions lib/src/widgets/static_board.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -155,12 +155,10 @@ class _StaticChessboardState extends State<StaticChessboard> {
),
);

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,
);
}
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit bb6cc12

Please sign in to comment.