Save the year in the database

We will need it later
This commit is contained in:
Ricardo Markiewicz
2019-07-02 09:50:56 -03:00
parent ffbec2acfd
commit 5b3358ca6f
2 changed files with 35 additions and 34 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

+8 -7
View File
@@ -33,12 +33,10 @@ class _AddPageState extends State<AddPage> with SingleTickerProviderStateMixin {
); );
_buttonAnimation = Tween<double>(begin: 0, end: 1.0).animate( _buttonAnimation = Tween<double>(begin: 0, end: 1.0).animate(
CurvedAnimation(parent: _controller, curve: Curves.fastOutSlowIn) CurvedAnimation(parent: _controller, curve: Curves.fastOutSlowIn));
);
_pageAnimation = Tween<double>(begin: -1, end: 1.0).animate( _pageAnimation = Tween<double>(begin: -1, end: 1.0).animate(
CurvedAnimation(parent: _controller, curve: Curves.fastOutSlowIn) CurvedAnimation(parent: _controller, curve: Curves.fastOutSlowIn));
);
_controller.addListener(() { _controller.addListener(() {
print(_controller.value); print(_controller.value);
@@ -230,7 +228,8 @@ class _AddPageState extends State<AddPage> with SingleTickerProviderStateMixin {
//<-- Margin from right //<-- Margin from right
top: widget.buttonRect.top, top: widget.buttonRect.top,
//<-- Margin from top //<-- Margin from top
bottom: (MediaQuery.of(context).size.height - widget.buttonRect.bottom) * bottom:
(MediaQuery.of(context).size.height - widget.buttonRect.bottom) *
(1 - _buttonAnimation.value), (1 - _buttonAnimation.value),
//<-- Margin from bottom //<-- Margin from bottom
child: Container( child: Container(
@@ -270,6 +269,7 @@ class _AddPageState extends State<AddPage> with SingleTickerProviderStateMixin {
), ),
), ),
onPressed: () { onPressed: () {
var today = DateTime.now();
var user = Provider.of<LoginState>(context).currentUser(); var user = Provider.of<LoginState>(context).currentUser();
if (value > 0 && category != "") { if (value > 0 && category != "") {
Firestore.instance Firestore.instance
@@ -280,8 +280,9 @@ class _AddPageState extends State<AddPage> with SingleTickerProviderStateMixin {
.setData({ .setData({
"category": category, "category": category,
"value": value / 100.0, "value": value / 100.0,
"month": DateTime.now().month, "month": today.month,
"day": DateTime.now().day, "day": today.day,
"year": today.year,
}); });
Navigator.of(context).pop(); Navigator.of(context).pop();