Skip to content

Commit

Permalink
♻️ Replace LaneEventsResponse to Records type
Browse files Browse the repository at this point in the history
release new version 1.3.0+35
  • Loading branch information
iqfareez committed Jul 4, 2023
1 parent c472a10 commit d9c19e0
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 67 deletions.
2 changes: 1 addition & 1 deletion Inno/setup-script.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "IIUM Schedule"
#define MyAppVersion "1.2.2.0"
#define MyAppVersion "1.3.0.0"
#define MyAppPublisher "Muhammad Fareez Iqmal"
#define MyAppURL "https://iiumschedule.iqfareez.com/"
#define MyAppExeName "iium_schedule.exe"
Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
[![Web](<https://img.shields.io/badge/WEB%20(PWA)-5a0fc8?style=for-the-badge&logo=GoogleChrome&logoColor=white>)](https://iiumschedule.web.app/#/)
[![Windows](https://img.shields.io/badge/Windows-0078D6?style=for-the-badge&logo=windows&logoColor=white)](https://iiumschedule.iqfareez.com/downloads/stable#windows)
![License](https://img.shields.io/github/license/iqfareez/iium_schedule?style=for-the-badge)
[![BuyMeACoffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-ffdd00?style=for-the-badge&logo=buy-me-a-coffee&logoColor=black)](https://www.buymeacoffee.com/iqfareez)
[![PRs Welcome](https://img.shields.io/badge/PR-welcome-brightgreen.svg?style=for-the-badge)](https://makeapullrequest.com)
[![BuyMeACoffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-ffdd00?style=for-the-badge&logo=buy-me-a-coffee&logoColor=black)](https://www.buymeacoffee.com/iqfareez)

# IIUM Schedule App

Generate a beautiful & clean IIUM Schedule quickly with automatic subject data fetching. View what courses are available to register at your fingertips.

Load timetable I-Ma'luum and your schedule is ready/ As easy as that :wink:.
Load timetable I-Ma'luum and your schedule is ready. As easy as that :wink:

<h1 align="center">
<picture>
Expand All @@ -23,15 +23,13 @@ Load timetable I-Ma'luum and your schedule is ready/ As easy as that :wink:.

Feel free to open up [issues](https://github.com/iqfareez/iium_schedule/issues) and/or submit [pull requests](https://github.com/iqfareez/iium_schedule/pulls).

<!-- For other types of contributions, kindly refer [wiki](https://github.com/iqfareez/iium_schedule/wiki). -->

More proper guides will be written soon.
Refer [Wiki/Contributing](https://github.com/iqfareez/iium_schedule/wiki/Contributing) for more info.

## Getting started

### Build the project locally

See [here](https://github.com/iqfareez/iium_schedule/wiki/Build-steps)
See [Wiki/Build](https://github.com/iqfareez/iium_schedule/wiki/Build)

### Cloud development environment

Expand Down
25 changes: 6 additions & 19 deletions lib/util/lane_events_util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class LaneEventsUtil {
required this.fontSize,
});

LaneEventsResponse laneEvents() {
({List<LaneEvents> laneEvents, int startHour, int endHour}) laneEvents() {
List<LaneEvents> laneEventsList = [];
// Find if there any subject in each day
for (var i = 1; i <= 7; i++) {
Expand Down Expand Up @@ -152,30 +152,17 @@ class LaneEventsUtil {
}
}

// TODO: Perhaps this will no longer needs when Dart's new Records are landed
return LaneEventsResponse(
laneEventsList: laneEventsList,
startHour: _startHour,
endHour: _endHour);
return (
laneEvents: laneEventsList,
startHour: _startHour,
endHour: _endHour
);
}

// int get scheduleStartHour => _startHour;
// int get scheduleEndHour => _endHour;
}

// TODO: Perhaps this will no longer needs when Dart's new Records are landed
class LaneEventsResponse {
final List<LaneEvents> laneEventsList;
final int startHour;
final int endHour;

LaneEventsResponse({
required this.laneEventsList,
required this.startHour,
required this.endHour,
});
}

class SubjectEvents {
final String title;
final String code;
Expand Down
3 changes: 1 addition & 2 deletions lib/util/schedule_share.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ class ScheduleShare {
Share.shareXFiles([xFilePath], text: scheduleTitle);
}

/// TODO: Test with Firebase functions and use it
/// TODO: Not fully implemented yet
/// TODO: Test with Firebase functions and use it (Not fully implemented yet)
static void email(String savedPath, String scheduleTitle) async {
Map<String, String> data = {"schedule_title": scheduleTitle};
var request =
Expand Down
2 changes: 1 addition & 1 deletion lib/util/screenshot_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ScreenshotWidget {
globalKey.currentContext?.findRenderObject() as RenderRepaintBoundary;
// In debug mode Android sometimes will return !debugNeedsPrint error
// TODO: this can be remove?
if (kDebugMode ? boundary.debugNeedsPaint : false) {
if (kDebugMode || boundary.debugNeedsPaint) {
print("Waiting for boundary to be painted.");
await Future.delayed(const Duration(milliseconds: 20));
}
Expand Down
24 changes: 14 additions & 10 deletions lib/views/saved_schedule/saved_schedule_layout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class _SavedScheduleLayoutState extends State<SavedScheduleLayout> {
titleSetting: snapshot.data!.subjectTitleSetting,
extraInfo: snapshot.data!.extraInfo);

LaneEventsResponse laneEventsList = LaneEventsUtil(
var laneEventsData = LaneEventsUtil(
context: context,
fontSize: snapshot.data!.fontSize,
savedSubjectList: snapshot.data!.subjects.toList())
Expand Down Expand Up @@ -358,9 +358,9 @@ class _SavedScheduleLayoutState extends State<SavedScheduleLayout> {
controller: _refreshController,
onRefresh: _onRefresh,
child: TimetableViewWidget(
startHour: laneEventsList.startHour,
endHour: laneEventsList.endHour,
laneEventsList: laneEventsList.laneEventsList,
laneEventsList: laneEventsData.laneEvents,
startHour: laneEventsData.startHour,
endHour: laneEventsData.endHour,
itemHeight: snapshot.data!.heightFactor,
))),
),
Expand Down Expand Up @@ -434,16 +434,20 @@ class _SavedScheduleLayoutState extends State<SavedScheduleLayout> {
case 'save':
if (!mounted) return;

var laneData = LaneEventsUtil(
context: context,
fontSize: schedule!.fontSize,
savedSubjectList: schedule.subjects.toList())
.laneEvents();

Navigator.push(
context,
MaterialPageRoute(
builder: (_) => ScheduleExportPage(
scheduleTitle: schedule!.title!,
laneEventsResponse: LaneEventsUtil(
context: context,
fontSize: schedule.fontSize,
savedSubjectList: schedule.subjects.toList())
.laneEvents(),
scheduleTitle: schedule.title!,
laneEventsList: laneData.laneEvents,
startHour: laneData.startHour,
endHour: laneData.endHour,
itemHeight: schedule.heightFactor),
),
);
Expand Down
19 changes: 11 additions & 8 deletions lib/views/saved_schedule/schedule_export_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import 'dart:io';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_timetable_view/flutter_timetable_view.dart';
import 'package:fluttertoast/fluttertoast.dart';

import '../../util/lane_events_util.dart';
import '../../util/my_ftoast.dart';
import '../../util/schedule_share.dart';
import '../../util/screenshot_widget.dart';
Expand All @@ -13,10 +13,14 @@ import '../scheduler/schedule_view/timetable_view_widget.dart';
class ScheduleExportPage extends StatefulWidget {
const ScheduleExportPage(
{super.key,
required this.laneEventsResponse,
required this.scheduleTitle,
required this.itemHeight});
final LaneEventsResponse laneEventsResponse;
required this.itemHeight,
required this.laneEventsList,
required this.startHour,
required this.endHour});
final List<LaneEvents> laneEventsList;
final int startHour;
final int endHour;
final double itemHeight;
final String scheduleTitle;

Expand Down Expand Up @@ -63,10 +67,9 @@ class _ScheduleExportPageState extends State<ScheduleExportPage> {
child: ClipRect(
// cliprect to remove schedule 'leaking' out of the container
child: TimetableViewWidget(
startHour: widget.laneEventsResponse.startHour,
endHour: widget.laneEventsResponse.endHour,
laneEventsList:
widget.laneEventsResponse.laneEventsList,
startHour: widget.startHour,
endHour: widget.endHour,
laneEventsList: widget.laneEventsList,
itemHeight: widget.itemHeight + 4,
),
),
Expand Down
7 changes: 3 additions & 4 deletions lib/views/scheduler/schedule_view/schedule_layout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,9 @@ class _ScheduleLayoutState extends State<ScheduleLayout> {
navigator.push(
MaterialPageRoute(
builder: (_) => ScheduleExportPage(
laneEventsResponse: LaneEventsResponse(
laneEventsList: laneEventsList,
startHour: _startHour,
endHour: _endHour),
laneEventsList: laneEventsList,
startHour: _startHour,
endHour: _endHour,
scheduleTitle: name,
itemHeight: _itemHeight),
),
Expand Down
23 changes: 9 additions & 14 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ packages:
albiruni:
dependency: "direct main"
description:
name: albiruni
sha256: "35506039256df62e841d052ab98da2ed25cd706b6a9b6dee28aafedfff36b587"
url: "https://pub.dev"
source: hosted
path: "../../Dart App/albiruni"
relative: true
source: path
version: "1.3.0"
analyzer:
dependency: transitive
Expand Down Expand Up @@ -344,11 +343,9 @@ packages:
flutter_timetable_view:
dependency: "direct main"
description:
path: "."
ref: "0486b731669a055b2c5d4924a0d2228f5e2968f7"
resolved-ref: "0486b731669a055b2c5d4924a0d2228f5e2968f7"
url: "https://github.com/iqfareez/flutter_timetable_view.git"
source: git
path: "../Experiments/flutter_timetable_view"
relative: true
source: path
version: "0.3.0"
flutter_web_plugins:
dependency: transitive
Expand Down Expand Up @@ -831,11 +828,9 @@ packages:
recase:
dependency: "direct main"
description:
path: "."
ref: HEAD
resolved-ref: "1e9c25cdf4828ce9d66430e4cd4deab6102e5722"
url: "https://github.com/iqfareez/recase.git"
source: git
path: "../../Dart App/recase"
relative: true
source: path
version: "4.0.5"
share_plus:
dependency: "direct main"
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# When changing this version, also change the versions in
# - msix block (msix_version)
# - Inno setup (MyAppVersion)
version: 1.2.2+34
version: 1.3.0+35

environment:
sdk: ">=3.0.0 <4.0.0"
Expand Down Expand Up @@ -111,7 +111,7 @@ msix_config:
display_name: IIUM Schedule
publisher_display_name: Muhammad Fareez Iqmal
identity_name: fareez.flutter.iiumschedule
msix_version: 1.2.2.0 # same as inno setup (MyAppVersion)
msix_version: 1.3.0.0 # same as inno setup (MyAppVersion)
logo_path: ".\\assets\\logo\\app-logo.png"
capabilities: "internetClient"
certificate_path: ".\\windows\\CERTIFICATE.pfx"
Expand Down

0 comments on commit d9c19e0

Please sign in to comment.