CardView: Show the title

This commit is contained in:
Vishesh Handa
2020-03-12 14:30:21 +01:00
parent f4dd4fd148
commit 063d0fda3a

View File

@ -57,11 +57,25 @@ class CardView extends StatelessWidget {
var textTheme = Theme.of(context).textTheme; var textTheme = Theme.of(context).textTheme;
var tileContent = Padding( var tileContent = Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Text( child: Column(
body, children: <Widget>[
maxLines: 30, if (note.title != null && note.title.isNotEmpty)
overflow: TextOverflow.ellipsis, Text(
style: textTheme.body1, note.title,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: textTheme.title,
),
if (note.title != null && note.title.isNotEmpty)
const SizedBox(height: 8.0),
Text(
body,
maxLines: 30,
overflow: TextOverflow.ellipsis,
style: textTheme.body1,
),
],
crossAxisAlignment: CrossAxisAlignment.start,
), ),
); );