Skip to content

Commit

Permalink
Illustration when no entry
Browse files Browse the repository at this point in the history
  • Loading branch information
letsintegreat committed Jun 5, 2022
1 parent 700d953 commit 742b2a7
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 5 deletions.
Binary file added assets/secret.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 31 additions & 4 deletions lib/pages/HomePage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,42 @@ class _HomePage extends State<HomePage> {
}
m[monthAndYear]!.add(entry);
}
print(m);
if (diaryUser.entries.isEmpty) {
return Center(
child: Column(
children: [
Spacer(),
Padding(
padding: const EdgeInsets.fromLTRB(8.0, 32, 8, 32),
child: Image.asset(
"assets/waiting.png",
height: 180,
),
),
Padding(
padding: const EdgeInsets.fromLTRB(32, 32, 32, 32),
child: Center(
child: Text(
"No entries as of now. Click on + to get started!",
style: GoogleFonts.sourceSansPro(
color: Colors.white,
fontSize: 17,
fontWeight: FontWeight.bold),
textAlign: TextAlign.center,
),
),
),
Spacer(),
],
),
);
}
return SizedBox.expand(
child: Padding(
padding: const EdgeInsets.fromLTRB(8.0, 8.0, 8.0, 8.0),
child: Container(
child: ListView(
children: m.keys.toList().map((String k) {
print(k);
return Padding(
padding: const EdgeInsets.fromLTRB(0, 0, 0, 25),
child: Column(
Expand Down Expand Up @@ -170,8 +198,7 @@ class _HomePage extends State<HomePage> {
diaryEntry: diaryEntry),
type:
PageTransitionType.scale,
alignment:
Alignment.center,
alignment: Alignment.center,
duration:
Duration(seconds: 1)));
},
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/ScreenLockPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class _ScreenLockPage extends State<ScreenLockPage> {
Padding(
padding: const EdgeInsets.fromLTRB(8.0, 50, 8, 32),
child: Image.asset(
"assets/waiting.png",
"assets/secret.png",
height: 180,
),
),
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ flutter:
assets:
- assets/diary_illustration.png
- assets/waiting.png
- assets/secret.png
# - images/a_dot_ham.jpeg

# An image asset can refer to one or more resolution-specific "variants", see
Expand Down

0 comments on commit 742b2a7

Please sign in to comment.