Skip to content

Commit

Permalink
Merge pull request #103 from enrique-lozano/feat/general-ui-changes
Browse files Browse the repository at this point in the history
Change and refactor the app color palette
  • Loading branch information
enrique-lozano authored Jan 13, 2024
2 parents 1909d7c + 0ddb3e9 commit 35f3fb7
Show file tree
Hide file tree
Showing 42 changed files with 533 additions and 426 deletions.
152 changes: 75 additions & 77 deletions lib/app/accounts/account_details.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import 'package:monekin/core/routes/app_router.dart';
import 'package:monekin/core/utils/list_tile_action_item.dart';
import 'package:monekin/i18n/translations.g.dart';

import '../../core/presentation/app_colors.dart';
import '../transactions/form/transaction_form.page.dart';

@RoutePage()
Expand Down Expand Up @@ -234,91 +235,88 @@ class _AccountDetailsPageState extends State<AccountDetailsPage> {

return Column(
children: [
Padding(
padding: const EdgeInsets.all(16),
child: Card(
margin: const EdgeInsets.all(0),
child: Padding(
padding: const EdgeInsets.all(16),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(account.name),
StreamBuilder(
initialData: 0.0,
stream: AccountService.instance
.getAccountMoney(account: account),
builder: (context, snapshot) {
return Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
CurrencyDisplayer(
amountToConvert: snapshot.data!,
currency: account.currency,
textStyle: const TextStyle(
fontSize: 32,
fontWeight: FontWeight.w600),
Card(
color: AppColors.of(context).light,
elevation: 0,
margin: const EdgeInsets.only(
left: 16, right: 16, bottom: 8, top: 16),
child: Padding(
padding: const EdgeInsets.all(16),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(account.name),
StreamBuilder(
initialData: 0.0,
stream: AccountService.instance
.getAccountMoney(account: account),
builder: (context, snapshot) {
return Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
CurrencyDisplayer(
amountToConvert: snapshot.data!,
currency: account.currency,
textStyle: const TextStyle(
fontSize: 32,
fontWeight: FontWeight.w600),
),
StreamBuilder(
stream: ExchangeRateService.instance
.calculateExchangeRateToPreferredCurrency(
amount: snapshot.data!,
fromCurrency: account.currency.code,
),
StreamBuilder(
stream: ExchangeRateService.instance
.calculateExchangeRateToPreferredCurrency(
amount: snapshot.data!,
fromCurrency:
account.currency.code,
),
builder:
(context, currencySnapshot) {
if (currencySnapshot
.connectionState ==
ConnectionState.waiting ||
currencySnapshot.data != 0 &&
currencySnapshot.data! ==
snapshot.data ||
snapshot.data! == 0) {
return Container();
}

return Row(
children: [
Text(
String.fromCharCode(Icons
builder: (context, currencySnapshot) {
if (currencySnapshot
.connectionState ==
ConnectionState.waiting ||
currencySnapshot.data != 0 &&
currencySnapshot.data! ==
snapshot.data ||
snapshot.data! == 0) {
return Container();
}

return Row(
children: [
Text(
String.fromCharCode(Icons
.currency_exchange_rounded
.codePoint),
style: TextStyle(
fontFamily: Icons
.currency_exchange_rounded
.codePoint),
style: TextStyle(
fontFamily: Icons
.currency_exchange_rounded
.fontFamily,
),
.fontFamily,
),
const SizedBox(width: 4),
CurrencyDisplayer(
amountToConvert:
currencySnapshot
.data!),
],
);
},
)
],
);
}),
],
),
Hero(
tag: 'account-icon-${widget.account.id}',
child: account.displayIcon(context, size: 48)),
],
),
),
const SizedBox(width: 4),
CurrencyDisplayer(
amountToConvert:
currencySnapshot.data!),
],
);
},
)
],
);
}),
],
),
Hero(
tag: 'account-icon-${widget.account.id}',
child: account.displayIcon(context, size: 48)),
],
),
),
),
Expanded(
child: SingleChildScrollView(
padding: const EdgeInsets.fromLTRB(16, 0, 16, 24),
padding: const EdgeInsets.fromLTRB(16, 8, 16, 24),
child: Column(
children: [
CardWithHeader(
Expand Down
13 changes: 7 additions & 6 deletions lib/app/accounts/account_type_selector.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import 'package:monekin/core/models/account/account.dart';
import 'package:flutter/material.dart';
import 'package:monekin/core/models/account/account.dart';

import '../../core/presentation/app_colors.dart';

class AccountTypeSelector extends StatefulWidget {
const AccountTypeSelector(
Expand Down Expand Up @@ -75,9 +77,8 @@ class MonekinFilterChip extends StatelessWidget {
borderRadius: BorderRadius.circular(16),
side: BorderSide(
width: 1.25,
color: isSelected
? Theme.of(context).colorScheme.primary
: Colors.transparent,
color:
isSelected ? AppColors.of(context).primary : Colors.transparent,
),
),
clipBehavior: Clip.hardEdge,
Expand All @@ -92,15 +93,15 @@ class MonekinFilterChip extends StatelessWidget {
accountType.icon,
size: 28,
color: isSelected
? Theme.of(context).colorScheme.primary
? AppColors.of(context).primary
: Theme.of(context).colorScheme.onSurfaceVariant,
),
const SizedBox(height: 18),
Text(
accountType.title(context),
style: Theme.of(context).textTheme.titleMedium?.copyWith(
color: isSelected
? Theme.of(context).colorScheme.primary
? AppColors.of(context).primary
: Theme.of(context).colorScheme.onSurfaceVariant),
),
Text(accountType.description(context),
Expand Down
8 changes: 4 additions & 4 deletions lib/app/accounts/all_accounts_balance.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ import 'package:flutter/material.dart';
import 'package:monekin/core/database/app_db.dart';
import 'package:monekin/core/database/services/account/account_service.dart';
import 'package:monekin/core/models/account/account.dart';
import 'package:monekin/core/routes/app_router.dart';
import 'package:monekin/core/presentation/widgets/animated_progress_bar.dart';
import 'package:monekin/core/presentation/widgets/card_with_header.dart';
import 'package:monekin/core/presentation/widgets/transaction_filter/transaction_filters.dart';
import 'package:monekin/core/routes/app_router.dart';
import 'package:monekin/i18n/translations.g.dart';

import '../../core/database/services/currency/currency_service.dart';
import '../../core/presentation/app_colors.dart';
import '../../core/presentation/widgets/number_ui_formatters/currency_displayer.dart';
import '../../core/presentation/widgets/skeleton.dart';

Expand Down Expand Up @@ -133,13 +134,12 @@ class _AllAccountBalancePageState extends State<AllAccountBalancePage> {
decoration: BoxDecoration(
border: Border.all(
width: 2,
color:
Theme.of(context).colorScheme.primary,
color: AppColors.of(context).primary,
),
borderRadius: BorderRadius.circular(1000)),
child: accountWithMoney.account.icon.display(
size: 22,
color: Theme.of(context).colorScheme.primary,
color: AppColors.of(context).primary,
)),
onTap: () => context.pushRoute(
AccountFormRoute(
Expand Down
4 changes: 2 additions & 2 deletions lib/app/budgets/budget_details_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import 'package:monekin/app/transactions/widgets/transaction_list.dart';
import 'package:monekin/core/database/services/budget/budget_service.dart';
import 'package:monekin/core/models/budget/budget.dart';
import 'package:monekin/core/models/transaction/transaction_status.dart';
import 'package:monekin/core/presentation/theme.dart';
import 'package:monekin/core/presentation/widgets/animated_progress_bar.dart';
import 'package:monekin/core/presentation/widgets/card_with_header.dart';
import 'package:monekin/core/presentation/widgets/confirm_dialog.dart';
Expand All @@ -21,6 +20,7 @@ import 'package:monekin/core/routes/app_router.dart';
import 'package:monekin/core/utils/list_tile_action_item.dart';
import 'package:monekin/i18n/translations.g.dart';

import '../../core/presentation/app_colors.dart';
import '../../core/presentation/widgets/empty_indicator.dart';

@RoutePage()
Expand Down Expand Up @@ -201,7 +201,7 @@ class _BudgetDetailsPageState extends State<BudgetDetailsPage> {
: budgetCurrentPercentage ?? 0,
color: budgetCurrentPercentage != null &&
budgetCurrentPercentage! >= 1
? CustomColors.of(context).danger
? AppColors.of(context).danger
: null,
)
],
Expand Down
8 changes: 4 additions & 4 deletions lib/app/budgets/budgets_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:monekin/core/database/services/budget/budget_service.dart';
import 'package:monekin/core/models/budget/budget.dart';
import 'package:monekin/core/presentation/theme.dart';
import 'package:monekin/core/presentation/widgets/animated_progress_bar.dart';
import 'package:monekin/core/presentation/widgets/empty_indicator.dart';
import 'package:monekin/core/presentation/widgets/number_ui_formatters/currency_displayer.dart';
import 'package:monekin/core/presentation/widgets/skeleton.dart';
import 'package:monekin/core/routes/app_router.dart';
import 'package:monekin/i18n/translations.g.dart';

import '../../core/presentation/app_colors.dart';

@RoutePage()
class BudgetsPage extends StatelessWidget {
const BudgetsPage({super.key});
Expand All @@ -36,8 +37,7 @@ class BudgetsPage extends StatelessWidget {
Chip(
side:
const BorderSide(width: 0, color: Colors.transparent),
backgroundColor:
Theme.of(context).colorScheme.primaryContainer,
backgroundColor: AppColors.of(context).primaryContainer,
padding: const EdgeInsets.all(0),
label: Text(
budget.intervalPeriod?.allThePeriodsText(context) ??
Expand Down Expand Up @@ -79,7 +79,7 @@ class BudgetsPage extends StatelessWidget {
? 1
: budgetValue ?? 0,
color: budgetValue != null && budgetValue >= 1
? CustomColors.of(context).danger
? AppColors.of(context).danger
: null,
);
})
Expand Down
14 changes: 8 additions & 6 deletions lib/app/budgets/components/budget_evolution_chart.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import 'dart:math';

import 'package:collection/collection.dart';
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:monekin/app/stats/widgets/fund_evolution_line_chart.dart';
import 'package:monekin/core/models/budget/budget.dart';
import 'package:monekin/core/utils/color_utils.dart';
import 'package:monekin/i18n/translations.g.dart';
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';

import '../../../core/presentation/app_colors.dart';

class BudgetEvolutionChart extends StatelessWidget {
const BudgetEvolutionChart({super.key, required this.budget});
Expand Down Expand Up @@ -43,8 +45,8 @@ class BudgetEvolutionChart extends StatelessWidget {
@override
Widget build(BuildContext context) {
List<Color> gradientColors = [
Theme.of(context).colorScheme.primary,
Theme.of(context).colorScheme.primary.lighten(0.3),
AppColors.of(context).primary,
AppColors.of(context).primary.lighten(0.3),
];

final t = Translations.of(context);
Expand Down Expand Up @@ -87,7 +89,7 @@ class BudgetEvolutionChart extends StatelessWidget {
]),
lineTouchData: LineTouchData(
touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Theme.of(context).colorScheme.background,
tooltipBgColor: AppColors.of(context).background,
tooltipHorizontalAlignment: FLHorizontalAlignment.right,
tooltipMargin: -10,
getTooltipItems: (touchedSpots) {
Expand Down
Loading

0 comments on commit 35f3fb7

Please sign in to comment.