Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 8 additions & 10 deletions .github/workflows/flutter-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- "web/**"
- "pubspec.yaml"

pull_request_target:
pull_request:
branches: [main]

workflow_dispatch:
Expand All @@ -20,13 +20,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout PR Code
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Checkout Code
uses: actions/checkout@v4

- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
~/.gradle/caches
Expand All @@ -36,9 +33,10 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-

- uses: actions/setup-java@v1
- uses: actions/setup-java@v4
with:
java-version: "21.x"
distribution: 'temurin'
java-version: "21"

- uses: subosito/flutter-action@v2
with:
Expand All @@ -55,7 +53,7 @@ jobs:
mv lib/firebase_options.example.dart lib/firebase_options.dart

if [ -z "$GOOGLE_JSON_DATA" ]; then
echo '{ "project_info": { "project_number": "123", "project_id": "dummy" }, "client": [ { "client_info": { "mobilesdk_app_id": "1:123:android:123", "android_client_info": { "package_name": "com.madclubtsec.tsec_application" } }, "api_key": [ { "current_key": "dummy" } ] } ], "configuration_version": "1" }' > android/app/google-services.json
cp android/app/google-services.mock.json android/app/google-services.json
else
echo "$GOOGLE_JSON_DATA" > android/app/google-services.json
fi
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/test-build-release-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,9 @@ jobs:

steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref || github.ref_name }}
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
uses: actions/checkout@v4

- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
~/.gradle/caches
Expand All @@ -40,9 +37,10 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-

- uses: actions/setup-java@v1
- uses: actions/setup-java@v4
with:
java-version: "21.x"
distribution: 'temurin'
java-version: "21"

- uses: subosito/flutter-action@v2
with:
Expand All @@ -58,7 +56,11 @@ jobs:
GRADLE_OPTS: -Xmx4096m
run: |
mv lib/firebase_options.example.dart lib/firebase_options.dart
echo "$GOOGLE_JSON_BASE64" | base64 --decode > /home/runner/work/Mobile-App/Mobile-App/android/app/google-services.json
if [ -z "$GOOGLE_JSON_BASE64" ]; then
cp android/app/google-services.mock.json android/app/google-services.json
else
echo "$GOOGLE_JSON_BASE64" | base64 --decode > android/app/google-services.json
fi
flutter pub get
flutter pub run build_runner build --delete-conflicting-outputs
- name: Extract Flutter Version
Expand Down
22 changes: 22 additions & 0 deletions android/app/google-services.mock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"project_info": {
"project_number": "123",
"project_id": "dummy"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:123:android:123",
"android_client_info": {
"package_name": "com.madclubtsec.tsec_application"
}
},
"api_key": [
{
"current_key": "dummy"
}
]
}
],
"configuration_version": "1"
}
1 change: 1 addition & 0 deletions ios/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ ios/Podfile.lock
!default.pbxuser
!default.perspectivev3
pubspec.lock
GoogleService-Info.plist
71 changes: 45 additions & 26 deletions lib/new_ui/screens/attendance_screen/attendance_details_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,28 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:pie_chart/pie_chart.dart';
import 'package:tsec_app/new_ui/colors.dart';
import 'package:tsec_app/new_ui/screens/attendance_screen/attendance_totals_provider.dart';

import 'package:tsec_app/models/subject_model/subject_model.dart';
import 'package:tsec_app/models/user_model/user_model.dart';
import 'package:tsec_app/provider/auth_provider.dart';
import 'package:tsec_app/provider/subjects_provider.dart';
import 'package:tsec_app/utils/profile_details.dart';
class AttendanceDetailsScreen extends ConsumerWidget {
const AttendanceDetailsScreen({super.key});

@override
Widget build(BuildContext context, WidgetRef ref) {
final attendanceAsync = ref.watch(attendanceTotalsProvider);

SubjectModel subjects = ref.watch(subjectsProvider);
UserModel? user = ref.watch(userModelProvider);
List<String> validSubjects = [];
if (user != null && user.studentModel != null) {
SemesterData semData = subjects.dataMap[
"${calcGradYear(user.studentModel?.gradyear)}_${user.studentModel?.branch}"] ??
SemesterData(even_sem: [], odd_sem: []);
validSubjects = evenOrOddSem() == "even_sem" ? semData.even_sem : semData.odd_sem;
}

return Scaffold(
appBar: AppBar(
backgroundColor: commonbgLightblack,
Expand All @@ -35,10 +49,13 @@ class AttendanceDetailsScreen extends ConsumerWidget {
ref.read(fetchedAttendanceTotalsProvider.notifier).state = totals;
});

final attendedMap = totals.attended
.map((key, value) => MapEntry(key, value.toDouble()));
final totalMap = totals.total
.map((key, value) => MapEntry(key, value.toDouble()));
final filteredAttended = totals.attended.entries.where((e) => validSubjects.isEmpty || validSubjects.contains(e.key));
final filteredTotal = totals.total.entries.where((e) => validSubjects.isEmpty || validSubjects.contains(e.key));

final attendedMap = Map.fromEntries(filteredAttended
.map((e) => MapEntry(e.key, e.value.toDouble())));
final totalMap = Map.fromEntries(filteredTotal
.map((e) => MapEntry(e.key, e.value.toDouble())));

if (attendedMap.isEmpty && totalMap.isEmpty) {
return Center(
Expand Down Expand Up @@ -133,28 +150,30 @@ class AttendanceDetailsScreen extends ConsumerWidget {
],
),
const SizedBox(height: 8),
ListView.builder(
itemBuilder: (context, index) {
String subject =
totals.attended.keys.elementAt(index);
int attended =
totals.attended[subject] ?? 0;
int total = totals.total[subject] ?? 0;
Builder(builder: (context) {
List<String> filteredSubjectKeys = validSubjects.isEmpty
? totals.attended.keys.toList()
: totals.attended.keys.where((k) => validSubjects.contains(k)).toList();

return Column(
children: [
attendanceItem(
subject, attended, total),
if (index <
totals.attended.length - 1)
Divider(color: Colors.grey[700]),
],
);
},
itemCount: totals.attended.length,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
),
return ListView.builder(
itemBuilder: (context, index) {
String subject = filteredSubjectKeys[index];
int attended = totals.attended[subject] ?? 0;
int total = totals.total[subject] ?? 0;

return Column(
children: [
attendanceItem(subject, attended, total),
if (index < filteredSubjectKeys.length - 1)
Divider(color: Colors.grey[700]),
],
);
},
itemCount: filteredSubjectKeys.length,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
);
}),
],
),
),
Expand Down
8 changes: 4 additions & 4 deletions lib/new_ui/screens/railway_screen/widgets/stepperwidget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class StatusStepper extends StatelessWidget {
customStep: getStatusCircle(2),
title: "Rejected",
);
} else if (concessionStatus == "serviced") {
} else if (concessionStatus == "serviced" || concessionStatus == "downloaded") {
return EasyStep(
customStep: getStatusCircle(0),
title: "Approved",
Expand Down Expand Up @@ -131,7 +131,7 @@ class StatusStepper extends StatelessWidget {
title: "Reviewing",
);
}
else if(concessionStatus == "serviced" || concessionStatus == "rejected") {
else if(concessionStatus == "serviced" || concessionStatus == "rejected" || concessionStatus == "downloaded") {
return EasyStep(
customStep: getStatusCircle(0),
title: "Reviewed",
Expand All @@ -144,7 +144,7 @@ class StatusStepper extends StatelessWidget {
}

EasyStep getFirstStep() {
if (concessionStatus == "unserviced" || concessionStatus == "rejected" || concessionStatus == "serviced") {
if (concessionStatus == "unserviced" || concessionStatus == "rejected" || concessionStatus == "serviced" || concessionStatus == "downloaded") {
return EasyStep(
customStep: getStatusCircle(0),
title: "Applied",
Expand All @@ -161,7 +161,7 @@ class StatusStepper extends StatelessWidget {
print("Returning 3");
return 3;
}
else if(concessionStatus == "serviced" || concessionStatus == "rejected") {return 2;}
else if(concessionStatus == "serviced" || concessionStatus == "rejected" || concessionStatus == "downloaded") {return 2;}
else if(concessionStatus == "unserviced") {return 1;}
else {return 0;}
}
Expand Down
Loading