Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions feedback/lib/src/controls_column.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class ControlsColumn extends StatelessWidget {
super.key,
required this.mode,
required this.activeColor,
required this.backgroundColor,
required this.onColorChanged,
required this.onUndo,
required this.onControlModeChanged,
Expand All @@ -32,12 +33,14 @@ class ControlsColumn extends StatelessWidget {
final VoidCallback onClearDrawing;
final List<Color> colors;
final Color activeColor;
final Color backgroundColor;
final FeedbackMode mode;

@override
Widget build(BuildContext context) {
final isNavigatingActive = FeedbackMode.navigate == mode;
return Card(
color: backgroundColor,
margin: EdgeInsets.zero,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Expand All @@ -51,7 +54,8 @@ class ControlsColumn extends StatelessWidget {
children: <Widget>[
IconButton(
key: const ValueKey<String>('close_controls_column'),
icon: const Icon(Icons.close),
icon: Icon(Icons.close,
color: FeedbackTheme.of(context).feedbackMenuForegroundColor),
onPressed: onCloseFeedback,
),
_ColumnDivider(),
Expand Down Expand Up @@ -83,12 +87,14 @@ class ControlsColumn extends StatelessWidget {
),
IconButton(
key: const ValueKey<String>('undo_button'),
icon: const Icon(Icons.undo),
icon: Icon(Icons.undo,
color: FeedbackTheme.of(context).feedbackMenuForegroundColor),
onPressed: isNavigatingActive ? null : onUndo,
),
IconButton(
key: const ValueKey<String>('clear_button'),
icon: const Icon(Icons.delete),
icon: Icon(Icons.delete,
color: FeedbackTheme.of(context).feedbackMenuForegroundColor),
onPressed: isNavigatingActive ? null : onClearDrawing,
),
for (final color in colors)
Expand Down
2 changes: 2 additions & 0 deletions feedback/lib/src/feedback_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ class FeedbackWidgetState extends State<FeedbackWidget>
progress: sheetProgress,
minScale: .7,
child: ControlsColumn(
backgroundColor: FeedbackTheme.of(context)
.feedbackMenuBackgroundColor,
mode: mode,
activeColor: painterController.drawColor,
colors: widget.drawColors,
Expand Down
14 changes: 14 additions & 0 deletions feedback/lib/src/theme/feedback_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class FeedbackThemeData {
FeedbackThemeData(
{this.background = Colors.grey,
this.feedbackSheetColor = _lightGrey,
this.feedbackMenuBackgroundColor = _lightGrey,
this.feedbackMenuForegroundColor = Colors.black,
this.feedbackSheetHeight = .25,
this.activeFeedbackModeColor = _blue,
this.drawColors = _defaultDrawColors,
Expand Down Expand Up @@ -69,6 +71,8 @@ class FeedbackThemeData {
background: Colors.grey.shade700,
dragHandleColor: Colors.white38,
feedbackSheetColor: _darkGrey,
feedbackMenuBackgroundColor: _darkGrey,
feedbackMenuForegroundColor: Colors.white,
bottomSheetDescriptionStyle: const TextStyle(
color: Colors.white,
),
Expand All @@ -82,6 +86,8 @@ class FeedbackThemeData {
background: Colors.grey,
dragHandleColor: Colors.black26,
feedbackSheetColor: _lightGrey,
feedbackMenuBackgroundColor: _lightGrey,
feedbackMenuForegroundColor: Colors.black,
bottomSheetDescriptionStyle: _defaultBottomSheetDescriptionStyle,
sheetIsDraggable: sheetIsDraggable,
brightness: Brightness.light,
Expand All @@ -97,6 +103,14 @@ class FeedbackThemeData {
/// his feedback and thoughts.
final Color feedbackSheetColor;

/// The background color of the column containing the action buttons
/// in the feedback menu.
final Color feedbackMenuBackgroundColor;

/// The foreground color of the column containing the action buttons (Trash, Undo, ModeButtons)
/// in the feedback menu.
final Color feedbackMenuForegroundColor;

/// The height of the bottom sheet as a fraction of the screen height.
///
/// Values between .2 and .3 are usually ideal.
Expand Down
2 changes: 2 additions & 0 deletions feedback/test/controls_column_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'package:flutter/material.dart';
void main() {
Widget create({
Color? activeColor,
Color? backgroundColor,
FeedbackMode? mode,
ValueChanged<Color>? onColorChanged,
VoidCallback? onUndo,
Expand All @@ -18,6 +19,7 @@ void main() {
return FeedbackLocalization(
child: ControlsColumn(
activeColor: activeColor ?? Colors.red,
backgroundColor: backgroundColor ?? Colors.grey,
mode: mode ?? FeedbackMode.draw,
colors:
colors ?? [Colors.red, Colors.green, Colors.blue, Colors.yellow],
Expand Down