Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 22 additions & 43 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,46 +1,26 @@
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

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))
}
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

android {
compileSdkVersion 33
namespace "com.channeli.img.placementonline"
compileSdk flutter.compileSdkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = '1.8'
jvmTarget = JavaVersion.VERSION_11.toString()
}

sourceSets {
Expand All @@ -52,13 +32,12 @@ android {
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.channeli.img.placementonline"
minSdkVersion 16
targetSdkVersion 31
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutter.versionCode
versionName flutter.versionName
// testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

signingConfigs {
Expand All @@ -83,8 +62,8 @@ flutter {
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
// implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
// testImplementation 'junit:junit:4.12'
// androidTestImplementation 'androidx.test:runner:1.1.1'
// androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}
3 changes: 1 addition & 2 deletions android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.placement">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
18 changes: 16 additions & 2 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.placement">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
Expand Down Expand Up @@ -31,4 +30,19 @@
android:name="flutterEmbedding"
android:value="2" />
</application>
<queries>
<!-- Required to query activities that can process text, see:
https://developer.android.com/training/package-visibility and
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.

In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
<intent>
<action android:name="android.intent.action.PROCESS_TEXT"/>
<data android:mimeType="text/plain"/>
</intent>
<intent>
<action android:name="android.intent.action.VIEW"/>
<data android:scheme="https"/>
</intent>
</queries>
</manifest>
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
package com.example.placement
package com.channeli.img.placementonline

import androidx.annotation.NonNull;
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugins.GeneratedPluginRegistrant

class MainActivity: FlutterActivity() {
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
GeneratedPluginRegistrant.registerWith(flutterEngine);
}
}
class MainActivity: FlutterActivity()
21 changes: 4 additions & 17 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,7 @@
buildscript {
ext.kotlin_version = '1.6.10'
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}

Expand All @@ -26,6 +13,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
delete rootProject.buildDir
}
tasks.register("clean", Delete) {
delete rootProject.layout.buildDirectory
}
3 changes: 1 addition & 2 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true
android.enableJetifier=true
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip
30 changes: 20 additions & 10 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
include ':app'
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()

def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

def plugins = new Properties()
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
if (pluginsFile.exists()) {
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

plugins.each { name, path ->
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
include ":$name"
project(":$name").projectDir = pluginDirectory
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.9.1" apply false
id "org.jetbrains.kotlin.android" version "2.1.0" apply false
}

include ":app"
32 changes: 32 additions & 0 deletions ios/Flutter/ephemeral/flutter_lldb_helper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#
# Generated file, do not edit.
#

import lldb

def handle_new_rx_page(frame: lldb.SBFrame, bp_loc, extra_args, intern_dict):
"""Intercept NOTIFY_DEBUGGER_ABOUT_RX_PAGES and touch the pages."""
base = frame.register["x0"].GetValueAsAddress()
page_len = frame.register["x1"].GetValueAsUnsigned()

# Note: NOTIFY_DEBUGGER_ABOUT_RX_PAGES will check contents of the
# first page to see if handled it correctly. This makes diagnosing
# misconfiguration (e.g. missing breakpoint) easier.
data = bytearray(page_len)
data[0:8] = b'IHELPED!'

error = lldb.SBError()
frame.GetThread().GetProcess().WriteMemory(base, data, error)
if not error.Success():
print(f'Failed to write into {base}[+{page_len}]', error)
return

def __lldb_init_module(debugger: lldb.SBDebugger, _):
target = debugger.GetDummyTarget()
# Caveat: must use BreakpointCreateByRegEx here and not
# BreakpointCreateByName. For some reasons callback function does not
# get carried over from dummy target for the later.
bp = target.BreakpointCreateByRegex("^NOTIFY_DEBUGGER_ABOUT_RX_PAGES$")
bp.SetScriptCallbackFunction('{}.handle_new_rx_page'.format(__name__))
bp.SetAutoContinue(True)
print("-- LLDB integration loaded --")
5 changes: 5 additions & 0 deletions ios/Flutter/ephemeral/flutter_lldbinit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#
# Generated file, do not edit.
#

command script import --relative-to-command-file flutter_lldb_helper.py
31 changes: 25 additions & 6 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,22 +1,41 @@
import 'package:flutter/material.dart';
import 'package:placement/locator.dart';
import 'package:placement/resources/R.dart';
import 'package:placement/services/routing/placement_routes.dart';

void main() {
import 'locator.dart';
import 'resources/R.dart';
import 'services/routing/placement_routes.dart';
import 'services/auth/auth_service.dart';

void main() async {
// TODO: Look for more consistent method that prevent race condition when phone is sleeping
await AuthService().initState();
setupLocator();
runApp(MyApp());
}

class MyApp extends StatelessWidget {
const MyApp({Key key}) : super(key: key);
const MyApp({super.key});

@override
Widget build(BuildContext context) {
return MaterialApp(
theme: Theme.of(context).copyWith(
primaryColor: R.primaryCol,
appBarTheme: AppBarTheme(backgroundColor: R.primaryCol),
appBarTheme: AppBarTheme(
backgroundColor: R.primaryCol,
foregroundColor: Colors.white,
),
floatingActionButtonTheme: FloatingActionButtonThemeData(
backgroundColor: R.primaryCol,
foregroundColor: Colors.white,
),
radioTheme: RadioThemeData(
fillColor: WidgetStateColor.resolveWith((states) => R.textColSecondary),
),
textButtonTheme: TextButtonThemeData(
style: TextButton.styleFrom(
foregroundColor: R.textColSecondary
)
)
),
title: 'Placement',
initialRoute: '/',
Expand Down
8 changes: 4 additions & 4 deletions lib/models/BranchRequirementModel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import 'package:placement/models/DepartmentModel.dart';

class BranchRequirementModel {

int id;
String code,
int? id;
String? code,
name;
DegreeModel degree;
DepartmentModel department;
DegreeModel? degree;
DepartmentModel? department;

BranchRequirementModel({
this.code,
Expand Down
4 changes: 2 additions & 2 deletions lib/models/CompanyDetailModel.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class CompanyDetailModel {
int id;
String sector,
int? id;
String? sector,
name,
email,
website,
Expand Down
4 changes: 2 additions & 2 deletions lib/models/DegreeModel.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class DegreeModel {
int id;
String code,
int? id;
String? code,
name,
graduation;

Expand Down
4 changes: 2 additions & 2 deletions lib/models/DepartmentModel.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class DepartmentModel {
int id;
String code,
int? id;
String? code,
name;

DepartmentModel({
Expand Down
Loading