From 063d0fda3a189bdb6e413d5db017e3f50ec7668c Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Thu, 12 Mar 2020 14:30:21 +0100 Subject: [PATCH] CardView: Show the title --- lib/folder_views/card_view.dart | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/lib/folder_views/card_view.dart b/lib/folder_views/card_view.dart index 4b9ff1d7..2a852776 100644 --- a/lib/folder_views/card_view.dart +++ b/lib/folder_views/card_view.dart @@ -57,11 +57,25 @@ class CardView extends StatelessWidget { var textTheme = Theme.of(context).textTheme; var tileContent = Padding( padding: const EdgeInsets.all(8.0), - child: Text( - body, - maxLines: 30, - overflow: TextOverflow.ellipsis, - style: textTheme.body1, + child: Column( + children: [ + if (note.title != null && note.title.isNotEmpty) + Text( + 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, ), );