mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-27 01:02:14 +08:00
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:
@ -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;
|
||||
}
|
||||
|
@ -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,
|
||||
|
Reference in New Issue
Block a user