Skip to content

Commit b12b676

Browse files
committed
homepage, create a note, and edit a note screen
1 parent 7940ce2 commit b12b676

File tree

12 files changed

+222
-21
lines changed

12 files changed

+222
-21
lines changed

assets/icons/drawer.png

315 Bytes
Loading
37.1 KB
Loading

lib/main.dart

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import 'package:flutter/material.dart';
2+
import 'package:notely/screens/createNoteScreens/createNoteScreen.dart';
23
import 'package:notely/screens/homepageScreens/homepageScreen.dart';
4+
import 'package:notely/screens/homepageScreens/noContentHomepage.dart';
35
import 'package:notely/screens/registrationScreens/registrationScreen.dart';
46

57
import 'screens/loginScreens/loginScreen.dart';
@@ -24,7 +26,9 @@ class MyApp extends StatelessWidget {
2426
'/': (context) => const OnboardingScreen(),
2527
'/registration': (context) => RegistrationScreen(),
2628
'/login': (context) => LoginScreen(),
29+
'/initial-homepage': (context) => NoContentHomePage(),
2730
'/homepage': (context) => HomePageScreen(),
31+
'/create-note': (context) => CreateNoteScreen(),
2832
},
2933
);
3034
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:gap/gap.dart';
3+
import 'package:notely/utils/colors.dart';
4+
import 'package:notely/utils/fonts.dart';
5+
import 'package:notely/widgets/common/appbarsCommon.dart';
6+
import 'package:notely/widgets/editNote/editNoteTextField.dart';
7+
import 'package:notely/widgets/registration/registrationTextField.dart';
8+
9+
class CreateNoteScreen extends StatefulWidget {
10+
const CreateNoteScreen({super.key});
11+
12+
@override
13+
State<CreateNoteScreen> createState() => _CreateNoteScreenState();
14+
}
15+
16+
class _CreateNoteScreenState extends State<CreateNoteScreen> {
17+
@override
18+
Widget build(BuildContext context) {
19+
return SafeArea(
20+
child: Scaffold(
21+
backgroundColor: ColorsConstant.backgroundColor,
22+
appBar: PreferredSize(
23+
preferredSize: const Size.fromHeight(64.0),
24+
child: AppBarCommon(
25+
leadingIcon: GestureDetector(
26+
onTap: () {
27+
Navigator.of(context).pop();
28+
},
29+
child: const Icon(
30+
Icons.arrow_back_ios,
31+
color: Colors.black,
32+
),
33+
),
34+
title: "Edit Note",
35+
actionIcon: const Icon(
36+
Icons.more_vert,
37+
color: Colors.black,
38+
),
39+
),
40+
),
41+
body: Column(
42+
children: [
43+
const Gap(30),
44+
EditNoteTextField(
45+
hintText: "Note title",
46+
),
47+
const Gap(12),
48+
Expanded(
49+
child: EditNoteTextField(
50+
hintText: "Note Content",
51+
height: MediaQuery.of(context).size.height,
52+
keyboardType: TextInputType.multiline,
53+
),
54+
),
55+
],
56+
),
57+
),
58+
);
59+
}
60+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:gap/gap.dart';
3+
import 'package:notely/utils/colors.dart';
4+
import 'package:notely/utils/fonts.dart';
5+
import 'package:notely/widgets/common/appbarsCommon.dart';
6+
import 'package:notely/widgets/onboarding/onboardingButton.dart';
7+
8+
class NoContentHomePage extends StatelessWidget {
9+
const NoContentHomePage({super.key});
10+
11+
@override
12+
Widget build(BuildContext context) {
13+
return SafeArea(
14+
child: Scaffold(
15+
appBar: PreferredSize(
16+
preferredSize: Size.fromHeight(64.0),
17+
child: AppBarCommon(
18+
// TODO change to drawer
19+
leadingIcon: IconButton(
20+
icon: Icon(
21+
Icons.menu,
22+
color: Colors.black,
23+
),
24+
onPressed: () => Scaffold.of(context).openDrawer(),
25+
),
26+
title: "All Notes",
27+
actionIcon: Icon(
28+
Icons.search,
29+
color: Colors.black,
30+
),
31+
),
32+
),
33+
backgroundColor: ColorsConstant.backgroundColor,
34+
body: Padding(
35+
padding: const EdgeInsets.symmetric(horizontal: 44.0),
36+
child: SingleChildScrollView(
37+
child: Column(
38+
children: [
39+
Gap(100),
40+
Image.asset("assets/images/homepage/no-content-homepage.png"),
41+
Gap(40),
42+
Text(
43+
"Create your first note",
44+
style: Fonts.onboardingTitle.bodyLarge,
45+
),
46+
Gap(12),
47+
Text(
48+
"Add a note about anything (your thoughts on climate change, or your history essay) and share it witht the world.",
49+
style: Fonts.onboardingTitle.bodyMedium,
50+
textAlign: TextAlign.center,
51+
),
52+
const Gap(78),
53+
OnboardingButton(
54+
title: "Create a note",
55+
moveTo: "/create-note",
56+
),
57+
const Gap(20),
58+
GestureDetector(
59+
onTap: () {},
60+
child: Text(
61+
"Import Notes",
62+
style: Fonts.onboardingLinks.bodyMedium,
63+
textAlign: TextAlign.center,
64+
),
65+
),
66+
],
67+
),
68+
),
69+
),
70+
),
71+
);
72+
}
73+
}

lib/screens/loginScreens/loginScreen.dart

+2-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ class LoginScreen extends StatelessWidget {
4848
textTitle: 'Password',
4949
),
5050
const Gap(44),
51-
const OnboardingButton(title: "Login", moveTo: "/homepage"),
51+
const OnboardingButton(
52+
title: "Login", moveTo: "/initial-homepage"),
5253
const Gap(20),
5354
GestureDetector(
5455
onTap: () {

lib/screens/registrationScreens/registrationScreen.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
5959
),
6060
const Gap(56),
6161
const OnboardingButton(
62-
title: "Create Account", moveTo: "/homepage"),
62+
title: "Create Account", moveTo: "/initial-homepage"),
6363
const Gap(20),
6464
GestureDetector(
6565
onTap: () {

lib/utils/fonts.dart

+9
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,13 @@ class Fonts {
4343
color: ColorsConstant.TextTitleColor,
4444
),
4545
);
46+
47+
static const TextTheme editNoteTitle = TextTheme(
48+
titleSmall: TextStyle(
49+
fontFamily: "Nunito-Bold",
50+
fontSize: 14,
51+
fontWeight: FontWeight.w900,
52+
color: ColorsConstant.TextTitleColor,
53+
),
54+
);
4655
}

lib/widgets/common/appbarsCommon.dart

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:notely/utils/fonts.dart';
3+
4+
class AppBarCommon extends StatelessWidget {
5+
dynamic leadingIcon, title, actionIcon;
6+
AppBarCommon({
7+
super.key,
8+
this.leadingIcon,
9+
this.title,
10+
this.actionIcon,
11+
});
12+
13+
@override
14+
Widget build(BuildContext context) {
15+
return AppBar(
16+
centerTitle: true,
17+
backgroundColor: Colors.transparent,
18+
elevation: 0,
19+
leading: leadingIcon,
20+
title: Text(
21+
title,
22+
style: Fonts.editNoteTitle.titleSmall,
23+
),
24+
actions: [
25+
actionIcon,
26+
],
27+
);
28+
}
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:notely/utils/colors.dart';
3+
import 'package:notely/utils/fonts.dart';
4+
5+
class EditNoteTextField extends StatelessWidget {
6+
dynamic hintText, height, keyboardType;
7+
EditNoteTextField({
8+
super.key,
9+
this.hintText,
10+
this.height,
11+
this.keyboardType,
12+
});
13+
14+
@override
15+
Widget build(BuildContext context) {
16+
return Container(
17+
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 8),
18+
height: height,
19+
child: TextField(
20+
decoration: InputDecoration(
21+
hintText: hintText,
22+
hintStyle: Fonts.hintTheme.bodyMedium,
23+
enabledBorder: InputBorder.none,
24+
focusedBorder: InputBorder.none,
25+
filled: true,
26+
fillColor: ColorsConstant.backgroundColor,
27+
),
28+
),
29+
);
30+
}
31+
}

pubspec.lock

+12-19
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ packages:
77
name: async
88
url: "https://pub.dartlang.org"
99
source: hosted
10-
version: "2.8.2"
10+
version: "2.9.0"
1111
boolean_selector:
1212
dependency: transitive
1313
description:
@@ -21,21 +21,14 @@ packages:
2121
name: characters
2222
url: "https://pub.dartlang.org"
2323
source: hosted
24-
version: "1.2.0"
25-
charcode:
26-
dependency: transitive
27-
description:
28-
name: charcode
29-
url: "https://pub.dartlang.org"
30-
source: hosted
31-
version: "1.3.1"
24+
version: "1.2.1"
3225
clock:
3326
dependency: transitive
3427
description:
3528
name: clock
3629
url: "https://pub.dartlang.org"
3730
source: hosted
38-
version: "1.1.0"
31+
version: "1.1.1"
3932
collection:
4033
dependency: transitive
4134
description:
@@ -63,7 +56,7 @@ packages:
6356
name: fake_async
6457
url: "https://pub.dartlang.org"
6558
source: hosted
66-
version: "1.3.0"
59+
version: "1.3.1"
6760
ffi:
6861
dependency: transitive
6962
description:
@@ -136,28 +129,28 @@ packages:
136129
name: matcher
137130
url: "https://pub.dartlang.org"
138131
source: hosted
139-
version: "0.12.11"
132+
version: "0.12.12"
140133
material_color_utilities:
141134
dependency: transitive
142135
description:
143136
name: material_color_utilities
144137
url: "https://pub.dartlang.org"
145138
source: hosted
146-
version: "0.1.4"
139+
version: "0.1.5"
147140
meta:
148141
dependency: transitive
149142
description:
150143
name: meta
151144
url: "https://pub.dartlang.org"
152145
source: hosted
153-
version: "1.7.0"
146+
version: "1.8.0"
154147
path:
155148
dependency: transitive
156149
description:
157150
name: path
158151
url: "https://pub.dartlang.org"
159152
source: hosted
160-
version: "1.8.1"
153+
version: "1.8.2"
161154
path_provider:
162155
dependency: transitive
163156
description:
@@ -239,7 +232,7 @@ packages:
239232
name: source_span
240233
url: "https://pub.dartlang.org"
241234
source: hosted
242-
version: "1.8.2"
235+
version: "1.9.0"
243236
stack_trace:
244237
dependency: transitive
245238
description:
@@ -260,21 +253,21 @@ packages:
260253
name: string_scanner
261254
url: "https://pub.dartlang.org"
262255
source: hosted
263-
version: "1.1.0"
256+
version: "1.1.1"
264257
term_glyph:
265258
dependency: transitive
266259
description:
267260
name: term_glyph
268261
url: "https://pub.dartlang.org"
269262
source: hosted
270-
version: "1.2.0"
263+
version: "1.2.1"
271264
test_api:
272265
dependency: transitive
273266
description:
274267
name: test_api
275268
url: "https://pub.dartlang.org"
276269
source: hosted
277-
version: "0.4.9"
270+
version: "0.4.12"
278271
typed_data:
279272
dependency: transitive
280273
description:

pubspec.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ flutter:
6060
# To add assets to your application, add an assets section, like this:
6161
assets:
6262
- assets/images/onboarding/onboarding1.png
63+
- assets/images/homepage/no-content-homepage.png
6364
# - images/a_dot_ham.jpeg
6465

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

0 commit comments

Comments
 (0)