@@ -3,6 +3,9 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
3
3
import 'package:flutter_svg/flutter_svg.dart' ;
4
4
import 'package:go_router/go_router.dart' ;
5
5
import 'package:spotify_collab_app/providers/playlist_provider.dart' ;
6
+ import 'package:spotify_collab_app/view/widgets/custom_title.dart' ;
7
+ import 'package:spotify_collab_app/view/widgets/new_playlist_button.dart' ;
8
+ import 'package:spotify_collab_app/view/widgets/playlist_card.dart' ;
6
9
7
10
class HomeScreen extends ConsumerWidget {
8
11
const HomeScreen ({super .key});
@@ -106,161 +109,4 @@ class HomeScreen extends ConsumerWidget {
106
109
}
107
110
}
108
111
109
- class CustomTitle extends StatelessWidget {
110
- const CustomTitle ({
111
- super .key,
112
- required this .title,
113
- });
114
112
115
- final String title;
116
-
117
- @override
118
- Widget build (BuildContext context) {
119
- return Row (
120
- children: [
121
- const Spacer (),
122
- const SizedBox (width: 20 ),
123
- Text (
124
- title,
125
- style: const TextStyle (
126
- fontFamily: "Gotham" ,
127
- fontWeight: FontWeight .w700,
128
- fontSize: 34 ,
129
- shadows: < Shadow > [
130
- Shadow (offset: Offset (0 , 1 ), color: Color (0xffDA84FE )),
131
- ],
132
- ),
133
- ),
134
- Column (
135
- children: [
136
- SvgPicture .asset ('assets/highlight.svg' ),
137
- const SizedBox (height: 30 ),
138
- ],
139
- ),
140
- const Spacer (),
141
- ],
142
- );
143
- }
144
- }
145
-
146
- class PlaylistCard extends ConsumerWidget {
147
- const PlaylistCard ({
148
- super .key,
149
- this .isActive = false ,
150
- required this .name,
151
- required this .id,
152
- });
153
-
154
- final bool isActive;
155
- final String ? name;
156
- final String ? id;
157
-
158
- @override
159
- Widget build (BuildContext context, WidgetRef ref) {
160
- final playlistNotifier = ref.read (playlistProvider.notifier);
161
-
162
- return Row (
163
- children: [
164
- Expanded (
165
- child: Container (
166
- height: 102 ,
167
- decoration: BoxDecoration (
168
- color: isActive ? const Color (0xff5822EE ) : Colors .white,
169
- borderRadius: const BorderRadius .all (Radius .circular (8 )),
170
- ),
171
- child: Padding (
172
- padding: const EdgeInsets .all (20.0 ),
173
- child: Row (
174
- children: [
175
- Container (
176
- height: 57 ,
177
- width: 57 ,
178
- decoration: const BoxDecoration (
179
- shape: BoxShape .circle,
180
- color: Colors .grey,
181
- ),
182
- child: const Icon (Icons .music_note, size: 32 ),
183
- ),
184
- const SizedBox (width: 10 ),
185
- Column (
186
- crossAxisAlignment: CrossAxisAlignment .start,
187
- children: [
188
- Text (
189
- name ?? '' ,
190
- style: TextStyle (
191
- fontFamily: "Gotham" ,
192
- fontWeight: FontWeight .w700,
193
- fontSize: 16 ,
194
- color: isActive ? Colors .white : Colors .black,
195
- ),
196
- ),
197
- ],
198
- ),
199
- const Spacer (),
200
- Align (
201
- alignment: Alignment .bottomRight,
202
- child: Container (
203
- width: 97 ,
204
- height: 31 ,
205
- decoration: BoxDecoration (
206
- color:
207
- ! isActive ? const Color (0xff5822EE ) : Colors .white,
208
- borderRadius:
209
- const BorderRadius .all (Radius .circular (8 )),
210
- ),
211
- child: Center (
212
- child: TextButton (
213
- onPressed: () {
214
- playlistNotifier.selectedPlaylistUuid = id ?? '' ;
215
- playlistNotifier.selectedPlaylistName = name ?? '' ;
216
- context.push ("/admin" );
217
- },
218
- child: Text (
219
- isActive ? "Manage" : "View" ,
220
- style: TextStyle (
221
- color: isActive
222
- ? const Color (0xff5822EE )
223
- : Colors .white,
224
- fontFamily: "Gotham" ,
225
- fontWeight: FontWeight .w700,
226
- fontSize: 16 ,
227
- ),
228
- ),
229
- )),
230
- ),
231
- ),
232
- ],
233
- ),
234
- ),
235
- ),
236
- ),
237
- ],
238
- );
239
- }
240
- }
241
-
242
- class NewPlaylistButton extends StatelessWidget {
243
- const NewPlaylistButton ({super .key});
244
-
245
- @override
246
- Widget build (BuildContext context) {
247
- return Row (
248
- children: [
249
- Expanded (
250
- child: Container (
251
- height: 59 ,
252
- decoration: const BoxDecoration (
253
- color: Colors .white,
254
- borderRadius: BorderRadius .all (Radius .circular (8 )),
255
- ),
256
- child: const Icon (
257
- Icons .add_circle,
258
- color: Color (0xff5822EE ),
259
- size: 43 ,
260
- ),
261
- ),
262
- ),
263
- ],
264
- );
265
- }
266
- }
0 commit comments