From cc114868fb22bc8d5426a371f6c38aafc9714823 Mon Sep 17 00:00:00 2001 From: mrlanu Date: Thu, 3 Aug 2023 21:01:47 -0500 Subject: [PATCH 01/12] build: add fontawesome --- pubspec.lock | 8 ++++++++ pubspec.yaml | 1 + 2 files changed, 9 insertions(+) diff --git a/pubspec.lock b/pubspec.lock index fa18c85..65df717 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -374,6 +374,14 @@ packages: description: flutter source: sdk version: "0.0.0" + font_awesome_flutter: + dependency: "direct main" + description: + name: font_awesome_flutter + sha256: "5fb789145cae1f4c3245c58b3f8fb287d055c26323879eab57a7bf0cfd1e45f3" + url: "https://pub.dev" + source: hosted + version: "10.5.0" form_inputs: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index fcd7de5..608616a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -32,6 +32,7 @@ dependencies: carousel_slider: ^4.2.1 adaptive_breakpoints: ^0.1.6 fl_chart: ^0.63.0 + font_awesome_flutter: ^10.5.0 dev_dependencies: bloc_test: ^9.0.0 From 204105b8c28d499ea33ee70484f28c41b99ae35a Mon Sep 17 00:00:00 2001 From: mrlanu Date: Thu, 3 Aug 2023 21:02:23 -0500 Subject: [PATCH 02/12] refactor: change icons on drawer --- lib/drawer/main_drawer.dart | 227 +++++++++++++++++++++--------------- 1 file changed, 130 insertions(+), 97 deletions(-) diff --git a/lib/drawer/main_drawer.dart b/lib/drawer/main_drawer.dart index bf618d6..8a1bd4b 100644 --- a/lib/drawer/main_drawer.dart +++ b/lib/drawer/main_drawer.dart @@ -4,6 +4,7 @@ import 'package:budget_app/constants/constants.dart'; import 'package:budget_app/debt_payoff_planner/view/payoff_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import '../app/bloc/app_bloc.dart'; import '../home/view/home_page.dart'; @@ -36,103 +37,135 @@ class _MainDrawerState extends State { width: double.infinity, child: Image.asset('assets/images/piggy_logo.png', fit: BoxFit.contain))), - ListTile( - tileColor: - widget.tabController?.index == 0 ? BudgetColors.teal100 : null, - leading: Icon(Icons.monetization_on_outlined, - size: 26, color: BudgetColors.teal900), - title: Text('Home', - style: Theme.of(context) - .textTheme - .titleLarge! - .copyWith(color: BudgetColors.teal900)), - onTap: () { - isDisplayDesktop(context) - ? {widget.tabController?.index = 0, setState(() {},)} - : Navigator.of(context).pushNamedAndRemoveUntil( - HomePage.routeName, - (route) => false, - ); - }, - ), - ListTile( - tileColor: - widget.tabController?.index == 1 ? BudgetColors.teal100 : null, - leading: - Icon(Icons.summarize_outlined, size: 26, color: BudgetColors.teal900), - title: Text('Summary', - style: Theme.of(context) - .textTheme - .titleLarge! - .copyWith(color: BudgetColors.teal900)), - onTap: () { - isDisplayDesktop(context) - ? {widget.tabController?.index = 1, setState(() {}),} - : { - Navigator.pop(context), - Navigator.of(context).push(SummaryPage.route()) - }; - }, - ), - ListTile( - tileColor: - widget.tabController?.index == 2 ? BudgetColors.teal100 : null, - leading: - Icon(Icons.bar_chart, size: 26, color: BudgetColors.teal900), - title: Text('Trend', - style: Theme.of(context) - .textTheme - .titleLarge! - .copyWith(color: BudgetColors.teal900)), - onTap: () { - isDisplayDesktop(context) - ? {widget.tabController?.index = 2, setState(() {}),} - : { - Navigator.pop(context), - Navigator.of(context).push(ChartPage.route()) - }; - }, - ), - ListTile( - tileColor: - widget.tabController?.index == 3 ? BudgetColors.teal100 : null, - leading: Icon(Icons.money_outlined, - size: 26, color: BudgetColors.teal900), - title: Text('Debt payoff planner', - style: Theme.of(context) - .textTheme - .titleLarge! - .copyWith(color: BudgetColors.teal900)), - onTap: () { - isDisplayDesktop(context) - ? {widget.tabController?.index = 3, setState(() {}),} - : { - Navigator.pop(context), - Navigator.push(context, DebtPayoffPage.route()) - }; - }, - ), - ListTile( - leading: - Icon(Icons.settings, size: 26, color: BudgetColors.teal900), - title: Text('Settings', - style: Theme.of(context) - .textTheme - .titleLarge! - .copyWith(color: BudgetColors.teal900)), - onTap: () {}, - ), - ListTile( - leading: Icon(Icons.logout, size: 26, color: BudgetColors.teal900), - title: Text('Log out', - style: Theme.of(context) - .textTheme - .titleLarge! - .copyWith(color: BudgetColors.teal900)), - onTap: () { - context.read().add(const AppLogoutRequested()); - }, - ), + Expanded( + child: SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 10.0), + child: Column( + children: [ + ListTile( + tileColor: + widget.tabController?.index == 0 ? BudgetColors.teal100 : null, + leading: + FaIcon(FontAwesomeIcons.coins, color: BudgetColors.teal900), + title: Text('Budgets', + style: Theme.of(context) + .textTheme + .titleLarge! + .copyWith(color: BudgetColors.teal900)), + onTap: () { + isDisplayDesktop(context) + ? { + widget.tabController?.index = 0, + setState( + () {}, + ) + } + : Navigator.of(context).pushNamedAndRemoveUntil( + HomePage.routeName, + (route) => false, + ); + }, + ), + Divider(color: BudgetColors.teal900), + ListTile( + tileColor: + widget.tabController?.index == 1 ? BudgetColors.teal100 : null, + leading: FaIcon( + FontAwesomeIcons.listUl, + color: BudgetColors.teal900, + ), + title: Text('Summary', + style: Theme.of(context) + .textTheme + .titleLarge! + .copyWith(color: BudgetColors.teal900)), + onTap: () { + isDisplayDesktop(context) + ? { + widget.tabController?.index = 1, + setState(() {}), + } + : { + Navigator.pop(context), + Navigator.of(context).push(SummaryPage.route()) + }; + }, + ), + Divider(color: BudgetColors.teal900), + ListTile( + tileColor: + widget.tabController?.index == 2 ? BudgetColors.teal100 : null, + leading: FaIcon(FontAwesomeIcons.chartSimple, + color: BudgetColors.teal900), + title: Text('Trend', + style: Theme.of(context) + .textTheme + .titleLarge! + .copyWith(color: BudgetColors.teal900)), + onTap: () { + isDisplayDesktop(context) + ? { + widget.tabController?.index = 2, + setState(() {}), + } + : { + Navigator.pop(context), + Navigator.of(context).push(ChartPage.route()) + }; + }, + ), + Divider(color: BudgetColors.teal900), + ListTile( + tileColor: + widget.tabController?.index == 3 ? BudgetColors.teal100 : null, + leading: FaIcon(FontAwesomeIcons.moneyCheckDollar, + color: BudgetColors.teal900), + title: Text('Debt payoff planner', + style: Theme.of(context) + .textTheme + .titleLarge! + .copyWith(color: BudgetColors.teal900)), + onTap: () { + isDisplayDesktop(context) + ? { + widget.tabController?.index = 3, + setState(() {}), + } + : { + Navigator.pop(context), + Navigator.push(context, DebtPayoffPage.route()) + }; + }, + ), + Divider(color: BudgetColors.teal900), + ListTile( + leading: FaIcon(FontAwesomeIcons.gear, color: BudgetColors.teal900), + title: Text('Settings', + style: Theme.of(context) + .textTheme + .titleLarge! + .copyWith(color: BudgetColors.teal900)), + onTap: () {}, + ), + Divider(color: BudgetColors.teal900), + ListTile( + leading: FaIcon(FontAwesomeIcons.rightFromBracket, color: BudgetColors.teal900), + title: Text('Log out', + style: Theme.of(context) + .textTheme + .titleLarge! + .copyWith(color: BudgetColors.teal900)), + onTap: () { + context.read().add(const AppLogoutRequested()); + }, + ), + Divider(color: BudgetColors.teal900) + ], + ), + ), + ), + ) ], ), ); From 60aeab55a158f002f7e41adb2c0211f21b5360d2 Mon Sep 17 00:00:00 2001 From: mrlanu Date: Fri, 4 Aug 2023 10:23:55 -0500 Subject: [PATCH 03/12] feat: add ability to choose icon --- assets/fonts/fa-brands-400.ttf | Bin 0 -> 187208 bytes assets/fonts/fa-regular-400.ttf | Bin 0 -> 63952 bytes assets/fonts/fa-solid-900.ttf | Bin 0 -> 394628 bytes lib/account_edit/view/account_edit_form.dart | 121 +++++++++--------- .../view/accounts_list_page.dart | 2 +- lib/categories/cubit/categories_cubit.dart | 19 ++- lib/categories/cubit/categories_state.dart | 8 +- lib/categories/view/categories_page.dart | 116 +++++++++++------ .../view/widgets/categories_grid.dart | 39 ++++++ lib/home/view/home_mobile_page.dart | 3 +- lib/home/view/widgets/category_summaries.dart | 5 +- lib/shared/models/awesome_icons.dart | 63 +++++++++ pubspec.yaml | 13 ++ 13 files changed, 276 insertions(+), 113 deletions(-) create mode 100644 assets/fonts/fa-brands-400.ttf create mode 100644 assets/fonts/fa-regular-400.ttf create mode 100644 assets/fonts/fa-solid-900.ttf create mode 100644 lib/categories/view/widgets/categories_grid.dart create mode 100644 lib/shared/models/awesome_icons.dart diff --git a/assets/fonts/fa-brands-400.ttf b/assets/fonts/fa-brands-400.ttf new file mode 100644 index 0000000000000000000000000000000000000000..989f323b1e32b3522c404c91818fb9b67a5e76c0 GIT binary patch literal 187208 zcmc${37lL-wLe~UZ{NPX@7=feb!K|@nVz1Ro=leMY!D!Uu!J?hgnc(ckN`$n37bzP zAiD_j6nUt@$76Z&o`|E5AEKi2-kiyfapc{eiV z2we1mGdC&Azl*X{`|upOc+=L+N{?+6@eZWVU$W`qvoG>=-prKA&5YSHn?G>b7GJ&d zyG(gz2V=2+WoWBvO+bC3~1#K{m#wR-F0Byt{u=Y4AxrJD5T_@WC&i+&{^f z(%8Rm|FrTkGh9T{k7A<`#bz5}Wf4gE_yMVG{Fi(O(-6FtpM%&#O?MAVuxp2u( zapb-iD4f#E_yA#NE-i)0aG7uNJO^NTC?o=Hc(#B4Bv&a2#{8!ZF*X=KtKU|6h)p5M_vR8i)r@0TO?dNBRjjc>tviQd$cTAEq?? zCnAjUh6MdkISqsnP~JLd7U=+nmDhBsTruW|lk_?z>e49Q%p=EnlDQG4D|MuoZKL`e zR=?-+&*!t+88_Qxl}F)ztDT~r2I{H<$Ys(M;Z(kf2YR+Z)JxB68CT9T(<3i`68<`i zQ5k$nltp+T8en|FOowpmS)^&;xy}qxCiwwY`O13Kzr#%5U}-8BkU*L|KmiN%P+1gi zy0R`=M%<#ug=x(4i9cBR6hY5jF)38%d^@jc%mq)F~=WiUQu32YYosz9nW>N^J!6*m3O{8$+szwBJxtd|A!#* zO$z$=DXWox5_Q!fhp3!7#+z`+WH{n72RzF-q7CBDk_R;)|G+D(zKimZ-)bMi<0#ih z&+w{(V|t*nbJVkfgr>@v26UCutlu3%f)mF%i=rF?ApxblYb3FX_T^r`Svaw(*VL z+4b_S*QUeM?bDsp!_!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