@@ -12,6 +12,7 @@ class ControlsColumn extends StatelessWidget {
1212 ControlsColumn ({
1313 super .key,
1414 required this .mode,
15+ required this .supportedModes,
1516 required this .activeColor,
1617 required this .onColorChanged,
1718 required this .onUndo,
@@ -33,6 +34,7 @@ class ControlsColumn extends StatelessWidget {
3334 final List <Color > colors;
3435 final Color activeColor;
3536 final FeedbackMode mode;
37+ final List <FeedbackMode > supportedModes;
3638
3739 @override
3840 Widget build (BuildContext context) {
@@ -54,50 +56,54 @@ class ControlsColumn extends StatelessWidget {
5456 icon: const Icon (Icons .close),
5557 onPressed: onCloseFeedback,
5658 ),
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+ ),
6872 ),
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+ ),
8288 ),
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,
10098 ),
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+ ],
101107 ],
102108 ),
103109 );
0 commit comments