Skip to content

Commit 8524082

Browse files
committed
InkWell Changes:
* Add overlayColor. * Move all other color sections to advanced panel. * Refactor ink well editor property. * Allow selection and enable focus handling of each ink well color tile. * Use a Stack to render InkWells infront of all content in SDK and codegen. * Reduce default opacity of InkWells.
1 parent 2f8d20a commit 8524082

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

lib/src/api/models/action/set_variable_action.g.dart

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/api/models/ink_well.dart

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,35 @@ part 'ink_well.g.dart';
1212
/// Represents properties that relate to the [InkWell] widget in Flutter.
1313
@JsonSerializable()
1414
class InkWellModel with EquatableMixin, SerializableMixin {
15-
/// The highlight color of the [InkWell] if [useInkWell] is true.
15+
/// The overlay color. This is the dominant color field. If this is null, then
16+
/// the individual [highlightColor], [splashColor], [hoverColor], and
17+
/// [focusColor] values are used instead.
18+
final ColorRGBA? overlayColor;
19+
20+
/// The highlight color.
1621
final ColorRGBA? highlightColor;
1722

18-
/// The splash color of the [InkWell] if [useInkWell] is true.
23+
/// The splash color.
1924
final ColorRGBA? splashColor;
2025

21-
/// The hover color of the [InkWell] if [useInkWell] is true.
26+
/// The hover color.
2227
final ColorRGBA? hoverColor;
2328

24-
/// The focus color of the [InkWell] if [useInkWell] is true.
29+
/// The focus color.
2530
final ColorRGBA? focusColor;
2631

2732
/// Creates an [InkWellModel] instance with the given data.
2833
const InkWellModel({
34+
this.overlayColor,
2935
this.highlightColor,
3036
this.splashColor,
3137
this.hoverColor,
3238
this.focusColor,
3339
});
3440

35-
/// Duplicates this instance of [InkWellModel] with given useInkWell value.
36-
InkWellModel copyWithUseInkWell(bool value) => InkWellModel(
41+
/// Duplicates this instance of [InkWellModel] with given overlay color.
42+
InkWellModel copyWithOverlayColor(ColorRGBA? color) => InkWellModel(
43+
overlayColor: color,
3744
highlightColor: highlightColor,
3845
splashColor: splashColor,
3946
hoverColor: hoverColor,
@@ -50,6 +57,7 @@ class InkWellModel with EquatableMixin, SerializableMixin {
5057

5158
/// Duplicates this instance of [InkWellModel] with given splash color.
5259
InkWellModel copyWithSplashColor(ColorRGBA? color) => InkWellModel(
60+
overlayColor: overlayColor,
5361
highlightColor: highlightColor,
5462
splashColor: color,
5563
hoverColor: hoverColor,
@@ -58,6 +66,7 @@ class InkWellModel with EquatableMixin, SerializableMixin {
5866

5967
/// Duplicates this instance of [InkWellModel] with given hover color.
6068
InkWellModel copyWithHoverColor(ColorRGBA? color) => InkWellModel(
69+
overlayColor: overlayColor,
6170
highlightColor: highlightColor,
6271
splashColor: splashColor,
6372
hoverColor: color,
@@ -66,6 +75,7 @@ class InkWellModel with EquatableMixin, SerializableMixin {
6675

6776
/// Duplicates this instance of [InkWellModel] with given focus color.
6877
InkWellModel copyWithFocusColor(ColorRGBA? color) => InkWellModel(
78+
overlayColor: overlayColor,
6979
highlightColor: highlightColor,
7080
splashColor: splashColor,
7181
hoverColor: hoverColor,
@@ -82,6 +92,7 @@ class InkWellModel with EquatableMixin, SerializableMixin {
8292

8393
@override
8494
List<Object?> get props => [
95+
overlayColor,
8596
highlightColor,
8697
splashColor,
8798
hoverColor,

lib/src/api/models/ink_well.g.dart

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)