Search: Show a better message when not found

It used to show "Why don't you add a new note"
This commit is contained in:
Vishesh Handa
2019-10-06 12:46:06 +02:00
parent 8d717cbaeb
commit d4718e9fc9
2 changed files with 5 additions and 1 deletions

View File

@ -33,6 +33,7 @@ class HomeScreen extends StatelessWidget {
);
Navigator.of(context).push(route);
},
emptyText: "Why not add your first\n Journal Entry?",
);
bool shouldShowBadge =
@ -141,6 +142,7 @@ class NoteSearch extends SearchDelegate<Note> {
);
Navigator.of(context).push(route);
},
emptyText: "No Search Results Found",
);
return journalList;
}

View File

@ -12,10 +12,12 @@ typedef void NoteSelectedFunction(int noteIndex);
class JournalList extends StatelessWidget {
final NoteSelectedFunction noteSelectedFunction;
final List<Note> notes;
final String emptyText;
JournalList({
@required this.notes,
@required this.noteSelectedFunction,
@required this.emptyText,
});
@override
@ -23,7 +25,7 @@ class JournalList extends StatelessWidget {
if (notes.isEmpty) {
return Center(
child: Text(
"Why not add your first\n Journal Entry?",
emptyText,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 28.0,