mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-28 01:45:55 +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);
|
Navigator.of(context).push(route);
|
||||||
},
|
},
|
||||||
|
emptyText: "Why not add your first\n Journal Entry?",
|
||||||
);
|
);
|
||||||
|
|
||||||
bool shouldShowBadge =
|
bool shouldShowBadge =
|
||||||
@ -141,6 +142,7 @@ class NoteSearch extends SearchDelegate<Note> {
|
|||||||
);
|
);
|
||||||
Navigator.of(context).push(route);
|
Navigator.of(context).push(route);
|
||||||
},
|
},
|
||||||
|
emptyText: "No Search Results Found",
|
||||||
);
|
);
|
||||||
return journalList;
|
return journalList;
|
||||||
}
|
}
|
||||||
|
@ -12,10 +12,12 @@ typedef void NoteSelectedFunction(int noteIndex);
|
|||||||
class JournalList extends StatelessWidget {
|
class JournalList extends StatelessWidget {
|
||||||
final NoteSelectedFunction noteSelectedFunction;
|
final NoteSelectedFunction noteSelectedFunction;
|
||||||
final List<Note> notes;
|
final List<Note> notes;
|
||||||
|
final String emptyText;
|
||||||
|
|
||||||
JournalList({
|
JournalList({
|
||||||
@required this.notes,
|
@required this.notes,
|
||||||
@required this.noteSelectedFunction,
|
@required this.noteSelectedFunction,
|
||||||
|
@required this.emptyText,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -23,7 +25,7 @@ class JournalList extends StatelessWidget {
|
|||||||
if (notes.isEmpty) {
|
if (notes.isEmpty) {
|
||||||
return Center(
|
return Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Why not add your first\n Journal Entry?",
|
emptyText,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 28.0,
|
fontSize: 28.0,
|
||||||
|
Reference in New Issue
Block a user