Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Achievement page #207

Merged
merged 26 commits into from
Apr 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
87772b5
beginning structure, wip
nit0107 Apr 9, 2024
63ffdfe
Filters mostly working now (except Category)
nit0107 Apr 14, 2024
7cbe7bb
removed commented code
nit0107 Apr 14, 2024
9279ad7
Implemented Filtering changes (except for categories)
nit0107 Apr 14, 2024
a3c63e8
removed api keys from server env
nit0107 Apr 17, 2024
7f9263b
Merge branch 'master' into nmp79/filterbackend
cathli66 Apr 21, 2024
0b4fafa
Enrollment type enum
cgu2020 Apr 21, 2024
a1f28ed
Merge master
cgu2020 Apr 21, 2024
15e8c9f
fixed filtering bugs after merging
cathli66 Apr 21, 2024
949e5c4
Merge branch 'master' into nmp79/filterbackend
cathli66 Apr 21, 2024
901457a
added friendly names, fixed category filtering
cathli66 Apr 21, 2024
f6ef17e
Merge branch 'master' into cli893/fix-miles-away
cathli66 Apr 21, 2024
77c78d3
Achievements Page UI work
cgu2020 Apr 21, 2024
9745e53
Merge branch 'master' into achievement-page
cgu2020 Apr 21, 2024
271595e
fixed miles away value in preview
cathli66 Apr 21, 2024
4d683dd
fix bug where listview breaks
cathli66 Apr 21, 2024
b1fc03b
fix formatting
cathli66 Apr 21, 2024
9903fbb
Achievements UI no backend
cgu2020 Apr 24, 2024
48e891f
Merge branch 'master' into achievement-page
cgu2020 Apr 24, 2024
ee4ef8d
Achievement model blocked by achievementTracker\
cgu2020 Apr 24, 2024
9499d34
Merge remote-tracking branch 'origin/cli893/fix-miles-away' into achi…
cgu2020 Apr 24, 2024
e562ba5
UI adjustments
cgu2020 Apr 25, 2024
c2e5cb1
Achievements UI completed, Hint icon fixed
cgu2020 Apr 26, 2024
b552692
Merge branch 'master' into achievement-page
cathli66 Apr 28, 2024
bcb1743
fixed issues caused by conflict, edited cells on profile page
cathli66 Apr 28, 2024
1383bf2
removed some old print statements
cathli66 Apr 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions admin/src/all.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ export interface RequestAchievementDataDto {

export interface LoginDto {
idToken: string;
lat: number;
long: number;
latF: number;
longF: number;
username?: string;
year?: string;
college?: string;
Expand Down
61 changes: 61 additions & 0 deletions game/assets/icons/achievementgold.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions game/assets/icons/achievementsilver.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 29 additions & 29 deletions game/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
PODS:
- AppAuth (1.7.3):
- AppAuth/Core (= 1.7.3)
- AppAuth/ExternalUserAgent (= 1.7.3)
- AppAuth/Core (1.7.3)
- AppAuth/ExternalUserAgent (1.7.3):
- AppAuth (1.7.4):
- AppAuth/Core (= 1.7.4)
- AppAuth/ExternalUserAgent (= 1.7.4)
- AppAuth/Core (1.7.4)
- AppAuth/ExternalUserAgent (1.7.4):
- AppAuth/Core
- device_info (0.0.1):
- Flutter
- device_info_plus (0.0.1):
- Flutter
- Firebase (10.23.0):
- Firebase/Core (= 10.23.0)
- Firebase/Analytics (10.23.0):
- Firebase (10.24.0):
- Firebase/Core (= 10.24.0)
- Firebase/Analytics (10.24.0):
- Firebase/Core
- Firebase/Core (10.23.0):
- Firebase/Core (10.24.0):
- Firebase/CoreOnly
- FirebaseAnalytics (~> 10.23.0)
- Firebase/CoreOnly (10.23.0):
- FirebaseCore (= 10.23.0)
- FirebaseAnalytics (10.23.0):
- FirebaseAnalytics/AdIdSupport (= 10.23.0)
- FirebaseAnalytics (~> 10.24.0)
- Firebase/CoreOnly (10.24.0):
- FirebaseCore (= 10.24.0)
- FirebaseAnalytics (10.24.0):
- FirebaseAnalytics/AdIdSupport (= 10.24.0)
- FirebaseCore (~> 10.0)
- FirebaseInstallations (~> 10.0)
- GoogleUtilities/AppDelegateSwizzler (~> 7.11)
- GoogleUtilities/MethodSwizzler (~> 7.11)
- GoogleUtilities/Network (~> 7.11)
- "GoogleUtilities/NSData+zlib (~> 7.11)"
- nanopb (< 2.30911.0, >= 2.30908.0)
- FirebaseAnalytics/AdIdSupport (10.23.0):
- FirebaseAnalytics/AdIdSupport (10.24.0):
- FirebaseCore (~> 10.0)
- FirebaseInstallations (~> 10.0)
- GoogleAppMeasurement (= 10.23.0)
- GoogleAppMeasurement (= 10.24.0)
- GoogleUtilities/AppDelegateSwizzler (~> 7.11)
- GoogleUtilities/MethodSwizzler (~> 7.11)
- GoogleUtilities/Network (~> 7.11)
- "GoogleUtilities/NSData+zlib (~> 7.11)"
- nanopb (< 2.30911.0, >= 2.30908.0)
- FirebaseCore (10.23.0):
- FirebaseCore (10.24.0):
- FirebaseCoreInternal (~> 10.0)
- GoogleUtilities/Environment (~> 7.12)
- GoogleUtilities/Logger (~> 7.12)
- FirebaseCoreInternal (10.23.0):
- FirebaseCoreInternal (10.24.0):
- "GoogleUtilities/NSData+zlib (~> 7.8)"
- FirebaseInstallations (10.23.0):
- FirebaseInstallations (10.24.0):
- FirebaseCore (~> 10.0)
- GoogleUtilities/Environment (~> 7.8)
- GoogleUtilities/UserDefaults (~> 7.8)
Expand Down Expand Up @@ -70,14 +70,14 @@ PODS:
- GoogleUtilities/Network (~> 7.11)
- "GoogleUtilities/NSData+zlib (~> 7.11)"
- nanopb (< 2.30911.0, >= 2.30908.0)
- GoogleAppMeasurement/AdIdSupport (10.23.0):
- GoogleAppMeasurement/WithoutAdIdSupport (= 10.23.0)
- GoogleAppMeasurement/AdIdSupport (10.24.0):
- GoogleAppMeasurement/WithoutAdIdSupport (= 10.24.0)
- GoogleUtilities/AppDelegateSwizzler (~> 7.11)
- GoogleUtilities/MethodSwizzler (~> 7.11)
- GoogleUtilities/Network (~> 7.11)
- "GoogleUtilities/NSData+zlib (~> 7.11)"
- nanopb (< 2.30911.0, >= 2.30908.0)
- GoogleAppMeasurement/WithoutAdIdSupport (10.23.0):
- GoogleAppMeasurement/WithoutAdIdSupport (10.24.0):
- GoogleUtilities/AppDelegateSwizzler (~> 7.11)
- GoogleUtilities/MethodSwizzler (~> 7.11)
- GoogleUtilities/Network (~> 7.11)
Expand Down Expand Up @@ -216,15 +216,15 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/url_launcher_ios/ios"

SPEC CHECKSUMS:
AppAuth: a13994980c1ec792f7e2e665acd4d4aa6be43240
AppAuth: 182c5b88630569df5acb672720534756c29b3358
device_info: d7d233b645a32c40dfdc212de5cf646ca482f175
device_info_plus: c6fb39579d0f423935b0c9ce7ee2f44b71b9fce6
Firebase: 333ec7c6b12fa09c77b5162cda6b862102211d50
FirebaseAnalytics: 45f6e2e5ef8ccbb90be73ae983c3b20fa78837f7
FirebaseCore: 63efb128decaebb04c4033ed4e05fb0bb1cccef1
FirebaseCoreInternal: 6a292e6f0bece1243a737e81556e56e5e19282e3
FirebaseInstallations: 42d6ead4605d6eafb3b6683674e80e18eb6f2c35
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
Firebase: 91fefd38712feb9186ea8996af6cbdef41473442
FirebaseAnalytics: b5efc493eb0f40ec560b04a472e3e1a15d39ca13
FirebaseCore: 11dc8a16dfb7c5e3c3f45ba0e191a33ac4f50894
FirebaseCoreInternal: bcb5acffd4ea05e12a783ecf835f2210ce3dc6af
FirebaseInstallations: 8f581fca6478a50705d2bd2abd66d306e0f5736e
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_config: f48f0d47a284f1791aacce2687eabb3309ba7a41
flutter_secure_storage: 23fc622d89d073675f2eaa109381aefbcf5a49be
fluttertoast: 31b00dabfa7fb7bacd9e7dbee580d7a2ff4bf265
Expand Down
2 changes: 1 addition & 1 deletion game/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1430;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
159 changes: 159 additions & 0 deletions game/lib/achievements/achievement_cell.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
import 'package:game/preview/preview.dart';
import 'package:flutter_svg/flutter_svg.dart';

class LoadingBar extends StatelessWidget {
final int totalTasks;
final int tasksFinished;

const LoadingBar(
this.tasksFinished,
this.totalTasks,
);

@override
Widget build(BuildContext context) {
return Row(
children: [
Container(
width: 200,
child: LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
return Stack(children: [
Container(
width: constraints.maxWidth,
height: 13,
alignment: Alignment.centerLeft,
child: Container(
decoration: new BoxDecoration(
color: Color.fromARGB(255, 241, 241, 241),
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(16.0)),
),
),
),
Container(
width: (totalTasks > 0 ? tasksFinished / totalTasks : 0) *
constraints.maxWidth,
height: 13,
alignment: Alignment.centerLeft,
child: Container(
decoration: new BoxDecoration(
color: Color.fromARGB(197, 237, 86, 86),
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(16.0)),
),
),
),
Container(
height: 3,
width: (totalTasks > 0 ? tasksFinished / totalTasks : 0) *
constraints.maxWidth -
16,
margin: EdgeInsets.only(left: 8, top: 3),
alignment: Alignment.centerLeft,
decoration: new BoxDecoration(
color: Color(0x99F3C6C6),
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(5.0)),
),
),
]);
})),
Padding(
padding: const EdgeInsets.only(left: 8.0),
child: Text(
tasksFinished.toString() + "/" + totalTasks.toString(),
),
),
],
);
}
}

class AchievementCell extends StatefulWidget {
final SvgPicture thumbnail;
final String description;
final int tasksFinished;
final int totalTasks;

const AchievementCell(
this.description, this.thumbnail, this.tasksFinished, this.totalTasks,
{Key? key})
: super(key: key);

@override
State<StatefulWidget> createState() =>
_AchievementCellState(description, thumbnail, tasksFinished, totalTasks);
}

class _AchievementCellState extends State<AchievementCell> {
final String description;
final SvgPicture thumbnail;
final int tasksFinished;
final int totalTasks;
// newly added field
// final int totalDistance;

_AchievementCellState(
this.description, this.thumbnail, this.tasksFinished, this.totalTasks
// newly added field
// this.totalDistance
);

@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () async {},
child: Container(
padding: EdgeInsets.all(5),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(15),
boxShadow: [
BoxShadow(
color: Color.fromARGB(255, 198, 198, 198),
blurRadius: 2,
offset: Offset(0, 4),
),
],
),
child: Container(
margin: EdgeInsets.all(10),
height: 64,
child: Row(
children: [
Container(margin: EdgeInsets.only(right: 12), child: thumbnail),
Column(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Align(
alignment: Alignment.centerLeft,
child: Text(
description,
style: TextStyle(
color: Color.fromARGB(204, 0, 0, 0),
fontSize: 14,
fontFamily: 'Poppins',
fontWeight: FontWeight.w500,
),
),
),
Spacer(),
Align(
alignment: Alignment.bottomCenter,
child: LoadingBar(3, 4)),
],
)
],
),
),
),
);
}
}
Loading
Loading