mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-07-01 04:07:53 +08:00
HomeScreen: Show some text when we have no journal entries
Ideally, I would want something way prettier, but this is a good enough start.
This commit is contained in:
@ -20,7 +20,9 @@ class HomeScreen extends StatelessWidget {
|
|||||||
child: Icon(Icons.add),
|
child: Icon(Icons.add),
|
||||||
);
|
);
|
||||||
|
|
||||||
var journalList = JournalList(
|
Widget journalList;
|
||||||
|
if (appState.notes.isNotEmpty) {
|
||||||
|
journalList = JournalList(
|
||||||
notes: appState.notes,
|
notes: appState.notes,
|
||||||
noteSelectedFunction: (noteIndex) {
|
noteSelectedFunction: (noteIndex) {
|
||||||
var route = MaterialPageRoute(
|
var route = MaterialPageRoute(
|
||||||
@ -32,6 +34,19 @@ class HomeScreen extends StatelessWidget {
|
|||||||
Navigator.of(context).push(route);
|
Navigator.of(context).push(route);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
journalList = Center(
|
||||||
|
child: Text(
|
||||||
|
"Why not add your first\n Journal Entry?",
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 28.0,
|
||||||
|
fontWeight: FontWeight.w300,
|
||||||
|
color: Colors.grey[350],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
bool shouldShowBadge =
|
bool shouldShowBadge =
|
||||||
!appState.remoteGitRepoConfigured && appState.hasJournalEntries;
|
!appState.remoteGitRepoConfigured && appState.hasJournalEntries;
|
||||||
|
Reference in New Issue
Block a user