From cc3145d44ea608af043be2cf16b12a04325269ed Mon Sep 17 00:00:00 2001 From: Ricardo Markiewicz Date: Fri, 24 Jan 2020 11:03:05 -0300 Subject: [PATCH] Add custom icons --- assets/ComoGastoIcons.ttf | Bin 0 -> 2868 bytes lib/como_gasto_icons.dart | 30 ++++++++++++++++++++++++++++++ lib/pages/add_page.dart | 5 +++-- lib/pages/home_page.dart | 11 ++++++----- pubspec.yaml | 16 +++++----------- 5 files changed, 44 insertions(+), 18 deletions(-) create mode 100755 assets/ComoGastoIcons.ttf create mode 100755 lib/como_gasto_icons.dart diff --git a/assets/ComoGastoIcons.ttf b/assets/ComoGastoIcons.ttf new file mode 100755 index 0000000000000000000000000000000000000000..17c41ae1be87d4285a692e613b785057a61a46c1 GIT binary patch literal 2868 zcmd^B&2Jmm5ue$mNLh;HkovONT3V7K71c5&FDX)170Qks%Lf|VQiP@pdAAb<}=5hMWu2+pBFfcj$Hk^(JI=MXqK#6^)q4(!FZTm*~i?>%l) z8F2g$c6Dxl6@3k|=*4Odwq}U{{q#?5AO7<2JaZ$GR|VjQgudP2$qZNWpdFJ*)%kx@#Ja`xQpJhkTyt4Ll#W@HokgFNR~vIb^scrtWC%Rrc% z|3lRpU#BMI_f17)>{?^wZ|DRg0)?7XppR%TWu9H8Q#GnNWjC!O=2%?eclP%|;H_(J=elnFE6%@f>5n%ZVr8cXqiuyCXh5Hs+3o*dOL-EFRN) z`nXeAk41PWzEoU_%TD?2J#KNex;u{U9_?_qx>~>X27_Mp_1@q>eKfh1OeRj>IGso) zxA^sHl__q!#h2Kp40ZG!_IRG`_xxFmTwanle=wbSVjMPqvR_e?MQqF6&$q@$g?u)c_I%;yh1&AbtRAr_wjK)dPGGJa+}ge4v2a=T?1gAD^sNZ&#~3)#~0IIY4Oq zY)JXIT7RxuRc}r`xT_BHy{c%tvKPLxDSt_zJvgG)9xNyyi%UYp`xW9Hpc6#FP=e!w zPVD4Z0DI^kboFsNyLw`J9}*T#u-+37HHnP|E4Nv_?q&V>rDM4Z(a)lbX>emg9?o8f z{4D}G6|T?5mtwI-9n_Df7rh^OBa6|oMcsSz$VG@Zdm|U3kymx#Q?^-gDTcjl#P(~% z)`6Rn*e%Phv!}bKTaTmA#-fAqFb{?TZoajVNli>nPNXvTGpUo4;l#jt@`ZWU_^-gy zz#7Vp^e?LC3w`}{d^F@OX4m`w_ll5mUk9?^5pm015+jmz1ldEH8~G3YhA;2%t@?Aj zyUH7Te-v|J>+P>X0D=$40jC7V!{>J%WpPGuP=3zhpy0GT&C!thkNUQ!ZKuss-){4G z+IUe4ya<8s$)W902I5`#_R+uPJuCQgAiQ1n?T{M0g6f;Md6nAfqRl(Nuh@JO>T|>9 zoxtC+`4*i1>o(tt+}}nmv*QrnaE(5%%YXf=S?A{{L^KMX!BEu_np6|<3WSTBd9kv~%|Rv{KnzO{c7I&az4qBO?dnpfhAri8iT>tY`5b z#3GHJ0y>0Ir%_27ZsJYIrfs!CMKUN4#Go~JvQeRRM5F_?up+UlvW#CtjX%6T4H*`?Rm_uuby()v0y;q>cz!4! zxL;%w|I;4Tnpt6$9o)oDc5yQwB4-N!G0TP{Wt6Svl#x#tmyNQTGP8$DE4b=%fLkh- RVO5S_GRhT4DZf@B`Y*se{yP8w literal 0 HcmV?d00001 diff --git a/lib/como_gasto_icons.dart b/lib/como_gasto_icons.dart new file mode 100755 index 0000000..cbb3b56 --- /dev/null +++ b/lib/como_gasto_icons.dart @@ -0,0 +1,30 @@ +/// Flutter icons ComoGastoIcons +/// Copyright (C) 2020 by original authors @ fluttericon.com, fontello.com +/// This font was generated by FlutterIcon.com, which is derived from Fontello. +/// +/// To use this font, place it in your fonts/ directory and include the +/// following in your pubspec.yaml +/// +/// flutter: +/// fonts: +/// - family: ComoGastoIcons +/// fonts: +/// - asset: fonts/ComoGastoIcons.ttf +/// +/// +/// +import 'package:flutter/widgets.dart'; + +class ComoGastoIcons { + ComoGastoIcons._(); + + static const _kFontFam = 'ComoGastoIcons'; + + static const IconData camera = const IconData(0xe800, fontFamily: _kFontFam); + static const IconData cart = const IconData(0xe801, fontFamily: _kFontFam); + static const IconData calendar = const IconData(0xe802, fontFamily: _kFontFam); + static const IconData settings = const IconData(0xe803, fontFamily: _kFontFam); + static const IconData pie_chart = const IconData(0xe804, fontFamily: _kFontFam); + static const IconData stats_bars = const IconData(0xe805, fontFamily: _kFontFam); + static const IconData plus = const IconData(0xe806, fontFamily: _kFontFam); +} diff --git a/lib/pages/add_page.dart b/lib/pages/add_page.dart index 23205ae..0825e62 100644 --- a/lib/pages/add_page.dart +++ b/lib/pages/add_page.dart @@ -7,6 +7,7 @@ import 'package:image_picker/image_picker.dart'; import 'package:provider/provider.dart'; import 'package:local_auth/local_auth.dart'; +import '../como_gasto_icons.dart'; import '../expenses_repository.dart'; class AddPage extends StatefulWidget { @@ -95,7 +96,7 @@ class _AddPageState extends State with SingleTickerProviderStateMixin { centerTitle: false, actions: [ IconButton( - icon: Icon(Icons.calendar_today), + icon: Icon(ComoGastoIcons.calendar), color: Colors.grey, onPressed: () { showDatePicker( @@ -116,7 +117,7 @@ class _AddPageState extends State with SingleTickerProviderStateMixin { }, ), IconButton( - icon: Icon(Icons.camera_alt), + icon: Icon(ComoGastoIcons.camera), color: Colors.grey, onPressed: () async { var image = diff --git a/lib/pages/home_page.dart b/lib/pages/home_page.dart index 1402393..c185a35 100644 --- a/lib/pages/home_page.dart +++ b/lib/pages/home_page.dart @@ -1,4 +1,5 @@ import 'package:cloud_firestore/cloud_firestore.dart'; +import 'package:como_gasto/como_gasto_icons.dart'; import 'package:como_gasto/others/month_widget.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; @@ -61,19 +62,19 @@ class _HomePageState extends State { mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ - _bottomAction(FontAwesomeIcons.chartLine, () { + _bottomAction(ComoGastoIcons.stats_bars, () { setState(() { currentType = GraphType.LINES; }); }), - _bottomAction(FontAwesomeIcons.chartPie, () { + _bottomAction(ComoGastoIcons.pie_chart, () { setState(() { currentType = GraphType.PIE; }); }), SizedBox(width: 48.0), - _bottomAction(FontAwesomeIcons.wallet, () {}), - _bottomAction(Icons.settings, () { + _bottomAction(ComoGastoIcons.cart, () {}), + _bottomAction(ComoGastoIcons.settings, () { Navigator.pushNamed(context, '/settings'); }), @@ -84,7 +85,7 @@ class _HomePageState extends State { floatingActionButton: RectGetter( key: globalKey, child: FloatingActionButton( - child: Icon(Icons.add), + child: Icon(ComoGastoIcons.plus), onPressed: () { buttonRect = RectGetter.getRectFromKey(globalKey); diff --git a/pubspec.yaml b/pubspec.yaml index ca98f82..09f6e0e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -78,17 +78,11 @@ flutter: # "family" key with the font family name, and a "fonts" key with a # list giving the asset and other descriptors for the font. For # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 + fonts: + - family: ComoGastoIcons + fonts: + - asset: assets/ComoGastoIcons.ttf + # # For details regarding fonts from package dependencies, # see https://flutter.io/custom-fonts/#from-packages