mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-29 02:07:39 +08:00
Move empty text inside the JournalList
This commit is contained in:
@ -21,33 +21,18 @@ class HomeScreen extends StatelessWidget {
|
||||
child: Icon(Icons.add),
|
||||
);
|
||||
|
||||
Widget journalList;
|
||||
if (appState.notes.isNotEmpty) {
|
||||
journalList = JournalList(
|
||||
notes: appState.notes,
|
||||
noteSelectedFunction: (noteIndex) {
|
||||
var route = MaterialPageRoute(
|
||||
builder: (context) => NoteBrowsingScreen(
|
||||
notes: appState.notes,
|
||||
noteIndex: noteIndex,
|
||||
),
|
||||
);
|
||||
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],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
Widget journalList = JournalList(
|
||||
notes: appState.notes,
|
||||
noteSelectedFunction: (noteIndex) {
|
||||
var route = MaterialPageRoute(
|
||||
builder: (context) => NoteBrowsingScreen(
|
||||
notes: appState.notes,
|
||||
noteIndex: noteIndex,
|
||||
),
|
||||
);
|
||||
Navigator.of(context).push(route);
|
||||
},
|
||||
);
|
||||
|
||||
bool shouldShowBadge =
|
||||
!appState.remoteGitRepoConfigured && appState.hasJournalEntries;
|
||||
|
@ -19,6 +19,20 @@ class JournalList extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (notes.isEmpty) {
|
||||
return 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],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return ListView.separated(
|
||||
separatorBuilder: (context, index) {
|
||||
return Divider(
|
||||
|
Reference in New Issue
Block a user