From 115b14f67dc9f0943ee3d35e47d96468be81dcdc Mon Sep 17 00:00:00 2001 From: jameskokoska <50821962+jameskokoska@users.noreply.github.com> Date: Tue, 9 Jan 2024 21:37:09 -0500 Subject: [PATCH] Fixed padding for full screen devices --- budget/lib/pages/addBudgetPage.dart | 80 ++++++++++++++----------- budget/lib/pages/walletDetailsPage.dart | 31 ++++++---- budget/lib/widgets/showChangelog.dart | 2 + budget/pubspec.yaml | 2 +- 4 files changed, 66 insertions(+), 49 deletions(-) diff --git a/budget/lib/pages/addBudgetPage.dart b/budget/lib/pages/addBudgetPage.dart index 49ad36f5..fefbd0a3 100644 --- a/budget/lib/pages/addBudgetPage.dart +++ b/budget/lib/pages/addBudgetPage.dart @@ -665,7 +665,9 @@ class _AddBudgetPageState extends State { centered: true, children: [ Padding( - padding: const EdgeInsets.symmetric(horizontal: 13), + padding: EdgeInsets.symmetric( + horizontal: + 13 + getHorizontalPaddingConstrained(context)), child: IncomeExpenseTabSelector( onTabChanged: setSelectedIncome, initialTabIsIncome: selectedIncome, @@ -809,41 +811,47 @@ class _AddBudgetPageState extends State { child: widget.budget == null ? SizedBox.shrink() : Padding( - padding: const EdgeInsets.only( - left: 20, - right: 20, - bottom: 15, - ), - child: Button( - flexibleLayout: true, - icon: appStateSettings["outlinedIcons"] - ? Icons.fact_check_outlined - : Icons.fact_check_rounded, - label: widget.budget?.income == true - ? "set-saving-goals".tr() - : "set-spending-goals".tr(), - onTap: () async { - Budget budget = await createBudget(); - pushRoute( - context, - StreamBuilder( - stream: - database.getBudget(widget.budget!.budgetPk), - builder: (context, snapshot) { - if (snapshot.data == null) - return SizedBox.shrink(); - return EditBudgetLimitsPage( - budget: budget, - currentIsAbsoluteSpendingLimit: - snapshot.data!.isAbsoluteSpendingLimit, - ); - }, - ), - ); - }, - color: Theme.of(context).colorScheme.secondaryContainer, - textColor: - Theme.of(context).colorScheme.onSecondaryContainer, + padding: EdgeInsets.symmetric( + horizontal: getHorizontalPaddingConstrained(context)), + child: Padding( + padding: const EdgeInsets.only( + left: 20, + right: 20, + bottom: 15, + ), + child: Button( + flexibleLayout: true, + icon: appStateSettings["outlinedIcons"] + ? Icons.fact_check_outlined + : Icons.fact_check_rounded, + label: widget.budget?.income == true + ? "set-saving-goals".tr() + : "set-spending-goals".tr(), + onTap: () async { + Budget budget = await createBudget(); + pushRoute( + context, + StreamBuilder( + stream: + database.getBudget(widget.budget!.budgetPk), + builder: (context, snapshot) { + if (snapshot.data == null) + return SizedBox.shrink(); + return EditBudgetLimitsPage( + budget: budget, + currentIsAbsoluteSpendingLimit: + snapshot.data!.isAbsoluteSpendingLimit, + ); + }, + ), + ); + }, + color: + Theme.of(context).colorScheme.secondaryContainer, + textColor: Theme.of(context) + .colorScheme + .onSecondaryContainer, + ), ), ), ), diff --git a/budget/lib/pages/walletDetailsPage.dart b/budget/lib/pages/walletDetailsPage.dart index 7bd69e3d..1e51a1b0 100644 --- a/budget/lib/pages/walletDetailsPage.dart +++ b/budget/lib/pages/walletDetailsPage.dart @@ -687,7 +687,8 @@ class _WalletDetailsPageState extends State ), if (widget.wallet != null) Padding( - padding: const EdgeInsets.symmetric(horizontal: 13), + padding: EdgeInsets.symmetric( + horizontal: 13 + getHorizontalPaddingConstrained(context)), child: Column( children: [ Padding( @@ -913,11 +914,8 @@ class _WalletDetailsPageState extends State padding: const EdgeInsets.only(bottom: 13, left: 13, right: 13), child: Padding( padding: EdgeInsets.symmetric( - horizontal: getHorizontalPaddingConstrained( - context, - enabled: enableDoubleColumn(context) == false && - widget.wallet == null, - )), + horizontal: getHorizontalPaddingConstrained(context), + ), child: Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, @@ -1330,10 +1328,18 @@ class _WalletDetailsPageState extends State sliverAppBar, if (widget.wallet != null) SliverToBoxAdapter( + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: + getHorizontalPaddingConstrained( + context), + ), child: Padding( - padding: const EdgeInsets.only(top: 8), - child: totalNetContainer, - )), + padding: const EdgeInsets.only(top: 8), + child: totalNetContainer, + ), + ), + ), if (widget.wallet == null) SliverToBoxAdapter( child: tabDateFilterSelectorHeader), @@ -1797,7 +1803,8 @@ class _WalletCategoryPieChartState extends State { padding: EdgeInsets.symmetric( horizontal: getHorizontalPaddingConstrained( context, - enabled: enableDoubleColumn(context) == false, + enabled: enableDoubleColumn(context) == false || + widget.isAllSpending == false, )), child: Padding( padding: const EdgeInsets.symmetric(horizontal: 13), @@ -1857,8 +1864,8 @@ class _WalletCategoryPieChartState extends State { categoryEntries.add( CategoryEntry( useHorizontalPaddingConstrained: - enableDoubleColumn(context) == false && - widget.isAllSpending, + enableDoubleColumn(context) == false || + widget.isAllSpending == false, selectedSubCategoryPk: selectedCategory?.categoryPk, expandSubcategories: showAllSubcategories || category.category.categoryPk == diff --git a/budget/lib/widgets/showChangelog.dart b/budget/lib/widgets/showChangelog.dart index 8c2f18ce..b87a8af3 100644 --- a/budget/lib/widgets/showChangelog.dart +++ b/budget/lib/widgets/showChangelog.dart @@ -26,6 +26,8 @@ import 'listItem.dart'; String getChangelogString() { return """ + < 5.1.6 + Fixed padding for full screen devices < 5.1.5 Fixed title searching with category name when adding a transaction (title has priority) Fixed wallet details page swipe to dismiss header diff --git a/budget/pubspec.yaml b/budget/pubspec.yaml index 18bd5efa..9c72f5af 100644 --- a/budget/pubspec.yaml +++ b/budget/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 5.1.5+298 +version: 5.1.6+299 environment: sdk: ">= 3.0.0"