Skip to content

Commit

Permalink
v3.5 (#151)
Browse files Browse the repository at this point in the history
* add flutter-plugin-dependencies

* Store v3.0 (#131)

* Test CD (#66)

* Update SCS to ICS, Link in notification (#65)

* Add Link in Notifications

* Update README.md

* Update README.md

* Update README.md

* Store (#68)

* Update SCS to ICS, Link in notification (#65)

* Add Link in Notifications

* Update README.md

* Update README.md

* Store (#67)

* Test CD (#66)

* Update SCS to ICS, Link in notification (#65)

* Add Link in Notifications

* Update README.md

* Update README.md

* Update README.md

* Update for Store Release

* Test for Store (#130)

* Store (#129)

* Test CD (#66)

* Update SCS to ICS, Link in notification (#65)

* Add Link in Notifications

* Update README.md

* Update README.md

* Update README.md

* Store (#68)

* Update SCS to ICS, Link in notification (#65)

* Add Link in Notifications

* Update README.md

* Update README.md

* Store (#67)

* Test CD (#66)

* Update SCS to ICS, Link in notification (#65)

* Add Link in Notifications

* Update README.md

* Update README.md

* Update README.md

* Update for Store Release

* Fix conflicts

* Update Version for Store

* Fix Adaptive & Legacy Icon Issue (#132)

* Fixed Adaptive & Legacy Icon Issue

Deleted Previous Icons

* Updated GitIgnore

* Configure notification channels (#134)

* Fixes 2/3 of #86

- Subscribed Academic, Academics. academic, academics Notifications Channel.
- Subscribed Others, Other, other, others Notification Channel.
- Stored Device Tokens in Firestore.

* Refactoring and Removing unused import

* Routed Setting Page and Improved Drawer's Design

* Fixed #86

* Shifted Firestore Token Writes to UserData.dart

And Did the changes Requested.

* Temporary Fix for Launch URL (#139)

Downgraded SdkVersion to 29

* Made Important Documents Dynamic (#141)

Fixes #76

* Delete daily record (#142)

* adding .vscode to .gitignore

* Appointment Screen Freeze fix (#143)

Co-authored-by: Chinmay Kabi <[email protected]>

* fixed hard coded text issue on timetable card

* Chat support for freshers (#147)

* Appointment Screen Freeze fix

* Live chat enabled

Co-authored-by: Chinmay Kabi <[email protected]>

* Timetable selector text fix

* Fix for Fresher Release 2020 (#149)

Fix Chat Remote Config
Fix SharedPref not loading after app force-close
Fix Attendance Tracker Section non-persistence

* Add DSC Social Links in Dev Info (#150)

Fixes #148

* Update version to 3.5 and 35

* Add new features from v3.5 to Readme

Co-authored-by: Sriram Patibanda <[email protected]>
Co-authored-by: Abhibhaw Asthana <[email protected]>
Co-authored-by: Astha Nayak <[email protected]>
Co-authored-by: Chinmay Kabi <[email protected]>
Co-authored-by: Chinmay Kabi <[email protected]>
Co-authored-by: SriramPatibanda <[email protected]>
Former-commit-id: 1568b6e
  • Loading branch information
7 people committed Dec 3, 2020
1 parent 0cfcacc commit f72c58e
Show file tree
Hide file tree
Showing 45 changed files with 588 additions and 266 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ scp/ios/Flutter/flutter_export_environment.sh
.idea/
.github/
scp/android/encodedOutputFileName
scp/.flutter-plugins-dependencies
.vscode/
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ Your appreciation makes us grow and glow up. ⭐
- Timetable selector
- Manage your mentors
- Get Notifications
- Attendance Tracker
- Freshers Chat Support

## Contributors ✨

Expand Down
1 change: 0 additions & 1 deletion scp/.flutter-plugins-dependencies

This file was deleted.

8 changes: 4 additions & 4 deletions scp/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ if (flutterRoot == null) {

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
//if (flutterVersionCode == null) {
flutterVersionCode = '30'
flutterVersionCode = '35'
//}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
//if (flutterVersionName == null) {
flutterVersionName = '3.0'
flutterVersionName = '3.5'
//}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
Expand All @@ -31,7 +31,7 @@ if (keystorePropertiesFile.exists()) {
}

android {
compileSdkVersion 30
compileSdkVersion 29

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -45,7 +45,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "in.ac.nitrkl.scp.scp"
minSdkVersion 21
targetSdkVersion 30
targetSdkVersion 29
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
3 changes: 2 additions & 1 deletion scp/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
<application
android:name="io.flutter.app.FlutterApplication"
android:label="ICS NIT Rourkela"
android:icon="@mipmap/launcher_icon">
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round">
<meta-data
android:name="flutterEmbedding"
android:value="2" />
Expand Down
Binary file modified scp/android/app/src/main/ic_launcher-playstore.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 modified scp/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified scp/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.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 not shown.
Binary file modified scp/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified scp/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.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 not shown.
Binary file modified scp/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified scp/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.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 not shown.
Binary file modified scp/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified scp/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
135 changes: 97 additions & 38 deletions scp/lib/HomePage.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import 'package:firebase_remote_config/firebase_remote_config.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:scp/utils/chatArgs.dart';
import 'package:scp/utils/routes.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:scp/utils/sizeConfig.dart';
Expand All @@ -25,6 +28,9 @@ class _HomePageState extends State<HomePage> {
String username = " ", rollNo = " ", phoneNo = " ";
DatabaseReference slotsRefMain;
final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
RemoteConfig remoteConfig;
bool isChat = false;
String chatUrl;

static const platform = const MethodChannel("FAQ_ACTIVITY");

Expand Down Expand Up @@ -84,6 +90,7 @@ class _HomePageState extends State<HomePage> {
],
)),
Expanded(
flex: 4,
child: Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
Expand All @@ -99,6 +106,28 @@ class _HomePageState extends State<HomePage> {
fontFamily: 'PfDin'),
),
),
ListTile(
onTap: () {
Navigator.pushNamed(context, Routes.rNots);
},
title: Text(
"Notifications",
style: TextStyle(
fontSize: SizeConfig.drawerItemTextSize,
fontFamily: 'PfDin'),
),
),
ListTile(
onTap: () {
Navigator.of(context).pushNamed(Routes.rSettings);
},
title: Text(
"Settings",
style: TextStyle(
fontSize: SizeConfig.drawerItemTextSize,
fontFamily: 'PfDin'),
),
),
ListTile(
onTap: () {
Navigator.pushNamed(context, Routes.rAboutScp);
Expand Down Expand Up @@ -136,29 +165,30 @@ class _HomePageState extends State<HomePage> {
),
),
Expanded(
flex: 2,
child: Align(
alignment: Alignment.center,
child: ButtonTheme(
minWidth: SizeConfig.screenWidth * 0.463,
height: SizeConfig.screenWidth * 0.093,
child: RaisedButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.0)),
color: Color.fromRGBO(25, 39, 45, 1),
onPressed: () {
_removeUserData(context);
},
child: Text(
"Log Out",
style: TextStyle(
fontWeight: FontWeight.w400,
fontFamily: 'PfDin',
color: Colors.white,
fontSize: SizeConfig.screenWidth * 0.046),
alignment: Alignment.center,
child: ButtonTheme(
minWidth: SizeConfig.screenWidth * 0.463,
height: SizeConfig.screenWidth * 0.093,
child: RaisedButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.0)),
color: Color.fromRGBO(25, 39, 45, 1),
onPressed: () {
_removeUserData(context);
},
child: Text(
"Log Out",
style: TextStyle(
fontWeight: FontWeight.w400,
fontFamily: 'PfDin',
color: Colors.white,
fontSize: SizeConfig.screenWidth * 0.046),
),
),
),
),
),
))
))
],
)),
appBar: AppBar(
Expand All @@ -173,19 +203,25 @@ class _HomePageState extends State<HomePage> {
onPressed: () => _scaffoldKey.currentState.openDrawer()),
),
actions: <Widget>[
IconButton(
padding: EdgeInsets.only(
top: SizeConfig.screenWidth * 0.048,
right: SizeConfig.screenWidth * 0.06),
icon: Icon(
Icons.notifications,
color: Colors.black,
size: 35.0,
),
onPressed: () {
Navigator.pushNamed(context, Routes.rNots);
},
)
(snap.connectionState != ConnectionState.waiting ||
snap.connectionState != ConnectionState.waiting)
? (isChat
? IconButton(
padding: EdgeInsets.only(
top: SizeConfig.screenWidth * 0.048,
right: SizeConfig.screenWidth * 0.06),
icon: Icon(
Icons.chat,
color: Colors.black,
size: 35.0,
),
onPressed: () {
Navigator.pushNamed(context, Routes.rChat,
arguments: ChatArguments(chatUrl));
},
)
: Container())
: Container(),
],
backgroundColor: Colors.white,
elevation: 0,
Expand Down Expand Up @@ -226,6 +262,7 @@ class _HomePageState extends State<HomePage> {

_removeUserData(BuildContext context) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
prefs.getKeys();
prefs.clear();
await firebaseInstance.signOut();
Navigator.of(context).pushNamedAndRemoveUntil(
Expand Down Expand Up @@ -269,15 +306,14 @@ class _HomePageState extends State<HomePage> {
// print(e.message);
// }
// }

FirebaseMessaging _fcm = new FirebaseMessaging();

@override
void initState() {
super.initState();
DateConfig().init();
fetchUserData(context);
reset();
_fcm.subscribeToTopic('ics-not');
_fcm.subscribeToTopic('academic');
_fcm.configure(
onMessage: (Map<String, dynamic> message) async {
Navigator.pushNamed(context, Routes.rNots);
Expand Down Expand Up @@ -306,11 +342,34 @@ class _HomePageState extends State<HomePage> {

Future fetchUserData(BuildContext context) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
prefs.getKeys();
remoteConfig = await RemoteConfig.instance;
remoteConfig.setConfigSettings(RemoteConfigSettings(debugMode: true));
try {
await remoteConfig.fetch(expiration: const Duration(seconds: 0));
await remoteConfig.activateFetched();
isChat = remoteConfig.getBool('is_chat_active');
chatUrl = remoteConfig.getString('chatLink');
await prefs.setBool('is_chat_active', isChat);
await prefs.setString('chatLink', chatUrl);
} on FetchThrottledException catch (exception) {
isChat = prefs.getBool('is_chat_active');
chatUrl = prefs.getString('chatLink');
// Fetch throttled.
print(exception);
} catch (exception) {
isChat = prefs.getBool('is_chat_active');
chatUrl = prefs.getString('chatLink');
}

isChat = remoteConfig.getBool('is_chat_active');
chatUrl = remoteConfig.getString('chatLink');
username = prefs.getString('username');
rollNo = prefs.getString('roll_no');
phoneNo = prefs.getString('phone_no');
prefs.setBool('hasBooked', prefs.getBool('hasBooked') ?? false);
await prefs.setBool('hasBooked', prefs.getBool('hasBooked') ?? false);
print(username + rollNo + phoneNo);
reset();
}

_launchURL() async {
Expand Down
Loading

0 comments on commit f72c58e

Please sign in to comment.