Skip to content

Commit

Permalink
add background color to theme
Browse files Browse the repository at this point in the history
  • Loading branch information
luffan committed Jul 24, 2024
1 parent b95f269 commit ab3ace6
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 0.4.3
* Add background color property to theme

## 0.4.2
* Updates to support flutter version 3.22.2

Expand Down
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class MyApp extends StatelessWidget {
initializeDateFormatting();
return MaterialApp(
title: 'Suggest a Feature',
theme: ThemeData(useMaterial3: true),
theme: ThemeData(useMaterial3: true, ),
navigatorKey: navigatorKey,
home: Scaffold(
body: SuggestionsPage(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class _SuggestionsPageState extends State<SuggestionsPage> {
screenTitle:
widget.appBarTitle ?? localization.suggestAFeature,
),
backgroundColor: context.theme.scaffoldBackgroundColor,
backgroundColor: theme.backgroundColor,
body: state.loading
? const Center(child: CircularProgressIndicator())
: Stack(
Expand Down
8 changes: 6 additions & 2 deletions lib/src/presentation/pages/theme/suggestions_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class SuggestionsTheme {

final Color featureLabelColor;
final Color bugLabelColor;
final Color backgroundColor;

SuggestionsTheme({
required this.actionColor,
Expand All @@ -33,6 +34,7 @@ class SuggestionsTheme {
required this.bugLabelColor,
required this.fade,
required this.fabColor,
required this.backgroundColor,
});

factory SuggestionsTheme.initial() => SuggestionsTheme(
Expand All @@ -50,6 +52,7 @@ class SuggestionsTheme {
bugLabelColor: const Color.fromRGBO(246, 24, 48, 1),
fade: const Color.fromRGBO(0, 0, 0, 0.65),
fabColor: const Color.fromRGBO(33, 33, 33, 0.12),
backgroundColor: const Color.fromRGBO(255,255,255, 0),
);

SuggestionsTheme copyWith({
Expand All @@ -67,12 +70,12 @@ class SuggestionsTheme {
Color? bugLabelColor,
Color? fade,
Color? fabColor,
Color? backgroundColor,
}) {
return SuggestionsTheme(
actionColor: actionColor ?? this.actionColor,
actionPressedColor: actionPressedColor ?? this.actionPressedColor,
actionBackgroundColor:
actionBackgroundColor ?? this.actionBackgroundColor,
actionBackgroundColor: actionBackgroundColor ?? this.actionBackgroundColor,
disabledTextColor: disabledTextColor ?? this.disabledTextColor,
upvoteArrowColor: upvoteArrowColor ?? this.upvoteArrowColor,
requestsTabColor: requestsTabColor ?? this.requestsTabColor,
Expand All @@ -84,6 +87,7 @@ class SuggestionsTheme {
bugLabelColor: bugLabelColor ?? this.bugLabelColor,
fade: fade ?? this.fade,
fabColor: fabColor ?? this.fabColor,
backgroundColor: backgroundColor ?? this.backgroundColor,
);
}
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: suggest_a_feature
description: Ready-made Flutter package for collecting suggestions from users.
version: 0.4.2
version: 0.4.3
repository: https://github.com/flutterwtf/Suggest-a-Feature
homepage: https://pub.dev/packages/suggest_a_feature

Expand Down

0 comments on commit ab3ace6

Please sign in to comment.