Skip to content

Commit

Permalink
fix:Added indicators temporarly to the time table page and linting is…
Browse files Browse the repository at this point in the history
…sues
  • Loading branch information
angrezichatterbox committed Oct 2, 2024
1 parent ef37190 commit 118ecdc
Show file tree
Hide file tree
Showing 12 changed files with 392 additions and 321 deletions.
2 changes: 1 addition & 1 deletion lib/controllers/homepage/course_summary_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class CourseSummaryController extends GetxController {
print("Task Done");
}
else if (response.statusCode == 404) {
Get.offAll(TimetableView());
Get.offAll(const TimetableView());
}
} catch (error) {
print(error);
Expand Down
3 changes: 2 additions & 1 deletion lib/controllers/timetable/time_table_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class TimeTableController extends GetxController {
return;
}


try {
final response = await http.post(
Uri.parse("${apiUrl}courses"),
Expand All @@ -102,7 +103,7 @@ class TimeTableController extends GetxController {
"schedules": {"day_of_week": day},
}),
);

print(response.body);
if (response.statusCode == 201) {
await getSchedule();
Get.snackbar("Success", "Course has been added!");
Expand Down
3 changes: 0 additions & 3 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import 'package:bunk_mate/screens/OnBoardView.dart';
import 'package:bunk_mate/screens/TimeTable/time_table_page.dart';
import 'package:bunk_mate/screens/auth/login_screen.dart';
import 'package:bunk_mate/screens/homepage/homepage_screen.dart';
import 'package:bunk_mate/utils/Navigation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
Expand Down
32 changes: 16 additions & 16 deletions lib/screens/OnBoardView.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class _TimetableViewState extends State<TimetableView> {
int _minAttendance = 0;
String _startDate = DateFormat("yyyy-MM-dd").format(DateTime.now());
String _endDate =
DateFormat("yyyy-MM-dd").format(DateTime.now().add(Duration(days: 30)));
DateFormat("yyyy-MM-dd").format(DateTime.now().add(const Duration(days: 30)));
bool _isShared = false;
late List<dynamic> _presets = [];

Expand Down Expand Up @@ -65,9 +65,9 @@ class _TimetableViewState extends State<TimetableView> {

@override
Widget build(BuildContext context) {
final Color bgColor = const Color(0xFF121212);
final Color cardColor = const Color(0xFF1E1E1E);
final Color textColor = Colors.white;
const Color bgColor = Color(0xFF121212);
const Color cardColor = Color(0xFF1E1E1E);
const Color textColor = Colors.white;

return Scaffold(
backgroundColor: bgColor,
Expand Down Expand Up @@ -95,12 +95,12 @@ class _TimetableViewState extends State<TimetableView> {
value: preset['id'],
child: Text(
preset['name'],
style: TextStyle(color: Colors.black),
style: const TextStyle(color: Colors.black),
),
);
}).toList(),
hint: const Text('Timetable Presets',
style: TextStyle(color: Colors.black)),
style: TextStyle(color: Colors.white)),
onChanged: (value) {
showDialog(
context: context,
Expand Down Expand Up @@ -143,13 +143,13 @@ class _TimetableViewState extends State<TimetableView> {
TextField(
style: const TextStyle(color: Colors.white),
onChanged: (timeTableName) => _timeTableName = timeTableName,
decoration: InputDecoration(
decoration: const InputDecoration(
hintText: 'Timetable Name',
hintStyle: const TextStyle(color: Colors.white24),
hintStyle: TextStyle(color: Colors.white24),
border: OutlineInputBorder(),
filled: true,
fillColor: cardColor,
focusedBorder: const OutlineInputBorder(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.green),
),
),
Expand All @@ -168,13 +168,13 @@ class _TimetableViewState extends State<TimetableView> {
},
keyboardType: TextInputType.number,
style: const TextStyle(color: Colors.white),
decoration: InputDecoration(
decoration: const InputDecoration(
hintText: 'Minimum Attendance %',
border: OutlineInputBorder(),
hintStyle: const TextStyle(color: Colors.white24),
hintStyle: TextStyle(color: Colors.white24),
filled: true,
fillColor: cardColor,
focusedBorder: const OutlineInputBorder(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.green),
),
),
Expand All @@ -199,11 +199,11 @@ class _TimetableViewState extends State<TimetableView> {
}
},
child: InputDecorator(
decoration: InputDecoration(
decoration: const InputDecoration(
labelText: 'Start Date',
filled: true,
fillColor: cardColor,
border: const OutlineInputBorder(),
border: OutlineInputBorder(),
),
child: Text(
_startDate,
Expand All @@ -230,11 +230,11 @@ class _TimetableViewState extends State<TimetableView> {
}
},
child: InputDecorator(
decoration: InputDecoration(
decoration: const InputDecoration(
labelText: 'End Date',
filled: true,
fillColor: cardColor,
border: const OutlineInputBorder(),
border: OutlineInputBorder(),
),
child: Text(
_endDate,
Expand Down
56 changes: 38 additions & 18 deletions lib/screens/Status/status_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@ import 'package:bunk_mate/controllers/status/status_controller.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:intl/intl.dart';
import 'package:line_icons/line_icons.dart';
import 'package:intl/intl.dart';

class StatusView extends StatelessWidget {
final StatusController controller =
Get.put(StatusController(apiUrl: 'https://api.bunkmate.college'));
final Color bgColor = Color(0xFF121212);
final Color cardColor = Color(0xFF1E1E1E);
final Color accentColor = Color(0xFF4CAF50);
final Color bgColor = const Color(0xFF121212);
final Color cardColor = const Color(0xFF1E1E1E);
final Color accentColor = const Color(0xFF4CAF50);
final Color textColor = Colors.white;
final Color secondaryTextColor = Colors.white70;

StatusView({super.key});

@override
Widget build(BuildContext context) {
controller.getStatus();
Expand All @@ -24,12 +26,26 @@ class StatusView extends StatelessWidget {
backgroundColor: bgColor,
elevation: 0,
actions: [
Padding(padding: EdgeInsets.only(left: 25),child:
Text(
controller.days[controller.selectedDate.value.weekday].toString(),
style: TextStyle(color: secondaryTextColor, fontSize: 30,fontWeight: FontWeight.bold,fontFamily: GoogleFonts.lexend().fontFamily),
)),
Spacer(),
Padding(
padding: const EdgeInsets.only(left: 25),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Obx(() => Text(
controller.days[controller.selectedDate.value.weekday]
.toString(),
style: TextStyle(
color: secondaryTextColor,
fontSize: 30,
fontWeight: FontWeight.bold,
fontFamily: GoogleFonts.lexend().fontFamily,
),
)),
],
),
),
const Spacer(),
_buildRewindTimeButton(context),
],
),
Expand All @@ -41,7 +57,6 @@ class StatusView extends StatelessWidget {
);
}


Widget _buildRewindTimeButton(BuildContext context) {
return Padding(
padding: const EdgeInsets.only(right: 20),
Expand All @@ -51,7 +66,7 @@ class StatusView extends StatelessWidget {
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
),
onPressed: () => controller.selectDate(context),
child: const Icon(LineIcons.calendar, size: 50, color: Colors.white),
Expand Down Expand Up @@ -87,30 +102,35 @@ class StatusView extends StatelessWidget {
BoxShadow(
color: Colors.black.withOpacity(0.1),
blurRadius: 10,
offset: Offset(0, 4),
offset: const Offset(0, 4),
),
],
),
child: ListTile(
contentPadding: EdgeInsets.symmetric(horizontal: 20, vertical: 12),
contentPadding:
const EdgeInsets.symmetric(horizontal: 20, vertical: 12),
leading: Icon(
controller.getRandomSubjectIcon(),
size: 36,
color: accentColor,
),
title: Text(
name,
style: TextStyle(color: textColor, fontSize: 18, fontWeight: FontWeight.w500),
style: TextStyle(
color: textColor, fontSize: 18, fontWeight: FontWeight.w500),
),
trailing: Container(
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 6),
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
decoration: BoxDecoration(
color: statusColor.withOpacity(0.2),
borderRadius: BorderRadius.circular(20),
),
child: Text(
status,
style: TextStyle(color: statusColor, fontSize: 14, fontWeight: FontWeight.bold),
style: TextStyle(
color: statusColor,
fontSize: 14,
fontWeight: FontWeight.bold),
),
),
),
Expand Down Expand Up @@ -183,4 +203,4 @@ class StatusView extends StatelessWidget {
),
);
}
}
}
Loading

0 comments on commit 118ecdc

Please sign in to comment.