@@ -12,6 +12,7 @@ class ControlsColumn extends StatelessWidget {
12
12
ControlsColumn ({
13
13
super .key,
14
14
required this .mode,
15
+ required this .supportedModes,
15
16
required this .activeColor,
16
17
required this .onColorChanged,
17
18
required this .onUndo,
@@ -33,6 +34,7 @@ class ControlsColumn extends StatelessWidget {
33
34
final List <Color > colors;
34
35
final Color activeColor;
35
36
final FeedbackMode mode;
37
+ final List <FeedbackMode > supportedModes;
36
38
37
39
@override
38
40
Widget build (BuildContext context) {
@@ -54,50 +56,54 @@ class ControlsColumn extends StatelessWidget {
54
56
icon: const Icon (Icons .close),
55
57
onPressed: onCloseFeedback,
56
58
),
57
- _ColumnDivider (),
58
- RotatedBox (
59
- quarterTurns: 1 ,
60
- child: MaterialButton (
61
- key: const ValueKey <String >('navigate_button' ),
62
- onPressed: isNavigatingActive
63
- ? null
64
- : () => onControlModeChanged (FeedbackMode .navigate),
65
- disabledTextColor:
66
- FeedbackTheme .of (context).activeFeedbackModeColor,
67
- child: Text (FeedbackLocalizations .of (context).navigate),
59
+ if (supportedModes.contains (FeedbackMode .navigate)) ...[
60
+ _ColumnDivider (),
61
+ RotatedBox (
62
+ quarterTurns: 1 ,
63
+ child: MaterialButton (
64
+ key: const ValueKey <String >('navigate_button' ),
65
+ onPressed: isNavigatingActive
66
+ ? null
67
+ : () => onControlModeChanged (FeedbackMode .navigate),
68
+ disabledTextColor:
69
+ FeedbackTheme .of (context).activeFeedbackModeColor,
70
+ child: Text (FeedbackLocalizations .of (context).navigate),
71
+ ),
68
72
),
69
- ),
70
- _ColumnDivider (),
71
- RotatedBox (
72
- quarterTurns: 1 ,
73
- child: MaterialButton (
74
- key: const ValueKey <String >('draw_button' ),
75
- minWidth: 20 ,
76
- onPressed: isNavigatingActive
77
- ? () => onControlModeChanged (FeedbackMode .draw)
78
- : null ,
79
- disabledTextColor:
80
- FeedbackTheme .of (context).activeFeedbackModeColor,
81
- child: Text (FeedbackLocalizations .of (context).draw),
73
+ ],
74
+ if (supportedModes.contains (FeedbackMode .draw)) ...[
75
+ _ColumnDivider (),
76
+ RotatedBox (
77
+ quarterTurns: 1 ,
78
+ child: MaterialButton (
79
+ key: const ValueKey <String >('draw_button' ),
80
+ minWidth: 20 ,
81
+ onPressed: isNavigatingActive
82
+ ? () => onControlModeChanged (FeedbackMode .draw)
83
+ : null ,
84
+ disabledTextColor:
85
+ FeedbackTheme .of (context).activeFeedbackModeColor,
86
+ child: Text (FeedbackLocalizations .of (context).draw),
87
+ ),
82
88
),
83
- ),
84
- IconButton (
85
- key: const ValueKey <String >('undo_button' ),
86
- icon: const Icon (Icons .undo),
87
- onPressed: isNavigatingActive ? null : onUndo,
88
- ),
89
- IconButton (
90
- key: const ValueKey <String >('clear_button' ),
91
- icon: const Icon (Icons .delete),
92
- onPressed: isNavigatingActive ? null : onClearDrawing,
93
- ),
94
- for (final color in colors)
95
- _ColorSelectionIconButton (
96
- key: ValueKey <Color >(color),
97
- color: color,
98
- onPressed: isNavigatingActive ? null : onColorChanged,
99
- isActive: activeColor == color,
89
+ IconButton (
90
+ key: const ValueKey <String >('undo_button' ),
91
+ icon: const Icon (Icons .undo),
92
+ onPressed: isNavigatingActive ? null : onUndo,
93
+ ),
94
+ IconButton (
95
+ key: const ValueKey <String >('clear_button' ),
96
+ icon: const Icon (Icons .delete),
97
+ onPressed: isNavigatingActive ? null : onClearDrawing,
100
98
),
99
+ for (final color in colors)
100
+ _ColorSelectionIconButton (
101
+ key: ValueKey <Color >(color),
102
+ color: color,
103
+ onPressed: isNavigatingActive ? null : onColorChanged,
104
+ isActive: activeColor == color,
105
+ ),
106
+ ],
101
107
],
102
108
),
103
109
);
0 commit comments