Skip to content

Commit

Permalink
added CIE marks
Browse files Browse the repository at this point in the history
  • Loading branch information
WaniAthar committed Mar 25, 2023
1 parent eab18ab commit a62abe9
Show file tree
Hide file tree
Showing 16 changed files with 257 additions and 120 deletions.
28 changes: 21 additions & 7 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}


android {
compileSdkVersion 33
ndkVersion flutter.ndkVersion
Expand Down Expand Up @@ -53,13 +60,20 @@ android {
versionName flutterVersionName
}

buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}

}

flutter {
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
package="com.athar.attendance">
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:label="attendance"
android:label="Attendd"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
package com.athar.attendance

import android.view.WindowManager.LayoutParams
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.embedding.android.FlutterActivity

class MainActivity: FlutterActivity() {
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
window.addFlags(LayoutParams.FLAG_SECURE)
super.configureFlutterEngine(flutterEngine)
}
}
Binary file modified 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.
Binary file modified 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.
Binary file modified 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.
Binary file modified 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.
Binary file modified 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.
Binary file modified assets/images/athar.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/github.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 33 additions & 1 deletion lib/api/attendance_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,37 @@ import 'package:shared_preferences/shared_preferences.dart';
import 'dart:convert';

class API extends ChangeNotifier {
// your api here
String? usn;
String? yyyy;
String? mm;
String? dd;
String? dob;
String? url;
dynamic personalData, attendanceData;
bool isDataFetched = false;
// these variables are for the communication of FutureBuilders in multiple screens
bool fetchErr = false;

void getSharedPref() async {
SharedPreferences pref = await SharedPreferences.getInstance();
usn = pref.getString('usn');
yyyy = pref.getString('yyyy');
mm = pref.getString('mm');
dd = pref.getString('dd');
dob = '$yyyy-$mm-$dd';
}

// split the full name into first name and last name
String fullNameSplit(String name) {
List<String> nameList = name.split(" ");
if (nameList.length > 2) {
return "${nameList.first} ${nameList.last}";
}
return name;
}
// add dummy data
personalData = {"name":"John Doe", "usn":"01fe20bbb043"};
attendanceData =[{"cie_marks":"20/20","course_attendance":"55%","course_code":"20ECSk303","course_name":"Computer Networks-2","course_teacher":"John Doe"},{"cie_marks":"15/15","course_attendance":"93%","course_code":"20ECKC305","course_name":"Distributed & Cloud Computing","course_teacher":"Mark Henry"},{"cie_marks":"0/0","course_attendance":"0%","course_code":"16EHUC301","course_name":"PA & LR","course_teacher":"Albert Einstein"},{"cie_marks":"0/0","course_attendance":"75%","course_code":"20EOSP305","course_name":"Computer Networks Lab","course_teacher":"Newton"},{"cie_marks":"0/0","course_attendance":"0%","course_code":"15EPSW302","course_name":"Minor Project","course_teacher":"Tim Cook"},{"cie_marks":"0/0","course_attendance":"73%","course_code":"20ECSK307","course_name":"Blockchain and Distributed Ledgers","course_teacher":"Shimsuke Nakamura"},{"cie_marks":"20/20","course_attendance":"39%","course_code":"19ELSE303","course_name":"Semantic Web","course_teacher":"Tim Lee"},{"cie_marks":"0/0","course_attendance":"0%","course_code":"17PCSE307","course_name":"Parallel Computing","course_teacher":"Messi"},{"cie_marks":"0/0","course_attendance":"0%","course_code":"22EMSH302","course_name":"Industry Readiness and Leadership Skills","course_teacher":"Kabir singh"}]
isDataFetched = true;
notifyListeners();
}
139 changes: 93 additions & 46 deletions lib/developer.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:url_launcher/url_launcher_string.dart';

class AboutDev extends StatelessWidget {
const AboutDev({super.key});
Expand All @@ -11,6 +13,7 @@ class AboutDev extends StatelessWidget {
Size size = MediaQuery.of(context).size;
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.orange,
elevation: 0,
title: Text(
"About Developer",
Expand Down Expand Up @@ -86,58 +89,102 @@ class AboutDev extends StatelessWidget {
fontWeight: FontWeight.bold),
),
const SizedBox(
height: 30,
height: 20,
),
Text(
"Make a contribution",
style: GoogleFonts.poppins(
color: Colors.white,
fontSize: 15,
),
),
// const Image(
// image: AssetImage("assets/images/sign.png"),
// height: 150,
// ),
Text("Found a bug?",
style: GoogleFonts.poppins(color: Colors.white)),
SizedBox(
child: IconButton(
onPressed: () async {
if (await launchUrl(Uri.parse(
"mailto:[email protected]?subject=Bug Report&body=Hi Athar, I found a bug in your app."))) {
// snackbar
true;
} else {
// snackbar
// ignore: use_build_context_synchronously
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text("Couldn't launch mail app"),
duration: Duration(seconds: 2),
),
);
}
},
tooltip: "Let's kill the bug",
icon: const Icon(
Icons.bug_report_outlined,
color: Colors.white,
size: 30,
grade: 1,
)),
height: size.height * 0.01,
),

// Container(
// height: size.height * 0.05,
// padding: const EdgeInsets.all(10),
// margin: const EdgeInsets.only(left: 50, right: 50),
// child: Text(
// "[email protected]",
// style: GoogleFonts.poppins(
// color: Colors.white,
// fontSize: 18,
// fontWeight: FontWeight.w600,
// fontStyle: FontStyle.italic,
// ),
// ),
//)
Container(
width: size.width * 0.2,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(50),
),
child: GestureDetector(
behavior: HitTestBehavior.translucent,
onTap: () async {
HapticFeedback.mediumImpact();
// if internet is not available
if (await hasNetwork()) {
await (launchUrl(Uri.parse(
"https://github.com/waniathar/kle-attendance.git")));
} else {
// ignore: use_build_context_synchronously
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text("No Internet Connection"),
backgroundColor: Colors.red,
),
);
}
},
child: const Image(
image: AssetImage("assets/images/github.png"),
),
),
),
SizedBox(
height: size.height * 0.07,
),
Text(
"Found a bug?",
style: GoogleFonts.poppins(color: Colors.white, fontSize: 12),
),
const SizedBox(
height: 10,
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(50),
// blurred colour
color: Colors.red,
),
child: IconButton(
onPressed: () async {
HapticFeedback.mediumImpact();
if (await launchUrl(Uri.parse(
"mailto:[email protected]?subject=Bug Report&body=Hi Athar, I found a bug in your app."))) {
// snackbar
true;
} else {
// snackbar
// ignore: use_build_context_synchronously
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text("Couldn't launch mail app"),
duration: Duration(seconds: 2),
),
);
}
},
tooltip: "Let's kill the bug",
icon: const Icon(
Icons.bug_report_outlined,
color: Colors.white,
size: 30,
grade: 1,
),
),
),
],
),
),
);
}

Future<bool> hasNetwork() async {
try {
final result = await InternetAddress.lookup('github.com');
return result.isNotEmpty && result[0].rawAddress.isNotEmpty;
} on SocketException catch (_) {
return false;
}
}
}
10 changes: 10 additions & 0 deletions lib/homepage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,16 @@ class HomePage extends StatelessWidget {
child: Lottie.asset(
"assets/lottieanimations/139432-person-riding-bicycle.json"),
),
// TextLiquidFill(
// text: '${api.personalData['name']}',
// textStyle: GoogleFonts.poppins(
// color: Colors.white,
// fontSize: 25,
// fontWeight: FontWeight.bold,
// ),
// waveColor: Colors.white,
// boxBackgroundColor: Colors.orange,
// ),
Text('${api.personalData['name']}',
style: GoogleFonts.poppins(
color: Colors.white,
Expand Down
3 changes: 3 additions & 0 deletions lib/input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class _InputDataState extends State<InputData> {
double deviceHeight = MediaQuery.of(context).size.height;
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.orange,
iconTheme: const IconThemeData(
color: Colors.white,
),
Expand Down Expand Up @@ -374,6 +375,7 @@ Thank you for using Attendd App!
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
appBar: AppBar(
backgroundColor: Colors.orange,
iconTheme: const IconThemeData(
Expand Down Expand Up @@ -428,6 +430,7 @@ Thank you for using Attendd App!
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
appBar: AppBar(
backgroundColor: Colors.orange,
iconTheme: const IconThemeData(
Expand Down
Loading

0 comments on commit a62abe9

Please sign in to comment.