Skip to content

Commit 9a0c0c4

Browse files
authored
Merge pull request #2 from champ96k/code-refactor
code refactor
2 parents 1721745 + cd6398d commit 9a0c0c4

File tree

5 files changed

+108
-52
lines changed

5 files changed

+108
-52
lines changed

lib/NavigationBar/NavigationBar.dart

Lines changed: 74 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import 'package:flutter/material.dart';
22
import 'package:solmusic/Style/Style.dart';
33

4-
class NavigationBar extends StatefulWidget {
4+
class NavigationBarItem extends StatefulWidget {
55
@override
6-
_NavigationBarState createState() => _NavigationBarState();
6+
_NavigationBarItemState createState() => _NavigationBarItemState();
77
}
88

9-
class _NavigationBarState extends State<NavigationBar> {
9+
class _NavigationBarItemState extends State<NavigationBarItem> {
1010
@override
1111
Widget build(BuildContext context) {
1212
return LayoutBuilder(
@@ -36,7 +36,7 @@ class _DesktopNavBarState extends State<DesktopNavBar> {
3636
@override
3737
Widget build(BuildContext context) {
3838
return Container(
39-
height: MediaQuery.of(context).size.height * 0.15,
39+
height: MediaQuery.of(context).size.height * 0.1,
4040
color: Color(0xff08192D),
4141
child: Padding(
4242
padding: const EdgeInsets.symmetric(horizontal: 16.0),
@@ -48,23 +48,67 @@ class _DesktopNavBarState extends State<DesktopNavBar> {
4848
child: Row(
4949
mainAxisAlignment: MainAxisAlignment.spaceAround,
5050
children: [
51-
Wrap(
52-
alignment: WrapAlignment.center,
51+
Wrap(
52+
alignment: WrapAlignment.center,
5353
children: [
5454
Text(
5555
"Sol".toUpperCase(),
5656
style: ThemText.titlePinkText,
5757
),
58-
Text("Music".toUpperCase(),
59-
style: ThemText.titleWhiteText
60-
)
58+
Text("Music".toUpperCase(),
59+
style: ThemText.titleWhiteText)
6160
],
6261
),
63-
Text("Home", style: ThemText.navBarWhiteTab),
64-
Text("About", style: ThemText.navBarWhiteTab),
65-
Text("Pages", style: ThemText.navBarWhiteTab),
66-
Text("News", style: ThemText.navBarWhiteTab),
67-
Text("Contact", style: ThemText.navBarWhiteTab),
62+
TextButton(
63+
onPressed: () {},
64+
child: Padding(
65+
padding: const EdgeInsets.symmetric(
66+
horizontal: 16.0,
67+
vertical: 10.0,
68+
),
69+
child: Text("Home", style: ThemText.navBarWhiteTab),
70+
),
71+
),
72+
TextButton(
73+
onPressed: () {},
74+
child: Padding(
75+
padding: const EdgeInsets.symmetric(
76+
horizontal: 16.0,
77+
vertical: 10.0,
78+
),
79+
child: Text("About", style: ThemText.navBarWhiteTab),
80+
),
81+
),
82+
TextButton(
83+
onPressed: () {},
84+
child: Padding(
85+
padding: const EdgeInsets.symmetric(
86+
horizontal: 16.0,
87+
vertical: 10.0,
88+
),
89+
child: Text("Pages", style: ThemText.navBarWhiteTab),
90+
),
91+
),
92+
TextButton(
93+
onPressed: () {},
94+
child: Padding(
95+
padding: const EdgeInsets.symmetric(
96+
horizontal: 16.0,
97+
vertical: 10.0,
98+
),
99+
child: Text("News", style: ThemText.navBarWhiteTab),
100+
),
101+
),
102+
TextButton(
103+
onPressed: () {},
104+
child: Padding(
105+
padding: const EdgeInsets.symmetric(
106+
horizontal: 16.0,
107+
vertical: 10.0,
108+
),
109+
child: Text("Contact", style: ThemText.navBarWhiteTab),
110+
),
111+
),
68112
],
69113
),
70114
),
@@ -82,29 +126,31 @@ class _DesktopNavBarState extends State<DesktopNavBar> {
82126
children: [
83127
Padding(
84128
padding: const EdgeInsets.all(2.0),
85-
child: Text("Help",
86-
style: ThemText.helpGreyText
87-
),
129+
child: Text("Help", style: ThemText.helpGreyText),
88130
),
89131
Padding(
90132
padding: const EdgeInsets.all(8.0),
91133
child: Container(
92-
width: 0.75,
93-
height: 16,
94-
color: Colors.white
95-
),
134+
width: 0.75, height: 16, color: Colors.white),
96135
),
97-
Padding(
98-
padding: const EdgeInsets.all(2.0),
99-
child: Text("Login",
100-
style: ThemText.loginWhiteText
101-
),
136+
TextButton(
137+
onPressed: () {},
138+
child: Padding(
139+
padding: const EdgeInsets.all(2.0),
140+
child:
141+
Text("Login", style: ThemText.loginWhiteText),
142+
),
102143
),
103144
],
104145
),
105146
),
106-
Text("Create an account",
107-
style: ThemText.createAccountPinkText),
147+
TextButton(
148+
onPressed: () {},
149+
child: Text(
150+
"Create an account",
151+
style: ThemText.createAccountPinkText,
152+
),
153+
),
108154
],
109155
),
110156
),

lib/Pages/HomePage.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ class _HomePageState extends State<HomePage> {
1212
Widget build(BuildContext context) {
1313
return Scaffold(
1414
body: SingleChildScrollView(
15-
child: Column(
15+
child: Column(
1616
children: [
17-
NavigationBar(),
17+
NavigationBarItem(),
1818
LandingPage(),
1919
],
2020
),

lib/Pages/LandingPage.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,9 @@ class _DesktopPageState extends State<DesktopPage> {
202202
),
203203
Padding(
204204
padding: const EdgeInsets.symmetric(
205-
horizontal: 48.0, vertical: 16.0),
205+
horizontal: 48.0,
206+
vertical: 16.0,
207+
),
206208
child: Row(
207209
children: [
208210
RoundedButton(

lib/Widget/RoundedButton.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@ class RoundedButton extends StatelessWidget {
1313
return Padding(
1414
padding: const EdgeInsets.symmetric(horizontal: 16.0),
1515
child: MaterialButton(
16-
height: size.height * 0.09,
16+
height: size.height * 0.07,
1717
minWidth: size.width * 0.15,
1818
shape: RoundedRectangleBorder(
19-
borderRadius: BorderRadius.circular(26.0),
19+
borderRadius: BorderRadius.circular(18.0),
2020
),
2121
onPressed: () {},
2222
color: color,
23-
child: Text(textTitle.toUpperCase(),
23+
child: Text(
24+
textTitle.toUpperCase(),
2425
style: ThemText.buttonText,
2526
),
2627
),

pubspec.lock

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,42 @@ packages:
77
name: async
88
url: "https://pub.dartlang.org"
99
source: hosted
10-
version: "2.4.1"
10+
version: "2.8.2"
1111
boolean_selector:
1212
dependency: transitive
1313
description:
1414
name: boolean_selector
1515
url: "https://pub.dartlang.org"
1616
source: hosted
17-
version: "2.0.0"
17+
version: "2.1.0"
18+
characters:
19+
dependency: transitive
20+
description:
21+
name: characters
22+
url: "https://pub.dartlang.org"
23+
source: hosted
24+
version: "1.2.0"
1825
charcode:
1926
dependency: transitive
2027
description:
2128
name: charcode
2229
url: "https://pub.dartlang.org"
2330
source: hosted
24-
version: "1.1.3"
31+
version: "1.3.1"
2532
clock:
2633
dependency: transitive
2734
description:
2835
name: clock
2936
url: "https://pub.dartlang.org"
3037
source: hosted
31-
version: "1.0.1"
38+
version: "1.1.0"
3239
collection:
3340
dependency: transitive
3441
description:
3542
name: collection
3643
url: "https://pub.dartlang.org"
3744
source: hosted
38-
version: "1.14.12"
45+
version: "1.15.0"
3946
cupertino_icons:
4047
dependency: "direct main"
4148
description:
@@ -49,7 +56,7 @@ packages:
4956
name: fake_async
5057
url: "https://pub.dartlang.org"
5158
source: hosted
52-
version: "1.1.0"
59+
version: "1.2.0"
5360
flutter:
5461
dependency: "direct main"
5562
description: flutter
@@ -66,21 +73,21 @@ packages:
6673
name: matcher
6774
url: "https://pub.dartlang.org"
6875
source: hosted
69-
version: "0.12.6"
76+
version: "0.12.11"
7077
meta:
7178
dependency: transitive
7279
description:
7380
name: meta
7481
url: "https://pub.dartlang.org"
7582
source: hosted
76-
version: "1.1.8"
83+
version: "1.7.0"
7784
path:
7885
dependency: transitive
7986
description:
8087
name: path
8188
url: "https://pub.dartlang.org"
8289
source: hosted
83-
version: "1.7.0"
90+
version: "1.8.0"
8491
sky_engine:
8592
dependency: transitive
8693
description: flutter
@@ -92,55 +99,55 @@ packages:
9299
name: source_span
93100
url: "https://pub.dartlang.org"
94101
source: hosted
95-
version: "1.7.0"
102+
version: "1.8.1"
96103
stack_trace:
97104
dependency: transitive
98105
description:
99106
name: stack_trace
100107
url: "https://pub.dartlang.org"
101108
source: hosted
102-
version: "1.9.3"
109+
version: "1.10.0"
103110
stream_channel:
104111
dependency: transitive
105112
description:
106113
name: stream_channel
107114
url: "https://pub.dartlang.org"
108115
source: hosted
109-
version: "2.0.0"
116+
version: "2.1.0"
110117
string_scanner:
111118
dependency: transitive
112119
description:
113120
name: string_scanner
114121
url: "https://pub.dartlang.org"
115122
source: hosted
116-
version: "1.0.5"
123+
version: "1.1.0"
117124
term_glyph:
118125
dependency: transitive
119126
description:
120127
name: term_glyph
121128
url: "https://pub.dartlang.org"
122129
source: hosted
123-
version: "1.1.0"
130+
version: "1.2.0"
124131
test_api:
125132
dependency: transitive
126133
description:
127134
name: test_api
128135
url: "https://pub.dartlang.org"
129136
source: hosted
130-
version: "0.2.15"
137+
version: "0.4.3"
131138
typed_data:
132139
dependency: transitive
133140
description:
134141
name: typed_data
135142
url: "https://pub.dartlang.org"
136143
source: hosted
137-
version: "1.1.6"
144+
version: "1.3.0"
138145
vector_math:
139146
dependency: transitive
140147
description:
141148
name: vector_math
142149
url: "https://pub.dartlang.org"
143150
source: hosted
144-
version: "2.0.8"
151+
version: "2.1.1"
145152
sdks:
146-
dart: ">=2.7.0 <3.0.0"
153+
dart: ">=2.14.0 <3.0.0"

0 commit comments

Comments
 (0)