Skip to content

Commit

Permalink
Apply full black to all page backgrounds
Browse files Browse the repository at this point in the history
  • Loading branch information
jameskokoska committed Mar 29, 2024
1 parent a2f98eb commit f1212ea
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 21 deletions.
17 changes: 10 additions & 7 deletions budget/lib/pages/budgetPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ class _BudgetPageContentState extends State<_BudgetPageContent> {
required VoidCallback toggleAllSubCategories,
required List<CategoryWithTotal> dataFilterUnassignedTransactions,
required bool hasSubCategories,
required Color? pageBackgroundColor,
}) {
return Column(
children: [
Expand Down Expand Up @@ -163,10 +164,7 @@ class _BudgetPageContentState extends State<_BudgetPageContent> {
// }
},
isPastBudget: widget.isPastBudget ?? false,
middleColor: appStateSettings["materialYou"]
? dynamicPastel(context, budgetColorScheme.primary,
amount: 0.92)
: null,
middleColor: pageBackgroundColor,
),
),
PieChartOptions(
Expand Down Expand Up @@ -211,9 +209,13 @@ class _BudgetPageContentState extends State<_BudgetPageContent> {
widget.budget.name +
budgetRange.end.millisecondsSinceEpoch.toString() +
widget.budget.budgetPk;
Color? pageBackgroundColor = appStateSettings["materialYou"]
? dynamicPastel(context, budgetColorScheme.primary, amount: 0.92)
: null;
Color? pageBackgroundColor = Theme.of(context).brightness ==
Brightness.dark &&
appStateSettings["forceFullDarkBackground"]
? Colors.black
: appStateSettings["materialYou"]
? dynamicPastel(context, budgetColorScheme.primary, amount: 0.92)
: null;
bool showIncomeExpenseIcons = widget.budget.budgetTransactionFilters == null
? true
: widget.budget.budgetTransactionFilters
Expand Down Expand Up @@ -624,6 +626,7 @@ class _BudgetPageContentState extends State<_BudgetPageContent> {
dataFilterUnassignedTransactions:
s.dataFilterUnassignedTransactions,
hasSubCategories: s.hasSubCategories,
pageBackgroundColor: pageBackgroundColor,
),
// if (snapshot.data!.length > 0)
// SizedBox(height: 35),
Expand Down
10 changes: 7 additions & 3 deletions budget/lib/pages/objectivePage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,13 @@ class _ObjectivePageContentState extends State<_ObjectivePageContent> {
defaultColor: Theme.of(context).colorScheme.primary),
brightness: determineBrightnessTheme(context),
);
Color? pageBackgroundColor = appStateSettings["materialYou"]
? dynamicPastel(context, objectiveColorScheme.primary, amount: 0.92)
: null;
Color? pageBackgroundColor = Theme.of(context).brightness ==
Brightness.dark &&
appStateSettings["forceFullDarkBackground"]
? Colors.black
: appStateSettings["materialYou"]
? dynamicPastel(context, objectiveColorScheme.primary, amount: 0.92)
: null;
String pageId = widget.objective.objectivePk;
return WillPopScope(
onWillPop: () async {
Expand Down
26 changes: 15 additions & 11 deletions budget/lib/pages/pastBudgetsPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -261,16 +261,20 @@ class __PastBudgetsPageContentState extends State<_PastBudgetsPageContent> {
defaultColor: Theme.of(context).colorScheme.primary),
brightness: determineBrightnessTheme(context),
);
Color backgroundColor = appStateSettings["materialYou"]
? dynamicPastel(context, budgetColorScheme.primary, amount: 0.92)
: Theme.of(context).canvasColor;
Color pageBackgroundColor = Theme.of(context).brightness ==
Brightness.dark &&
appStateSettings["forceFullDarkBackground"]
? Colors.black
: appStateSettings["materialYou"]
? dynamicPastel(context, budgetColorScheme.primary, amount: 0.92)
: Theme.of(context).canvasColor;
double budgetAmount = budgetAmountToPrimaryCurrency(
Provider.of<AllWallets>(context, listen: true), widget.budget);

return PageFramework(
backgroundColor: backgroundColor,
backgroundColor: pageBackgroundColor,
appBarBackgroundColor: budgetColorScheme.secondaryContainer,
appBarBackgroundColorStart: backgroundColor,
appBarBackgroundColorStart: pageBackgroundColor,
key: budgetHistoryKey,
title: "history".tr(),
subtitle: TextFont(
Expand Down Expand Up @@ -347,7 +351,7 @@ class __PastBudgetsPageContentState extends State<_PastBudgetsPageContent> {
Container(
padding: const EdgeInsets.symmetric(
vertical: 7, horizontal: 0),
color: backgroundColor,
color: pageBackgroundColor,
child: Padding(
padding: const EdgeInsets.only(right: 5),
child: StreamBuilder<Map<String, TransactionCategory>>(
Expand Down Expand Up @@ -530,8 +534,8 @@ class __PastBudgetsPageContentState extends State<_PastBudgetsPageContent> {
foregroundDecoration: BoxDecoration(
gradient: LinearGradient(
colors: [
backgroundColor,
backgroundColor.withOpacity(0.0),
pageBackgroundColor,
pageBackgroundColor.withOpacity(0.0),
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
Expand Down Expand Up @@ -566,8 +570,8 @@ class __PastBudgetsPageContentState extends State<_PastBudgetsPageContent> {
foregroundDecoration: BoxDecoration(
gradient: LinearGradient(
colors: [
backgroundColor,
backgroundColor.withOpacity(0.0),
pageBackgroundColor,
pageBackgroundColor.withOpacity(0.0),
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
Expand Down Expand Up @@ -716,7 +720,7 @@ class __PastBudgetsPageContentState extends State<_PastBudgetsPageContent> {
});
}
},
backgroundColor: backgroundColor,
backgroundColor: pageBackgroundColor,
),
],
),
Expand Down

1 comment on commit f1212ea

@ngocanhtve
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please build the apk soon.

Please sign in to comment.