Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#38 Implement a dark mode #241

Merged
merged 14 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
feat(dark-mode): Add dragHandleColor into the theme to improve custom…
…ization
  • Loading branch information
apomalyn committed Oct 4, 2023
commit bd0a55b78910ba5b477c7a14d19c8a3d65310d35
4 changes: 1 addition & 3 deletions feedback/lib/src/better_feedback.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ class FeedbackSheetDragHandle extends StatelessWidget {
height: 5,
width: 30,
decoration: BoxDecoration(
color: feedbackTheme.brightness == Brightness.light
? Colors.black26
: Colors.white38,
color: feedbackTheme.dragHandleColor,
borderRadius: BorderRadius.circular(5),
),
),
Expand Down
18 changes: 12 additions & 6 deletions feedback/lib/src/theme/feedback_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class FeedbackThemeData {
this.drawColors = _defaultDrawColors,
this.bottomSheetDescriptionStyle = _defaultBottomSheetDescriptionStyle,
this.sheetIsDraggable = true,
this.dragHandleColor = Colors.black26,
}) :
// if the user chooses to supply custom drawing colors,
// make sure there is at least on color to draw with
Expand All @@ -49,12 +50,14 @@ class FeedbackThemeData {
/// Create a dark version of the [FeedbackThemeData]
factory FeedbackThemeData.dark({bool sheetIsDraggable = true}) =>
apomalyn marked this conversation as resolved.
Show resolved Hide resolved
FeedbackThemeData(
background: Colors.grey.shade700,
feedbackSheetColor: _darkGrey,
bottomSheetDescriptionStyle: const TextStyle(
color: Colors.white,
),
sheetIsDraggable: sheetIsDraggable);
background: Colors.grey.shade700,
dragHandleColor: Colors.white38,
feedbackSheetColor: _darkGrey,
bottomSheetDescriptionStyle: const TextStyle(
color: Colors.white,
),
sheetIsDraggable: sheetIsDraggable,
);

/// Brightness of the theme based on the [background] color
final Brightness brightness;
Expand Down Expand Up @@ -86,6 +89,9 @@ class FeedbackThemeData {
/// [DraggableScrollableSheet] that will expand when the user drags upward on
/// it. This is useful for large feedback forms.
final bool sheetIsDraggable;

/// Color of the drag handle on the feedback sheet
final Color? dragHandleColor;
}

/// Provides an instance of [FeedbackThemeData] for all descendants.
Expand Down