@@ -3,6 +3,8 @@ import 'package:flutter/material.dart';
33import 'package:flutter_secure_storage/flutter_secure_storage.dart' ;
44import 'package:mobile_app/utils/backend_api/backend_api.dart' ;
55
6+ import '../constants/color_constants.dart' ;
7+
68class LeaderboardPage extends StatefulWidget {
79 const LeaderboardPage ({super .key, required this .title});
810 final String title;
@@ -92,10 +94,18 @@ class _LeaderboardPageState extends State<LeaderboardPage> {
9294 Widget build (BuildContext context) {
9395 return Scaffold (
9496 appBar: AppBar (
95- title: Text (widget.title),
96- backgroundColor: Colors .blueGrey[100 ],
97+ title: Text (
98+ widget.title,
99+ style: TextStyle (
100+ color: ColorConstants .white,
101+ fontSize: 20 ,
102+ fontWeight: FontWeight .bold,
103+ ),
104+ ),
105+ centerTitle: true ,
106+ backgroundColor: ColorConstants .primaryColor,
97107 ),
98- backgroundColor: Colors .blueGrey[ 100 ] ,
108+ backgroundColor: ColorConstants .primaryColor ,
99109 body: isLoading
100110 ? const Center (child: CircularProgressIndicator ())
101111 : SafeArea (
@@ -112,9 +122,9 @@ class _LeaderboardPageState extends State<LeaderboardPage> {
112122 height: 44 ,
113123 width: 200 ,
114124 decoration: BoxDecoration (
115- color: Colors .grey ,
125+ color: ColorConstants .secoundaryColor ,
116126 borderRadius: BorderRadius .circular (100 ),
117- border: Border .all (color: Colors .black , width: 2 ),
127+ border: Border .all (color: ColorConstants .purpleColor. withValues (alpha : 0.3 ) , width: 2 ),
118128 ),
119129 child: Stack (
120130 alignment: Alignment .center,
@@ -129,7 +139,7 @@ class _LeaderboardPageState extends State<LeaderboardPage> {
129139 width: 100 ,
130140 height: 44 ,
131141 decoration: BoxDecoration (
132- color: const Color ( 0xff9ba0fc ) ,
142+ color: ColorConstants .purpleColor ,
133143 borderRadius: BorderRadius .circular (100 ),
134144 ),
135145 ),
@@ -145,9 +155,8 @@ class _LeaderboardPageState extends State<LeaderboardPage> {
145155 child: Text (
146156 "All" ,
147157 style: TextStyle (
148- color: selectedTab == 0
149- ? Colors .white
150- : Colors .black,
158+ color: ColorConstants .white,
159+ fontWeight: FontWeight .w600,
151160 fontSize: 15 ,
152161 ),
153162 ),
@@ -161,9 +170,8 @@ class _LeaderboardPageState extends State<LeaderboardPage> {
161170 child: Text (
162171 "Friends" ,
163172 style: TextStyle (
164- color: selectedTab == 1
165- ? Colors .white
166- : Colors .black,
173+ color: ColorConstants .white,
174+ fontWeight: FontWeight .w600,
167175 fontSize: 15 ,
168176 ),
169177 ),
@@ -247,21 +255,25 @@ class _LeaderboardPageState extends State<LeaderboardPage> {
247255 leading: Text (
248256 '${displayedUsers .length < 3 ? index + 1 : index + 4 }.' ,
249257 style: const TextStyle (
250- fontSize: 16 ,
258+ fontSize: 18 ,
251259 fontWeight: FontWeight .bold,
252- color: Colors .black ,
260+ color: ColorConstants .white ,
253261 ),
254262 ),
255263 title: Text (
256264 user.username,
257265 style: const TextStyle (
258- fontSize: 14 ,
259- color: Colors .black,
266+ fontSize: 16 ,
267+ fontWeight: FontWeight .bold,
268+ color: ColorConstants .white,
260269 ),
261270 ),
262271 subtitle: Text (
263272 'Rocketpoints: ${user .rocketPoints }' ,
264- style: const TextStyle (fontSize: 12 ),
273+ style: const TextStyle (
274+ fontSize: 14 ,
275+ color: ColorConstants .purpleColor
276+ ),
265277 ),
266278 trailing: selectedTab == 0
267279 ? ElevatedButton (
@@ -272,16 +284,18 @@ class _LeaderboardPageState extends State<LeaderboardPage> {
272284 },
273285 style: ElevatedButton .styleFrom (
274286 backgroundColor: isFriend (user)
275- ? Colors .green
276- : Colors .grey,
287+ ? ColorConstants .greenColor
288+ : Colors .grey. withValues (alpha : 0.3 ) ,
277289 shape: const CircleBorder (),
278290 padding: const EdgeInsets .all (8 ),
279291 ),
280292 child: Icon (
281293 isFriend (user)
282294 ? Icons .check
283295 : Icons .person_add_alt,
284- color: Colors .white,
296+ color: isFriend (user)
297+ ? ColorConstants .greenColor
298+ : ColorConstants .white,
285299 size: 22 ,
286300 ),
287301 )
@@ -304,26 +318,50 @@ class _LeaderboardPageState extends State<LeaderboardPage> {
304318 context: context,
305319 builder: (BuildContext context) {
306320 return AlertDialog (
307- title: Text (user.username),
321+ backgroundColor: ColorConstants .secoundaryColor.withValues (alpha: 0.9 ),
322+ title: Center (
323+ child: Text (
324+ user.username,
325+ style: const TextStyle (color: ColorConstants .white),
326+ ),
327+ ),
308328 content: Column (
309329 mainAxisSize: MainAxisSize .min,
310330 children: [
311- Text ('Rocketpoints: ${user .rocketPoints }' ),
312- Text ('Signed up: 01.01.2023' ), // Example date
313- Text ('Status: Not a friend' ),
331+ Text (
332+ 'Rocketpoints: ${user .rocketPoints }' ,
333+ style: const TextStyle (color: ColorConstants .white),
334+ ),
314335 IconButton (
315- icon: const Icon (Icons .person_add_alt, color: Colors .black),
316- onPressed: () {
336+ icon: Icon (
337+ isFriend (user)
338+ ? Icons .check
339+ : Icons .person_add_alt,
340+ color: isFriend (user)
341+ ? ColorConstants .greenColor
342+ : ColorConstants .white,
343+ ),
344+ onPressed: isFriend (user)
345+ ? null
346+ : () async {
317347 addFriend (user);
348+ Navigator .of (context).pop ();
318349 },
319350 ),
320351 ],
321352 ),
322353 actions: [
323- TextButton (
354+ ElevatedButton (
324355 onPressed: () {
325356 Navigator .of (context).pop ();
326357 },
358+ style: ElevatedButton .styleFrom (
359+ backgroundColor: ColorConstants .purpleColor,
360+ foregroundColor: Colors .white,
361+ shape: RoundedRectangleBorder (
362+ borderRadius: BorderRadius .circular (8 ),
363+ ),
364+ ),
327365 child: const Text ('Okay' ),
328366 ),
329367 ],
@@ -335,12 +373,12 @@ class _LeaderboardPageState extends State<LeaderboardPage> {
335373 width: size,
336374 height: size,
337375 decoration: BoxDecoration (
338- border: Border .all (color: Colors .black ),
376+ border: Border .all (color: ColorConstants .purpleColor. withValues (alpha : 0.3 ) ),
339377 color: color,
340378 shape: BoxShape .circle,
341379 boxShadow: [
342380 BoxShadow (
343- color: Colors .black.withOpacity ( 0.08 ),
381+ color: Colors .black.withValues (alpha : 0.08 ),
344382 blurRadius: 6 ,
345383 offset: const Offset (0 , 3 ),
346384 ),
@@ -357,7 +395,7 @@ class _LeaderboardPageState extends State<LeaderboardPage> {
357395 : user.username,
358396 style: const TextStyle (
359397 color: Colors .black,
360- fontSize: 12 ,
398+ fontSize: 14 ,
361399 fontWeight: FontWeight .bold,
362400 ),
363401 textAlign: TextAlign .center,
@@ -392,13 +430,17 @@ class _PodiumSpot extends StatelessWidget {
392430 const SizedBox (height: 8 ),
393431 Text (
394432 place,
395- style: const TextStyle (fontWeight: FontWeight .bold, fontSize: 15 ),
433+ style: const TextStyle (
434+ fontWeight: FontWeight .bold,
435+ fontSize: 18 ,
436+ color: ColorConstants .white,
437+ ),
396438 ),
397439 Text (
398440 '$points RP' ,
399441 style: const TextStyle (
400- color: Colors .black87 ,
401- fontSize: 13 ,
442+ color: ColorConstants .purpleColor ,
443+ fontSize: 15 ,
402444 fontWeight: FontWeight .w500,
403445 ),
404446 ),
0 commit comments