I'm new to flutter
How do I print the data from getAge() to ListTile(title: )?
Here's the code:
const Divider(),
const ListTile(
leading: Icon(Icons.face),
title: Text(''),
subtitle: Text('Age'),
),
];
return ListView(children: listTiles);
}
}
void getAge() {
final DateTime now = DateTime.now();
final DateTime birthday = DateTime.parse('1985-8-13');
final age = now.year -
birthday.year -
(now.month > birthday.month
? 0
: now.month == birthday.month
? now.day >= birthday.day
? 0
: 1
: 1);
print(age);
}
Here's the image:
