Skip to content

Commit

Permalink
Merge pull request #80 from Pranjal2041/master
Browse files Browse the repository at this point in the history
Play Store Release v1
  • Loading branch information
Pranjal2041 authored Jan 3, 2022
2 parents a2b32b7 + 7673140 commit 1fe8c9d
Show file tree
Hide file tree
Showing 11 changed files with 72 additions and 47 deletions.
2 changes: 2 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
Expand All @@ -78,6 +79,7 @@
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/>

<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
Expand Down
Binary file modified assets/images/origami.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/origami2.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/origami3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 26 additions & 24 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import 'package:IITDAPP/values/colors/colors.dart';
import 'package:IITDAPP/values/colors/darkColors.dart';
import 'package:IITDAPP/push_notifications.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/services.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';

// import 'package:global_configuration/global_configuration.dart';
Expand Down Expand Up @@ -45,30 +46,31 @@ void main() async {
await dotenv.load(fileName: ".env");
initializeAnalytics();

runApp(MultiProvider(providers: [
ChangeNotifierProvider(
create: (_) => NewsProvider<TrendingNews>(),
),
ChangeNotifierProvider(
create: (_) => NewsProvider<RecentNews>(),
),
ChangeNotifierProvider(
create: (_) => NewsProvider<OldNews>(),
),
ChangeNotifierProvider(
create: (_) => AttendanceProvider(),
),
ChangeNotifierProvider(
create: (_) => NewsHistoryProvider(),
),
ChangeNotifierProvider<ThemeModel>(
create: (_) => ThemeModel(),
),
ChangeNotifierProvider(
create: (_) => EventsTabProvider(),
),
ChangeNotifierProvider(create: (_) => LoginStateProvider()),
], child: MyApp()));
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp])
.then((value) => runApp(MultiProvider(providers: [
ChangeNotifierProvider(
create: (_) => NewsProvider<TrendingNews>(),
),
ChangeNotifierProvider(
create: (_) => NewsProvider<RecentNews>(),
),
ChangeNotifierProvider(
create: (_) => NewsProvider<OldNews>(),
),
ChangeNotifierProvider(
create: (_) => AttendanceProvider(),
),
ChangeNotifierProvider(
create: (_) => NewsHistoryProvider(),
),
ChangeNotifierProvider<ThemeModel>(
create: (_) => ThemeModel(),
),
ChangeNotifierProvider(
create: (_) => EventsTabProvider(),
),
ChangeNotifierProvider(create: (_) => LoginStateProvider()),
], child: MyApp())));
}

class MyApp extends StatelessWidget {
Expand Down
8 changes: 4 additions & 4 deletions lib/modules/calendar/screens/AppointmentEditor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ class AppointmentEditorState extends State<AppointmentEditor> {
? const Text('')
: FloatingActionButton(
onPressed: () async {
// Dlete the Given Appointment
// Delete the Given Appointment
var isExternalCalendar =
_selectedAppointment.calendarId != IITDCalendarId &&
_selectedAppointment.calendarId !=
Expand All @@ -728,11 +728,11 @@ class AppointmentEditorState extends State<AppointmentEditor> {
print('User shouldnt delete this');
print('Show an appropriate Dialog and return');
// Navigator.pop(context);
showChoiceAlert(
await showChoiceAlert(
context,
'Unable to delete Event',
'The event was added from external calendar, cannot be deleted from this App!!! You can still delete the event in your device\'s default calendar.',
UrlHandler.launchInBrowser);
'The event was added from external calendar, cannot be deleted from this App!!! You can still delete the event in your device\'s default calendar. Do you want to open your device\'s default calendar?',
UrlHandler.launchDeviceCalendar);

Navigator.pop(context);
} else {
Expand Down
9 changes: 4 additions & 5 deletions lib/modules/dashboard/widgets/userWidgets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,24 +64,23 @@ class UserImage extends StatelessWidget {
// radius: MediaQuery.of(context).size.width / 5,
// ),
// );

bgimage ??= 'assets/images/cosmos.png';
avImage ??= 'assets/images/origami.png';
avImage ??= 'assets/images/origami2.png';
//print(bgimage);
return Stack(children: [

Container(
// height: 210,
height: MediaQuery.of(context).size.height * 0.215,
width: double.infinity,
margin: EdgeInsets.fromLTRB(0, 0, 0, 10),

// color: Colors.red,
child: Image.asset(
bgimage,
//'assets/bg/1.jpg',
//backgroundimages['beach'],

fit: BoxFit.cover,
),
),
Expand Down
11 changes: 11 additions & 0 deletions lib/modules/login/casi_user.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ class CasiLogin {
var signedToken = builder.getSignedToken(signer);
secret = signedToken.toString();

// _loginURL =
// '$_serverUrl/auth/iitd?serviceURL=$_serverUrl/auth/clientVerify?q=${Uri.encodeQueryComponent(secret)}';

_loginURL =
'$_serverUrl/user/login?serviceURL=$_serverUrl/auth/clientVerify?q=${Uri.encodeQueryComponent(secret)}';
}
Expand All @@ -80,6 +83,10 @@ class CasiLogin {
});
webview.onStateChanged.listen((state) {
if (state.type == WebViewState.finishLoad) {
if (state.url.startsWith('$_serverUrl/user/login')) {
webview
.evalJavascript('document.querySelector("#iitdLogin").click()');
}
webview.resize(Rect.fromLTRB(
MediaQuery.of(context).padding.left,
MediaQuery.of(context).padding.top,
Expand All @@ -88,9 +95,13 @@ class CasiLogin {
));
}
});

webview.onUrlChanged.listen((url) async {
print('URL CHANGED: $url');

// if (url.startsWith('$_serverUrl/user/login')) {
// }

if (url.startsWith('$_serverUrl/auth/clientVerify?q=')) {
if (_token != null) return;
_token = 'mutex';
Expand Down
35 changes: 23 additions & 12 deletions lib/modules/quickLinks/data/LinksData.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,50 @@ var linksData = {
LinksModel(name: 'Gradescope', url: 'https://www.gradescope.com'),
LinksModel(name: 'Piazza', url: 'https://piazza.com/'),
LinksModel(name: 'Central Library', url: 'http://library.iitd.ac.in/'),
LinksModel(name: 'Academic ERP', url: 'https://eacademics.iitd.ac.in/sportal/login'),
LinksModel(name: 'Ciriculum Info', url: 'https://home.iitd.ac.in/curriculum.php'),
LinksModel(name: 'Owncloud', url: 'https://owncloud.iitd.ac.in/nextcloud/index.php'),
LinksModel(
name: 'Academic ERP',
url: 'https://eacademics.iitd.ac.in/sportal/login'),
LinksModel(
name: 'Ciriculum Info', url: 'https://home.iitd.ac.in/curriculum.php'),
LinksModel(
name: 'Owncloud',
url: 'https://owncloud.iitd.ac.in/nextcloud/index.php'),
],
'Time Table': [
LinksModel(name: 'Academic Calendar', url: 'https://home.iitd.ac.in/academic-calendar.php'),
LinksModel(
name: 'Academic Calendar',
url: 'https://home.iitd.ac.in/academic-calendar.php'),
LinksModel(name: 'Exam Schedule', url: 'http://timetable.iitd.ac.in/'),
LinksModel(name: 'Time Table', url: 'http://timetable.iitd.ac.in/'),
LinksModel(name: 'List of Holidays', url: 'https://home.iitd.ac.in/uploads/IITD-133065-19-ICDN.pdf')
LinksModel(
name: 'List of Holidays',
url: 'https://home.iitd.ac.in/uploads/holidays-year-2021.pdf')
],
'Miscellaneous': [
LinksModel(name: 'Webmail', url: 'https://webmail.iitd.ac.in/roundcube/'),
LinksModel(name: 'IITD Website', url: 'https://home.iitd.ac.in/'),
LinksModel(name: 'Career Services', url: 'https://tnp.iitd.ac.in/newocs/ocs/index.php'),
LinksModel(name: 'CSC', url: 'http://www.cc.iitd.ac.in/CSC/'),
LinksModel(name: 'Smart Notice Board', url: 'http://notices.smartcampus.iitd.ac.in/'),
LinksModel(name: 'Career Services', url: 'https://ocs.iitd.ac.in/'),
LinksModel(name: 'CSC', url: 'https://csc.iitd.ac.in/'),
LinksModel(
name: 'Smart Notice Board',
url: 'http://notices.smartcampus.iitd.ac.in/'),
LinksModel(name: 'NGU', url: 'https://ngu.iitd.ac.in/'),
LinksModel(name: 'Internal Complaints Committee', url: 'http://old.iitd.ac.in/content/anti-sexual-harassment-policy'),
LinksModel(
name: 'Internal Complaints Committee',
url: 'http://old.iitd.ac.in/content/anti-sexual-harassment-policy'),
],
'Boards and Councils': [
LinksModel(name: 'SAC', url: 'http://sac.iitd.ac.in/'),
LinksModel(name: 'DoSA', url: 'http://dos.iitd.ac.in/'),
LinksModel(name: 'BSA', url: 'http://bsa-iitd.in/home/'),
LinksModel(name: 'BRCA', url: 'http://brca.iitd.ac.in/'),
LinksModel(name: 'BSP', url: 'http://bsp.iitd.ac.in/'),
LinksModel(name: 'BSP', url: 'https://www.bspiitd.com/'),
LinksModel(name: 'BHM', url: 'https://home.iitd.ac.in/bhm.php'),
LinksModel(name: 'BSW', url: 'http://bsw.iitd.ac.in/'),
],
'Health & Wellness': [
LinksModel(name: 'Hospital', url: 'http://hospital.iitd.ac.in/'),
LinksModel(name: 'Your Dost', url: 'https://yourdost.com/'),
]

};

class LinksModel {
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/settings/data/SettingsData.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var defaultsForKey = {
'showOtherCalendars': true,
'theme': 'Dark',
'avatar': 'ninja',
'bgimage': 'peachtree',
'bgimage': 'nightsky',
'showEventNotifications': true,
'showNewsNotifications': true,
'newsItemPerPage': '5',
Expand Down
2 changes: 1 addition & 1 deletion lib/values/Constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ void RNG(var randomNumber) {

var avatars = {
// 'anime': xyz,
'origami': 'assets/images/origami.png',
'origami': 'assets/images/origami3.png',
'man': 'assets/avatars/man2.jpg',
'woman': 'assets/avatars/woman2.png',
'scenery': 'assets/images/scenery.png',
Expand Down

0 comments on commit 1fe8c9d

Please sign in to comment.