Skip to content

Commit a8d91d5

Browse files
authored
Merge pull request #95 from RealTeamRocket/87-new-design
87 new design
2 parents 60242dd + 861d102 commit a8d91d5

File tree

6 files changed

+253
-77
lines changed

6 files changed

+253
-77
lines changed

mobile_app/lib/pages/leaderboard.dart

Lines changed: 75 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import 'package:flutter/material.dart';
33
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
44
import 'package:mobile_app/utils/backend_api/backend_api.dart';
55

6+
import '../constants/color_constants.dart';
7+
68
class 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
),

mobile_app/lib/pages/route.dart

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'package:flutter/material.dart';
22
import 'package:flutter_osm_plugin/flutter_osm_plugin.dart';
3+
import 'package:mobile_app/constants/color_constants.dart';
34
import 'dart:math';
45

56
import 'package:mobile_app/pages/pages.dart';
@@ -67,13 +68,35 @@ class _RoutePageState extends State<RoutePage> {
6768
@override
6869
Widget build(BuildContext context) {
6970
return Scaffold(
70-
appBar: AppBar(title: Text(widget.title)),
71+
appBar: AppBar(
72+
iconTheme: IconThemeData(
73+
color: ColorConstants.white,
74+
),
75+
title: Text(
76+
widget.title,
77+
style: TextStyle(
78+
color: ColorConstants.white,
79+
fontWeight: FontWeight.bold,
80+
),
81+
),
82+
centerTitle: true,
83+
backgroundColor: ColorConstants.secoundaryColor,
84+
),
85+
backgroundColor: ColorConstants.secoundaryColor,
7186
body: Column(
7287
children: [
7388
SizedBox(
7489
height: 500,
7590
child: _initPosition == null || _routePoints.isEmpty
76-
? Center(child: Text("Keine Route verfügbar"))
91+
? Center(
92+
child: Text(
93+
"No route available",
94+
style: TextStyle(
95+
color: ColorConstants.white,
96+
fontWeight: FontWeight.bold,
97+
),
98+
)
99+
)
77100
: OSMFlutter(
78101
controller: _mapController,
79102
osmOption: OSMOption(
@@ -120,7 +143,7 @@ class _RoutePageState extends State<RoutePage> {
120143
),
121144
Container(
122145
padding: const EdgeInsets.all(16.0),
123-
color: Colors.blueAccent,
146+
color: ColorConstants.secoundaryColor,
124147
child: Column(
125148
crossAxisAlignment: CrossAxisAlignment.start,
126149
children: [
@@ -132,13 +155,15 @@ class _RoutePageState extends State<RoutePage> {
132155
style: TextStyle(
133156
fontSize: 16,
134157
fontWeight: FontWeight.bold,
158+
color: ColorConstants.white
135159
),
136160
),
137161
Text(
138162
"Time: ${widget.elapsedTime}",
139163
style: TextStyle(
140164
fontSize: 16,
141165
fontWeight: FontWeight.bold,
166+
color: ColorConstants.white
142167
),
143168
),
144169
],
@@ -155,6 +180,10 @@ class _RoutePageState extends State<RoutePage> {
155180
(route) => false,
156181
);
157182
},
183+
style: ElevatedButton.styleFrom(
184+
backgroundColor: ColorConstants.purpleColor,
185+
foregroundColor: ColorConstants.white,
186+
),
158187
child: Text("Back To App"),
159188
),
160189
),

mobile_app/lib/pages/settings_page.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ class _SettingsPageState extends State<SettingsPage> {
126126
),
127127
backgroundColor: ColorConstants.secoundaryColor,
128128
iconTheme: const IconThemeData(color: Colors.white),
129+
centerTitle: true,
129130
),
130131
backgroundColor: ColorConstants.primaryColor,
131132
body: _isLoading

0 commit comments

Comments
 (0)