Skip to content

Commit

Permalink
Merge pull request #142 from swciitg/Hacktoberfest_2023
Browse files Browse the repository at this point in the history
Hacktoberfest 2023
  • Loading branch information
Hareesh-Nandigrama authored Oct 8, 2023
2 parents 7085dae + ed44f2d commit d84b5d7
Show file tree
Hide file tree
Showing 36 changed files with 1,463 additions and 795 deletions.
Binary file added assets/images/github.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/linkedin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/outlook.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions lib/globals/class_timings.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const List<String> kmorningClasses = [
"08:00 - 08:55 AM",
"09:00 - 09:55 AM",
"10:00 - 10:55 AM",
"11:00 - 11:55 AM",
"12:00 - 12:55 PM",
//labs
"09:00 - 11:55 AM",
];

const List<String> kafternoonClasses = [
"01:00 - 01:55 PM",
"02:00 - 02:55 PM",
"03:00 - 03:55 PM",
"04:00 - 04-55 PM",
"05:00 - 05:55 PM",
//labs
"01:00 - 03:55 PM",
"02:00 - 04:55 PM",
"03:00 - 05:55 PM",
];
15 changes: 15 additions & 0 deletions lib/globals/hostels.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const List<String> khostels = [
"Kameng",
"Barak",
"Lohit",
"Brahmaputra",
"Disang",
"Manas",
"Dihing",
"Umiam",
"Siang",
"Kapili",
"Dhansiri",
"Subansiri",
"Married Scholars"
];
7 changes: 7 additions & 0 deletions lib/globals/working_days.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const Map<int, String> kworkingDays = {
0: "Monday",
1: "Tuesday",
2: "Wednesday",
3: "Thursday",
4: "Friday",
};
108 changes: 72 additions & 36 deletions lib/models/timetable/course_model.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:intl/intl.dart';
// import 'package:intl/intl.dart';

class CourseModel implements Comparable<CourseModel> {
class CourseModel /*implements Comparable<CourseModel> */ {
String? code;
String? course;
String? ltpc;
Expand All @@ -9,17 +9,23 @@ class CourseModel implements Comparable<CourseModel> {
String? venue;
String? midsem;
String? endsem;
String timing = "";
String? midsemVenue;
String? endsemVenue;
Map<String, dynamic>? timings;

CourseModel(
{this.code,
this.course,
this.ltpc,
this.slot,
this.endsem,
this.midsem,
this.instructor,
this.venue});
CourseModel({
this.code,
this.course,
this.ltpc,
this.slot,
this.endsem,
this.midsem,
this.instructor,
this.venue,
this.midsemVenue,
this.endsemVenue,
this.timings,
});

CourseModel.fromJson(Map<String, dynamic> json) {
code = json['code'];
Expand All @@ -30,6 +36,17 @@ class CourseModel implements Comparable<CourseModel> {
venue = json['venue'];
midsem = json['midsem'];
endsem = json['endsem'];
midsemVenue = json['midsemVenue'];
endsemVenue = json['endsemVenue'];
timings = (json['timings'] as Map<String, dynamic>).map(
(key, value) {
value = formatTime(value.toString().trim());
return MapEntry(
key,
value.toString(),
);
},
);
}

Map<String, dynamic> toJson() {
Expand All @@ -40,38 +57,57 @@ class CourseModel implements Comparable<CourseModel> {
data['slot'] = slot;
data['midsem'] = midsem;
data['endsem'] = endsem;
data['venue']= venue;
data['venue'] = venue;
data['instructor'] = instructor;
data['midSemVenue'] = midsemVenue;
data['endSemVenue'] = endsemVenue;
data['timings'] = timings;
return data;
}

@override
String toString() {
return "$timing : $course";
}
// @override
// String toString() {
// return "$timing : $course";
// }

// String get startTime {
// List<String> l = timing.split(' ');
// List<String> startList = [l.first, l.last];
// return startList.join(' ');
// }

String get startTime {
List<String> l = timing.split(' ');
List<String> startList = [l.first, l.last];
return startList.join(' ');
String formatTime(String time) {
var times = time.split(' - ');
List<String> ft = [];
for (var t in times) {
if (t[1] == ':') {
t = '0$t';
}
ft.add(t);
}
return ft.join(' - ');
}

CourseModel.clone(CourseModel c)
: this(
code: c.code,
course: c.course,
ltpc: c.ltpc,
slot: c.slot,
midsem: c.midsem,
endsem: c.endsem,
instructor: c.instructor,
venue: c.venue);
code: c.code,
course: c.course,
ltpc: c.ltpc,
slot: c.slot,
midsem: c.midsem,
endsem: c.endsem,
instructor: c.instructor,
venue: c.venue,
midsemVenue: c.midsemVenue,
endsemVenue: c.endsemVenue,
timings: c.timings,
);

@override
int compareTo(CourseModel other) {
DateFormat df = DateFormat.jm();
DateTime curr = df.parse(startTime);
DateTime oth = df.parse(other.startTime);
return curr.compareTo(oth);
}
// @override
// int compareTo(CourseModel other) {
// DateFormat df = DateFormat.jm();
// DateTime curr = df.parse(startTime);
// DateTime oth = df.parse(other.startTime);
// return curr.compareTo(oth);
// }
}
9 changes: 1 addition & 8 deletions lib/models/timetable/timetable_day.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,7 @@ class TimetableDay {
List<CourseModel> morning = [];
List<CourseModel> afternoon = [];

void addMorning(CourseModel c) {
// Tutorials first
if (c.timing == '08:00 - 08:55 AM') {
morning.insert(0, c);
} else {
morning.add(c);
}
}
void addMorning(CourseModel c) => morning.add(c);

void addAfternoon(CourseModel c) => afternoon.add(c);

Expand Down
50 changes: 50 additions & 0 deletions lib/pages/developer/developer_page.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import 'package:flutter/material.dart';

import 'package:onestop_dev/globals/my_colors.dart';
import 'package:onestop_dev/widgets/developer/developer_card.dart';

class DeveloperPage extends StatefulWidget {
static String id = '/developer';
const DeveloperPage({super.key});

@override
State<DeveloperPage> createState() => _DeveloperPageState();
}

class _DeveloperPageState extends State<DeveloperPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Image.asset(
'assets/images/AppLogo.png',
),
centerTitle: true,
backgroundColor: kGrey14,
),
body: Container(
color: kBackground,
child: GridView(
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
mainAxisSpacing: 30,
crossAxisSpacing: 20,
childAspectRatio: 0.64,
),
padding: const EdgeInsets.symmetric(
horizontal: 15,
vertical: 50,
),
children: List.filled(
4,
const DeveloperCard(
developerAvatarPath: 'assets/images/profile_placeholder.png', //Replace with your own image
developerName: 'Developer name', //Replace with your own name
developerPosition: 'Developer position', //Replace with your own position
),
),
),
),
);
}
}
11 changes: 5 additions & 6 deletions lib/pages/food/food_tab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:onestop_dev/models/food/restaurant_model.dart';
import 'package:onestop_dev/services/data_provider.dart';
import 'package:onestop_dev/widgets/food/favourite_dishes.dart';
import 'package:onestop_dev/widgets/food/food_search_bar.dart';
import 'package:onestop_dev/widgets/food/mess/mess_links.dart';
import 'package:onestop_dev/widgets/food/mess/mess_menu.dart';
import 'package:onestop_dev/widgets/food/outlets_filter.dart';
import 'package:onestop_dev/widgets/food/restaurant/restaurant_tile.dart';
Expand Down Expand Up @@ -34,14 +35,12 @@ class FoodTab extends StatelessWidget {
children: [
MessMenu(),
const SizedBox(height: 16),
const MessLinks(),
const SizedBox(height: 16),
const FavoriteDishes(),
const SizedBox(
height: 16,
),
const SizedBox(height: 16),
const OutletsFilter(),
const SizedBox(
height: 10,
),
const SizedBox(height: 10),
FutureBuilder<List<RestaurantModel>>(
future: DataProvider.getRestaurants(),
builder: (BuildContext context,
Expand Down
Loading

0 comments on commit d84b5d7

Please sign in to comment.