diff --git a/android/app/build.gradle b/android/app/build.gradle index 5d3b48a..48eda73 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -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 { @@ -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 { @@ -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' } diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index 81fc411..f880684 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,4 @@ - + diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 14f6bd0..b5660f4 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,5 +1,4 @@ - + + + + + + + + + + diff --git a/android/app/src/main/kotlin/com/example/placement/MainActivity.kt b/android/app/src/main/kotlin/com/example/placement/MainActivity.kt index eaebc75..b791ad8 100644 --- a/android/app/src/main/kotlin/com/example/placement/MainActivity.kt +++ b/android/app/src/main/kotlin/com/example/placement/MainActivity.kt @@ -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() \ No newline at end of file diff --git a/android/build.gradle b/android/build.gradle index 31e9577..0800cf9 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -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() } } @@ -26,6 +13,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { - delete rootProject.buildDir -} +tasks.register("clean", Delete) { + delete rootProject.layout.buildDirectory +} \ No newline at end of file diff --git a/android/gradle.properties b/android/gradle.properties index 38c8d45..f018a61 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -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 diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index cb24abd..ac3b479 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -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 diff --git a/android/settings.gradle b/android/settings.gradle index 5a2f14f..b507b94 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -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" diff --git a/ios/Flutter/ephemeral/flutter_lldb_helper.py b/ios/Flutter/ephemeral/flutter_lldb_helper.py new file mode 100644 index 0000000..a88caf9 --- /dev/null +++ b/ios/Flutter/ephemeral/flutter_lldb_helper.py @@ -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 --") diff --git a/ios/Flutter/ephemeral/flutter_lldbinit b/ios/Flutter/ephemeral/flutter_lldbinit new file mode 100644 index 0000000..e3ba6fb --- /dev/null +++ b/ios/Flutter/ephemeral/flutter_lldbinit @@ -0,0 +1,5 @@ +# +# Generated file, do not edit. +# + +command script import --relative-to-command-file flutter_lldb_helper.py diff --git a/lib/main.dart b/lib/main.dart index 3a67321..90a6793 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -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: '/', diff --git a/lib/models/BranchRequirementModel.dart b/lib/models/BranchRequirementModel.dart index 2669189..514eb45 100644 --- a/lib/models/BranchRequirementModel.dart +++ b/lib/models/BranchRequirementModel.dart @@ -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, diff --git a/lib/models/CompanyDetailModel.dart b/lib/models/CompanyDetailModel.dart index b973d7f..293666d 100644 --- a/lib/models/CompanyDetailModel.dart +++ b/lib/models/CompanyDetailModel.dart @@ -1,6 +1,6 @@ class CompanyDetailModel { - int id; - String sector, + int? id; + String? sector, name, email, website, diff --git a/lib/models/DegreeModel.dart b/lib/models/DegreeModel.dart index 93418e8..447c9e9 100644 --- a/lib/models/DegreeModel.dart +++ b/lib/models/DegreeModel.dart @@ -1,6 +1,6 @@ class DegreeModel { - int id; - String code, + int? id; + String? code, name, graduation; diff --git a/lib/models/DepartmentModel.dart b/lib/models/DepartmentModel.dart index bf55e20..4e34d1b 100644 --- a/lib/models/DepartmentModel.dart +++ b/lib/models/DepartmentModel.dart @@ -1,6 +1,6 @@ class DepartmentModel { - int id; - String code, + int? id; + String? code, name; DepartmentModel({ diff --git a/lib/models/DetailCompanyProfileModel.dart b/lib/models/DetailCompanyProfileModel.dart index d5405e7..58a62eb 100644 --- a/lib/models/DetailCompanyProfileModel.dart +++ b/lib/models/DetailCompanyProfileModel.dart @@ -4,7 +4,7 @@ import 'package:placement/models/RoundSetModel.dart'; import 'package:placement/models/applicationModel.dart'; class DetailCompanyProfileModel { - int id, + int? id, applicationCost, packageCtcUg, packageCtcPg, @@ -13,9 +13,9 @@ class DetailCompanyProfileModel { packageBasePg, packageBasePhd, talkAbsenceCost; - CompanyDetailModel company; + CompanyDetailModel? company; dynamic application; - String name, + String? name, profileStatus, category, cgpaRequirement, @@ -27,10 +27,10 @@ class DetailCompanyProfileModel { applicationDeadline, talkDate, talkStatus; - bool requiresCoverLetter, + bool? requiresCoverLetter, talkPresenceRequired; - List branchRequirement; - final List roundSet; + List? branchRequirement; + final List? roundSet; DetailCompanyProfileModel({ this.application, this.applicationDeadline, this.category, @@ -63,7 +63,7 @@ class DetailCompanyProfileModel { } return DetailCompanyProfileModel( application: _application, - applicationCost : json['applicationCost'], + applicationCost : json['applicationCost'] ?? 0, applicationDeadline: json['applicationDeadline'] ?? "", category: json['category'] ?? "", cgpaRequirement: json['cgpaRequirement'], @@ -74,14 +74,14 @@ class DetailCompanyProfileModel { name: json['name'] ?? "", post: json['post'] ?? "", profileStatus: json['profileStatus'] ?? "", - requiresCoverLetter: json['requiresCoverLetter'], + requiresCoverLetter: json['requiresCoverLetter'] ?? false, targetCreditPool: json['targetCreditPool'] ?? "", packageCtcPg: json['packageCtcPg'], packageCtcPhd: json['packageCtcPhd'], packageCtcUg: json['packageCtcUg'], - talkAbsenceCost: json['talkAbsenceCost'], + talkAbsenceCost: json['talkAbsenceCost'] ?? 0, talkDate: json['talkDate'] ?? "", - talkPresenceRequired: json['talkPresenceRequired'] ?? "", + talkPresenceRequired: json['talkPresenceRequired'] ?? false, branchRequirement: branchList, packageDescription: json['packageDescription'] ?? "", talkStatus: json['talkStatus'] ?? "", diff --git a/lib/models/RoundSetModel.dart b/lib/models/RoundSetModel.dart index 0e717ab..d0b4e9a 100644 --- a/lib/models/RoundSetModel.dart +++ b/lib/models/RoundSetModel.dart @@ -1,7 +1,7 @@ class RoundSetModel { - final int id, profile, index; - final String name, date, time; + final int? id, profile, index; + final String? name, date, time; RoundSetModel({ this.date, diff --git a/lib/models/applicationModel.dart b/lib/models/applicationModel.dart index 0f36ec6..c274020 100644 --- a/lib/models/applicationModel.dart +++ b/lib/models/applicationModel.dart @@ -1,12 +1,12 @@ import 'package:placement/models/resumeModel.dart'; class ApplicationModel { - int id; - String status, + int? id; + String? status, profileName, profileStatus, statusDisplayName; - ResumeModel resume; + ResumeModel? resume; ApplicationModel({ this.id, diff --git a/lib/models/branchConciseModel.dart b/lib/models/branchConciseModel.dart index 915c398..9c91179 100644 --- a/lib/models/branchConciseModel.dart +++ b/lib/models/branchConciseModel.dart @@ -6,11 +6,11 @@ class BranchConciseModel { final String companyDetails; BranchConciseModel({ - this.studentDegree, - this.studentBranchName, - this.selected, - this.studentDetails, - this.companyDetails + required this.studentDegree, + required this.studentBranchName, + required this.selected, + required this.studentDetails, + required this.companyDetails }); factory BranchConciseModel.fromJson(Map _json) { diff --git a/lib/models/branchWiseStudentModel.dart b/lib/models/branchWiseStudentModel.dart index de1b92e..70631ca 100644 --- a/lib/models/branchWiseStudentModel.dart +++ b/lib/models/branchWiseStudentModel.dart @@ -1,12 +1,12 @@ class BranchWiseStudentModel { - final int studentEnrolmentNumber; + final int? studentEnrolmentNumber; final String studentName; final String companyName; BranchWiseStudentModel({ this.studentEnrolmentNumber, - this.studentName, - this.companyName + required this.studentName, + required this.companyName }); factory BranchWiseStudentModel.fromJson(Map _json) { diff --git a/lib/models/calendarEventModel.dart b/lib/models/calendarEventModel.dart index 7a77201..b238a5b 100644 --- a/lib/models/calendarEventModel.dart +++ b/lib/models/calendarEventModel.dart @@ -1,14 +1,14 @@ class CalendarEventModel { final String title, description, - dateTime, - color; + dateTime; + final String? color; CalendarEventModel({ this.color, - this.dateTime, - this.description, - this.title + required this.dateTime, + required this.description, + required this.title }); factory CalendarEventModel.fromJson(Map json) { diff --git a/lib/models/candidateModel.dart b/lib/models/candidateModel.dart index be92650..0f63c9a 100644 --- a/lib/models/candidateModel.dart +++ b/lib/models/candidateModel.dart @@ -1,20 +1,20 @@ -import 'package:placement/models/BranchRequirementModel.dart'; +import 'BranchRequirementModel.dart'; class CandidateModel { - int candidateId; - String candidateName; - int departmentId; - String departmentCode; - int degreeId; - String degreeName; - String displayPicture; - String season; - int creditsPoolA; - int creditsPoolB; - String departmentName; - int currentYear; - String internshipStatus; - BranchRequirementModel branch; + int? candidateId; + String? candidateName; + int? departmentId; + String? departmentCode; + int? degreeId; + String? degreeName; + String? displayPicture; + String? season; + int? creditsPoolA; + int? creditsPoolB; + String? departmentName; + int? currentYear; + String? internshipStatus; + BranchRequirementModel? branch; CandidateModel({ this.candidateId, @@ -36,17 +36,17 @@ class CandidateModel { factory CandidateModel.fromJson(Map json) { return CandidateModel( candidateId: json['id'], - candidateName: json['student']['person']['fullName'], + candidateName: json['student']['person']['fullName'] ?? "-", departmentId: json['student']['branch']['department']['id'], departmentCode: json['student']['branch']['department']['code'], degreeId: json['student']['branch']['degree']['id'], - degreeName: json['student']['branch']['degree']['name'], - departmentName: json['student']['branch']['department']['name'], - currentYear: json['student']['currentYear'], - internshipStatus: json['status'], - season: json['season'], - creditsPoolA: json['creditsPoolA'], - creditsPoolB: json['creditsPoolB'], + degreeName: json['student']['branch']['degree']['name'] ?? "-", + departmentName: json['student']['branch']['department']['name'] ?? "-", + currentYear: json['student']['currentYear'] ?? "-", + internshipStatus: json['status'] ?? "Closed", + season: json['season'] ?? "Not Eligible", + creditsPoolA: json['creditsPoolA'] ?? 100, + creditsPoolB: json['creditsPoolB'] ?? 0, branch: BranchRequirementModel.fromJson(json['student']['branch']) ); } diff --git a/lib/models/companyConciseModel.dart b/lib/models/companyConciseModel.dart index c90e93d..d5927c8 100644 --- a/lib/models/companyConciseModel.dart +++ b/lib/models/companyConciseModel.dart @@ -4,9 +4,9 @@ class CompanyConciseModel { final String detail; CompanyConciseModel({ - this.companyName, - this.selected, - this.detail + required this.companyName, + required this.selected, + required this.detail }); factory CompanyConciseModel.fromJson(Map _json) { diff --git a/lib/models/companyWiseStudentModel.dart b/lib/models/companyWiseStudentModel.dart index 4f2e288..9560068 100644 --- a/lib/models/companyWiseStudentModel.dart +++ b/lib/models/companyWiseStudentModel.dart @@ -1,20 +1,20 @@ class CompantWiseStudentModel { - final String studentEnrolmentNumber; + final String? studentEnrolmentNumber; final String studentName; final String studentBranchName; - final String studentDegree; - final String studentContactNo; - final String studentEmail; + final String? studentDegree; + final String? studentContactNo; + final String? studentEmail; final String hasAccepted; CompantWiseStudentModel({ this.studentEnrolmentNumber, - this.studentName, - this.studentBranchName, - this.studentDegree, + required this.studentName, + required this.studentBranchName, + required this.studentDegree, this.studentContactNo, this.studentEmail, - this.hasAccepted + required this.hasAccepted }); factory CompantWiseStudentModel.fromJson(Map _json) { diff --git a/lib/models/placement_exception.dart b/lib/models/placement_exception.dart new file mode 100644 index 0000000..4b1d983 --- /dev/null +++ b/lib/models/placement_exception.dart @@ -0,0 +1,9 @@ +class PlacementException implements Exception { + final String message; + PlacementException(this.message); + + @override + String toString() { + return 'PlacementException: $message'; + } +} \ No newline at end of file diff --git a/lib/models/profilesModel.dart b/lib/models/profilesModel.dart index fef597f..75ae041 100644 --- a/lib/models/profilesModel.dart +++ b/lib/models/profilesModel.dart @@ -2,31 +2,31 @@ import 'package:placement/models/RoundSetModel.dart'; import 'package:placement/models/applicationModel.dart'; class ProfilesModel { - final int profileId; + final int? profileId; final String name; - final int companyId; + final int? companyId; final String companyName; - final String companySector; - final String companyEmail; - final String companyDescription; - final String website; - final String applicationDeadline; + final String? companySector; + final String? companyEmail; + final String? companyDescription; + final String? website; + final String? applicationDeadline; final String status; - final bool requiresCoverLetter; + final bool? requiresCoverLetter; final application; - final List roundSet; + final List? roundSet; ProfilesModel({ this.profileId, - this.name, + required this.name, this.companyId, - this.companyName, + required this.companyName, this.companySector, this.companyEmail, this.companyDescription, this.website, this.applicationDeadline, - this.status, + required this.status, this.requiresCoverLetter, this.application, this.roundSet @@ -42,9 +42,9 @@ class ProfilesModel { } return ProfilesModel( profileId: json['id'], - name: json['name'], + name: json['name'] ?? '-', companyId: json['company']['id'], - companyName: json['company']['name'], + companyName: json['company']['name'] ?? '-', companySector: json['company']['sector'], companyEmail: json['company']['email'], companyDescription: json['company']['description'], diff --git a/lib/models/resultModel.dart b/lib/models/resultModel.dart index 6dfa0b0..4ff035f 100644 --- a/lib/models/resultModel.dart +++ b/lib/models/resultModel.dart @@ -4,8 +4,8 @@ class ResultModel { ResultModel( { - this.key, - this.value + required this.key, + required this.value } ); } \ No newline at end of file diff --git a/lib/models/resumeModel.dart b/lib/models/resumeModel.dart index 965c6fe..c8fb474 100644 --- a/lib/models/resumeModel.dart +++ b/lib/models/resumeModel.dart @@ -1,22 +1,22 @@ class ResumeModel { - int id; - String candidate; + int? id; + String? candidate; String title; - bool isDefault; + bool? isDefault; bool isVerified; dynamic interests; dynamic achievements; - String computerLanguages; - String softwarePackages; - String additionalCourses; - String minorCourses; - String languages; - String resumeUrl; + String? computerLanguages; + String? softwarePackages; + String? additionalCourses; + String? minorCourses; + String? languages; + String? resumeUrl; ResumeModel({ this.id, this.candidate, - this.title, + required this.title, this.isDefault, this.interests, this.achievements, @@ -25,7 +25,7 @@ class ResumeModel { this.additionalCourses, this.minorCourses, this.languages, - this.isVerified, + required this.isVerified, this.resumeUrl }); @@ -33,7 +33,7 @@ class ResumeModel { return ResumeModel( id: _data['id'], candidate: _data['candidate'], - title: _data['title'], + title: _data['title'] ?? "Untitled", isDefault: _data['isDefault'], interests: _data['interests'], achievements: _data['achievements'], @@ -42,7 +42,7 @@ class ResumeModel { additionalCourses: _data['additionalCourses'], minorCourses: _data['minorCourses'], languages: _data['languages'], - isVerified: _data['isVerified'] + isVerified: _data['isVerified'] ?? false ); } } \ No newline at end of file diff --git a/lib/models/selectedStudentModel.dart b/lib/models/selectedStudentModel.dart index 6697acb..de11833 100644 --- a/lib/models/selectedStudentModel.dart +++ b/lib/models/selectedStudentModel.dart @@ -1,7 +1,7 @@ class SelectedStudentModel { - final String studentName; - final String studentBranchName; - final int studentEnrolmentNumber; + final String? studentName; + final String? studentBranchName; + final int? studentEnrolmentNumber; SelectedStudentModel({ this.studentName, diff --git a/lib/models/user.dart b/lib/models/user.dart index 7a01970..97483ed 100644 --- a/lib/models/user.dart +++ b/lib/models/user.dart @@ -1,8 +1,8 @@ class User { - final String uid; - final String name; - final String sugars; - final int strength; + final String? uid; + final String? name; + final String? sugars; + final int? strength; User({this.uid,this.name,this.sugars,this.strength}); } \ No newline at end of file diff --git a/lib/models/yearModel.dart b/lib/models/yearModel.dart index 226b520..331da47 100644 --- a/lib/models/yearModel.dart +++ b/lib/models/yearModel.dart @@ -3,7 +3,7 @@ class YearModel { final String value; YearModel({ - this.key, - this.value + required this.key, + required this.value }); } \ No newline at end of file diff --git a/lib/resources/fetchedResources.dart b/lib/resources/fetchedResources.dart index 1798389..f0ed587 100644 --- a/lib/resources/fetchedResources.dart +++ b/lib/resources/fetchedResources.dart @@ -1,71 +1,62 @@ class FetchedResources { + FetchedResources._internal(); - static final FetchedResources _fetchedResources = FetchedResources.internal(); - factory FetchedResources() => _fetchedResources; + static final _instance = FetchedResources._internal(); + factory FetchedResources() => _instance; - Map _resultsBranchWise; - get resultsBranchWise => _resultsBranchWise; + final Map _resultsBranchWise = { + 'initialised': false, + 'data': null + }; + Map get resultsBranchWise => _resultsBranchWise; - Map _resultsCompanyWise; - get resultsCompanyWise => _resultsCompanyWise; + final Map _resultsCompanyWise = { + 'initialised': false, + 'data': null + }; + Map get resultsCompanyWise => _resultsCompanyWise; - Map _applyForAll; - get applyForAll => _applyForAll; + final Map _applyForAll = { + 'initialised': false, + 'data': null + }; + Map get applyForAll => _applyForAll; - Map _applyForMe; - get applyForMe => _applyForMe; + final Map _applyForMe = { + 'initialised': false, + 'data': null + }; + Map get applyForMe => _applyForMe; - Map _candidateProfile; - get candidateProfile => _candidateProfile; - - FetchedResources.internal() { - initState(); - } - void initState() { - _resultsBranchWise = { - 'initialised' : false, - 'data' : null - }; - _resultsCompanyWise = { - 'initialised' : false, - 'data' : null - }; - _applyForMe = { - 'initialised' : false, - 'data' : null - }; - _applyForAll = { - 'initialised' : false, - 'data' : null - }; - _candidateProfile = { - 'initialised' : false, - 'data' : null - }; - } - void setResultsBranchWise(results) { + final Map _candidateProfile = { + 'initialised': false, + 'data': null + }; + Map get candidateProfile => _candidateProfile; + + void setResultsBranchWise(dynamic results) { _resultsBranchWise['initialised'] = true; _resultsBranchWise['data'] = results; } - void setResultsCompanyWise(results) { + void setResultsCompanyWise(dynamic results) { _resultsCompanyWise['initialised'] = true; _resultsCompanyWise['data'] = results; } - void setApplyForMe(results) { + void setApplyForMe(dynamic results) { _applyForMe['initialised'] = true; _applyForMe['data'] = results; } - void setApplyForAll(results) { + void setApplyForAll(dynamic results) { _applyForAll['initialised'] = true; _applyForAll['data'] = results; } - void setCandidateProfile(results) { + void setCandidateProfile(dynamic results) { _candidateProfile['initialised'] = true; _candidateProfile['data'] = results; } diff --git a/lib/resources/modelResources.dart b/lib/resources/modelResources.dart index b94b531..38e02f4 100644 --- a/lib/resources/modelResources.dart +++ b/lib/resources/modelResources.dart @@ -1,5 +1,5 @@ -import 'package:placement/models/resultModel.dart'; -import 'package:placement/models/yearModel.dart'; +import '../models/resultModel.dart'; +import '../models/yearModel.dart'; class ModelResources { diff --git a/lib/screens/authenticate/authenticatePage.dart b/lib/screens/authenticate/authenticatePage.dart index b64eef1..96e4544 100644 --- a/lib/screens/authenticate/authenticatePage.dart +++ b/lib/screens/authenticate/authenticatePage.dart @@ -1,26 +1,29 @@ import 'package:flutter/material.dart'; -import 'package:placement/screens/authenticate/signIn.dart'; -import 'package:placement/screens/authenticate/signUp.dart'; + +import 'signIn.dart'; class Authenticate extends StatefulWidget { - Authenticate({Key key}) : super(key: key); + Authenticate({super.key}); @override _AuthenticateState createState() => _AuthenticateState(); } class _AuthenticateState extends State { - bool sign_in_shown = true; - void toggle() { - setState(() => sign_in_shown = !sign_in_shown); - } + // DEAD CODE + // bool sign_in_shown = true; + // void toggle() { + // setState(() => sign_in_shown = !sign_in_shown); + // } @override Widget build(BuildContext context) { - return Container( - child: sign_in_shown - ? SignIn(toggleview: toggle) - : Register(toggleView: toggle), - ); + // DEAD CODE + // return Container( + // child: sign_in_shown + // ? SignIn(toggleview: toggle) + // : Register(toggleView: toggle), + // ); + return SignIn(); } } diff --git a/lib/screens/authenticate/signIn.dart b/lib/screens/authenticate/signIn.dart index 802ec28..c658dc4 100644 --- a/lib/screens/authenticate/signIn.dart +++ b/lib/screens/authenticate/signIn.dart @@ -1,15 +1,13 @@ import 'package:flutter/material.dart'; -import 'package:flutter/animation.dart'; -import 'package:placement/resources/endpoints.dart'; -import 'package:url_launcher/url_launcher.dart'; -import 'package:placement/resources/strings.dart'; -import 'package:placement/services/auth/auth_service.dart'; -import 'package:placement/shared/loadingPage.dart'; import 'package:url_launcher/url_launcher_string.dart'; +import '../../resources/endpoints.dart'; +import '../../resources/strings.dart'; +import '../../services/auth/auth_service.dart'; +import '../../shared/loadingPage.dart'; + class SignIn extends StatefulWidget { - final Function toggleview; - SignIn({this.toggleview}); + SignIn(); @override _SignInState createState() => _SignInState(); @@ -21,18 +19,18 @@ class _SignInState extends State with TickerProviderStateMixin { final _formKey = GlobalKey(); - AnimationController _controller; - Animation _growAnimation; + late AnimationController _controller; + late Animation _growAnimation; - AnimationController _controllerForm; - Animation _growAnimationForm; + late AnimationController _controllerForm; + late Animation _growAnimationForm; var _obscurePasswordField = true; var _errorPasswordString; var _errorUsernameString; - AuthService _auth; + late AuthService _auth; bool _loading = false; bool _keyboardIsVisible() { @@ -128,7 +126,7 @@ class _SignInState extends State with TickerProviderStateMixin { BuildContext context, double _width, double _height) { return Column( children: [ - Container( + SizedBox( width: _width * 0.75, child: TextFormField( decoration: InputDecoration( @@ -138,10 +136,10 @@ class _SignInState extends State with TickerProviderStateMixin { controller: _usernameController, ), ), - SizedBox( + const SizedBox( height: 10.0, ), - Container( + SizedBox( width: _width * 0.75, child: TextFormField( decoration: InputDecoration( @@ -163,7 +161,7 @@ class _SignInState extends State with TickerProviderStateMixin { obscureText: _obscurePasswordField, ), ), - SizedBox( + const SizedBox( height: 20, ), SizedBox( @@ -171,7 +169,7 @@ class _SignInState extends State with TickerProviderStateMixin { height: 40.0, child: TextButton( style: ButtonStyle( - backgroundColor: MaterialStateProperty.all(Colors.blue), + backgroundColor: WidgetStateProperty.all(Colors.blue), ), child: Text( "Log In", @@ -187,6 +185,7 @@ class _SignInState extends State with TickerProviderStateMixin { 'password': _passwordController.text }; var res = await _auth.signInWithEmailPassword(dataMap); + if (!mounted) return; print("Signed IN!! with $res"); if (res == 0) { Navigator.of(context).pushNamedAndRemoveUntil( @@ -252,7 +251,7 @@ class _SignInState extends State with TickerProviderStateMixin { } Widget containsBranding(BuildContext context, double _width, double _height) { - return Container( + return Align( alignment: Alignment.center, child: Row( mainAxisSize: MainAxisSize.min, @@ -279,7 +278,7 @@ class _SignInState extends State with TickerProviderStateMixin { } Widget _lotsOfLove(BuildContext context, double _width, double _height) { - return Row( + return const Row( mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -304,8 +303,9 @@ class _SignInState extends State with TickerProviderStateMixin { } bool _validatePassword() { + _errorPasswordString = null; var isPasswordEmpty = - _passwordController.text == null || _passwordController.text == ''; + _passwordController.text == ''; if (isPasswordEmpty) { setState(() { _errorPasswordString = 'Password can not be empty'; @@ -315,8 +315,9 @@ class _SignInState extends State with TickerProviderStateMixin { } bool _validateUsername() { + _errorUsernameString = null; var isUsernameEmpty = - _usernameController.text == null || _usernameController.text == ''; + _usernameController.text == ''; if (isUsernameEmpty) { setState(() { _errorUsernameString = 'Username can not be empty'; diff --git a/lib/screens/authenticate/signUp.dart b/lib/screens/authenticate/signUp.dart deleted file mode 100644 index b3e9fcd..0000000 --- a/lib/screens/authenticate/signUp.dart +++ /dev/null @@ -1,19 +0,0 @@ -import 'package:flutter/material.dart'; - -class Register extends StatefulWidget { - - final Function toggleView; - Register({this.toggleView}); - - @override - _RegisterState createState() => _RegisterState(); -} - -class _RegisterState extends State { - @override - Widget build(BuildContext context) { - return Container( - child: Text("Register-View"), - ); - } -} \ No newline at end of file diff --git a/lib/screens/home/applyPage.dart b/lib/screens/home/applyPage.dart index 947526c..24438e6 100644 --- a/lib/screens/home/applyPage.dart +++ b/lib/screens/home/applyPage.dart @@ -1,20 +1,19 @@ import 'package:flutter/material.dart'; -import 'package:placement/resources/strings.dart'; -import 'package:placement/screens/home/screens_for_apply/profilesForAllScreen.dart'; -import 'package:placement/screens/home/screens_for_apply/profilesForMeScreen.dart'; -import 'package:placement/views/ProfilesForAllView.dart'; -import 'package:placement/views/ProfilesForMeView.dart'; + +import '../../resources/strings.dart'; +import '../../views/ProfilesForAllView.dart'; +import '../../views/ProfilesForMeView.dart'; class ApplyPage extends StatefulWidget { - ApplyPage({Key key}) : super(key: key); + ApplyPage({super.key}); @override _ApplyPageState createState() => _ApplyPageState(); } class _ApplyPageState extends State with SingleTickerProviderStateMixin { - TabController _tabController; - ScrollController _scrollController; + late TabController _tabController; + late ScrollController _scrollController; @override void initState() { @@ -41,8 +40,8 @@ class _ApplyPageState extends State @override Widget build(BuildContext context) { - final double _width = MediaQuery.of(context).size.width; - final double _height = MediaQuery.of(context).size.height; + // final double _width = MediaQuery.of(context).size.width; + // final double _height = MediaQuery.of(context).size.height; return NestedScrollView( controller: _scrollController, headerSliverBuilder: (BuildContext context, bool boxIsScrolled) { @@ -70,11 +69,12 @@ class _ApplyPageState extends State ); } - Widget _profilesListPage(BuildContext context) { + PreferredSizeWidget _profilesListPage(BuildContext context) { return TabBar( controller: _tabController, tabs: _profileTabs, - unselectedLabelColor: Colors.white70, + unselectedLabelColor: Colors.white60, + labelColor: Colors.white, indicatorPadding: EdgeInsets.only(top: 10), indicatorColor: Colors.white, indicatorWeight: 6.0, diff --git a/lib/screens/home/calendarPage.dart b/lib/screens/home/calendarPage.dart deleted file mode 100644 index be9acab..0000000 --- a/lib/screens/home/calendarPage.dart +++ /dev/null @@ -1,66 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:table_calendar/table_calendar.dart'; - -class CalendarPage extends StatefulWidget { - CalendarPage({Key key}) : super(key: key); - - @override - _CalendarPageState createState() => _CalendarPageState(); -} - -class _CalendarPageState extends State { - // CalendarController _calendarController; - - @override - void initState() { - super.initState(); - // _calendarController = CalendarController(); - } - - @override - Widget build(BuildContext context) { - return myCalendar(context); - } - - Widget myCalendar(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text("Calendar"), - centerTitle: true, - ), - body: _calendarBody(context), - ); - } - - Widget _calendarBody(BuildContext context) { - return SingleChildScrollView( - child: Column( - children: [ - TableCalendar( - focusedDay: DateTime.now(), - firstDay: DateTime.now().subtract( - const Duration(days: 100), - ), - lastDay: DateTime.now().add( - const Duration(days: 100), - ), - calendarStyle: CalendarStyle( - todayDecoration: BoxDecoration( - color: Colors.orange, - ), - selectedDecoration: BoxDecoration( - color: Theme.of(context).primaryColor, - ), - ), - headerStyle: HeaderStyle( - formatButtonShowsNext: false, - ), - ), - // TableCalendar( - // calendarController: _calendarController, - // ), - ], - ), - ); - } -} diff --git a/lib/screens/home/candidatePage.dart b/lib/screens/home/candidatePage.dart deleted file mode 100644 index 32a93ab..0000000 --- a/lib/screens/home/candidatePage.dart +++ /dev/null @@ -1,285 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:placement/models/candidateModel.dart'; -import 'package:placement/resources/R.dart'; -import 'package:placement/resources/endpoints.dart'; -import 'package:placement/resources/fetchedResources.dart'; -import 'package:placement/services/api_models/fetchService.dart'; -import 'package:placement/services/auth/auth_service.dart'; -import 'package:placement/shared/loadingPage.dart'; - -class CandidatePage extends StatefulWidget { - CandidatePage({Key key}) : super(key: key); - - @override - _CandidatePageState createState() => _CandidatePageState(); -} - -class _CandidatePageState extends State { - var _fetch; - var _fetchedResources; - AuthService _auth; - - @override - void initState() { - super.initState(); - _fetch = FetchService(); - _auth = AuthService(); - _fetchedResources = FetchedResources(); - } - - @override - Widget build(BuildContext context) { - var _width = MediaQuery.of(context).size.width; - return _candidateProfile(context, _width); - } - - Widget _candidateProfile(BuildContext context, double _width) { - return Scaffold( - appBar: AppBar( - title: Text("Profile"), - centerTitle: true, - ), - body: Container( - constraints: BoxConstraints.expand(), - child: FutureBuilder( - future: _giveCandidate(), - builder: (context, snapshot) { - if (snapshot.data == null) { - return LoadingPage(); - } - return _profileBody(context, snapshot.data, _width); - }, - ), - ), - ); - } - - Widget _profileBody(BuildContext context, dynamic model, double _width) { - return SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - SizedBox( - height: 30, - ), - _headerAndIcon(context, model, _width), - SizedBox( - height: 20, - ), - _studentInfo(context, model, _width), - SizedBox( - height: 20, - ), - _myApplicationsButton(context, model, _width), - SizedBox( - height: 20, - ), - _myResumesButton(context, model, _width), - SizedBox( - height: 20, - ), - _menu(context, model, _width), - ], - ), - ); - } - - Widget _menu(BuildContext context, dynamic model, double _width) { - return Container( - width: _width * 0.9, - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - _divider(), - ListTile( - contentPadding: EdgeInsets.fromLTRB(10, 5, 5, 5), - leading: Icon(Icons.help_outline), - title: Text( - "FAQs", - style: TextStyle(color: R.textColPrimary), - ), - onTap: () {}, - ), - _divider(), - ListTile( - contentPadding: EdgeInsets.fromLTRB(10, 5, 5, 5), - leading: Icon(Icons.info), - title: Text( - "About Us", - style: TextStyle(color: R.textColPrimary), - ), - onTap: () {}, - ), - _divider(), - ListTile( - contentPadding: EdgeInsets.fromLTRB(10, 5, 5, 5), - leading: Icon(Icons.exit_to_app), - title: Text( - "Log Out", - style: TextStyle(color: R.textColPrimary), - ), - onTap: () async { - await _auth.logOut(); - Navigator.of(context).pushNamedAndRemoveUntil( - '/wrapper', (Route route) => false); - }, - ), - _divider(), - ], - ), - ); - } - - Widget _divider() { - return Divider( - color: Color(0xFFe6e6e6), - thickness: 1, - indent: 10, - height: 0, - endIndent: 10, - ); - } - - Widget _myApplicationsButton( - BuildContext context, dynamic model, double _width) { - return InkWell( - onTap: () { - Navigator.pushNamed(context, '/profileApplied'); - }, - child: _button("My Applications", _width), - ); - } - - Widget _myResumesButton(BuildContext context, dynamic model, double _width) { - return InkWell( - onTap: () { - Navigator.pushNamed(context, '/resumes'); - }, - child: _button("My Resumes", _width), - ); - } - - Widget _button(String heading, double _width) { - return Container( - width: _width * 0.9, - decoration: BoxDecoration( - color: Color(0xFF73A1FD).withOpacity(0.1), - borderRadius: BorderRadius.circular(10)), - padding: EdgeInsets.symmetric(vertical: 10), - child: Row( - children: [ - Expanded( - flex: 3, - child: Container( - padding: EdgeInsets.only(left: 20), - child: Text( - heading, - style: TextStyle(color: Color(0xFF878787), fontSize: 17), - ), - ), - ), - Expanded( - flex: 1, - child: Icon( - Icons.arrow_forward_ios, - color: Color(0xFF73A1FD), - ), - ), - ], - ), - ); - } - - Widget _studentInfo(BuildContext context, dynamic model, double _width) { - return Container( - width: _width * 0.9, - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - model.degreeName, - style: TextStyle(color: Colors.black54), - ), - SizedBox( - height: 5, - ), - Text( - model.departmentName, - style: TextStyle(color: Colors.black54), - ), - SizedBox( - height: 10, - ), - _statusRows(model.season + " Status: ", model.internshipStatus), - SizedBox( - height: 5, - ), - _statusRows("Pool A Credits: ", model.creditsPoolA.toString()), - SizedBox( - height: 5, - ), - _statusRows("Pool B Credits: ", model.creditsPoolB.toString()), - ], - ), - ); - } - - Widget _statusRows(String heading, String value) { - return Row( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - heading, - style: TextStyle(fontSize: 17, color: R.textColPrimary), - ), - Text( - value, - style: TextStyle(fontSize: 17, fontWeight: FontWeight.bold), - ), - ], - ); - } - - Widget _headerAndIcon(BuildContext context, dynamic model, double _width) { - return Container( - width: _width * 0.9, - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - Container( - child: CircleAvatar( - radius: 30, - backgroundColor: Colors.grey[300], - child: Icon( - Icons.account_circle, - size: 60, - color: Colors.deepPurpleAccent, - ), - ), - ), - SizedBox( - width: 10, - ), - Text( - model.candidateName, - style: TextStyle(fontSize: 30), - ), - ], - ), - ); - } - - Future _giveCandidate() async { - if (!_fetchedResources.candidateProfile['initialised']) { - var _data = - await _fetch.fetchDataService(EndPoints.HOST + EndPoints.CANDIDATE); - var _candidate = CandidateModel.fromJson(_data); - _fetchedResources.setCandidateProfile(_candidate); - return _candidate; - } else { - return _fetchedResources.candidateProfile['data']; - } - } -} diff --git a/lib/screens/home/homePage.dart b/lib/screens/home/homePage.dart index 1d5d4b9..c8821dd 100644 --- a/lib/screens/home/homePage.dart +++ b/lib/screens/home/homePage.dart @@ -1,19 +1,13 @@ -import 'dart:ui'; - import 'package:flutter/material.dart'; -import 'package:placement/resources/R.dart'; -import 'package:placement/resources/strings.dart'; -import 'package:placement/screens/home/applyPage.dart'; -import 'package:placement/screens/home/calendarPage.dart'; -import 'package:placement/screens/home/candidatePage.dart'; -import 'package:placement/screens/home/resultPage.dart'; -import 'package:placement/services/auth/auth_service.dart'; -import 'package:placement/views/CandidateDetailsView.dart'; -import 'package:placement/views/ResultPageView.dart'; -import 'package:placement/views/calendarView.dart'; + +import '../../resources/R.dart'; +import '../../views/CandidateDetailsView.dart'; +import '../../views/ResultPageView.dart'; +import '../../views/calendarView.dart'; +import 'applyPage.dart'; class HomePage extends StatefulWidget { - HomePage({Key key}) : super(key: key); + HomePage({super.key}); @override _HomePageState createState() => _HomePageState(); @@ -21,11 +15,9 @@ class HomePage extends StatefulWidget { class _HomePageState extends State with SingleTickerProviderStateMixin { - TabController _tabController; - bool _isCollapsed = true; - AuthService _auth; + late TabController _tabController; - final List _bottomTab = [ + final List _bottomTab = const [ Tab( icon: Icon(Icons.check_circle), text: 'Apply', @@ -47,7 +39,6 @@ class _HomePageState extends State @override void initState() { super.initState(); - _auth = AuthService(); _tabController = TabController(vsync: this, length: 4); } @@ -57,225 +48,50 @@ class _HomePageState extends State super.dispose(); } - void _onHorizontalDrag(DragEndDetails details) { - if (details.primaryVelocity == 0) - return; // user have just tapped on screen (no dragging) - - if (details.primaryVelocity.compareTo(0) == -1) - setState(() { - _isCollapsed = true; - }); - } - @override Widget build(BuildContext context) { - var _size = MediaQuery.of(context).size; - double _height = _size.height; - double _width = _size.width; - return _homePageStack(context, _height, _width); - } - - Widget _homePageStack(BuildContext context, double _height, double _width) { - return Stack( - children: [ - _homePageScaffold(context), - - /// Notifications and Hamburger Menu - /// F - // SafeArea( - // child: Align( - // alignment: Alignment.topRight, - // child: Container( - // child: GestureDetector( - // onTap: () { - // print("tapped!!"); - // }, - // child: Padding( - // padding: EdgeInsets.fromLTRB(0.0, 10.0, 10, 0.0), - // child: Material( - // color: Colors.transparent, - // child: IconButton( - // icon: Icon( - // Icons.notifications, - // size: 30, - // color: Colors.white, - // ), - // onPressed: () { - // Navigator.of(context).pushNamed('/notifs'); - // }, - // ) - // ) - // ), - // ) - // ), - // ) - // ), - // SafeArea( - // child: Align( - // alignment: Alignment.topLeft, - // child: Container( - // child: GestureDetector( - // onTap: () { - // print("tapped!!"); - // }, - // child: Padding( - // padding: EdgeInsets.fromLTRB(0.0, 10.0, 10, 0.0), - // child: Material( - // color: Colors.transparent, - // child: IconButton( - // icon: Icon( - // Icons.menu, - // size: 30, - // color: Colors.white, - // ), - // onPressed: () { - // setState(() { - // _isCollapsed = false; - // }); - // }, - // ) - // ) - // ), - // ) - // ), - // ) - // ), - // Container( - // child: BackdropFilter( - // filter: ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0), - // child: Container( - // height: _isCollapsed ? 0 : _height, - // width: _isCollapsed ? 0 : _width, - // decoration: BoxDecoration( - // color: Colors.grey.shade200.withOpacity(0.05) - // ), - // ), - // ), - // ), - // Positioned( - // left: 0, - // child: GestureDetector( - // onHorizontalDragEnd: (DragEndDetails details) => _onHorizontalDrag(details), - // child: AnimatedContainer( - // duration: Duration(milliseconds: 300), - // height: _height, - // width: _isCollapsed ? 0 : _width*0.75, - // child: _isCollapsed ? Container() : - // Material( - // elevation: 8.0, - // child: Scaffold( - // appBar: AppBar( - // elevation: 0.0, - // actions: [ - // IconButton( - // icon: Icon(Icons.arrow_back_ios), - // onPressed: () { - // setState(() { - // _isCollapsed = true; - // }); - // }, - // ) - // ], - // ), - // body: Container( - // child: LayoutBuilder( - // builder: (context, constraints) { - // if (constraints.maxWidth < 50) { - // return Container(); - // } else { - // return menu(context, _height, _width); - // } - // }, - // ) - // ), - // ), - // ), - // ), - // ), - // ), - ], - ); + return _homePageScaffold(context); } Widget _homePageScaffold(BuildContext context) { - return Scaffold( - body: TabBarView( - controller: _tabController, - children: _tabSelector(), - ), - bottomNavigationBar: Container( - decoration: BoxDecoration(color: Colors.white, boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.3), - blurRadius: 10.0, - spreadRadius: 2.0, - offset: Offset(0, -5), + return ColoredBox( + color: R.primaryCol, + child: SafeArea( + left: false, + right: false, + child:Scaffold( + body: TabBarView( + controller: _tabController, + children: _tabSelector(), ), - ]), - child: TabBar( - controller: _tabController, - tabs: _bottomTab, - indicatorPadding: EdgeInsets.all(5.0), - indicatorColor: R.primaryCol, - labelColor: R.primaryCol, - unselectedLabelColor: Colors.grey, - ))); + bottomNavigationBar: DecoratedBox( + decoration: BoxDecoration(color: Colors.white, boxShadow: [ + BoxShadow( + color: Colors.grey.shade300, + blurRadius: 10.0, + spreadRadius: 2.0, + offset: Offset(0, -5), + ), + ]), + child: TabBar( + controller: _tabController, + tabs: _bottomTab, + indicatorPadding: EdgeInsets.all(5.0), + indicatorColor: R.primaryCol, + labelColor: R.primaryCol, + unselectedLabelColor: Colors.grey, + ))), + ), + ) + ; } List _tabSelector() { return [ - Container(child: ApplyPage()), - Container(child: ResultPageView()), - Container(child: CalendarView()), - Container(child: CandidateDetailsView()), + ApplyPage(), + ResultPageView(), + CalendarView(), + CandidateDetailsView(), ]; } - - Widget menu(BuildContext context, double _height, double _width) { - return Container( - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Container( - color: Colors.blue, - height: 200, - child: Center( - child: Icon( - Icons.arrow_drop_down_circle, - size: 40, - ), - ), - ), - ListTile( - contentPadding: EdgeInsets.fromLTRB(10, 5, 5, 5), - leading: Icon(Icons.format_list_bulleted), - title: Text("Resume list"), - onTap: () {}, - ), - ListTile( - contentPadding: EdgeInsets.fromLTRB(10, 5, 5, 5), - leading: Icon(Icons.help_outline), - title: Text("FAQs"), - onTap: () {}, - ), - ListTile( - contentPadding: EdgeInsets.fromLTRB(10, 5, 5, 5), - leading: Icon(Icons.info), - title: Text("About Us"), - onTap: () {}, - ), - ListTile( - contentPadding: EdgeInsets.fromLTRB(10, 5, 5, 5), - leading: Icon(Icons.exit_to_app), - title: Text("Log Out"), - onTap: () async { - await _auth.logOut(); - Navigator.of(context).pushNamedAndRemoveUntil( - '/wrapper', (Route route) => false); - }, - ), - ], - ), - ); - } } diff --git a/lib/screens/home/profilePage.dart b/lib/screens/home/profilePage.dart deleted file mode 100644 index 10fed76..0000000 --- a/lib/screens/home/profilePage.dart +++ /dev/null @@ -1,73 +0,0 @@ -import 'package:flutter/material.dart'; - -class ProfilePage extends StatefulWidget { - final args; - ProfilePage({Key key, this.args}) : super(key: key); - - @override - _ProfilePageState createState() => _ProfilePageState(); -} - -class _ProfilePageState extends State { - @override - Widget build(BuildContext context) { - var _width = MediaQuery.of(context).size.width; - var _height = MediaQuery.of(context).size.height; - return Scaffold( - appBar: AppBar( - title: Text("Company Details"), - ), - body: Container( - width: _width, - height: _height, - color: Colors.red, - child: SingleChildScrollView( - child: Column( - children: [ - SizedBox( - height: 5, - ), - Container( - color: Colors.blue, - height: 200, - width: 200, - ), - SizedBox( - height: 5, - ), - Container( - color: Colors.blue, - height: 200, - width: 200, - ), - SizedBox( - height: 5, - ), - Container( - color: Colors.blue, - height: 200, - width: 200, - ), - SizedBox( - height: 5, - ), - Container( - color: Colors.blue, - height: 200, - width: 200, - ), - SizedBox( - height: 5, - ), - Container( - color: Colors.blue, - height: 200, - width: 200, - ), - ], - ), - ), - ), - ); - } -} diff --git a/lib/screens/home/resultPage.dart b/lib/screens/home/resultPage.dart deleted file mode 100644 index 93883a8..0000000 --- a/lib/screens/home/resultPage.dart +++ /dev/null @@ -1,122 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:placement/resources/strings.dart'; -import 'package:placement/screens/home/screen_for_results/bottomSheetForm.dart'; -import 'package:placement/screens/home/screen_for_results/resultsBranchWise.dart'; -import 'package:placement/screens/home/screen_for_results/resultsCompanyWise.dart'; - -class ResultPage extends StatefulWidget { - final Map args; - const ResultPage({Key key, this.args}) : super(key: key); - @override - _ResultPageState createState() => _ResultPageState(); -} - -class _ResultPageState extends State - with SingleTickerProviderStateMixin { - TabController _tabController; - ScrollController _scrollController; - int _yearSelectionVariable; - int _resultTypeVariable; - - @override - void initState() { - super.initState(); - _yearSelectionVariable = 0; - _resultTypeVariable = 0; - _tabController = TabController(vsync: this, length: 2); - _scrollController = ScrollController(); - } - - @override - void dispose() { - _tabController.dispose(); - _scrollController.dispose(); - super.dispose(); - } - - List _profileTabs = [ - Tab( - text: Strings.RESULT_TABBAR[0], - ), - Tab( - text: Strings.RESULT_TABBAR[1], - ), - ]; - - @override - Widget build(BuildContext context) { - final double _width = MediaQuery.of(context).size.width; - final double _height = MediaQuery.of(context).size.height; - return Stack( - children: [ - _resultsView(context), - Align( - alignment: Alignment.bottomRight, - child: Padding( - padding: EdgeInsets.fromLTRB(0, 0, 10, 10), - child: FloatingActionButton( - onPressed: () { - showModalBottomSheet( - context: context, - builder: (context) { - return SafeArea( - child: BottomSheetForm( - yearSelectionVariable: _yearSelectionVariable, - resultTypeVariable: _resultTypeVariable, - valueChangedForYear: (yearSelectionVariable) { - _yearSelectionVariable = yearSelectionVariable; - }, - valueChangedForResult: (resultTypeVariable) { - _resultTypeVariable = resultTypeVariable; - }, - ), - ); - }, - ); - }, - child: Icon(Icons.filter_b_and_w), - ), - ), - ) - ], - ); - } - - Widget _resultsView(BuildContext context) { - return NestedScrollView( - controller: _scrollController, - headerSliverBuilder: (BuildContext context, bool boxIsScrolled) { - return [ - SliverAppBar( - title: Text(Strings.PLACEMENT_YEAR), - centerTitle: true, - pinned: true, - floating: true, - forceElevated: boxIsScrolled, - bottom: _resultsListPage(context), - ) - ]; - }, - body: TabBarView( - controller: _tabController, - physics: NeverScrollableScrollPhysics(), - children: [ - ResultsBranchWise(), - ResultsCompanyWise(), - ], - ), - ); - } - - Widget _resultsListPage(BuildContext context) { - return TabBar( - controller: _tabController, - tabs: _profileTabs, - unselectedLabelColor: Colors.white70, - indicatorPadding: EdgeInsets.only(top: 10), - indicatorColor: Colors.white, - indicatorWeight: 6.0, - onTap: (index) {}, - ); - } -} diff --git a/lib/screens/home/screen_for_results/bottomSheetForm.dart b/lib/screens/home/screen_for_results/bottomSheetForm.dart index 0811359..e9e28e3 100644 --- a/lib/screens/home/screen_for_results/bottomSheetForm.dart +++ b/lib/screens/home/screen_for_results/bottomSheetForm.dart @@ -1,35 +1,28 @@ import 'package:flutter/material.dart'; -import 'package:placement/locator.dart'; -import 'package:placement/resources/R.dart'; -import 'package:placement/resources/modelResources.dart'; -import 'package:placement/shared/GlobalCache.dart'; + +import '../../../resources/R.dart'; +import '../../../resources/modelResources.dart'; class BottomSheetForm extends StatefulWidget { - BottomSheetForm( - {Key key, - this.yearSelectionVariable, - this.resultTypeVariable, - this.sortVariable, - this.valueChangedForYear, - this.valueChangedForResult, - this.valueChangedForSort}) - : super(key: key); + BottomSheetForm({ + super.key, + required this.yearSelectionVariable, + required this.resultTypeVariable, + required this.sortVariable + }); final int yearSelectionVariable; final int resultTypeVariable; final int sortVariable; - final valueChangedForYear; - final valueChangedForResult; - final valueChangedForSort; @override _BottomSheetFormState createState() => _BottomSheetFormState(); } class _BottomSheetFormState extends State { - int yearSelectionVariable; - int resultTypeVariable; - int sortVariable; - GlobalCache _cache = locator(); + late int yearSelectionVariable; + late int resultTypeVariable; + late int sortVariable; + // GlobalCache _cache = locator(); @override void initState() { @@ -61,11 +54,11 @@ class _BottomSheetFormState extends State { margin: EdgeInsets.symmetric(horizontal: 10), child: TextButton( style: ButtonStyle( - backgroundColor: MaterialStateProperty.all( + backgroundColor: WidgetStateProperty.all( Theme.of(context).primaryColor, ), ), - child: Text( + child: const Text( 'Get Results', style: TextStyle(color: Colors.white), ), @@ -87,27 +80,27 @@ class _BottomSheetFormState extends State { return Card( child: Column( children: [ - SizedBox( + const SizedBox( height: 10, ), Text( "Select Year", style: TextStyle(color: R.textColPrimary), ), - SizedBox( + const SizedBox( height: 10, ), - Column( - children: ModelResources.yearOptions().map((year) { - return RadioListTile( - groupValue: yearSelectionVariable, - value: year.key, - title: Text(year.value), - onChanged: (val) { - _setYear(val); - }, - ); - }).toList(), + RadioGroup( + groupValue: yearSelectionVariable, + onChanged: (val) => _setYear(val), + child: Column( + children: ModelResources.yearOptions().map((year) { + return RadioListTile( + value: year.key, + title: Text(year.value), + ); + }).toList(), + ), ), ], ), @@ -119,27 +112,27 @@ class _BottomSheetFormState extends State { child: Column( mainAxisSize: MainAxisSize.min, children: [ - SizedBox( + const SizedBox( height: 10, ), Text( "Sort By", style: TextStyle(color: R.textColPrimary), ), - SizedBox( + const SizedBox( height: 10, ), - Column( - children: ModelResources.SORT_OPTIONS.map((resultType) { - return RadioListTile( - groupValue: sortVariable, - value: resultType.key, - title: Text(resultType.value), - onChanged: (val) { - _setSortVar(val); - }, - ); - }).toList(), + RadioGroup( + groupValue: sortVariable, + onChanged: (val) => _setSortVar(val), + child: Column( + children: ModelResources.SORT_OPTIONS.map((resultType) { + return RadioListTile( + value: resultType.key, + title: Text(resultType.value), + ); + }).toList(), + ), ), ], ), @@ -151,27 +144,27 @@ class _BottomSheetFormState extends State { child: Column( mainAxisSize: MainAxisSize.min, children: [ - SizedBox( + const SizedBox( height: 10, ), Text( "Select Results type", style: TextStyle(color: R.textColPrimary), ), - SizedBox( + const SizedBox( height: 10, ), - Column( - children: ModelResources.RESULT_OPTIONS.map((resultType) { - return RadioListTile( - groupValue: resultTypeVariable, - value: resultType.key, - title: Text(resultType.value), - onChanged: (val) { - _setResultType(val); - }, - ); - }).toList(), + RadioGroup( + groupValue: resultTypeVariable, + onChanged: (val) => _setResultType(val), + child: Column( + children: ModelResources.RESULT_OPTIONS.map((resultType) { + return RadioListTile( + value: resultType.key, + title: Text(resultType.value), + ); + }).toList(), + ), ), ], ), diff --git a/lib/screens/home/screen_for_results/resultsBranchWise.dart b/lib/screens/home/screen_for_results/resultsBranchWise.dart deleted file mode 100644 index bfc2952..0000000 --- a/lib/screens/home/screen_for_results/resultsBranchWise.dart +++ /dev/null @@ -1,95 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:placement/models/branchConciseModel.dart'; -import 'package:placement/resources/endpoints.dart'; -import 'package:placement/resources/fetchedResources.dart'; -import 'package:placement/services/api_models/fetchService.dart'; -import 'package:placement/shared/dataProvider.dart'; -import 'package:placement/shared/hexColor.dart'; -import 'package:placement/shared/loadingPage.dart'; -import 'package:provider/provider.dart'; - -class ResultsBranchWise extends StatefulWidget { - final int yearSelectionVariable; - const ResultsBranchWise({ - Key key, - this.yearSelectionVariable, - }) : super(key: key); - - @override - _ResultsBranchWiseState createState() => _ResultsBranchWiseState(); -} - -class _ResultsBranchWiseState extends State { - var _fetch; - var _fetchedResources; - List _results = []; - - @override - void initState() { - super.initState(); - _fetch = FetchService(); - _fetchedResources = FetchedResources(); - } - - @override - Widget build(BuildContext context) { - return Consumer( - builder: (context, data, child) { - return Container(child: _resultDisplay(context, data.yearSelector)); - }, - ); - } - - Widget _resultDisplay(BuildContext context, int yearSelector) { - return FutureBuilder( - future: _futureOfResults(context, yearSelector), - builder: (context, snapshot) { - if (snapshot.data == null) { - return LoadingPage(); - } - return ListView.builder( - itemCount: snapshot.data.length, - padding: EdgeInsets.all(0), - itemBuilder: (context, index) { - return Card( - elevation: 0.2, - margin: EdgeInsets.only(bottom: 1, top: 0), - child: ListTile( - title: Text( - snapshot.data[index].studentBranchName, - style: TextStyle( - fontWeight: FontWeight.bold, - ), - ), - subtitle: Text( - "Degree: " + snapshot.data[index].studentDegree, - style: TextStyle(height: 1.85), - ), - onTap: () { - Navigator.of(context).pushNamed('/result_details_branchwise', - arguments: snapshot.data[index].studentDetails); - }, - ), - ); - }, - ); - }, - ); - } - - Future> _futureOfResults( - BuildContext context, int yearSelector) async { - if (!_fetchedResources.resultsBranchWise['initialised']) { - var _data = await _fetch.fetchDataService(EndPoints.RESULTS_HOST + - EndPoints.RESULTS_BRANCH[yearSelector] + - EndPoints.WITH_INDEX); - for (var r in _data) { - _results.add(BranchConciseModel.fromJson(r)); - } - _fetchedResources.setResultsBranchWise(_results); - return _results; - } else { - return _fetchedResources.resultsBranchWise['data']; - } - } -} diff --git a/lib/screens/home/screen_for_results/resultsCompanyWise.dart b/lib/screens/home/screen_for_results/resultsCompanyWise.dart deleted file mode 100644 index ee17963..0000000 --- a/lib/screens/home/screen_for_results/resultsCompanyWise.dart +++ /dev/null @@ -1,103 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:placement/models/companyConciseModel.dart'; -import 'package:placement/resources/endpoints.dart'; -import 'package:placement/resources/fetchedResources.dart'; -import 'package:placement/services/api_models/fetchService.dart'; -import 'package:placement/shared/dataProvider.dart'; -import 'package:placement/shared/loadingPage.dart'; -import 'package:provider/provider.dart'; - -class ResultsCompanyWise extends StatefulWidget { - bool resultType; - ResultsCompanyWise({Key key, this.resultType}) : super(key: key); - - @override - _ResultsCompanyWiseState createState() => _ResultsCompanyWiseState(); -} - -class _ResultsCompanyWiseState extends State { - var _fetch; - var _fetchedResources; - List _results = []; - - @override - void initState() { - super.initState(); - _fetch = FetchService(); - _fetchedResources = FetchedResources(); - } - - @override - Widget build(BuildContext context) { - return Consumer( - builder: (context, data, child) { - return Container(child: _resultDisplay(context, data.yearSelector)); - }, - ); - } - - Widget _resultDisplay(BuildContext context, int yearSelector) { - return FutureBuilder( - future: _futureOfResults(context, yearSelector), - builder: (context, snapshot) { - if (snapshot.data == null) { - return LoadingPage(); - } - return ListView.builder( - shrinkWrap: true, - padding: EdgeInsets.all(0), - itemCount: snapshot.data.length, - itemBuilder: (context, index) { - return Card( - margin: EdgeInsets.only(bottom: 1), - elevation: 0.2, - child: ListTile( - title: Text( - snapshot.data[index].companyName, - style: TextStyle( - fontWeight: FontWeight.bold, - ), - ), - subtitle: Wrap( - children: [ - Text( - "Selected: ", - style: TextStyle(height: 1.85), - ), - Text( - snapshot.data[index].selected, - style: TextStyle( - height: 1.85, - color: Colors.blue, - fontWeight: FontWeight.bold), - ) - ], - ), - onTap: () { - Navigator.of(context).pushNamed('/result_details_companywise', - arguments: snapshot.data[index].detail); - }, - ), - ); - }, - ); - }, - ); - } - - Future> _futureOfResults( - BuildContext context, int yearSelector) async { - if (!_fetchedResources.resultsCompanyWise['initialised']) { - var _data = await _fetch.fetchDataService(EndPoints.RESULTS_HOST + - EndPoints.RESULTS_COMPANY[0] + - EndPoints.WITH_INDEX); - for (var r in _data) { - _results.add(CompanyConciseModel.fromJson(r)); - } - _fetchedResources.setResultsCompanyWise(_results); - return _results; - } else { - return _fetchedResources.resultsCompanyWise['data']; - } - } -} diff --git a/lib/screens/home/screens_for_apply/bottomModalApplySheet.dart b/lib/screens/home/screens_for_apply/bottomModalApplySheet.dart index 3a8c797..1f2f941 100644 --- a/lib/screens/home/screens_for_apply/bottomModalApplySheet.dart +++ b/lib/screens/home/screens_for_apply/bottomModalApplySheet.dart @@ -1,27 +1,27 @@ import 'package:flutter/material.dart'; import 'package:fluttertoast/fluttertoast.dart'; -import 'package:placement/locator.dart'; -import 'package:placement/models/resumeModel.dart'; -import 'package:placement/resources/endpoints.dart'; -import 'package:placement/services/api_models/fetchService.dart'; -import 'package:placement/services/api_models/postService.dart'; -import 'package:placement/services/generic/requestService.dart'; -import 'package:placement/shared/loadingPage.dart'; + +import '../../../locator.dart'; +import "../../../models/resumeModel.dart"; +import '../../../resources/endpoints.dart'; +import '../../../services/api_models/fetchService.dart'; +import '../../../services/generic/requestService.dart'; +import '../../../shared/loadingPage.dart'; class BottomModalApplySheet extends StatefulWidget { - BottomModalApplySheet({Key key, this.profile}) : super(key: key); - final profile; + BottomModalApplySheet({super.key, required this.profile}); + final dynamic profile; @override _BottomModalApplySheetState createState() => _BottomModalApplySheetState(); } class _BottomModalApplySheetState extends State { - var profile; + late dynamic profile; var _fetch; - RequestService _requestService; - List _resumeList; - Future _resumeFuture; + late RequestService _requestService; + late List _resumeList; + late Future _resumeFuture; @override void initState() { @@ -36,20 +36,17 @@ class _BottomModalApplySheetState extends State { @override Widget build(BuildContext context) { var _width = MediaQuery.of(context).size.width; - return Container( - child: FutureBuilder( - future: _resumeFuture, - builder: (BuildContext context, AsyncSnapshot snapshot) { - if (snapshot.data == null) { - return Container( - width: _width * 0.9, - height: 200, - child: LoadingPage(), - ); - } - return _listOfResume(context, _width, snapshot); - }, - ), + return FutureBuilder( + future: _resumeFuture, + builder: (BuildContext context, AsyncSnapshot snapshot) { + if (snapshot.data == null) { + return SizedBox( + height: 200, + child: LoadingPage(), + ); + } + return _listOfResume(context, _width, snapshot); + }, ); } @@ -60,7 +57,7 @@ class _BottomModalApplySheetState extends State { itemCount: snapshot.data.length, //snapshot.data.length, itemBuilder: (BuildContext context, int index) { return Card( - child: Container( + child: Padding( padding: EdgeInsets.fromLTRB(0, 10, 0, 10), child: Column( children: [ @@ -85,7 +82,7 @@ class _BottomModalApplySheetState extends State { ), TextButton( style: ButtonStyle( - backgroundColor: MaterialStateProperty.all( + backgroundColor: WidgetStateProperty.all( Colors.blue, ), ), @@ -94,6 +91,7 @@ class _BottomModalApplySheetState extends State { Fluttertoast.showToast( msg: "Processing...", toastLength: Toast.LENGTH_LONG); + // ignore: unused_local_variable int _apply = await _requestService .makePostRequest( EndPoints.HOST + @@ -105,9 +103,17 @@ class _BottomModalApplySheetState extends State { snapshot.data[index].id.toString() //"cover_letter": null }); - // TODO : handle the response - Navigator.of(context).pop(); Navigator.of(context).pop(); + if (_apply == -1){ + // return true to reload parent page + Navigator.of(context).pop(true); + } else { + Fluttertoast.showToast( + msg: "An error occurred. Please check your connection.", + textColor: Colors.red, + toastLength: Toast.LENGTH_LONG); + Navigator.of(context).pop(false); + } }, ), ], @@ -115,7 +121,7 @@ class _BottomModalApplySheetState extends State { ); }, ) - : Container(), + : const SizedBox.shrink(), ], ), ), @@ -126,7 +132,7 @@ class _BottomModalApplySheetState extends State { Widget _headerWidget(int index) { if (index == 0) { - return Container( + return const Padding( padding: EdgeInsets.fromLTRB(0, 5, 0, 5), child: Text( "Choose the resume you wish to apply with: ", @@ -134,7 +140,7 @@ class _BottomModalApplySheetState extends State { ), ); } - return SizedBox(); + return const SizedBox.shrink(); } Future _giveAppliedResumeList() async { diff --git a/lib/screens/home/screens_for_apply/profilesForAllScreen.dart b/lib/screens/home/screens_for_apply/profilesForAllScreen.dart deleted file mode 100644 index f44b213..0000000 --- a/lib/screens/home/screens_for_apply/profilesForAllScreen.dart +++ /dev/null @@ -1,231 +0,0 @@ -import 'dart:convert'; - -import 'package:flutter/material.dart'; -import 'package:jiffy/jiffy.dart'; -import 'package:placement/models/profilesModel.dart'; -import 'package:placement/resources/endpoints.dart'; -import 'package:placement/resources/fetchedResources.dart'; -import 'package:placement/screens/home/screens_for_apply/bottomModalApplySheet.dart'; -import 'package:placement/services/api_models/deleteService.dart'; -import 'package:placement/services/api_models/fetchService.dart'; -import 'package:placement/shared/loadingPage.dart'; - -class ProfilesForAllPage extends StatefulWidget { - ProfilesForAllPage({Key key}) : super(key: key); - - @override - _ProfilesForAllPageState createState() => _ProfilesForAllPageState(); -} - -class _ProfilesForAllPageState extends State { - var _fetch; - var _fetchedResources; - var _deleteService; - List _profiles = []; - - @override - void initState() { - super.initState(); - _fetch = FetchService(); - _fetchedResources = FetchedResources(); - _deleteService = DeleteService(); - } - - @override - Widget build(BuildContext context) { - var _width = MediaQuery.of(context).size.width; - return Container( - child: FutureBuilder( - future: _giveList(context), - builder: (BuildContext context, AsyncSnapshot snapshot) { - if (snapshot.data == null) { - return LoadingPage(); - } - return ListView.builder( - shrinkWrap: true, - itemCount: snapshot.data.length, - padding: EdgeInsets.all(0), - itemBuilder: (BuildContext context, int index) { - String _date = snapshot.data[index].applicationDeadline != null - ? "Apply before " + - Jiffy(snapshot.data[index].applicationDeadline.toString()) - .yMMMd - : 'Open'; - return Card( - margin: EdgeInsets.only(bottom: 1), - child: ListTile( - title: Text( - snapshot.data[index].companyName, - style: TextStyle(fontWeight: FontWeight.bold, height: 1.5), - ), - subtitle: Text( - "Status: " + _date, - style: TextStyle( - height: 1.85, - ), - ), - onTap: () { - Navigator.of(context).pushNamed("/profileDetail", - arguments: snapshot.data[index]); - }, - trailing: _profileStatusIcon(context, - snapshot.data[index].status, snapshot.data[index]), - ), - ); - }, - ); - }, - ), - ); - } - - Widget _profileStatusIcon( - BuildContext context, String status, dynamic profile) { - switch (status) { - case 'branch_not_eligible': - return IconButton( - icon: Icon( - Icons.highlight_off, - color: Colors.red, - ), - onPressed: () { - showDialog( - context: context, - barrierDismissible: true, - builder: (_) => AlertDialog( - content: Text("This Company is incompatible with you branch"), - actions: [ - TextButton( - child: Text("OK"), - onPressed: () { - Navigator.of(context).pop(); - }, - ) - ], - ), - ); - }, - ); - break; - case 'expired': - return IconButton( - icon: Icon( - Icons.highlight_off, - color: Colors.red, - ), - onPressed: () { - showDialog( - context: context, - barrierDismissible: true, - builder: (_) => AlertDialog( - content: Text("This Deadline for application has expired"), - actions: [ - TextButton( - child: Text("OK"), - onPressed: () { - Navigator.of(context).pop(); - }, - ) - ], - ), - ); - }, - ); - break; - case 'open': - return IconButton( - icon: Icon( - Icons.next_week, - color: Colors.green, - ), - onPressed: () { - showModalBottomSheet( - context: context, - builder: (context) { - return BottomModalApplySheet( - profile: profile, - ); - }, - ); - }, - ); - break; - case 'withdrawable': - return IconButton( - icon: Icon( - Icons.arrow_back_ios, - color: Colors.blue, - ), - onPressed: () { - showDialog( - context: context, - barrierDismissible: true, - builder: (_) => AlertDialog( - content: Text( - "Do you wish to withdraw your resume from this Company?"), - actions: [ - TextButton( - child: Text("Cancel"), - onPressed: () { - Navigator.of(context).pop(); - }, - ), - TextButton( - child: Text("Sure"), - onPressed: () { - _deleteService - .deleteApplicationService(profile.application.id); - Navigator.of(context).pop(); - }, - ), - ], - ), - ); - }, - ); - break; - case 'locked': - return IconButton( - icon: Icon( - Icons.lock, - color: Colors.grey, - ), - onPressed: () { - showDialog( - context: context, - barrierDismissible: true, - builder: (_) => AlertDialog( - content: Text("This Application has been locked"), - actions: [ - TextButton( - child: Text("OK"), - onPressed: () { - Navigator.of(context).pop(); - }, - ) - ], - ), - ); - }, - ); - break; - default: - return Icon(Icons.signal_cellular_connected_no_internet_4_bar); - } - } - - Future> _giveList(BuildContext context) async { - if (!_fetchedResources.applyForAll['initialised']) { - var _data = await _fetch - .fetchDataService(EndPoints.HOST + EndPoints.PROFILES_ALL); - print(_data); - for (var p in _data) { - _profiles.add(ProfilesModel.fromJson(p)); - } - _fetchedResources.setApplyForAll(_profiles); - return _profiles; - } else { - return _fetchedResources.applyForAll['data']; - } - } -} diff --git a/lib/screens/home/screens_for_apply/profilesForMeScreen.dart b/lib/screens/home/screens_for_apply/profilesForMeScreen.dart deleted file mode 100644 index 4923244..0000000 --- a/lib/screens/home/screens_for_apply/profilesForMeScreen.dart +++ /dev/null @@ -1,239 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:jiffy/jiffy.dart'; -import 'package:placement/models/profilesModel.dart'; -import 'package:placement/resources/endpoints.dart'; -import 'package:placement/resources/fetchedResources.dart'; -import 'package:placement/screens/home/screens_for_apply/bottomModalApplySheet.dart'; -import 'package:placement/services/api_models/deleteService.dart'; -import 'package:placement/services/api_models/fetchService.dart'; -import 'package:placement/shared/loadingPage.dart'; - -class ProfilesForMePage extends StatefulWidget { - ProfilesForMePage({Key key}) : super(key: key); - - @override - _ProfilesForMePageState createState() => _ProfilesForMePageState(); -} - -class _ProfilesForMePageState extends State { - var _fetch; - var _fetchedResources; - var _deleteService; - List _profiles = []; - - @override - void initState() { - super.initState(); - _fetch = FetchService(); - _fetchedResources = FetchedResources(); - _deleteService = DeleteService(); - } - - @override - Widget build(BuildContext context) { - var _width = MediaQuery.of(context).size.width; - return Scaffold( - body: Container( - constraints: BoxConstraints.expand(), - child: Column( - children: [ - _applyList(context), - ], - ), - ), - ); - } - - Widget _applyList(BuildContext context) { - return Container( - child: FutureBuilder( - future: _giveList(context), - builder: (BuildContext context, AsyncSnapshot snapshot) { - if (snapshot.data == null) { - return LoadingPage(); - } - //return Container(height: 100,width: 100,color: Colors.red,); - return ListView.builder( - shrinkWrap: true, - itemCount: snapshot.data.length, - padding: EdgeInsets.all(5), - itemBuilder: (BuildContext context, int index) { - String _date = snapshot.data[index].applicationDeadline != null - ? "Apply before " + - Jiffy(snapshot.data[index].applicationDeadline.toString()) - .yMMMd - : 'Open'; - return Card( - margin: EdgeInsets.only(bottom: 1), - child: ListTile( - title: Text( - snapshot.data[index].companyName, - style: - TextStyle(fontWeight: FontWeight.bold, height: 1.5), - ), - subtitle: Text( - "Status: " + _date, - style: TextStyle( - height: 1.85, - ), - ), - onTap: () { - Navigator.of(context).pushNamed("/profileDetail", - arguments: snapshot.data[index]); - }, - trailing: _profileStatusIcon(context, - snapshot.data[index].status, snapshot.data[index]))); - }, - ); - }, - ), - ); - } - - Widget _profileStatusIcon( - BuildContext context, String status, dynamic profile) { - print("STATUS - $status"); - switch (status) { - case 'branch_not_eligible': - return IconButton( - icon: Icon( - Icons.highlight_off, - color: Colors.red, - ), - onPressed: () { - showDialog( - context: context, - barrierDismissible: true, - builder: (_) => AlertDialog( - content: - Text("This Company is incompatible with you branch"), - actions: [ - TextButton( - child: Text("OK"), - onPressed: () { - Navigator.of(context).pop(); - }, - ) - ], - )); - }, - ); - break; - case 'expired': - return IconButton( - icon: Icon( - Icons.highlight_off, - color: Colors.red, - ), - onPressed: () { - showDialog( - context: context, - barrierDismissible: true, - builder: (_) => AlertDialog( - content: - Text("This Deadline for application has expired"), - actions: [ - TextButton( - child: Text("OK"), - onPressed: () { - Navigator.of(context).pop(); - }, - ) - ], - )); - }, - ); - break; - case 'open': - return IconButton( - icon: Icon( - Icons.undo, - color: Colors.green, - ), - onPressed: () { - showModalBottomSheet( - context: context, - builder: (context) { - return BottomModalApplySheet( - profile: profile, - ); - }); - }, - ); - break; - case 'withdrawable': - return IconButton( - icon: Icon( - Icons.arrow_back_ios, - color: Colors.blue, - ), - onPressed: () { - showDialog( - context: context, - barrierDismissible: true, - builder: (_) => AlertDialog( - content: Text( - "Do you wish to withdraw your resume from this Company?"), - actions: [ - TextButton( - child: Text("Cancel"), - onPressed: () { - Navigator.of(context).pop(); - }, - ), - TextButton( - child: Text("Sure"), - onPressed: () async { - _deleteService.deleteApplicationService( - profile.application.id); - Navigator.of(context).pop(); - }, - ), - ], - )); - }, - ); - break; - case 'locked': - return IconButton( - icon: Icon( - Icons.lock, - color: Colors.grey, - ), - onPressed: () { - showDialog( - context: context, - barrierDismissible: true, - builder: (_) => AlertDialog( - content: Text("This Application has been locked"), - actions: [ - TextButton( - child: Text("OK"), - onPressed: () { - Navigator.of(context).pop(); - }, - ) - ], - )); - }, - ); - break; - default: - return Icon(Icons.signal_cellular_connected_no_internet_4_bar); - } - } - - Future> _giveList(BuildContext context) async { - if (!_fetchedResources.applyForMe['initialised']) { - var _data = - await _fetch.fetchDataService(EndPoints.HOST + EndPoints.PROFILES_ME); - for (var p in _data) { - _profiles.add(ProfilesModel.fromJson(p)); - } - _fetchedResources.setApplyForMe(_profiles); - return _profiles; - } else { - return _fetchedResources.applyForMe['data']; - } - } -} diff --git a/lib/screens/home/screens_for_result_details/resultDetailsBranchWise.dart b/lib/screens/home/screens_for_result_details/resultDetailsBranchWise.dart index b8fa561..dbe5926 100644 --- a/lib/screens/home/screens_for_result_details/resultDetailsBranchWise.dart +++ b/lib/screens/home/screens_for_result_details/resultDetailsBranchWise.dart @@ -1,12 +1,13 @@ import 'package:flutter/material.dart'; -import 'package:placement/models/branchWiseStudentModel.dart'; -import 'package:placement/resources/endpoints.dart'; -import 'package:placement/services/api_models/fetchService.dart'; -import 'package:placement/shared/loadingPage.dart'; + +import '../../../models/branchWiseStudentModel.dart'; +import '../../../resources/endpoints.dart'; +import '../../../services/api_models/fetchService.dart'; +import '../../../shared/loadingPage.dart'; class ResultDetailsBranchWise extends StatefulWidget { - final Map args; - ResultDetailsBranchWise({Key key, this.args}) : super(key: key); + final dynamic args; + ResultDetailsBranchWise({super.key, required this.args}); @override _ResultDetailsBranchWiseState createState() => @@ -16,11 +17,11 @@ class ResultDetailsBranchWise extends StatefulWidget { class _ResultDetailsBranchWiseState extends State with SingleTickerProviderStateMixin { var _fetch; - List _results; - List _resultsBackup; - AnimationController animationController; - Animation animation; - OverlayEntry overlayEntry; + List _results = []; + List _resultsBackup = []; + late AnimationController animationController; + late Animation animation; + OverlayEntry? overlayEntry; @override void initState() { @@ -41,11 +42,11 @@ class _ResultDetailsBranchWiseState extends State onWillPop: () async { if (overlayEntry == null) { return true; - } else if (overlayEntry.mounted) { + } else if (overlayEntry!.mounted) { await Future.delayed(Duration(milliseconds: 10)).whenComplete( () => animationController.reverse(), ); - overlayEntry.remove(); + overlayEntry!.remove(); return false; } else { return true; @@ -90,12 +91,12 @@ class _ResultDetailsBranchWiseState extends State () => animationController.reverse(), ); animationController.reverse(); - overlayEntry.remove(); + overlayEntry!.remove(); }, ), title: TextField( maxLines: 1, - cursorColor: Colors.white.withOpacity(0.75), + cursorColor: const Color(0xBFFFFFFF), style: TextStyle( color: Colors.white, ), @@ -104,7 +105,7 @@ class _ResultDetailsBranchWiseState extends State hintText: "Search Name...", border: InputBorder.none, hintStyle: TextStyle( - color: Colors.white.withOpacity(0.75), + color: const Color(0xBFFFFFFF), ), ), ), @@ -118,7 +119,7 @@ class _ResultDetailsBranchWiseState extends State overlayState.setState(() {}); }); // inserting overlay entry - overlayState.insert(overlayEntry); + overlayState.insert(overlayEntry!); animationController.forward(); } @@ -158,19 +159,21 @@ class _ResultDetailsBranchWiseState extends State } void _branchResultsFiltered(String keyword) { + final lowerCaseKeyword = keyword.toLowerCase(); setState(() { if (keyword == "") { _results = _resultsBackup; } else { _results = _resultsBackup - .where((element) => element.studentName.contains(keyword)) - .toList(); + .where((element) => + element.studentName.toLowerCase().contains(lowerCaseKeyword)) + .toList(); } }); } Future _futureOfResults(BuildContext context) async { - if (_results != null && _results.length >= 0) return "Success!"; + if (_resultsBackup.isNotEmpty) return "Success!"; List _studentResults = []; var _data = await _fetch @@ -182,8 +185,10 @@ class _ResultDetailsBranchWiseState extends State _studentResults.sort((a, b) => a.studentName.compareTo(b.studentName)); } - _results = _studentResults; - _resultsBackup = _results; + setState(() { + _results = _studentResults; + _resultsBackup = _results; + }); return "Success!"; } diff --git a/lib/screens/home/screens_for_result_details/resultDetailsCompanyWise.dart b/lib/screens/home/screens_for_result_details/resultDetailsCompanyWise.dart index 5cd9280..56e62b9 100644 --- a/lib/screens/home/screens_for_result_details/resultDetailsCompanyWise.dart +++ b/lib/screens/home/screens_for_result_details/resultDetailsCompanyWise.dart @@ -1,12 +1,13 @@ import 'package:flutter/material.dart'; -import 'package:placement/models/companyWiseStudentModel.dart'; -import 'package:placement/resources/endpoints.dart'; -import 'package:placement/services/api_models/fetchService.dart'; -import 'package:placement/shared/loadingPage.dart'; + +import '../../../models/companyWiseStudentModel.dart'; +import '../../../resources/endpoints.dart'; +import '../../../services/api_models/fetchService.dart'; +import '../../../shared/loadingPage.dart'; class ResultDetailsCompanyWise extends StatefulWidget { - final Map args; - ResultDetailsCompanyWise({Key key, this.args}) : super(key: key); + final dynamic args; + ResultDetailsCompanyWise({super.key, required this.args}); @override _ResultDetailsCompanyWiseState createState() => @@ -16,11 +17,11 @@ class ResultDetailsCompanyWise extends StatefulWidget { class _ResultDetailsCompanyWiseState extends State with SingleTickerProviderStateMixin { var _fetch; - List _results; - List _resultsBackup; - AnimationController animationController; - Animation animation; - OverlayEntry overlayEntry; + List _results = []; + List _resultsBackup = []; + late AnimationController animationController; + late Animation animation; + OverlayEntry? overlayEntry; @override void initState() { @@ -41,11 +42,11 @@ class _ResultDetailsCompanyWiseState extends State onWillPop: () async { if (overlayEntry == null) { return true; - } else if (overlayEntry.mounted) { + } else if (overlayEntry!.mounted) { await Future.delayed(Duration(milliseconds: 10)).whenComplete( () => animationController.reverse(), ); - overlayEntry.remove(); + overlayEntry!.remove(); return false; } else { return true; @@ -91,12 +92,12 @@ class _ResultDetailsCompanyWiseState extends State .whenComplete( () => animationController.reverse(), ); - overlayEntry.remove(); + overlayEntry!.remove(); }, ), title: TextField( maxLines: 1, - cursorColor: Colors.white.withOpacity(0.75), + cursorColor: const Color(0xBFFFFFFF), style: TextStyle( color: Colors.white, ), @@ -105,7 +106,7 @@ class _ResultDetailsCompanyWiseState extends State hintText: "Search Name...", border: InputBorder.none, hintStyle: TextStyle( - color: Colors.white.withOpacity(0.75), + color: const Color(0xBFFFFFFF), ), ), ), @@ -119,7 +120,7 @@ class _ResultDetailsCompanyWiseState extends State overlayState.setState(() {}); }); // inserting overlay entry - overlayState.insert(overlayEntry); + overlayState.insert(overlayEntry!); animationController.forward(); } @@ -173,19 +174,21 @@ class _ResultDetailsCompanyWiseState extends State } void _companyResultsFiltered(String keyword) { + final lowerCaseKeyword = keyword.toLowerCase(); setState(() { if (keyword == "") { _results = _resultsBackup; } else { _results = _resultsBackup - .where((element) => element.studentName.contains(keyword)) - .toList(); + .where((element) => + element.studentName.toLowerCase().contains(lowerCaseKeyword)) + .toList(); } }); } Future _futureOfResults(BuildContext context) async { - if (_results != null && _results.length >= 0) return "Success!"; + if (_resultsBackup.isNotEmpty) return "Success!"; List _studentResults = []; var _data = await _fetch @@ -196,8 +199,10 @@ class _ResultDetailsCompanyWiseState extends State if (widget.args['sort'] == 1) { _studentResults.sort((a, b) => a.studentName.compareTo(b.studentName)); } - _results = _studentResults; - _resultsBackup = _results; + setState(() { + _results = _studentResults; + _resultsBackup = _results; + }); return "Success!"; } diff --git a/lib/screens/notifications/notificationsScreen.dart b/lib/screens/notifications/notificationsScreen.dart index c6b3997..cc7bf87 100644 --- a/lib/screens/notifications/notificationsScreen.dart +++ b/lib/screens/notifications/notificationsScreen.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; class NotificationsScreen extends StatefulWidget { - NotificationsScreen({Key key}) : super(key: key); + NotificationsScreen({super.key}); @override _NotificationsScreenState createState() => _NotificationsScreenState(); diff --git a/lib/screens/splash/splash.dart b/lib/screens/splash/splash.dart index 7bcf566..a4e4bee 100644 --- a/lib/screens/splash/splash.dart +++ b/lib/screens/splash/splash.dart @@ -1,25 +1,25 @@ import 'package:flutter/material.dart'; import 'dart:async'; -import 'package:placement/resources/strings.dart'; -import 'package:placement/services/api_models/fetchService.dart'; -import 'package:placement/services/auth/auth_service.dart'; -import 'package:placement/shared/loadingPage.dart'; +import '../../resources/strings.dart'; +import '../../services/auth/auth_service.dart'; +import '../../shared/loadingPage.dart'; class SplashPage extends StatefulWidget { - SplashPage({Key key}) : super(key: key); + SplashPage({super.key}); @override _SplashPageState createState() => _SplashPageState(); } class _SplashPageState extends State { - AuthService _auth; + // late AuthService _auth; @override void initState() { super.initState(); - _auth = AuthService(); + // _auth = AuthService(); + AuthService(); Timer(Duration(seconds: 2), () { Navigator.of(context) .pushNamedAndRemoveUntil('/wrapper', (Route route) => false); @@ -28,8 +28,8 @@ class _SplashPageState extends State { @override Widget build(BuildContext context) { - final double width = MediaQuery.of(context).size.width; - final double height = MediaQuery.of(context).size.height; + // final double width = MediaQuery.of(context).size.width; + // final double height = MediaQuery.of(context).size.height; return Material( child: Stack( diff --git a/lib/screens/wrapper.dart b/lib/screens/wrapper.dart index f2584a3..7dac0d9 100644 --- a/lib/screens/wrapper.dart +++ b/lib/screens/wrapper.dart @@ -6,17 +6,17 @@ import 'package:placement/services/auth/auth_service.dart'; import 'package:provider/provider.dart'; class WrapperPage extends StatefulWidget { - WrapperPage({Key key}) : super(key: key); + WrapperPage({super.key}); @override _WrapperPageState createState() => _WrapperPageState(); } class _WrapperPageState extends State { - AuthService _auth; - DataProvider data; + late AuthService _auth; + late DataProvider data; final Duration _duration = Duration(milliseconds: 300); - bool _isCollapsed = false; + // bool _isCollapsed = false; @override void initState() { @@ -27,9 +27,9 @@ class _WrapperPageState extends State { @override Widget build(BuildContext context) { - var _size = MediaQuery.of(context).size; - double _height = _size.height; - double _width = _size.width; + // var _size = MediaQuery.of(context).size; + // double _height = _size.height; + // double _width = _size.width; //return _auth.authStateListener() ? HomePage() : Authenticate(); return ChangeNotifierProvider( create: (context) => DataProvider(), diff --git a/lib/services/api_models/deleteService.dart b/lib/services/api_models/deleteService.dart index b7a23e8..90e9855 100644 --- a/lib/services/api_models/deleteService.dart +++ b/lib/services/api_models/deleteService.dart @@ -1,13 +1,14 @@ import 'package:http/http.dart' as http; -import 'package:placement/resources/endpoints.dart'; -import 'package:placement/services/auth/auth_service.dart'; + +import '../../resources/endpoints.dart'; +import '../auth/auth_service.dart'; class DeleteService { AuthService _auth = AuthService(); Future deleteApplicationService(int applicationID) async { print("HELLO!! im in!! DELETING $applicationID"); - var res = await genericDeleteService(EndPoints.HOST + + await genericDeleteService(EndPoints.HOST + EndPoints.APPLICATIONS + applicationID.toString() + '/'); diff --git a/lib/services/api_models/fetchService.dart b/lib/services/api_models/fetchService.dart index eac593e..5dbb513 100644 --- a/lib/services/api_models/fetchService.dart +++ b/lib/services/api_models/fetchService.dart @@ -1,12 +1,8 @@ import 'dart:convert'; -import 'package:flutter/cupertino.dart'; import 'package:http/http.dart' as http; -import 'package:hive/hive.dart'; -import 'package:hive_flutter/hive_flutter.dart'; import 'package:placement/resources/endpoints.dart'; -import 'package:placement/resources/strings.dart'; import 'package:placement/services/auth/auth_service.dart'; class FetchService { @@ -23,7 +19,7 @@ class FetchService { } Future fetchDataService(String endPoint) async { - String _jsonData; + // String _jsonData; Map _headers = await _auth.fetchHeaderProvider(endPoint); try { var res = await http.get(Uri.parse(endPoint), headers: _headers); diff --git a/lib/services/auth/auth_service.dart b/lib/services/auth/auth_service.dart index 6b03f39..cd57134 100644 --- a/lib/services/auth/auth_service.dart +++ b/lib/services/auth/auth_service.dart @@ -2,28 +2,25 @@ import 'dart:async'; import 'dart:convert'; import 'package:http/http.dart' as http; -import 'package:placement/locator.dart'; - -import 'package:placement/resources/endpoints.dart'; - -import 'package:hive/hive.dart'; import 'package:hive_flutter/hive_flutter.dart'; -import 'package:placement/resources/strings.dart'; -import 'package:placement/services/api_models/fetchService.dart'; -import 'package:placement/shared/GlobalCache.dart'; + +import '../../locator.dart'; +import '../../resources/endpoints.dart'; +import '../../resources/strings.dart'; +import '../../shared/GlobalCache.dart'; class AuthService { - FetchService _fetchService; - static final AuthService _auth = AuthService.internal(); + // FetchService _fetchService; + static final AuthService _auth = AuthService._internal(); factory AuthService() => _auth; - AuthService.internal() { + AuthService._internal() { initState(); } - void initState() { - _openEncryptedBox(); + Future initState() async { + await _openEncryptedBox(); } var _box; @@ -47,7 +44,7 @@ class AuthService { Future refreshToken() async { var _jsonData; - String _refresh = _box.get('refresh'); + String? _refresh = _box.get('refresh'); try { var _res = await http.post( Uri.parse(EndPoints.HOST + EndPoints.REFRESH), @@ -91,11 +88,11 @@ class AuthService { _box.put('access', access); } - _openEncryptedBox() async { + Future _openEncryptedBox() async { print("initialising box"); await Hive.initFlutter(); await Hive.openBox(Strings.AUTH_BOX); _box = Hive.box(Strings.AUTH_BOX); - refreshToken(); + await refreshToken(); } } diff --git a/lib/services/generic/applyService.dart b/lib/services/generic/applyService.dart index 25085bb..ed07e3b 100644 --- a/lib/services/generic/applyService.dart +++ b/lib/services/generic/applyService.dart @@ -12,16 +12,17 @@ class ApplyService { final RequestService _requestService = locator(); final GlobalCache _cache = locator(); - Future fetchCompanyDetails(int profileId) async { + Future fetchCompanyDetails(int profileId) async { var _data = await _requestService.makeGetRequest( EndPoints.HOST + EndPoints.PROFILES_ALL + profileId.toString() + '/' ); if(_data != -1 && _data != -2) { return DetailCompanyProfileModel.fromJson(_data); } + return null; } - Future> fetchProfileForMe() async { + Future?> fetchProfileForMe() async { List _list = []; if(_cache.profilesForMe == null) { var _data = await _requestService.makeGetRequest( @@ -31,7 +32,7 @@ class ApplyService { for(var p in _data) { _list.add(ProfilesModel.fromJson(p)); } - if(_list.length > 0) { + if(_list.length >= 0) { _cache.profilesForMe = _list; } } @@ -39,7 +40,7 @@ class ApplyService { return _cache.profilesForMe; } - Future getCandidateProfile() async { + Future getCandidateProfile() async { if(_cache.candidateData == null) { var _data = await _requestService.makeGetRequest( EndPoints.HOST + EndPoints.CANDIDATE @@ -51,7 +52,9 @@ class ApplyService { EndPoints.HOST + EndPoints.WHOAMI ); if(_profilePic != -1 && _profilePic != -2) { - candidate.displayPicture = EndPoints.HOST + _profilePic['displayPicture'].toString(); + if (_profilePic['displayPicture'] != null){ + candidate.displayPicture = EndPoints.HOST + _profilePic['displayPicture'].toString(); + } } print("CANDI PIC ${candidate.displayPicture}"); _cache.candidateData = candidate; @@ -60,7 +63,7 @@ class ApplyService { return _cache.candidateData; } - Future> fetchProfileForAll() async { + Future?> fetchProfileForAll() async { List _list = []; if(_cache.profilesOpenForAll == null) { var _data = await _requestService.makeGetRequest( @@ -70,7 +73,7 @@ class ApplyService { for(var p in _data) { _list.add(ProfilesModel.fromJson(p)); } - if(_list.length > 0) { + if(_list.length >= 0) { _cache.profilesOpenForAll = _list; } } @@ -78,11 +81,12 @@ class ApplyService { return _cache.profilesOpenForAll; } - Future> fetchProfileApplied() async { + Future?> fetchProfileApplied() async { List _list = []; var _data = await _requestService.makeGetRequest( EndPoints.HOST + EndPoints.PROFILES_APPLIED ); + if (_data == -2) return null; if(_data != -1 && _data != -2) { for(var p in _data) { _list.add(ProfilesModel.fromJson(p)); @@ -91,11 +95,12 @@ class ApplyService { return _list; } - Future> fetchResumes() async { + Future?> fetchResumes() async { List _list = []; var _data = await _requestService.makeGetRequest( EndPoints.HOST + EndPoints.CANDIDATE_RESUME_LIST ); + if (_data == -2) return null; if(_data != -1 && _data != -2) { for(var p in _data) { ResumeModel temp = ResumeModel.fromJson(p); diff --git a/lib/services/generic/requestService.dart b/lib/services/generic/requestService.dart index 9a56917..dde6472 100644 --- a/lib/services/generic/requestService.dart +++ b/lib/services/generic/requestService.dart @@ -1,6 +1,5 @@ import 'dart:convert'; -import 'package:dio/dio.dart'; import 'package:http/http.dart' as http; import 'package:placement/services/auth/auth_service.dart'; @@ -39,32 +38,10 @@ class RequestService { print("GOT 200"); return json.decode(res.body); } - return -1; } catch (e) { print(e.toString()); print("POST REQUEST FAILED"); return -2; } } - - Future dioGetRequest(String endpoint, Map data) async { - print(endpoint); - print(data); - var dio = Dio(); - dio.options.headers['authorization'] = - await _auth.fetchHeaderProvider(endpoint); - try { - Response res = await dio.get(endpoint, queryParameters: data); - print(res.statusCode); - if (res.statusCode == 200) { - print(res.data); - return res.data; - } - return -1; - } catch (e) { - print('REQUEST FAILED!!'); - print(e.toString()); - return -2; - } - } } diff --git a/lib/services/generic/resultService.dart b/lib/services/generic/resultService.dart index c91cacc..1c52d7b 100644 --- a/lib/services/generic/resultService.dart +++ b/lib/services/generic/resultService.dart @@ -1,79 +1,51 @@ -import 'package:placement/locator.dart'; -import 'package:placement/models/branchConciseModel.dart'; -import 'package:placement/models/branchWiseStudentModel.dart'; -import 'package:placement/models/companyConciseModel.dart'; -import 'package:placement/models/companyWiseStudentModel.dart'; -import 'package:placement/resources/endpoints.dart'; -import 'package:placement/resources/fetchedResources.dart'; -import 'package:placement/services/generic/requestService.dart'; -import 'package:placement/shared/GlobalCache.dart'; +import '../../locator.dart'; +import '../../models/branchConciseModel.dart'; +import '../../models/companyConciseModel.dart'; +import '../../resources/endpoints.dart'; +import '../../shared/GlobalCache.dart'; +import 'requestService.dart'; class ResultService { final RequestService _requestService = locator(); final GlobalCache _cache = locator(); - FetchedResources _fetchedResources = FetchedResources(); - Future> companyWiseResults(int yearIndex, int internSwitch) async { + Future?> companyWiseResults(int yearIndex, int internSwitch) async { + if(_cache.companyWiseResults != null) { + return _cache.companyWiseResults; + } List _companyResults = []; - if(_cache.companyWiseResults == null) { - var _data = await _requestService.makeGetRequest( - EndPoints.RESULTS_HOST + EndPoints.year(yearIndex) + EndPoints.RESULTS_COMPANY[internSwitch] + EndPoints.WITH_INDEX - ); - if(_data == -2) return null; - if(_data != -1 && _data != -2) { - for (var r in _data) { - _companyResults.add(CompanyConciseModel.fromJson(r)); - } - if(_companyResults.length > 0) { - _cache.companyWiseResults = _companyResults; - } + var _data = await _requestService.makeGetRequest( + EndPoints.RESULTS_HOST + EndPoints.year(yearIndex) + EndPoints.RESULTS_COMPANY[internSwitch] + EndPoints.WITH_INDEX + ); + if(_data == -2) return null; + if(_data != -1 && _data != -2) { + for (var r in _data) { + _companyResults.add(CompanyConciseModel.fromJson(r)); } - return _companyResults; - } - return _cache.companyWiseResults; - } - - Future> branchWiseResults(int yearIndex, int internSwitch) async { - List _branchResults = []; - if(_cache.branchWiseResults == null) { - var _data = await _requestService.makeGetRequest( - EndPoints.RESULTS_HOST + EndPoints.year(yearIndex) + EndPoints.RESULTS_BRANCH[internSwitch] + EndPoints.WITH_INDEX - ); - if(_data == -2) return null; - if(_data != -1 && _data != -2) { - for (var r in _data) { - _branchResults.add(BranchConciseModel.fromJson(r)); - } - if(_branchResults.length > 0) _cache.branchWiseResults = _branchResults; + if(_companyResults.length >= 0) { + _cache.companyWiseResults = _companyResults; } - return _branchResults; - } else { - return _cache.branchWiseResults; } + return _companyResults; } - //TODO: Convert Detail Result pages to MVVM - Future> companyWiseDetailResult(String args) async { - List _results = []; - var _data = await _requestService.makeGetRequest( - EndPoints.RESULTS_HOST + args - ); - for(var r in _data) { - _results.add(CompantWiseStudentModel.fromJson(r)); + Future?> branchWiseResults(int yearIndex, int internSwitch) async { + if(_cache.branchWiseResults != null) { + return _cache.branchWiseResults; } - return _results; - } - - Future> branchWiseDetailResult(String args) async { - List _results = []; + List _branchResults = []; var _data = await _requestService.makeGetRequest( - EndPoints.RESULTS_HOST + args + EndPoints.RESULTS_HOST + EndPoints.year(yearIndex) + EndPoints.RESULTS_BRANCH[internSwitch] + EndPoints.WITH_INDEX ); - for(var r in _data) { - _results.add(BranchWiseStudentModel.fromJson(r)); + if(_data == -2) return null; + if(_data != -1 && _data != -2) { + for (var r in _data) { + _branchResults.add(BranchConciseModel.fromJson(r)); + } + if(_branchResults.length >= 0) _cache.branchWiseResults = _branchResults; } - return _results; + return _branchResults; } -} \ No newline at end of file +} diff --git a/lib/services/routing/navigationService.dart b/lib/services/routing/navigationService.dart index 3a555c7..f4eb9d7 100644 --- a/lib/services/routing/navigationService.dart +++ b/lib/services/routing/navigationService.dart @@ -5,10 +5,10 @@ class NavigationService { new GlobalKey(); Future navigateToWithRemove(String routeName, Map args) { - return navigatorKey.currentState.pushNamedAndRemoveUntil(routeName, (Route route)=>false, arguments: args); + return navigatorKey.currentState!.pushNamedAndRemoveUntil(routeName, (Route route)=>false, arguments: args); } Future navigateTo(String routeName, Map args) { - return navigatorKey.currentState.pushNamed(routeName, arguments: args); + return navigatorKey.currentState!.pushNamed(routeName, arguments: args); } } \ No newline at end of file diff --git a/lib/services/routing/placement_routes.dart b/lib/services/routing/placement_routes.dart index d7789a1..ed0a6f8 100644 --- a/lib/services/routing/placement_routes.dart +++ b/lib/services/routing/placement_routes.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; import 'package:placement/screens/home/homePage.dart'; -import 'package:placement/screens/home/profilePage.dart'; import 'package:placement/screens/home/screens_for_result_details/resultDetailsBranchWise.dart'; import 'package:placement/screens/home/screens_for_result_details/resultDetailsCompanyWise.dart'; import 'package:placement/screens/notifications/notificationsScreen.dart'; @@ -15,41 +14,32 @@ class RouteGeneratorPlacement { switch (settings.name) { case '/': return MaterialPageRoute(builder: (_) => SplashPage()); - break; case '/wrapper': return MaterialPageRoute(builder: (_) => WrapperPage()); - break; case '/home': return MaterialPageRoute(builder: (_) => HomePage()); - break; case '/result_details_branchwise': - var _resultArgs = settings.arguments; + Object? _resultArgs = settings.arguments; return MaterialPageRoute( builder: (_) => ResultDetailsBranchWise( args: _resultArgs, )); - break; case '/result_details_companywise': - var _resultArgs = settings.arguments; + Object? _resultArgs = settings.arguments; return MaterialPageRoute( builder: (_) => ResultDetailsCompanyWise( args: _resultArgs, )); - break; case '/notifs': return MaterialPageRoute(builder: (_) => NotificationsScreen()); - break; case '/profileDetail': - var _profileArgs = settings.arguments; + Object? _profileArgs = settings.arguments; return MaterialPageRoute( builder: (_) => CompanyDetailView(args: _profileArgs)); - break; case '/profileApplied': return MaterialPageRoute(builder: (_) => ProfilesAppliedView()); - break; case '/resumes': return MaterialPageRoute(builder: (_) => ResumeListView()); - break; default: return MaterialPageRoute( builder: (_) => Scaffold( diff --git a/lib/shared/ErrorWidget.dart b/lib/shared/ErrorWidget.dart new file mode 100644 index 0000000..3c4cf8f --- /dev/null +++ b/lib/shared/ErrorWidget.dart @@ -0,0 +1,33 @@ +import 'package:flutter/material.dart'; + +class ErrorWidgetWithRefreshCallback extends StatelessWidget { + final RefreshCallback onRefresh; + const ErrorWidgetWithRefreshCallback({ + super.key, + required this.onRefresh + }); + + @override + Widget build(BuildContext context) { + return RefreshIndicator( + onRefresh: onRefresh, + child: const CustomScrollView( + physics: AlwaysScrollableScrollPhysics(), + slivers: [ + SliverFillRemaining( + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text("(ㅠ﹏ㅠ)", style: TextStyle(fontSize: 24)), + SizedBox(height: 8), + Text("Something went Wrong"), + ], + ), + ), + ), + ], + ), + ); + } +} diff --git a/lib/shared/GlobalCache.dart b/lib/shared/GlobalCache.dart index a64999c..8ee1274 100644 --- a/lib/shared/GlobalCache.dart +++ b/lib/shared/GlobalCache.dart @@ -1,7 +1,7 @@ -import 'package:placement/models/branchConciseModel.dart'; -import 'package:placement/models/candidateModel.dart'; -import 'package:placement/models/companyConciseModel.dart'; -import 'package:placement/models/profilesModel.dart'; +import '../models/branchConciseModel.dart'; +import '../models/candidateModel.dart'; +import '../models/companyConciseModel.dart'; +import '../models/profilesModel.dart'; class GlobalCache { @@ -10,15 +10,15 @@ class GlobalCache { * "year" - the year index, 0 implies current year, 1 the year before and so on... * "type" - 0 means internship, 1 means placement */ - Map filterFields; + Map? filterFields; - CandidateModel candidateData; + CandidateModel? candidateData; - List companyWiseResults; + List? companyWiseResults; - List branchWiseResults; + List? branchWiseResults; - List profilesForMe; + List? profilesForMe; - List profilesOpenForAll; -} \ No newline at end of file + List? profilesOpenForAll; +} diff --git a/lib/shared/ProfileStatusIcon.dart b/lib/shared/ProfileStatusIcon.dart index 6f0583d..858db6e 100644 --- a/lib/shared/ProfileStatusIcon.dart +++ b/lib/shared/ProfileStatusIcon.dart @@ -1,13 +1,19 @@ import 'package:flutter/material.dart'; -import 'package:placement/resources/R.dart'; -import 'package:placement/screens/home/screens_for_apply/bottomModalApplySheet.dart'; + +import '../models/profilesModel.dart'; +import '../resources/R.dart'; +import '../screens/home/screens_for_apply/bottomModalApplySheet.dart'; class ProfileStatusIcon extends StatelessWidget { final String status; - final dynamic profile; + final ProfilesModel profile; final dynamic model; - const ProfileStatusIcon({Key key, this.status, this.profile, this.model}) - : super(key: key); + const ProfileStatusIcon({ + super.key, + required this.status, + required this.profile, + required this.model, + }); @override Widget build(BuildContext context) { @@ -36,7 +42,6 @@ class ProfileStatusIcon extends StatelessWidget { )); }, ); - break; case 'expired': return IconButton( icon: Icon( @@ -61,7 +66,6 @@ class ProfileStatusIcon extends StatelessWidget { )); }, ); - break; case 'open': return IconButton( icon: Icon( @@ -81,7 +85,6 @@ class ProfileStatusIcon extends StatelessWidget { }); }, ); - break; case 'withdrawable': return IconButton( icon: Icon( @@ -114,7 +117,6 @@ class ProfileStatusIcon extends StatelessWidget { )); }, ); - break; case 'locked': return IconButton( icon: Icon( @@ -138,7 +140,6 @@ class ProfileStatusIcon extends StatelessWidget { )); }, ); - break; default: return Icon(Icons.signal_cellular_connected_no_internet_4_bar); } diff --git a/lib/shared/dataProvider.dart b/lib/shared/dataProvider.dart index d4ec15c..9fd4a5a 100644 --- a/lib/shared/dataProvider.dart +++ b/lib/shared/dataProvider.dart @@ -14,8 +14,8 @@ class DataProvider with ChangeNotifier { // _placementResultSelector = true; // } + // bool _placementResultSelector = true; int _yearSelector = 0; - bool _placementResultSelector = true; int get yearSelector => _yearSelector; void yearSetter(int year) { diff --git a/lib/shared/loadingPage.dart b/lib/shared/loadingPage.dart index 6f83d03..fc74541 100644 --- a/lib/shared/loadingPage.dart +++ b/lib/shared/loadingPage.dart @@ -6,7 +6,7 @@ class LoadingPage extends StatelessWidget { @override Widget build(BuildContext context) { - return Container( + return ColoredBox( color: Colors.transparent, child: Center( child: SpinKitChasingDots( diff --git a/lib/viewmodels/CalendarViewModel.dart b/lib/viewmodels/CalendarViewModel.dart index eacbf0a..d98d80f 100644 --- a/lib/viewmodels/CalendarViewModel.dart +++ b/lib/viewmodels/CalendarViewModel.dart @@ -1,32 +1,23 @@ -import 'package:placement/enums/ViewStateEnum.dart'; -import 'package:placement/locator.dart'; -import 'package:placement/models/calendarEventModel.dart'; -import 'package:placement/services/generic/calendarService.dart'; -import 'package:placement/viewmodels/BaseViewModel.dart'; -import 'package:table_calendar/table_calendar.dart'; +import '../locator.dart'; +import '../models/calendarEventModel.dart'; +import '../services/generic/calendarService.dart'; +import 'BaseViewModel.dart'; class CalendarViewModel extends BaseViewModel { // CalendarController _calendarController = CalendarController(); + CalendarService _calendarService = locator(); List _events = []; List _upcomingEvents = []; List _selectedEvents = []; - CalendarService _calendarService = locator(); Map> _eventMap = {}; + Map> get eventMap => _eventMap; bool _displayUpcoming = true; - bool _isDisposed = false; + bool get displayUpcoming => _displayUpcoming; // CalendarController get calendarController => _calendarController; - Map> get eventMap => _eventMap; List get displayEvents => (_displayUpcoming) ? _upcomingEvents : _sortedCalendarModel(_selectedEvents); - bool get displayUpcoming => _displayUpcoming; - - @override - void dispose() { - _isDisposed = true; - super.dispose(); - } List _sortedCalendarModel( List unsorted) { @@ -38,10 +29,6 @@ class CalendarViewModel extends BaseViewModel { return unsorted; } - void _notif() { - if (!_isDisposed) notifyListeners(); - } - Future populateCalendar() async { setLoading(); _events = await _calendarService.fetchEvents(); @@ -56,11 +43,9 @@ class CalendarViewModel extends BaseViewModel { continue; } DateTime createDay = DateTime(eveDay.year, eveDay.month, eveDay.day); - if (_eventMap[createDay] != null) { - _eventMap[createDay].add(item); - } else { - _eventMap[createDay] = [item]; - } + + _eventMap.putIfAbsent(createDay, () => []).add(item); + if (today.isBefore(eveDay)) _upcomingEvents.add(item); } _upcomingEvents = _sortedCalendarModel(_upcomingEvents); @@ -69,13 +54,13 @@ class CalendarViewModel extends BaseViewModel { setIdle(); } - void onSelect(List _seEvents) { - if (_seEvents != null && _seEvents.length > 0) { + void onSelect(List? _seEvents) { + if (_seEvents != null && _seEvents.isNotEmpty) { _selectedEvents = _seEvents; _displayUpcoming = false; } else { _displayUpcoming = true; } - _notif(); + reload(); } } diff --git a/lib/viewmodels/CandidateDetailsViewModel.dart b/lib/viewmodels/CandidateDetailsViewModel.dart index eb648d4..cc006ab 100644 --- a/lib/viewmodels/CandidateDetailsViewModel.dart +++ b/lib/viewmodels/CandidateDetailsViewModel.dart @@ -1,15 +1,17 @@ -import 'package:placement/locator.dart'; -import 'package:placement/models/candidateModel.dart'; -import 'package:placement/services/auth/auth_service.dart'; -import 'package:placement/services/generic/applyService.dart'; -import 'package:placement/viewmodels/BaseViewModel.dart'; import 'package:url_launcher/url_launcher_string.dart'; +import '../locator.dart'; +import '../models/candidateModel.dart'; +import '../services/auth/auth_service.dart'; +import '../services/generic/applyService.dart'; +import 'BaseViewModel.dart'; +import '../models/placement_exception.dart'; + class CandidateDetailsViewModel extends BaseViewModel { ApplyService _applyService = locator(); - CandidateModel _candidate; AuthService _auth = AuthService(); - CandidateModel get candidate => _candidate; + CandidateModel? _candidate; + CandidateModel? get candidate => _candidate; Future fetchCandidate() async { setLoading(); @@ -17,11 +19,11 @@ class CandidateDetailsViewModel extends BaseViewModel { setIdle(); } - void launchURL(String url) async { + Future launchURL(String url) async { if (await canLaunchUrlString(url)) { await launchUrlString(url); } else { - throw 'Could not launch $url'; + throw PlacementException('Could not launch $url'); } } diff --git a/lib/viewmodels/CompanyDetailViewModel.dart b/lib/viewmodels/CompanyDetailViewModel.dart index b0b3c16..ecc4b10 100644 --- a/lib/viewmodels/CompanyDetailViewModel.dart +++ b/lib/viewmodels/CompanyDetailViewModel.dart @@ -1,33 +1,18 @@ - import 'package:jiffy/jiffy.dart'; -import 'package:placement/locator.dart'; -import 'package:placement/models/DetailCompanyProfileModel.dart'; -import 'package:placement/services/generic/applyService.dart'; -import 'package:placement/viewmodels/BaseViewModel.dart'; - -class CompanyDetailViewModel extends BaseViewModel { - - DetailCompanyProfileModel _companyProfile; - ApplyService _applyService = locator(); - bool _isDisposed = false; - bool _isLoading = false; - int _profileId; - bool get isLoading => _isLoading; - DetailCompanyProfileModel get companyProfile => _companyProfile; +import '../locator.dart'; +import '../models/DetailCompanyProfileModel.dart'; +import '../services/generic/applyService.dart'; +import 'BaseViewModel.dart'; - @override - void dispose() { - _isDisposed = true; - super.dispose(); - } - - void notif() { - if(!_isDisposed) notifyListeners(); - } +class CompanyDetailViewModel extends BaseViewModel { + DetailCompanyProfileModel? _companyProfile; + final ApplyService _applyService = locator(); + late int _profileId; + DetailCompanyProfileModel? get companyProfile => _companyProfile; - String formatIt(String it) { - if(it == null || it == "") return "-"; + String formatIt(String? it) { + if (it == null || it == "") return "-"; return it; } @@ -36,20 +21,29 @@ class CompanyDetailViewModel extends BaseViewModel { } bool checkPackage(String st) { - if(st == "ug") return (_companyProfile.packageBaseUg != null) || (_companyProfile.packageCtcUg != null); - else if(st == "pg") return (_companyProfile.packageBasePg != null) || (_companyProfile.packageCtcPg != null); - else if(st == "phd") return (_companyProfile.packageBasePhd != null) || (_companyProfile.packageCtcPhd != null); - else return true; + if (st == "ug") { + return (_companyProfile?.packageBaseUg != null) || + (_companyProfile?.packageCtcUg != null); + } else if (st == "pg") { + return (_companyProfile?.packageBasePg != null) || + (_companyProfile?.packageCtcPg != null); + } else if (st == "phd") { + return (_companyProfile?.packageBasePhd != null) || + (_companyProfile?.packageCtcPhd != null); + } else { + return true; + } } - String formatInt(int it) { - if(it == null) return "-"; + String formatInt(int? it) { + if (it == null) return "-"; return it.toString(); } - String formatDate(String it) { - if(it == "") return "-"; - return Jiffy(it).yMMMd + ", " + Jiffy(it).Hm; + String formatDate(String? it) { + if (it == null || it == "") return "-"; + final jiffy = Jiffy.parse(it).toLocal(); + return "${jiffy.yMMMd}, ${jiffy.Hm}"; } Future refreshDetails() async { @@ -58,16 +52,14 @@ class CompanyDetailViewModel extends BaseViewModel { String getTime(String time) { List _list = time.split(":"); - return _list[0] + ":" + _list[1]; + return "${_list[0]}:${_list[1]}"; } Future fetchCompanyDetails(int profileId) async { print("DETAIL FOR PID $profileId"); _profileId = profileId; - _isLoading = true; - notif(); + setLoading(); _companyProfile = await _applyService.fetchCompanyDetails(profileId); - _isLoading = false; - notif(); + setIdle(); } } \ No newline at end of file diff --git a/lib/viewmodels/ProfilesAppliedViewModel.dart b/lib/viewmodels/ProfilesAppliedViewModel.dart index 8fdb40d..a383a7e 100644 --- a/lib/viewmodels/ProfilesAppliedViewModel.dart +++ b/lib/viewmodels/ProfilesAppliedViewModel.dart @@ -1,52 +1,43 @@ - import 'package:jiffy/jiffy.dart'; -import 'package:placement/locator.dart'; -import 'package:placement/models/profilesModel.dart'; -import 'package:placement/resources/modelResources.dart'; -import 'package:placement/services/generic/applyService.dart'; -import 'package:placement/viewmodels/BaseViewModel.dart'; + +import '../locator.dart'; +import '../models/profilesModel.dart'; +import '../resources/modelResources.dart'; +import '../services/generic/applyService.dart'; +import 'BaseViewModel.dart'; class ProfilesAppliedViewModel extends BaseViewModel { ApplyService _applyService = locator(); - List _profiles = []; - bool _isLoading = false; - bool _isDisposed = false; - - List get profiles => _profiles; - bool get isLoading => _isLoading; - bool get isEmpty => (!_isLoading)&&(_profiles.length==0); + List? _profiles = []; + List? get profiles => _profiles; - @override - void dispose() { - _isDisposed = true; - super.dispose(); - } + bool get isEmpty => (!isBusy)&&(_profiles?.length==0); String formatDate(String it) { if(it == "") return "-"; - return Jiffy(it).yMMMd + " - " + Jiffy(it).Hm; + return Jiffy.parse(it).toLocal().yMMMd + " - " + Jiffy.parse(it).toLocal().Hm; } String profileStatus(int index) { - if(_profiles[index].status == "locked") return _profiles[index].application.statusDisplayName; - else if(_profiles[index].status == "open" && _profiles[index].applicationDeadline !=null) { - String date = "Apply before " + formatDate(_profiles[index].applicationDeadline); + final profiles = _profiles; + if (profiles == null) { + return "-"; + }; + if(profiles[index].status == "locked") return profiles[index].application.statusDisplayName ?? '-'; + else if(profiles[index].status == "open" && profiles[index].applicationDeadline !=null) { + String date = "Apply before " + formatDate(profiles[index].applicationDeadline!); return date; + } else if (profiles[index].status == "withdrawable") { + final title = profiles[index].application?.resume?.title ?? ""; + return title.isNotEmpty ? "$title Sent" : "Application Sent"; } - else if(_profiles[index].status == "withdrawable") return _profiles[index].application.resume.title + " Sent"; - return ModelResources.analyseProfileStatus(_profiles[index].status); - } - - void notif() { - if(!_isDisposed) notifyListeners(); + return ModelResources.analyseProfileStatus(profiles[index].status); } Future fetchProfilesApplied() async { - _isLoading = true; - notif(); + setLoading(); _profiles = await _applyService.fetchProfileApplied(); - _isLoading = false; - notif(); + setIdle(); } } \ No newline at end of file diff --git a/lib/viewmodels/ProfilesForAllViewModel.dart b/lib/viewmodels/ProfilesForAllViewModel.dart index dec3627..eaa58f0 100644 --- a/lib/viewmodels/ProfilesForAllViewModel.dart +++ b/lib/viewmodels/ProfilesForAllViewModel.dart @@ -13,25 +13,8 @@ class ProfilesForAllViewModel extends BaseViewModel { ApplyService _applyService = locator(); GlobalCache _cache = locator(); DeleteService _deleteService = DeleteService(); - List _profiles = []; - bool _isDisposed = false; - bool _loading = false; - bool _isNull = false; - - List get profiles => _profiles; - bool get isLoading => _loading; - bool get isNull => _isNull; - - @override - void dispose() { - print("DISPOSING FOR ALL!!"); - _isDisposed = true; - super.dispose(); - } - - void notif() { - if(!_isDisposed) notifyListeners(); - } + List? _profiles = []; + List? get profiles => _profiles; void _destroyProfileCache() { _cache.profilesOpenForAll = null; @@ -50,17 +33,23 @@ class ProfilesForAllViewModel extends BaseViewModel { String formatDate(String it) { if(it == "") return "-"; - return Jiffy(it).yMMMd + " - " + Jiffy(it).Hm; + return Jiffy.parse(it).toLocal().yMMMd + " - " + Jiffy.parse(it).toLocal().Hm; } String profileStatus(int index) { - if(_profiles[index].status == "locked") return _profiles[index].application.statusDisplayName; - else if(_profiles[index].status == "open" && _profiles[index].applicationDeadline !=null) { - String date = "Apply before " + formatDate(_profiles[index].applicationDeadline); + final profiles = _profiles; + if (profiles == null) { + return "-"; + }; + if(profiles[index].status == "locked") return profiles[index].application.statusDisplayName ?? '-'; + else if(profiles[index].status == "open" && profiles[index].applicationDeadline !=null) { + String date = "Apply before " + formatDate(profiles[index].applicationDeadline!); return date; + } else if (profiles[index].status == "withdrawable") { + final title = profiles[index].application?.resume?.title ?? ""; + return title.isNotEmpty ? "$title Sent" : "Application Sent"; } - else if(_profiles[index].status == "withdrawable") return _profiles[index].application.resume.title + " Sent"; - return ModelResources.analyseProfileStatus(_profiles[index].status); + return ModelResources.analyseProfileStatus(profiles[index].status); } Future deleteApplication(int applicationId) async { @@ -71,11 +60,8 @@ class ProfilesForAllViewModel extends BaseViewModel { Future populateProfiles() async { print("POPULATING ALL"); - _loading = true; - notif(); + setLoading(); _profiles = await _applyService.fetchProfileForAll(); - if(_profiles == null) _isNull = true; - _loading = false; - notif(); + setIdle(); } } \ No newline at end of file diff --git a/lib/viewmodels/ProfilesForMeViewModel.dart b/lib/viewmodels/ProfilesForMeViewModel.dart index bc7b006..97321a3 100644 --- a/lib/viewmodels/ProfilesForMeViewModel.dart +++ b/lib/viewmodels/ProfilesForMeViewModel.dart @@ -1,37 +1,21 @@ import 'package:jiffy/jiffy.dart'; -import 'package:placement/locator.dart'; -import 'package:placement/models/profilesModel.dart'; -import 'package:placement/resources/modelResources.dart'; -import 'package:placement/services/api_models/deleteService.dart'; -import 'package:placement/services/generic/applyService.dart'; -import 'package:placement/shared/GlobalCache.dart'; -import 'package:placement/viewmodels/BaseViewModel.dart'; + +import '../locator.dart'; +import '../models/profilesModel.dart'; +import '../resources/modelResources.dart'; +import '../services/api_models/deleteService.dart'; +import '../services/generic/applyService.dart'; +import '../shared/GlobalCache.dart'; +import 'BaseViewModel.dart'; class ProfilesForMeViewModel extends BaseViewModel { ApplyService _applyService = locator(); GlobalCache _cache = locator(); DeleteService _deleteService = DeleteService(); - List _profiles = []; - bool _isDisposed = false; - bool _loading = false; - bool _isNull = false; - - List get profiles => _profiles; - bool get isLoading => _loading; - bool get isNull => _isNull; - - @override - void dispose() { - _isDisposed = true; - print("DISPOSING FOR ME!!"); - super.dispose(); - } - - void notif() { - if(!_isDisposed) notifyListeners(); - } + List? _profiles= []; + List? get profiles => _profiles; void _destroyProfileCache() { _cache.profilesForMe = null; @@ -40,17 +24,23 @@ class ProfilesForMeViewModel extends BaseViewModel { String formatDate(String it) { if(it == "") return "-"; - return Jiffy(it).yMMMd + " - " + Jiffy(it).Hm; + return Jiffy.parse(it).toLocal().yMMMd + " - " + Jiffy.parse(it).toLocal().Hm; } String profileStatus(int index) { - if(_profiles[index].status == "locked") return _profiles[index].application.statusDisplayName; - else if(_profiles[index].status == "open" && _profiles[index].applicationDeadline !=null) { - String date = "Apply before " + formatDate(_profiles[index].applicationDeadline); + final profiles = _profiles; + if (profiles == null) { + return "-"; + }; + if(profiles[index].status == "locked") return profiles[index].application.statusDisplayName ?? '-'; + else if(profiles[index].status == "open" && profiles[index].applicationDeadline !=null) { + String date = "Apply before " + formatDate(profiles[index].applicationDeadline!); return date; + } else if (profiles[index].status == "withdrawable") { + final title = profiles[index].application?.resume?.title ?? ""; + return title.isNotEmpty ? "$title Sent" : "Application Sent"; } - else if(_profiles[index].status == "withdrawable") return _profiles[index].application.resume.title + " Sent"; - return ModelResources.analyseProfileStatus(_profiles[index].status); + return ModelResources.analyseProfileStatus(profiles[index].status); } Future refreshAndWait() async { @@ -70,11 +60,8 @@ class ProfilesForMeViewModel extends BaseViewModel { } Future populateProfiles() async { - _loading = true; - notif(); + setLoading(); _profiles = await _applyService.fetchProfileForMe(); - if(_profiles == null) _isNull = true; - _loading = false; - notif(); + setIdle(); } } \ No newline at end of file diff --git a/lib/viewmodels/ResultPageViewModel.dart b/lib/viewmodels/ResultPageViewModel.dart index 8747833..8d9bc93 100644 --- a/lib/viewmodels/ResultPageViewModel.dart +++ b/lib/viewmodels/ResultPageViewModel.dart @@ -1,22 +1,20 @@ - import 'package:flutter/material.dart'; -import 'package:placement/locator.dart'; -import 'package:placement/shared/GlobalCache.dart'; -import 'package:placement/viewmodels/BaseViewModel.dart'; + +import '../locator.dart'; +import '../shared/GlobalCache.dart'; +import 'BaseViewModel.dart'; class ResultPageViewModel extends BaseViewModel { final ScrollController _scrollController = ScrollController(); + ScrollController get scrollController => _scrollController; + GlobalCache _cache = locator(); - int _yearSelectionVariable; - int _resultTypeVariable; - int _sortVariable; - bool _isDisposed = false; + late int _yearSelectionVariable, _resultTypeVariable, _sortVariable; int get yearSelectionVariable => _yearSelectionVariable; int get resultTypeVariable => _resultTypeVariable; int get sortVariable => _sortVariable; - ScrollController get scrollController => _scrollController; @override void dispose() { @@ -26,38 +24,31 @@ class ResultPageViewModel extends BaseViewModel { void retrieveCache() { if(_cache.filterFields == null) { - Map _cacheMap = { + Map _cacheMap = { "year" : 0, "type" : 0, "sort" : 0 }; _cache.filterFields = _cacheMap; - _yearSelectionVariable = 0; - _resultTypeVariable = 0; - _sortVariable = 0; - } else { - _yearSelectionVariable = _cache.filterFields['year']; - _resultTypeVariable = _cache.filterFields['type']; - _sortVariable = _cache.filterFields['sort']; } + _yearSelectionVariable = _cache.filterFields!['year'] ?? 0; + _resultTypeVariable = _cache.filterFields!['type'] ?? 0; + _sortVariable = _cache.filterFields!['sort'] ?? 0; } void _cacheFields() { - _cache.filterFields['year'] = _yearSelectionVariable; - _cache.filterFields['type'] = _resultTypeVariable; - _cache.filterFields['sort'] = _sortVariable; - } - - void _notif() { - if(!_isDisposed) notifyListeners(); + _cache.filterFields + ?..['year'] = _yearSelectionVariable + ..['type'] = _resultTypeVariable + ..['sort'] = _sortVariable; } - void setFields(int year, int type, int sort) { - _yearSelectionVariable = year; - _resultTypeVariable = type; - _sortVariable = sort; + void setFields(int? year, int? type, int? sort) { + _yearSelectionVariable = year ?? 0; + _resultTypeVariable = type ?? 0; + _sortVariable = sort ?? 0; print("SETTING THE FIELDS $_yearSelectionVariable - $_resultTypeVariable - $_sortVariable"); - _notif(); + reload(); _deleteCachedResults(); _cacheFields(); } @@ -66,22 +57,4 @@ class ResultPageViewModel extends BaseViewModel { _cache.companyWiseResults = null; _cache.branchWiseResults = null; } - - void selectYear(int year) { - _yearSelectionVariable = year; - _notif(); - _cacheFields(); - } - - void selectSort(int sort) { - _sortVariable = sort; - _notif(); - _cacheFields(); - } - - void selectResultType(int type) { - _resultTypeVariable = type; - _notif(); - _cacheFields(); - } -} \ No newline at end of file +} diff --git a/lib/viewmodels/ResultsBranchWiseViewModel.dart b/lib/viewmodels/ResultsBranchWiseViewModel.dart index 48eeaee..5043fbe 100644 --- a/lib/viewmodels/ResultsBranchWiseViewModel.dart +++ b/lib/viewmodels/ResultsBranchWiseViewModel.dart @@ -1,34 +1,27 @@ - -import 'package:placement/locator.dart'; -import 'package:placement/models/branchConciseModel.dart'; -import 'package:placement/services/generic/resultService.dart'; -import 'package:placement/shared/GlobalCache.dart'; -import 'package:placement/viewmodels/BaseViewModel.dart'; +import '../locator.dart'; +import '../models/branchConciseModel.dart'; +import '../services/generic/resultService.dart'; +import '../shared/GlobalCache.dart'; +import 'BaseViewModel.dart'; class ResultsBranchWiseViewModel extends BaseViewModel { ResultService _resultService = locator(); GlobalCache _cache = locator(); - List _branchResults = []; - int _yearIndex, _internSwitch, _sortSwitch; - bool _isDisposed = false; - List get branchResults => _branchResults; + List? _branchResults = []; + List? get branchResults => _branchResults; + + late int _yearIndex, _internSwitch, _sortSwitch; int get yearIndex => _yearIndex; int get internSwitch => _internSwitch; int get sortSwitch => _sortSwitch; - @override - void dispose() { - _isDisposed = true; - super.dispose(); - } - - void setResultFilter(int yrIndex, int internSwitcher, int sortSwitch) { + Future setResultFilter(int yrIndex, int internSwitcher, int sortSwitch) async { _yearIndex = yrIndex; _internSwitch = internSwitcher; _sortSwitch = sortSwitch; - _populateResults(); + await _populateResults(); } Future refreshResults() async { @@ -36,17 +29,14 @@ class ResultsBranchWiseViewModel extends BaseViewModel { await _populateResults(); } - void notif() { - if(!_isDisposed) notifyListeners(); - } - Future _populateResults() async { + setLoading(); _branchResults = await _resultService.branchWiseResults(_yearIndex, _internSwitch); if(_sortSwitch == 1) { - _branchResults.sort( + _branchResults?.sort( (a,b) => a.studentBranchName.compareTo(b.studentBranchName) ); } - notif(); + setIdle(); } -} \ No newline at end of file +} diff --git a/lib/viewmodels/ResultsCompanyWiseViewModel.dart b/lib/viewmodels/ResultsCompanyWiseViewModel.dart index e508fab..a37bbc0 100644 --- a/lib/viewmodels/ResultsCompanyWiseViewModel.dart +++ b/lib/viewmodels/ResultsCompanyWiseViewModel.dart @@ -1,33 +1,27 @@ - -import 'package:placement/locator.dart'; -import 'package:placement/models/companyConciseModel.dart'; -import 'package:placement/services/generic/resultService.dart'; -import 'package:placement/shared/GlobalCache.dart'; -import 'package:placement/viewmodels/BaseViewModel.dart'; +import '../locator.dart'; +import '../models/companyConciseModel.dart'; +import '../services/generic/resultService.dart'; +import '../shared/GlobalCache.dart'; +import 'BaseViewModel.dart'; class ResultsCompanyWiseViewModel extends BaseViewModel { ResultService _resultService = locator(); GlobalCache _cache = locator(); - List _companyResults = []; - int _yearIndex, _internSwitch, _sortSwitch; - bool _isDisposed = false; - List get companyResults => _companyResults; + List? _companyResults = []; + List? get companyResults => _companyResults; + + late int _yearIndex, _internSwitch, _sortSwitch; int get yearIndex => _yearIndex; int get internSwitch => _internSwitch; int get sortSwitch => _sortSwitch; - @override - void dispose() { - _isDisposed = true; - super.dispose(); - } - void setResultFilter(int yrIndex, int internSwitcher, int sortIndex) { + Future setResultFilter(int yrIndex, int internSwitcher, int sortIndex) async { _yearIndex = yrIndex; _internSwitch = internSwitcher; _sortSwitch = sortIndex; - _populateResults(); + await _populateResults(); } Future refreshResults() async { @@ -35,15 +29,12 @@ class ResultsCompanyWiseViewModel extends BaseViewModel { await _populateResults(); } - void notif() { - if(!_isDisposed) notifyListeners(); - } - Future _populateResults() async { + setLoading(); _companyResults = await _resultService.companyWiseResults(_yearIndex, _internSwitch); - if(_sortSwitch == 1) _companyResults.sort( + if(_sortSwitch == 1) _companyResults?.sort( (a,b) => a.companyName.compareTo(b.companyName) ); - notif(); + setIdle(); } -} \ No newline at end of file +} diff --git a/lib/viewmodels/ResumeListViewModel.dart b/lib/viewmodels/ResumeListViewModel.dart index 390cc9c..6999223 100644 --- a/lib/viewmodels/ResumeListViewModel.dart +++ b/lib/viewmodels/ResumeListViewModel.dart @@ -1,15 +1,17 @@ -import 'package:placement/locator.dart'; -import 'package:placement/models/resumeModel.dart'; -import 'package:placement/services/generic/applyService.dart'; -import 'package:placement/viewmodels/BaseViewModel.dart'; import 'package:url_launcher/url_launcher_string.dart'; +import '../locator.dart'; +import '../models/placement_exception.dart'; +import '../models/resumeModel.dart'; +import '../services/generic/applyService.dart'; +import 'BaseViewModel.dart'; + class ResumeListViewModel extends BaseViewModel { - List _resumes = []; + List? _resumes = []; ApplyService _applyService = locator(); - List get resumes => _resumes; - bool get isEmpty => (!isBusy) && (_resumes.length == 0); + List? get resumes => _resumes; + bool get isEmpty => (!isBusy) && (_resumes?.length == 0); Future getResumes() async { setLoading(); @@ -17,11 +19,11 @@ class ResumeListViewModel extends BaseViewModel { setIdle(); } - void launchURL(String url) async { + Future launchURL(String url) async { if (await canLaunchUrlString(url)) { await launchUrlString(url); } else { - throw 'Could not launch $url'; + throw PlacementException('Could not launch "$url"'); } } } diff --git a/lib/views/CandidateDetailsView.dart b/lib/views/CandidateDetailsView.dart index 7e62ac6..4fc881f 100644 --- a/lib/views/CandidateDetailsView.dart +++ b/lib/views/CandidateDetailsView.dart @@ -1,14 +1,14 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; -import 'package:placement/resources/R.dart'; -import 'package:placement/resources/strings.dart'; -import 'package:placement/shared/hexColor.dart'; -import 'package:placement/shared/loadingPage.dart'; -import 'package:placement/viewmodels/CandidateDetailsViewModel.dart'; -import 'package:placement/views/baseView.dart'; + +import '../resources/R.dart'; +import '../resources/strings.dart'; +import '../shared/loadingPage.dart'; +import '../viewmodels/CandidateDetailsViewModel.dart'; +import 'baseView.dart'; class CandidateDetailsView extends StatelessWidget { - const CandidateDetailsView({Key key}) : super(key: key); + const CandidateDetailsView({super.key}); @override Widget build(BuildContext context) { @@ -27,10 +27,10 @@ class CandidateDetailsView extends StatelessWidget { BuildContext context, CandidateDetailsViewModel model, double _width) { return Scaffold( appBar: AppBar( - title: Text("Profile"), + title: const Text("Profile"), centerTitle: true, ), - body: Container( + body: ConstrainedBox( constraints: BoxConstraints.expand(), child: (model.isBusy) ? Center( @@ -49,13 +49,13 @@ class CandidateDetailsView extends StatelessWidget { child: Column( mainAxisSize: MainAxisSize.min, children: [ - SizedBox( + const SizedBox( height: 30, ), - Center( + const Center( child: Text("Something went Wrong"), ), - SizedBox( + const SizedBox( height: 20, ), _menu(context, model, _width), @@ -69,23 +69,23 @@ class CandidateDetailsView extends StatelessWidget { child: Column( mainAxisSize: MainAxisSize.min, children: [ - SizedBox( + const SizedBox( height: 30, ), _headerAndIcon(context, model.candidate, _width), - SizedBox( + const SizedBox( height: 20, ), _studentInfo(context, model.candidate, _width), - SizedBox( + const SizedBox( height: 20, ), _myApplicationsButton(context, model.candidate, _width), - SizedBox( + const SizedBox( height: 20, ), _myResumesButton(context, model.candidate, _width), - SizedBox( + const SizedBox( height: 20, ), _menu(context, model, _width), @@ -95,7 +95,7 @@ class CandidateDetailsView extends StatelessWidget { } Widget _menu(BuildContext context, dynamic model, double _width) { - return Container( + return SizedBox( width: _width * 0.9, child: Column( mainAxisSize: MainAxisSize.min, @@ -108,8 +108,8 @@ class CandidateDetailsView extends StatelessWidget { "FAQs", style: TextStyle(color: R.textColPrimary), ), - onTap: () { - model.launchURL(Strings.FAQ_LINK); + onTap: () async { + await model.launchURL(Strings.FAQ_LINK); }, ), _divider(), @@ -165,7 +165,7 @@ class CandidateDetailsView extends StatelessWidget { } Widget _divider() { - return Divider( + return const Divider( color: Color(0xFFe6e6e6), thickness: 1, indent: 10, @@ -197,14 +197,14 @@ class CandidateDetailsView extends StatelessWidget { return Container( width: _width * 0.9, decoration: BoxDecoration( - color: Color(0xFF73A1FD).withOpacity(0.1), + color: const Color.fromRGBO(115, 161, 253, 0.1), borderRadius: BorderRadius.circular(10)), padding: EdgeInsets.symmetric(vertical: 10), child: Row( children: [ Expanded( flex: 3, - child: Container( + child: Padding( padding: EdgeInsets.only(left: 20), child: Text( heading, @@ -212,7 +212,7 @@ class CandidateDetailsView extends StatelessWidget { ), ), ), - Expanded( + const Expanded( flex: 1, child: Icon( Icons.arrow_forward_ios, @@ -225,7 +225,7 @@ class CandidateDetailsView extends StatelessWidget { } Widget _studentInfo(BuildContext context, dynamic model, double _width) { - return Container( + return SizedBox( width: _width * 0.9, child: Column( mainAxisSize: MainAxisSize.min, @@ -235,22 +235,22 @@ class CandidateDetailsView extends StatelessWidget { model.degreeName, style: TextStyle(color: Colors.black54), ), - SizedBox( + const SizedBox( height: 5, ), Text( model.departmentName, style: TextStyle(color: Colors.black54), ), - SizedBox( + const SizedBox( height: 10, ), _statusRows("Status: ", model.season + ", " + model.internshipStatus), - SizedBox( + const SizedBox( height: 5, ), _statusRows("Pool A Credits: ", model.creditsPoolA.toString()), - SizedBox( + const SizedBox( height: 5, ), _statusRows("Pool B Credits: ", model.creditsPoolB.toString()), @@ -277,62 +277,39 @@ class CandidateDetailsView extends StatelessWidget { } Widget _headerAndIcon(BuildContext context, dynamic model, double _width) { - return Container( + final String? displayPicture = model.displayPicture; + return SizedBox( width: _width * 0.9, child: Row( mainAxisSize: MainAxisSize.min, children: [ - Container( - child: Stack( - children: [ - Container( - width: 60, - height: 60, - decoration: BoxDecoration( - color: Colors.grey[300], shape: BoxShape.circle), - child: Icon( - Icons.account_circle, - size: 60, - color: Theme.of(context).primaryColor, - ), - ), - CachedNetworkImage( - imageUrl: model.displayPicture, - placeholder: _imagePlaceHolder, - imageBuilder: (context, imageProvider) { - return CircleAvatar( - backgroundImage: imageProvider, - radius: 30, - ); - }, + Stack( + children: [ + Container( + width: 60, + height: 60, + decoration: const BoxDecoration( + color: Color(0xFFE0E0E0), shape: BoxShape.circle), + child: Icon( + Icons.account_circle, + size: 60, + color: Theme.of(context).primaryColor, ), - ], - ), + ), + if (displayPicture != null) + CachedNetworkImage( + imageUrl: displayPicture, + placeholder: _imagePlaceHolder, + imageBuilder: (context, imageProvider) { + return CircleAvatar( + backgroundImage: imageProvider, + radius: 30, + ); + }, + ), + ], ), - // Container( - // width: 60, - // height: 60, - // decoration: BoxDecoration( - // color: Colors.red, - // shape: BoxShape.circle, - // image: DecorationImage( - // image: - // ) - // ), - // child: (model.displayPicture != null) ? - // CachedNetworkImage( - // imageUrl: model.displayPicture, - // placeholder: _imagePlaceHolder, - // imageBuilder: (context, imageProvider) { - // return CircleAvatar( - // backgroundImage: imageProvider, - // radius: 30, - // ); - // }, - // ) : - // _imagePlaceHolder(context, ""), - // ), - SizedBox( + const SizedBox( width: 10, ), Text( diff --git a/lib/views/CompanyDetailView.dart b/lib/views/CompanyDetailView.dart index f73310b..90da542 100644 --- a/lib/views/CompanyDetailView.dart +++ b/lib/views/CompanyDetailView.dart @@ -1,13 +1,16 @@ import 'package:flutter/material.dart'; import 'package:jiffy/jiffy.dart'; -import 'package:placement/screens/home/screens_for_apply/bottomModalApplySheet.dart'; -import 'package:placement/shared/loadingPage.dart'; -import 'package:placement/viewmodels/CompanyDetailViewModel.dart'; -import 'package:placement/views/baseView.dart'; + +import '../models/DetailCompanyProfileModel.dart'; +import '../resources/R.dart'; +import '../screens/home/screens_for_apply/bottomModalApplySheet.dart'; +import '../shared/loadingPage.dart'; +import '../viewmodels/CompanyDetailViewModel.dart'; +import 'baseView.dart'; class CompanyDetailView extends StatelessWidget { - final Map args; - const CompanyDetailView({Key key, this.args}) : super(key: key); + final dynamic args; + const CompanyDetailView({super.key, required this.args}); @override Widget build(BuildContext context) { @@ -24,80 +27,88 @@ class CompanyDetailView extends StatelessWidget { Widget _companyDetailScaffold( BuildContext context, CompanyDetailViewModel model, double _width) { - return Scaffold( - appBar: AppBar( - title: Text("Profile Details"), - ), - body: (model.isLoading) - ? Center( - child: LoadingPage(), - ) - : Container( - constraints: BoxConstraints.expand(), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - SizedBox( - height: 30, - ), - _header(context, model, _width), - SizedBox( - height: 20, - ), - _applyButton(context, model, _width), - SizedBox( - height: 10, - ), - _description(context, model, _width), - SizedBox( - height: 20, - ), - _eligibleBranches(context, model, _width), - SizedBox( - height: 20, - ), - _profileDetail(context, model, _width), - SizedBox( - height: 20, - ), - _packageDetail(context, model, _width), - SizedBox( - height: 20, - ), - _roundSet(context, model, _width), - SizedBox( - height: 20, + final companyProfile = model.companyProfile; + return ColoredBox( + color: R.primaryCol, + child: SafeArea( + left: false, + right: false, + child: Scaffold( + appBar: AppBar( + title: Text("Profile Details"), + ), + body: (model.isBusy || companyProfile == null) + ? Center( + child: LoadingPage(), + ) + : ConstrainedBox( + constraints: BoxConstraints.expand(), + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + const SizedBox( + height: 30, + ), + _header(context, model, companyProfile, _width), + const SizedBox( + height: 20, + ), + _applyButton(context, model, companyProfile, _width), + const SizedBox( + height: 10, + ), + _description(context, companyProfile, _width), + const SizedBox( + height: 20, + ), + _eligibleBranches(context, companyProfile, _width), + const SizedBox( + height: 20, + ), + _profileDetail(context, model, companyProfile, _width), + const SizedBox( + height: 20, + ), + _packageDetail(context, model, companyProfile, _width), + const SizedBox( + height: 20, + ), + _roundSet(context, model, companyProfile, _width), + const SizedBox( + height: 20, + ), + ], ), - ], + ), ), - ), - ), + ), + ), ); } Widget _roundSet( - BuildContext context, CompanyDetailViewModel model, double _width) { + BuildContext context, CompanyDetailViewModel model, DetailCompanyProfileModel companyProfile, double _width) { int inx = 0; - return (model.companyProfile.roundSet.length == 0) - ? Container() - : Container( + return (companyProfile.roundSet!.length == 0) + ? const SizedBox.shrink() + : SizedBox( width: _width * 0.9, child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ _sectionHeading("Process Details"), - SizedBox( + const SizedBox( height: 5, ), Column( mainAxisSize: MainAxisSize.min, - children: model.companyProfile.roundSet.map((val) { + children: companyProfile.roundSet!.map((val) { return _rowItem( context, - val.name, - Jiffy(val.date).yMMMd + ", " + model.getTime(val.time), + val.name!, + Jiffy.parse(val.date!).toLocal().yMMMd + ", " + model.getTime(val.time!), (inx++) % 2 == 0); }).toList(), ), @@ -107,9 +118,9 @@ class CompanyDetailView extends StatelessWidget { } Widget _packageDetail( - BuildContext context, CompanyDetailViewModel model, double _width) { + BuildContext context, CompanyDetailViewModel model,DetailCompanyProfileModel companyProfile, double _width) { return (model.checkOverallPackage()) - ? Container( + ? SizedBox( width: _width * 0.9, child: Column( mainAxisSize: MainAxisSize.min, @@ -119,79 +130,79 @@ class CompanyDetailView extends StatelessWidget { _rowItemDual( context, "Under Graduate", - model.formatInt(model.companyProfile.packageCtcUg), - model.formatInt(model.companyProfile.packageBaseUg), + model.formatInt(companyProfile.packageCtcUg), + model.formatInt(companyProfile.packageBaseUg), true, visible: model.checkPackage("ug")), _rowItemDual( context, "Post Graduate", - model.formatInt(model.companyProfile.packageCtcPg), - model.formatInt(model.companyProfile.packageBasePg), + model.formatInt(companyProfile.packageCtcPg), + model.formatInt(companyProfile.packageBasePg), false, visible: model.checkPackage("pg")), _rowItemDual( context, "PHd", - model.formatInt(model.companyProfile.packageCtcPhd), - model.formatInt(model.companyProfile.packageBasePhd), + model.formatInt(companyProfile.packageCtcPhd), + model.formatInt(companyProfile.packageBasePhd), true, visible: model.checkPackage("phd")), ], ), ) - : Container(); + : const SizedBox.shrink(); } Widget _profileDetail( - BuildContext context, CompanyDetailViewModel model, double _width) { - print("REBUILD!! + ${model.companyProfile.packageDescription.toString()}"); - return Container( + BuildContext context, CompanyDetailViewModel model,DetailCompanyProfileModel companyProfile, double _width) { + print("REBUILD!! + ${companyProfile.packageDescription.toString()}"); + return SizedBox( width: _width * 0.9, child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ _sectionHeading("Profile Details"), - SizedBox( + const SizedBox( height: 5, ), _rowItem(context, "Profile Name", - model.formatIt(model.companyProfile.name), true), + model.formatIt(companyProfile.name), true), _rowItem(context, "Profile Category", - model.formatIt(model.companyProfile.category), false), + model.formatIt(companyProfile.category), false), _rowItem(context, "CGPA Requirement", - model.formatIt(model.companyProfile.cgpaRequirement), true), + model.formatIt(companyProfile.cgpaRequirement), true), _rowItem(context, "Description", - model.formatIt(model.companyProfile.description), false), + model.formatIt(companyProfile.description), false), _rowItem( - context, "Post", model.formatIt(model.companyProfile.post), true), + context, "Post", model.formatIt(companyProfile.post), true), _rowItem(context, "Posting Location", - model.formatIt(model.companyProfile.location), false), + model.formatIt(companyProfile.location), false), _rowItem(context, "Package Description", - model.formatIt(model.companyProfile.packageDescription), true), + model.formatIt(companyProfile.packageDescription), true), _rowItem(context, "Cover Letter Required", - (model.companyProfile.requiresCoverLetter) ? "Yes" : "No", false), + (companyProfile.requiresCoverLetter!) ? "Yes" : "No", false), _rowItem(context, "Target Credit Pool", - model.formatIt(model.companyProfile.targetCreditPool), true), + model.formatIt(companyProfile.targetCreditPool), true), _rowItem( context, "PPT Presence Required", - (model.companyProfile.talkPresenceRequired) ? "Yes" : "No", + (companyProfile.talkPresenceRequired!) ? "Yes" : "No", false), _rowItem(context, "PPT Date", - model.formatDate(model.companyProfile.talkDate), true), + model.formatDate(companyProfile.talkDate), true), _rowItem(context, "PPT Absence Cost", - model.companyProfile.talkAbsenceCost.toString(), false), + companyProfile.talkAbsenceCost.toString(), false), _rowItem(context, "PPT Status", - model.formatIt(model.companyProfile.talkStatus), true), + model.formatIt(companyProfile.talkStatus), true), _rowItem( context, "Application Deadline", - model.formatDate(model.companyProfile.applicationDeadline), + model.formatDate(companyProfile.applicationDeadline), false), _rowItem(context, "Application Cost", - model.companyProfile.applicationCost.toString(), true), + companyProfile.applicationCost.toString(), true), ], ), ); @@ -264,11 +275,11 @@ class CompanyDetailView extends StatelessWidget { ], ), ) - : Container(); + : const SizedBox.shrink(); } Widget _eligibleBranches( - BuildContext context, CompanyDetailViewModel model, double _width) { + BuildContext context, DetailCompanyProfileModel companyProfile, double _width) { return Container( width: _width * 0.9, decoration: BoxDecoration( @@ -284,14 +295,14 @@ class CompanyDetailView extends StatelessWidget { ), child: ExpansionTile( title: Text("View Eligible Branches"), - children: model.companyProfile.branchRequirement + children: companyProfile.branchRequirement! .map((val) => Container( width: _width * 0.9, padding: EdgeInsets.fromLTRB(5, 5, 0, 5), child: Text( - val.name, + val.name!, overflow: TextOverflow.clip, - style: TextStyle(color: Color(0xFF666666)), + style: const TextStyle(color: Color(0xFF666666)), ), )) .toList(), @@ -300,8 +311,8 @@ class CompanyDetailView extends StatelessWidget { } Widget _description( - BuildContext context, CompanyDetailViewModel model, double _width) { - return Container( + BuildContext context, DetailCompanyProfileModel companyProfile, double _width) { + return SizedBox( width: _width * 0.9, child: Column( mainAxisSize: MainAxisSize.min, @@ -309,7 +320,7 @@ class CompanyDetailView extends StatelessWidget { children: [ _sectionHeading("Description"), Text( - model.companyProfile.company.description, + companyProfile.company!.description!, style: TextStyle(color: Color(0xFF666666)), ) ], @@ -318,29 +329,29 @@ class CompanyDetailView extends StatelessWidget { } Widget _header( - BuildContext context, CompanyDetailViewModel model, double _width) { - return Container( + BuildContext context, CompanyDetailViewModel model, DetailCompanyProfileModel companyProfile, double _width) { + return SizedBox( width: _width * 0.9, child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - model.companyProfile.company.name + + companyProfile.company!.name! + " (" + - model.companyProfile.name + + companyProfile.name! + ")", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 23), ), Text( - model.companyProfile.company.sector, + companyProfile.company!.sector!, style: TextStyle(color: Color(0xFF666666)), ), - SizedBox( + const SizedBox( height: 20, ), Text( - "Last Date of Application : ${model.formatDate(model.companyProfile.applicationDeadline)}", + "Last Date of Application : ${model.formatDate(companyProfile.applicationDeadline)}", style: TextStyle(fontWeight: FontWeight.bold), ) ], @@ -349,7 +360,7 @@ class CompanyDetailView extends StatelessWidget { } Widget _sectionHeading(String heading) { - return Container( + return Padding( padding: EdgeInsets.symmetric(vertical: 10), child: Text( heading, @@ -359,10 +370,10 @@ class CompanyDetailView extends StatelessWidget { } Widget _applyButton( - BuildContext context, CompanyDetailViewModel model, double _width) { + BuildContext context, CompanyDetailViewModel model, DetailCompanyProfileModel companyProfile, double _width) { dynamic parentViewModel = args["parentViewModel"]; dynamic profileModel = args["profileModel"]; - switch (model.companyProfile.profileStatus) { + switch (companyProfile.profileStatus) { case 'branch_not_eligible': return InkWell( child: _buttonContainer( @@ -391,7 +402,6 @@ class CompanyDetailView extends StatelessWidget { )); }, ); - break; case 'expired': return InkWell( child: _buttonContainer( @@ -420,7 +430,6 @@ class CompanyDetailView extends StatelessWidget { )); }, ); - break; case 'open': return InkWell( child: _buttonContainer( @@ -431,21 +440,17 @@ class CompanyDetailView extends StatelessWidget { Icons.send, color: Colors.white, )), - onTap: () { - showModalBottomSheet( + onTap: () async { + bool? _didApply = await showModalBottomSheet( context: context, - builder: (context) { - return BottomModalApplySheet( - profile: profileModel, - ); - }).then((value) { - print("APPLIED!!"); - parentViewModel.refresh(); - model.refreshDetails(); - }); + builder: (context) => BottomModalApplySheet(profile: profileModel)); + if (_didApply == true){ + print("APPLIED!!"); + parentViewModel.refresh(); + model.refreshDetails(); + } }, ); - break; case 'withdrawable': return InkWell( child: _buttonContainer( @@ -474,7 +479,7 @@ class CompanyDetailView extends StatelessWidget { child: Text("Sure"), onPressed: () async { await parentViewModel.deleteApplication( - model.companyProfile.application.id); + companyProfile.application.id); model.refreshDetails(); Navigator.of(context).pop(); }, @@ -483,7 +488,6 @@ class CompanyDetailView extends StatelessWidget { )); }, ); - break; case 'locked': return InkWell( child: _buttonContainer( @@ -511,7 +515,6 @@ class CompanyDetailView extends StatelessWidget { )); }, ); - break; default: return Icon(Icons.signal_cellular_connected_no_internet_4_bar); } diff --git a/lib/views/ProfilesAppliedView.dart b/lib/views/ProfilesAppliedView.dart index 854234f..87b41af 100644 --- a/lib/views/ProfilesAppliedView.dart +++ b/lib/views/ProfilesAppliedView.dart @@ -1,10 +1,12 @@ import 'package:flutter/material.dart'; -import 'package:placement/shared/loadingPage.dart'; -import 'package:placement/viewmodels/ProfilesAppliedViewModel.dart'; -import 'package:placement/views/baseView.dart'; + +import '../models/profilesModel.dart'; +import '../shared/loadingPage.dart'; +import '../viewmodels/ProfilesAppliedViewModel.dart'; +import 'baseView.dart'; class ProfilesAppliedView extends StatelessWidget { - const ProfilesAppliedView({Key key}) : super(key: key); + const ProfilesAppliedView({super.key}); @override Widget build(BuildContext context) { @@ -26,46 +28,35 @@ class ProfilesAppliedView extends StatelessWidget { } Widget _profilesBody(BuildContext context, ProfilesAppliedViewModel model) { - if (model.isLoading) + if (model.isBusy) return Center( child: LoadingPage(), ); + final profiles = model.profiles; + if (profiles == null){ + return Center(child: Text("Something went Wrong"),); + } if (model.isEmpty) - return Center( + return const Center( child: Text("No Applications found"), ); - return Container( - constraints: BoxConstraints.expand(), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - _profilesList(context, model), - ], - ), - ), - ); + return _profilesList(context, model, profiles); } - Widget _profilesList(BuildContext context, ProfilesAppliedViewModel model) { + Widget _profilesList(BuildContext context, ProfilesAppliedViewModel model, List profiles) { return ListView.builder( - shrinkWrap: true, - physics: ScrollPhysics(), padding: EdgeInsets.all(0), - itemCount: model.profiles.length, + itemCount: profiles.length, itemBuilder: (context, index) { return Card( margin: EdgeInsets.only(bottom: 1), child: ListTile( title: Text( - model.profiles[index].companyName, + profiles[index].companyName, style: TextStyle(fontWeight: FontWeight.bold, height: 1.5), ), subtitle: Text( - model.profiles[index].application.resume.title + - " sent" + - ", " + - model.profileStatus(index), + _subTitleText(model, profiles, index), style: TextStyle(height: 1.85), ), ), @@ -73,4 +64,12 @@ class ProfilesAppliedView extends StatelessWidget { }, ); } + + String _subTitleText(ProfilesAppliedViewModel model, List profiles, int index) { + String? resumeTitle = profiles[index].application.resume.title; + if (resumeTitle == null){ + return "Resume sent"; + } + return (resumeTitle+" sent, "+ model.profileStatus(index)); + } } diff --git a/lib/views/ProfilesForAllView.dart b/lib/views/ProfilesForAllView.dart index a24d080..4906fc1 100644 --- a/lib/views/ProfilesForAllView.dart +++ b/lib/views/ProfilesForAllView.dart @@ -1,13 +1,13 @@ import 'package:flutter/material.dart'; -import 'package:jiffy/jiffy.dart'; -import 'package:placement/shared/ProfileStatusIcon.dart'; -import 'package:placement/shared/loadingPage.dart'; -import 'package:placement/viewmodels/ProfilesForAllViewModel.dart'; -import 'package:placement/viewmodels/ProfilesForMeViewModel.dart'; -import 'package:placement/views/baseView.dart'; + +import '../shared/ErrorWidget.dart'; +import '../shared/ProfileStatusIcon.dart'; +import '../shared/loadingPage.dart'; +import '../viewmodels/ProfilesForAllViewModel.dart'; +import 'baseView.dart'; class ProfilesForAllView extends StatelessWidget { - const ProfilesForAllView({Key key}) : super(key: key); + const ProfilesForAllView({super.key}); @override Widget build(BuildContext context) { @@ -20,26 +20,25 @@ class ProfilesForAllView extends StatelessWidget { } Widget _applyWidget(BuildContext context, ProfilesForAllViewModel model) { - if (model.isLoading) + if (model.isBusy) return Center( child: LoadingPage(), ); - return Container( + return ConstrainedBox( constraints: BoxConstraints.expand(), child: _applyList(context, model), ); } Widget _applyList(BuildContext context, ProfilesForAllViewModel model) { - if (model.isNull) - return Center( - child: Text("Not Eligible for any Active season"), - ); + final profiles = model.profiles; + if (profiles == null) { + return ErrorWidgetWithRefreshCallback(onRefresh: model.refreshAndWait); + } return RefreshIndicator( onRefresh: model.refreshAndWait, child: ListView.builder( - shrinkWrap: true, - itemCount: model.profiles.length, + itemCount: profiles.length, padding: EdgeInsets.all(5), itemBuilder: (BuildContext context, int index) { return Card( @@ -47,12 +46,12 @@ class ProfilesForAllView extends StatelessWidget { elevation: 0.3, child: ListTile( title: Text( - model.profiles[index].companyName + + profiles[index].companyName + "(" + - model.profiles[index].name + + profiles[index].name + ")", overflow: TextOverflow.ellipsis, - style: TextStyle( + style: const TextStyle( fontWeight: FontWeight.bold, height: 1.1, fontSize: 15), ), subtitle: Text( @@ -63,16 +62,16 @@ class ProfilesForAllView extends StatelessWidget { ), onTap: () { Navigator.of(context).pushNamed("/profileDetail", arguments: { - "profileId": model.profiles[index].profileId, + "profileId": profiles[index].profileId, "parentViewModel": model, - "profileModel": model.profiles[index] + "profileModel": profiles[index] }); }, //trailing: _profileStatusIcon(context,model.profiles[index].status,model.profiles[index]) trailing: ProfileStatusIcon( model: model, - profile: model.profiles[index], - status: model.profiles[index].status, + profile: profiles[index], + status: profiles[index].status, ), )); }, diff --git a/lib/views/ProfilesForMeView.dart b/lib/views/ProfilesForMeView.dart index 5c6cfc1..48b2bce 100644 --- a/lib/views/ProfilesForMeView.dart +++ b/lib/views/ProfilesForMeView.dart @@ -1,12 +1,13 @@ import 'package:flutter/material.dart'; -import 'package:placement/shared/ProfileStatusIcon.dart'; -import 'package:placement/shared/loadingPage.dart'; -import 'package:placement/viewmodels/CandidateDetailsViewModel.dart'; -import 'package:placement/viewmodels/ProfilesForMeViewModel.dart'; -import 'package:placement/views/baseView.dart'; + +import '../shared/ErrorWidget.dart'; +import '../shared/ProfileStatusIcon.dart'; +import '../shared/loadingPage.dart'; +import '../viewmodels/ProfilesForMeViewModel.dart'; +import 'baseView.dart'; class ProfilesForMeView extends StatelessWidget { - const ProfilesForMeView({Key key}) : super(key: key); + const ProfilesForMeView({super.key}); @override Widget build(BuildContext context) { @@ -19,47 +20,28 @@ class ProfilesForMeView extends StatelessWidget { } Widget _applyWidget(BuildContext context, ProfilesForMeViewModel model) { - if (model.isLoading) + if (model.isBusy) return Center( child: LoadingPage(), ); - return Container( + return ConstrainedBox( constraints: BoxConstraints.expand(), child: _applyList(context, model), ); } Widget _applyList(BuildContext context, ProfilesForMeViewModel model) { - if (model.isNull) { - return Center( - child: Text("Not Eligible for any active season"), - ); - // return BaseView( - // onModelReady: (model) { - // model.fetchCandidate(); - // }, - // builder: (context, model, child) { - // if (model.candidate.internshipStatus == "Closed" || - // model.candidate.season == "Not Eligible") { - // return Center( - // child: Text("Not Eligible for any active season"), - // ); - // } - - // return Center( - // child: Text("Not Eligible for any open profiles"), - // ); - // }, - // ); - // return Center( - // child: Text("Not Eligible for any open profiles"), - // ); + final profiles = model.profiles; + if (profiles == null) { + return ErrorWidgetWithRefreshCallback(onRefresh: model.refreshAndWait); + } + if (profiles.isEmpty){ + return Center(child: Text("No Active Profiles"),); } return RefreshIndicator( onRefresh: model.refreshAndWait, child: ListView.builder( - shrinkWrap: true, - itemCount: model.profiles.length, + itemCount: profiles.length, padding: EdgeInsets.all(5), itemBuilder: (BuildContext context, int index) { return Card( @@ -67,9 +49,9 @@ class ProfilesForMeView extends StatelessWidget { elevation: 0.3, child: ListTile( title: Text( - model.profiles[index].companyName + + profiles[index].companyName + " (" + - model.profiles[index].name + + profiles[index].name + ")", overflow: TextOverflow.ellipsis, style: TextStyle( @@ -83,16 +65,15 @@ class ProfilesForMeView extends StatelessWidget { ), onTap: () { Navigator.of(context).pushNamed("/profileDetail", arguments: { - "profileId": model.profiles[index].profileId, + "profileId": profiles[index].profileId, "parentViewModel": model, - "profileModel": model.profiles[index] + "profileModel": profiles[index] }); }, - //trailing: _profileStatusIcon(context,model.profiles[index].status,model.profiles[index]) trailing: ProfileStatusIcon( model: model, - profile: model.profiles[index], - status: model.profiles[index].status, + profile: profiles[index], + status: profiles[index].status, ), ), ); diff --git a/lib/views/ResultPageView.dart b/lib/views/ResultPageView.dart index 26fe68d..50c664c 100644 --- a/lib/views/ResultPageView.dart +++ b/lib/views/ResultPageView.dart @@ -1,14 +1,15 @@ import 'package:flutter/material.dart'; -import 'package:placement/resources/R.dart'; -import 'package:placement/resources/strings.dart'; -import 'package:placement/screens/home/screen_for_results/bottomSheetForm.dart'; -import 'package:placement/viewmodels/ResultPageViewModel.dart'; -import 'package:placement/views/ResultsBranchWiseView.dart'; -import 'package:placement/views/ResultsCompanyWiseView.dart'; -import 'package:placement/views/baseView.dart'; + +import '../resources/R.dart'; +import '../resources/strings.dart'; +import '../screens/home/screen_for_results/bottomSheetForm.dart'; +import '../viewmodels/ResultPageViewModel.dart'; +import 'ResultsBranchWiseView.dart'; +import 'ResultsCompanyWiseView.dart'; +import 'baseView.dart'; class ResultPageView extends StatefulWidget { - ResultPageView({Key key}) : super(key: key); + ResultPageView({super.key}); @override _ResultPageViewState createState() => _ResultPageViewState(); @@ -16,7 +17,7 @@ class ResultPageView extends StatefulWidget { class _ResultPageViewState extends State with SingleTickerProviderStateMixin { - TabController _tabController; + late TabController _tabController; @override void initState() { @@ -63,7 +64,7 @@ class _ResultPageViewState extends State child: FloatingActionButton( backgroundColor: R.primaryCol, onPressed: () { - showModalBottomSheet( + showModalBottomSheet>( context: context, isScrollControlled: true, builder: (context) { @@ -72,19 +73,15 @@ class _ResultPageViewState extends State yearSelectionVariable: model.yearSelectionVariable, resultTypeVariable: model.resultTypeVariable, sortVariable: model.sortVariable, - valueChangedForYear: model.selectYear, - valueChangedForResult: model.selectResultType, - valueChangedForSort: model.selectSort, ), ); }).then((value) { if (value != null) { - model.setFields( - value['year'], value['type'], value['sort']); + model.setFields(value['year'], value['type'], value['sort']); } }); }, - child: Icon( + child: const Icon( Icons.filter_list, ), ), @@ -128,11 +125,12 @@ class _ResultPageViewState extends State ); } - Widget _resultsListPage(BuildContext context, ResultPageViewModel model) { + PreferredSizeWidget _resultsListPage(BuildContext context, ResultPageViewModel model) { return TabBar( controller: _tabController, tabs: _profileTabs, unselectedLabelColor: Colors.white70, + labelColor: Colors.white, indicatorPadding: EdgeInsets.only(top: 10), indicatorColor: Colors.white, indicatorWeight: 6.0, diff --git a/lib/views/ResultsBranchWiseView.dart b/lib/views/ResultsBranchWiseView.dart index 36f079d..9944b5e 100644 --- a/lib/views/ResultsBranchWiseView.dart +++ b/lib/views/ResultsBranchWiseView.dart @@ -1,13 +1,19 @@ import 'package:flutter/material.dart'; -import 'package:placement/shared/loadingPage.dart'; -import 'package:placement/viewmodels/ResultsBranchWiseViewModel.dart'; -import 'package:placement/views/baseView.dart'; + +import '../shared/ErrorWidget.dart'; +import '../shared/loadingPage.dart'; +import '../viewmodels/ResultsBranchWiseViewModel.dart'; +import 'baseView.dart'; class ResultsBranchWiseView extends StatelessWidget { final int yearSelector, internSwitch, sortSwitch; - const ResultsBranchWiseView( - {Key key, this.yearSelector, this.internSwitch, this.sortSwitch}) - : super(key: key); + + const ResultsBranchWiseView({ + super.key, + required this.yearSelector, + required this.internSwitch, + required this.sortSwitch, + }); @override Widget build(BuildContext context) { @@ -19,63 +25,75 @@ class ResultsBranchWiseView extends StatelessWidget { ); } - Widget _resultDisplay( - BuildContext context, ResultsBranchWiseViewModel model) { - bool changed = (model.yearIndex != yearSelector) || + Widget _resultDisplay(BuildContext context, ResultsBranchWiseViewModel model) { + bool filtersHaveChanged = (model.yearIndex != yearSelector) || (model.internSwitch != internSwitch) || (model.sortSwitch != sortSwitch); - if (changed) model.setResultFilter(yearSelector, internSwitch, sortSwitch); - return (changed) - ? Center( - child: LoadingPage(), - ) - : (model.branchResults == null) - ? Center( - child: Text("No Results Found"), - ) - : RefreshIndicator( - onRefresh: model.refreshResults, - child: ListView.builder( - itemCount: model.branchResults.length, - padding: EdgeInsets.all(0), - itemBuilder: (context, index) { - return Card( - elevation: 0.3, - margin: EdgeInsets.only(bottom: 1, top: 0), - child: ListTile( - title: Text( - model.branchResults[index].studentBranchName, - style: TextStyle( - fontWeight: FontWeight.bold, - height: 1.1, - fontSize: 15), - ), - subtitle: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - "Degree: " + model.branchResults[index].studentDegree, - style: TextStyle(height: 1.85), - ), - Text( - "Selected: " + model.branchResults[index].selected, - style: TextStyle(height: 1.85), - ), - ], - ), - onTap: () { - Navigator.of(context).pushNamed( - '/result_details_branchwise', - arguments: { - 'url': - model.branchResults[index].studentDetails, - 'sort': sortSwitch - }); - }, - ), - ); - }, - ), - ); + + if (filtersHaveChanged) { + WidgetsBinding.instance.addPostFrameCallback((_) { + model.setResultFilter(yearSelector, internSwitch, sortSwitch); + }); + } + if (model.isBusy){ + return Center( + child: LoadingPage(), + ); } -} \ No newline at end of file + final branchResults = model.branchResults; + if (branchResults == null){ + return ErrorWidgetWithRefreshCallback(onRefresh: model.refreshResults); + } + if (branchResults.isEmpty) { + return const Center( + child: Text("No Results Found"), + ); + } + return RefreshIndicator( + onRefresh: model.refreshResults, + child: ListView.builder( + itemCount: branchResults.length, + padding: EdgeInsets.zero, + itemBuilder: (context, index) { + final result = branchResults[index]; + return Card( + elevation: 0.3, + margin: const EdgeInsets.only(bottom: 1), + child: ListTile( + title: Text( + result.studentBranchName, + style: const TextStyle( + fontWeight: FontWeight.bold, + height: 1.1, + fontSize: 15, + ), + ), + subtitle: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "Degree: ${result.studentDegree}", + style: const TextStyle(height: 1.85), + ), + Text( + "Selected: ${result.selected}", + style: const TextStyle(height: 1.85), + ), + ], + ), + onTap: () { + Navigator.of(context).pushNamed( + '/result_details_branchwise', + arguments: { + 'url': result.studentDetails, + 'sort': sortSwitch, + }, + ); + }, + ), + ); + }, + ), + ); + } +} diff --git a/lib/views/ResultsCompanyWiseView.dart b/lib/views/ResultsCompanyWiseView.dart index 045d854..a993a04 100644 --- a/lib/views/ResultsCompanyWiseView.dart +++ b/lib/views/ResultsCompanyWiseView.dart @@ -1,14 +1,19 @@ import 'package:flutter/material.dart'; -import 'package:placement/resources/R.dart'; -import 'package:placement/shared/loadingPage.dart'; -import 'package:placement/viewmodels/ResultsCompanyWiseViewModel.dart'; -import 'package:placement/views/baseView.dart'; + +import '../resources/R.dart'; +import '../shared/ErrorWidget.dart'; +import '../shared/loadingPage.dart'; +import '../viewmodels/ResultsCompanyWiseViewModel.dart'; +import 'baseView.dart'; class ResultsCompanyWiseView extends StatelessWidget { final int yearSelector, internSwitch, sortSwitch; - const ResultsCompanyWiseView( - {Key key, this.yearSelector, this.internSwitch, this.sortSwitch}) - : super(key: key); + const ResultsCompanyWiseView({ + super.key, + required this.yearSelector, + required this.internSwitch, + required this.sortSwitch + }); @override Widget build(BuildContext context) { @@ -22,63 +27,70 @@ class ResultsCompanyWiseView extends StatelessWidget { Widget _resultDisplay( BuildContext context, ResultsCompanyWiseViewModel model) { - bool changed = (model.yearIndex != yearSelector) || + bool filtersHaveChanged = (model.yearIndex != yearSelector) || (model.internSwitch != internSwitch) || (model.sortSwitch != sortSwitch); - if (changed) model.setResultFilter(yearSelector, internSwitch, sortSwitch); - return (changed) - ? Center( - child: LoadingPage(), - ) - : (model.companyResults == null) - ? Center( - child: Text("No Results Found"), - ) - : RefreshIndicator( - onRefresh: model.refreshResults, - child: ListView.builder( - shrinkWrap: true, - padding: EdgeInsets.all(0), - itemCount: model.companyResults.length, - itemBuilder: (context, index) { - return Card( - margin: EdgeInsets.only(bottom: 1), - elevation: 0.3, - child: ListTile( - title: Text( - model.companyResults[index].companyName, - style: TextStyle( - fontWeight: FontWeight.bold, - height: 1.1, - fontSize: 15), - ), - subtitle: Wrap( - children: [ - Text( - "Selected: ", - style: TextStyle(height: 1.85), - ), - Text( - model.companyResults[index].selected, - style: TextStyle( - height: 1.85, - color: R.primaryCol, - fontWeight: FontWeight.bold), - ) - ], - ), - onTap: () { - Navigator.of(context).pushNamed( - '/result_details_companywise', - arguments: { - 'url': model.companyResults[index].detail, - 'sort': model.sortSwitch - }); - }, + if (filtersHaveChanged){ + WidgetsBinding.instance.addPostFrameCallback((_) { + model.setResultFilter(yearSelector, internSwitch, sortSwitch); + }); + } + + if (model.isBusy){ + return Center(child: LoadingPage()); + } + final companyResults = model.companyResults; + if (companyResults == null){ + return ErrorWidgetWithRefreshCallback(onRefresh: model.refreshResults); + } + return (companyResults.isEmpty) + ? const Center( + child: Text("No Results Found"), + ) + : RefreshIndicator( + onRefresh: model.refreshResults, + child: ListView.builder( + padding: const EdgeInsets.all(0), + itemCount: companyResults.length, + itemBuilder: (context, index) { + return Card( + elevation: 0.3, + margin: const EdgeInsets.only(bottom: 1), + child: ListTile( + title: Text( + companyResults[index].companyName, + style: const TextStyle( + fontWeight: FontWeight.bold, + height: 1.1, + fontSize: 15), + ), + subtitle: Wrap( + children: [ + const Text( + "Selected: ", + style: TextStyle(height: 1.85), ), - ); + Text( + companyResults[index].selected, + style: TextStyle( + height: 1.85, + color: R.primaryCol, + fontWeight: FontWeight.bold), + ) + ], + ), + onTap: () { + Navigator.of(context).pushNamed( + '/result_details_companywise', + arguments: { + 'url': companyResults[index].detail, + 'sort': model.sortSwitch + }); }, ), ); + }, + ), + ); } } diff --git a/lib/views/ResumeListView.dart b/lib/views/ResumeListView.dart index 4700334..2efe2a8 100644 --- a/lib/views/ResumeListView.dart +++ b/lib/views/ResumeListView.dart @@ -1,10 +1,14 @@ import 'package:flutter/material.dart'; -import 'package:placement/shared/loadingPage.dart'; -import 'package:placement/viewmodels/ResumeListViewModel.dart'; -import 'package:placement/views/baseView.dart'; +import 'package:fluttertoast/fluttertoast.dart'; + +import '../models/placement_exception.dart'; +import '../models/resumeModel.dart'; +import '../shared/loadingPage.dart'; +import '../viewmodels/ResumeListViewModel.dart'; +import 'baseView.dart'; class ResumeListView extends StatelessWidget { - const ResumeListView({Key key}) : super(key: key); + const ResumeListView({super.key}); @override Widget build(BuildContext context) { @@ -35,44 +39,36 @@ class ResumeListView extends StatelessWidget { return Center( child: LoadingPage(), ); + final resumes = model.resumes; + if (resumes == null){ + return Center(child: Text("Something went Wrong"),); + } if (model.isEmpty) return Center( child: Text("No Resumes Found"), ); - return Container( - constraints: BoxConstraints.expand(), - child: SingleChildScrollView( - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - _resumeList(context, model, _width), - ], - ), - ), - ); + return _resumeList(context, model, resumes, _width); } Widget _resumeList( - BuildContext context, ResumeListViewModel model, double _width) { + BuildContext context, ResumeListViewModel model, List resumes, double _width) { return ListView.builder( - shrinkWrap: true, - physics: ScrollPhysics(), - itemCount: model.resumes.length, + itemCount: resumes.length, itemBuilder: (context, index) { return Card( margin: EdgeInsets.only(bottom: 1), elevation: 0.3, child: ListTile( onTap: () async { - await model.launchURL(model.resumes[index].resumeUrl); + await launchURL(model, resumes, index); }, title: Text( - model.resumes[index].title, + resumes[index].title, style: TextStyle( fontWeight: FontWeight.bold, height: 1.1, fontSize: 15), ), subtitle: Text( - "Verified: " + ((model.resumes[index].isVerified) ? "Yes" : "No"), + "Verified: " + (resumes[index].isVerified ? "Yes" : "No"), style: TextStyle(height: 1.85), ), ), @@ -80,4 +76,17 @@ class ResumeListView extends StatelessWidget { }, ); } + + Future launchURL(ResumeListViewModel model, List resumes, int index) async { + String? resumeUrl = resumes[index].resumeUrl; + if (resumeUrl != null){ + try { + await model.launchURL(resumeUrl); + } on PlacementException catch (e) { + Fluttertoast.showToast(msg: e.message); + } + } else { + Fluttertoast.showToast(msg: "Resume URL not found"); + } + } } diff --git a/lib/views/baseView.dart b/lib/views/baseView.dart index bd17b61..255101c 100644 --- a/lib/views/baseView.dart +++ b/lib/views/baseView.dart @@ -4,10 +4,10 @@ import 'package:placement/viewmodels/BaseViewModel.dart'; import 'package:provider/provider.dart'; class BaseView extends StatefulWidget { - final Widget Function(BuildContext context, T model, Widget child) builder; + final Widget Function(BuildContext context, T model, Widget? child) builder; final Function(T) onModelReady; - BaseView({this.builder, this.onModelReady}); + BaseView({required this.builder, required this.onModelReady}); @override _BaseViewState createState() => _BaseViewState(); @@ -18,9 +18,7 @@ class _BaseViewState extends State> { @override void initState() { - if (widget.onModelReady != null) { - widget.onModelReady(model); - } + widget.onModelReady(model); super.initState(); } diff --git a/lib/views/calendarView.dart b/lib/views/calendarView.dart index afa126a..74327ca 100644 --- a/lib/views/calendarView.dart +++ b/lib/views/calendarView.dart @@ -2,18 +2,18 @@ import 'dart:collection'; import 'package:flutter/material.dart'; import 'package:jiffy/jiffy.dart'; -import 'package:placement/enums/ViewStateEnum.dart'; -import 'package:placement/models/calendarEventModel.dart'; -import 'package:placement/resources/R.dart'; -import 'package:placement/shared/hexColor.dart'; -import 'package:placement/shared/loadingPage.dart'; -import 'package:placement/viewmodels/CalendarViewModel.dart'; -import 'package:placement/views/baseView.dart'; import 'package:table_calendar/table_calendar.dart'; +import 'baseView.dart'; +import '../resources/R.dart'; +import '../shared/hexColor.dart'; +import '../shared/loadingPage.dart'; +import '../viewmodels/CalendarViewModel.dart'; +import '../models/calendarEventModel.dart'; + class CalendarView extends StatefulWidget { - final Map args; - const CalendarView({Key key, this.args}) : super(key: key); + final Map? args; + const CalendarView({super.key, this.args}); @override State createState() => _CalendarViewState(); @@ -21,7 +21,8 @@ class CalendarView extends StatefulWidget { class _CalendarViewState extends State { DateTime _focusedDay = DateTime.now(); - DateTime _selectedDay; + CalendarFormat _format = CalendarFormat.month; + DateTime? _selectedDay; int getHashCode(DateTime key) { return key.day * 1000000 + key.month * 10000 + key.year; @@ -30,7 +31,7 @@ class _CalendarViewState extends State { @override Widget build(BuildContext context) { final double _width = MediaQuery.of(context).size.width; - final double _height = MediaQuery.of(context).size.height; + // final double _height = MediaQuery.of(context).size.height; return BaseView( onModelReady: (model) { @@ -55,7 +56,7 @@ class _CalendarViewState extends State { Widget _calendarBody( BuildContext context, CalendarViewModel model, double _width) { - final LinkedHashMap events = LinkedHashMap( + final LinkedHashMap events = LinkedHashMap>( equals: isSameDay, hashCode: getHashCode) ..addAll(model.eventMap); return SingleChildScrollView( @@ -81,7 +82,7 @@ class _CalendarViewState extends State { formatButtonShowsNext: false, ), eventLoader: (day) { - return events[day]; + return events[day] ?? []; }, selectedDayPredicate: (day) => isSameDay(_selectedDay, day), onDaySelected: (selectedDay, focusedDay) { @@ -96,19 +97,12 @@ class _CalendarViewState extends State { onPageChanged: (focusedDay) { _focusedDay = focusedDay; }, + onFormatChanged: (format){ + setState(() => _format = format); + }, + calendarFormat: _format, ), - - // TableCalendar( - // events: model.eventMap, - // calendarController: model.calendarController, - // onDaySelected: (day, events) { - // model.onSelect(events); - // //List x = events; - // //print("FUKIN EVENTS"+events.toString()+" len "+events.length.toString()); - // }, - // - // ), - SizedBox( + const SizedBox( height: 20, ), _eventsDisplay(context, model, _width), @@ -124,7 +118,7 @@ class _CalendarViewState extends State { mainAxisSize: MainAxisSize.min, children: [ (model.displayUpcoming) - ? Container( + ? SizedBox( width: _width, child: Container( margin: EdgeInsets.fromLTRB(20, 0, 0, 10), @@ -137,7 +131,7 @@ class _CalendarViewState extends State { ), ), ) - : Container(), + : const SizedBox.shrink(), _eventList(context, model), ], ); @@ -151,8 +145,8 @@ class _CalendarViewState extends State { itemBuilder: (context, index) { CalendarEventModel item = model.displayEvents[index]; DateTime dateObject = DateTime.parse(item.dateTime); - var date = Jiffy(dateObject); - String col = model.displayEvents[index].color; + var date = Jiffy.parseFromDateTime(dateObject).toLocal(); + String? col = model.displayEvents[index].color; return Card( margin: EdgeInsets.only(bottom: 1), elevation: 0.3, @@ -169,7 +163,7 @@ class _CalendarViewState extends State { shape: BoxShape.circle, ), ), - Container( + const SizedBox( width: 10, ), Expanded( diff --git a/pubspec.lock b/pubspec.lock index 192e3dd..5eed390 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,199 +5,183 @@ packages: dependency: transitive description: name: archive - sha256: ed7cc591a948744994714375caf9a2ce89e1d82e8243997c8a2994d57181c212 + sha256: "2fde1607386ab523f7a36bb3e7edb43bd58e6edaf2ffb29d8a6d578b297fdbbd" url: "https://pub.dev" source: hosted - version: "3.3.5" + version: "4.0.7" args: dependency: transitive description: name: args - sha256: b003c3098049a51720352d219b0bb5f219b60fbfb68e7a4748139a06a5676515 + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.7.0" async: dependency: transitive description: name: async - sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" url: "https://pub.dev" source: hosted - version: "2.10.0" + version: "2.13.0" boolean_selector: dependency: transitive description: name: boolean_selector - sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" cached_network_image: dependency: "direct main" description: name: cached_network_image - sha256: fd3d0dc1d451f9a252b32d95d3f0c3c487bc41a75eba2e6097cb0b9c71491b15 + sha256: "7c1183e361e5c8b0a0f21a28401eecdbde252441106a9816400dd4c2b2424916" url: "https://pub.dev" source: hosted - version: "3.2.3" + version: "3.4.1" cached_network_image_platform_interface: dependency: transitive description: name: cached_network_image_platform_interface - sha256: bb2b8403b4ccdc60ef5f25c70dead1f3d32d24b9d6117cfc087f496b178594a7 + sha256: "35814b016e37fbdc91f7ae18c8caf49ba5c88501813f73ce8a07027a395e2829" url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "4.1.1" cached_network_image_web: dependency: transitive description: name: cached_network_image_web - sha256: b8eb814ebfcb4dea049680f8c1ffb2df399e4d03bf7a352c775e26fa06e02fa0 + sha256: "980842f4e8e2535b8dbd3d5ca0b1f0ba66bf61d14cc3a17a9b4788a3685ba062" url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "1.3.1" characters: dependency: transitive description: name: characters - sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.4.0" checked_yaml: dependency: transitive description: name: checked_yaml - sha256: dd007e4fb8270916820a0d66e24f619266b60773cddd082c6439341645af2659 + sha256: "959525d3162f249993882720d52b7e0c833978df229be20702b33d48d91de70f" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.0.4" cli_util: dependency: transitive description: name: cli_util - sha256: "66f86e916d285c1a93d3b79587d94bd71984a66aac4ff74e524cfa7877f1395c" + sha256: ff6785f7e9e3c38ac98b2fb035701789de90154024a75b6cb926445e83197d1c url: "https://pub.dev" source: hosted - version: "0.3.5" + version: "0.4.2" clock: dependency: transitive description: name: clock - sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.2" collection: dependency: transitive description: name: collection - sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 - url: "https://pub.dev" - source: hosted - version: "1.17.0" - convert: - dependency: transitive - description: - name: convert - sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" url: "https://pub.dev" source: hosted - version: "3.1.1" + version: "1.19.1" crypto: dependency: transitive description: name: crypto - sha256: aa274aa7774f8964e4f4f38cc994db7b6158dd36e9187aaceaddc994b35c6c67 + sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "3.0.6" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be - url: "https://pub.dev" - source: hosted - version: "1.0.5" - dio: - dependency: "direct main" - description: - name: dio - sha256: "7d328c4d898a61efc3cd93655a0955858e29a0aa647f0f9e02d59b3bb275e2e8" + sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 url: "https://pub.dev" source: hosted - version: "4.0.6" + version: "1.0.8" fake_async: dependency: transitive description: name: fake_async - sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.3.3" ffi: dependency: transitive description: name: ffi - sha256: a38574032c5f1dd06c4aee541789906c12ccaab8ba01446e800d9c5b79c4a978 + sha256: "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.1.4" file: dependency: transitive description: name: file - sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 + url: "https://pub.dev" + source: hosted + version: "7.0.1" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be url: "https://pub.dev" source: hosted - version: "6.1.4" + version: "1.1.1" flutter: dependency: "direct main" description: flutter source: sdk version: "0.0.0" - flutter_blurhash: - dependency: transitive - description: - name: flutter_blurhash - sha256: "05001537bd3fac7644fa6558b09ec8c0a3f2eba78c0765f88912882b1331a5c6" - url: "https://pub.dev" - source: hosted - version: "0.7.0" flutter_cache_manager: dependency: transitive description: name: flutter_cache_manager - sha256: "32cd900555219333326a2d0653aaaf8671264c29befa65bbd9856d204a4c9fb3" + sha256: "400b6592f16a4409a7f2bb929a9a7e38c72cceb8ffb99ee57bbf2cb2cecf8386" url: "https://pub.dev" source: hosted - version: "3.3.0" + version: "3.4.1" flutter_hooks: dependency: "direct main" description: name: flutter_hooks - sha256: "2b202559a4ed3656bbb7aae9d8b335fb0037b23acc7ae3f377d1ba0b95c21aec" + sha256: "8ae1f090e5f4ef5cfa6670ce1ab5dddadd33f3533a7f9ba19d9f958aa2a89f42" url: "https://pub.dev" source: hosted - version: "0.18.5+1" + version: "0.21.3+1" flutter_launcher_icons: dependency: "direct main" description: name: flutter_launcher_icons - sha256: ce0e501cfc258907842238e4ca605e74b7fd1cdf04b3b43e86c43f3e40a1592c + sha256: "10f13781741a2e3972126fae08393d3c4e01fa4cd7473326b94b72cf594195e7" url: "https://pub.dev" source: hosted - version: "0.11.0" + version: "0.14.4" flutter_spinkit: dependency: "direct main" description: name: flutter_spinkit - sha256: "77a2117c0517ff909221f3160b8eb20052ab5216107581168af574ac1f05dff8" + sha256: "77850df57c00dc218bfe96071d576a8babec24cf58b2ed121c83cca4a2fdce7f" url: "https://pub.dev" source: hosted - version: "5.1.0" + version: "5.2.2" flutter_test: dependency: "direct dev" description: flutter @@ -212,18 +196,18 @@ packages: dependency: "direct main" description: name: fluttertoast - sha256: "7a738eddad04c7b27a1ecfecd12e8ecd4b188cdd2d91c252a02a4aba65838c9d" + sha256: "144ddd74d49c865eba47abe31cbc746c7b311c82d6c32e571fd73c4264b740e2" url: "https://pub.dev" source: hosted - version: "8.1.1" + version: "9.0.0" get_it: dependency: "direct main" description: name: get_it - sha256: "290fde3a86072e4b37dbb03c07bec6126f0ecc28dad403c12ffe2e5a2d751ab7" + sha256: a4292e7cf67193f8e7c1258203104eb2a51ec8b3a04baa14695f4064c144297b url: "https://pub.dev" source: hosted - version: "7.2.0" + version: "8.2.0" hive: dependency: "direct main" description: @@ -244,90 +228,106 @@ packages: dependency: "direct main" description: name: http - sha256: "6aa2946395183537c8b880962d935877325d6a09a2867c3970c05c0fed6ac482" + sha256: bb2ce4590bc2667c96f318d68cac1b5a7987ec819351d32b1c987239a815e007 url: "https://pub.dev" source: hosted - version: "0.13.5" + version: "1.5.0" http_parser: dependency: transitive description: name: http_parser - sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" url: "https://pub.dev" source: hosted - version: "4.0.2" + version: "4.1.2" image: dependency: transitive description: name: image - sha256: f6ffe2895e3c86c6ad5a27e6302cf807403463e397cb2f0c580f619ac2fa588b + sha256: "4e973fcf4caae1a4be2fa0a13157aa38a8f9cb049db6529aa00b4d71abc4d928" url: "https://pub.dev" source: hosted - version: "3.2.2" + version: "4.5.4" intl: dependency: transitive description: name: intl - sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91" + sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5" url: "https://pub.dev" source: hosted - version: "0.17.0" + version: "0.20.2" jiffy: dependency: "direct main" description: name: jiffy - sha256: "85172c4fc975a50224521c05bf43abc845288863b19d91bd3c221a96a8785dd3" + sha256: "9bafbfe6d97587048bf449165e050029e716a12438f54a3d39e7e3a256decdac" url: "https://pub.dev" source: hosted - version: "5.0.0" - js: + version: "6.4.3" + json_annotation: dependency: transitive description: - name: js - sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" + name: json_annotation + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" url: "https://pub.dev" source: hosted - version: "0.6.5" - json_annotation: + version: "4.9.0" + leak_tracker: dependency: transitive description: - name: json_annotation - sha256: "3520fa844009431b5d4491a5a778603520cdc399ab3406332dcc50f93547258c" + name: leak_tracker + sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" url: "https://pub.dev" source: hosted - version: "4.7.0" + version: "11.0.2" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" + url: "https://pub.dev" + source: hosted + version: "3.0.10" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" + url: "https://pub.dev" + source: hosted + version: "3.0.2" logger: dependency: transitive description: name: logger - sha256: "5076f09225f91dc49289a4ccb92df2eeea9ea01cf7c26d49b3a1f04c6a49eec1" + sha256: a7967e31b703831a893bbc3c3dd11db08126fe5f369b5c648a36f821979f5be3 url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "2.6.2" matcher: dependency: transitive description: name: matcher - sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 url: "https://pub.dev" source: hosted - version: "0.12.13" + version: "0.12.17" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.11.1" meta: dependency: transitive description: name: meta - sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.16.0" nested: dependency: transitive description: @@ -340,367 +340,391 @@ packages: dependency: transitive description: name: octo_image - sha256: "107f3ed1330006a3bea63615e81cf637433f5135a52466c7caa0e7152bca9143" + sha256: "34faa6639a78c7e3cbe79be6f9f96535867e879748ade7d17c9b1ae7536293bd" url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "2.1.0" path: dependency: transitive description: name: path - sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.9.1" path_provider: dependency: transitive description: name: path_provider - sha256: "050e8e85e4b7fecdf2bb3682c1c64c4887a183720c802d323de8a5fd76d372dd" + sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd" url: "https://pub.dev" source: hosted - version: "2.0.11" + version: "2.1.5" path_provider_android: dependency: transitive description: name: path_provider_android - sha256: a776c088d671b27f6e3aa8881d64b87b3e80201c64e8869b811325de7a76c15e + sha256: e122c5ea805bb6773bb12ce667611265980940145be920cd09a4b0ec0285cb16 url: "https://pub.dev" source: hosted - version: "2.0.22" - path_provider_ios: + version: "2.2.20" + path_provider_foundation: dependency: transitive description: - name: path_provider_ios - sha256: "03d639406f5343478352433f00d3c4394d52dac8df3d847869c5e2333e0bbce8" + name: path_provider_foundation + sha256: efaec349ddfc181528345c56f8eda9d6cccd71c177511b132c6a0ddaefaa2738 url: "https://pub.dev" source: hosted - version: "2.0.11" + version: "2.4.3" path_provider_linux: dependency: transitive description: name: path_provider_linux - sha256: ab0987bf95bc591da42dffb38c77398fc43309f0b9b894dcc5d6f40c4b26c379 - url: "https://pub.dev" - source: hosted - version: "2.1.7" - path_provider_macos: - dependency: transitive - description: - name: path_provider_macos - sha256: "2a97e7fbb7ae9dcd0dfc1220a78e9ec3e71da691912e617e8715ff2a13086ae8" + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 url: "https://pub.dev" source: hosted - version: "2.0.6" + version: "2.2.1" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - sha256: f0abc8ebd7253741f05488b4813d936b4d07c6bae3e86148a09e342ee4b08e76 + sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" url: "https://pub.dev" source: hosted - version: "2.0.5" + version: "2.1.2" path_provider_windows: dependency: transitive description: name: path_provider_windows - sha256: bcabbe399d4042b8ee687e17548d5d3f527255253b4a639f5f8d2094a9c2b45c + sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 url: "https://pub.dev" source: hosted - version: "2.1.3" - pedantic: - dependency: transitive - description: - name: pedantic - sha256: "67fc27ed9639506c856c840ccce7594d0bdcd91bc8d53d6e52359449a1d50602" - url: "https://pub.dev" - source: hosted - version: "1.11.1" + version: "2.3.0" petitparser: dependency: transitive description: name: petitparser - sha256: "49392a45ced973e8d94a85fdb21293fbb40ba805fc49f2965101ae748a3683b4" + sha256: "1a97266a94f7350d30ae522c0af07890c70b8e62c71e8e3920d1db4d23c057d1" url: "https://pub.dev" source: hosted - version: "5.1.0" + version: "7.0.1" photo_view: dependency: "direct main" description: name: photo_view - sha256: "8036802a00bae2a78fc197af8a158e3e2f7b500561ed23b4c458107685e645bb" + sha256: "1fc3d970a91295fbd1364296575f854c9863f225505c28c46e0a03e48960c75e" url: "https://pub.dev" source: hosted - version: "0.14.0" + version: "0.15.0" platform: dependency: transitive description: name: platform - sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.1.6" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - sha256: dbf0f707c78beedc9200146ad3cb0ab4d5da13c246336987be6940f026500d3a + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" url: "https://pub.dev" source: hosted - version: "2.1.3" - pointycastle: + version: "2.1.8" + posix: dependency: transitive description: - name: pointycastle - sha256: db7306cf0249f838d1a24af52b5a5887c5bf7f31d8bb4e827d071dc0939ad346 + name: posix + sha256: "6323a5b0fa688b6a010df4905a56b00181479e6d10534cecfecede2aa55add61" url: "https://pub.dev" source: hosted - version: "3.6.2" - process: - dependency: transitive - description: - name: process - sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09" - url: "https://pub.dev" - source: hosted - version: "4.2.4" + version: "6.0.3" provider: dependency: "direct main" description: name: provider - sha256: e1e7413d70444ea3096815a60fe5da1b11bda8a9dc4769252cc82c53536f8bcc + sha256: "4e82183fa20e5ca25703ead7e05de9e4cceed1fbd1eadc1ac3cb6f565a09f272" url: "https://pub.dev" source: hosted - version: "6.0.4" + version: "6.1.5+1" + quiver: + dependency: transitive + description: + name: quiver + sha256: ea0b925899e64ecdfbf9c7becb60d5b50e706ade44a85b2363be2a22d88117d2 + url: "https://pub.dev" + source: hosted + version: "3.2.2" rename: dependency: "direct main" description: name: rename - sha256: "2e3f2800712e00c66fee8eb6285d290c418e99fe3f69ca794d9fa09654bb005e" + sha256: da5f4d67f8c68f066ad04edfd6585495dbe595f2baf3b1999eb6af1805d79539 url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.1.0" rxdart: dependency: transitive description: name: rxdart - sha256: "0c7c0cedd93788d996e33041ffecda924cc54389199cde4e6a34b440f50044cb" + sha256: "5c3004a4a8dbb94bd4bf5412a4def4acdaa12e12f269737a5751369e12d1a962" url: "https://pub.dev" source: hosted - version: "0.27.7" + version: "0.28.0" simple_gesture_detector: dependency: transitive description: name: simple_gesture_detector - sha256: "86d08f85f1f58583b7b4b941d989f48ea6ce08c1724a1d10954a277c2ec36592" + sha256: ba2cd5af24ff20a0b8d609cec3f40e5b0744d2a71804a2616ae086b9c19d19a3 url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.2.1" sky_engine: dependency: transitive description: flutter source: sdk - version: "0.0.99" + version: "0.0.0" source_span: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.1" + sprintf: + dependency: transitive + description: + name: sprintf + sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23" + url: "https://pub.dev" + source: hosted + version: "7.0.0" sqflite: dependency: transitive description: name: sqflite - sha256: d21c022832f139b89922738e200c07387a49c549bf36c35654418e19ff76d161 + sha256: e2297b1da52f127bc7a3da11439985d9b536f75070f3325e62ada69a5c585d03 url: "https://pub.dev" source: hosted - version: "2.2.0+3" + version: "2.4.2" + sqflite_android: + dependency: transitive + description: + name: sqflite_android + sha256: ecd684501ebc2ae9a83536e8b15731642b9570dc8623e0073d227d0ee2bfea88 + url: "https://pub.dev" + source: hosted + version: "2.4.2+2" sqflite_common: dependency: transitive description: name: sqflite_common - sha256: "0c21a187d645aa65da5be6997c0c713eed61e049158870ae2de157e6897067ab" + sha256: "6ef422a4525ecc601db6c0a2233ff448c731307906e92cabc9ba292afaae16a6" url: "https://pub.dev" source: hosted - version: "2.4.0+2" + version: "2.5.6" + sqflite_darwin: + dependency: transitive + description: + name: sqflite_darwin + sha256: "279832e5cde3fe99e8571879498c9211f3ca6391b0d818df4e17d9fff5c6ccb3" + url: "https://pub.dev" + source: hosted + version: "2.4.2" + sqflite_platform_interface: + dependency: transitive + description: + name: sqflite_platform_interface + sha256: "8dd4515c7bdcae0a785b0062859336de775e8c65db81ae33dd5445f35be61920" + url: "https://pub.dev" + source: hosted + version: "2.4.0" stack_trace: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.12.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.4" string_scanner: dependency: transitive description: name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.4.1" synchronized: dependency: transitive description: name: synchronized - sha256: "7b530acd9cb7c71b0019a1e7fa22c4105e675557a4400b6a401c71c5e0ade1ac" + sha256: c254ade258ec8282947a0acbbc90b9575b4f19673533ee46f2f6e9b3aeefd7c0 url: "https://pub.dev" source: hosted - version: "3.0.0+3" + version: "3.4.0" table_calendar: dependency: "direct main" description: name: table_calendar - sha256: "7f1270313c0cdb245b583ed8518982c01d4a7e95869b3c30abcbae3b642c45d0" + sha256: "0c0c6219878b363a2d5f40c7afb159d845f253d061dc3c822aa0d5fe0f721982" url: "https://pub.dev" source: hosted - version: "3.0.8" + version: "3.2.0" term_glyph: dependency: transitive description: name: term_glyph - sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.2.2" test_api: dependency: transitive description: name: test_api - sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 + sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00" url: "https://pub.dev" source: hosted - version: "0.4.16" + version: "0.7.6" typed_data: dependency: transitive description: name: typed_data - sha256: "26f87ade979c47a150c9eaab93ccd2bebe70a27dc0b4b29517f2904f04eb11a5" + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.4.0" url_launcher: dependency: "direct main" description: name: url_launcher - sha256: "75f2846facd11168d007529d6cd8fcb2b750186bea046af9711f10b907e1587e" + sha256: f6a7e5c4835bb4e3026a04793a4199ca2d14c739ec378fdfe23fc8075d0439f8 url: "https://pub.dev" source: hosted - version: "6.1.10" + version: "6.3.2" url_launcher_android: dependency: transitive description: name: url_launcher_android - sha256: "6f91d30ce9060c204b2dbe728adb300750fa4b228e8f7ed1b961aa1ceb728799" + sha256: "5c8b6c2d89a78f5a1cca70a73d9d5f86c701b36b42f9c9dac7bad592113c28e9" url: "https://pub.dev" source: hosted - version: "6.0.22" + version: "6.3.24" url_launcher_ios: dependency: transitive description: name: url_launcher_ios - sha256: "6ba7dddee26c9fae27c9203c424631109d73c8fa26cfa7bc3e35e751cb87f62e" + sha256: "6b63f1441e4f653ae799166a72b50b1767321ecc263a57aadf825a7a2a5477d9" url: "https://pub.dev" source: hosted - version: "6.0.17" + version: "6.3.5" url_launcher_linux: dependency: transitive description: name: url_launcher_linux - sha256: "360fa359ab06bcb4f7c5cd3123a2a9a4d3364d4575d27c4b33468bd4497dd094" + sha256: "4e9ba368772369e3e08f231d2301b4ef72b9ff87c31192ef471b380ef29a4935" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.2.1" url_launcher_macos: dependency: transitive description: name: url_launcher_macos - sha256: a9b3ea9043eabfaadfa3fb89de67a11210d85569086d22b3854484beab8b3978 + sha256: "8262208506252a3ed4ff5c0dc1e973d2c0e0ef337d0a074d35634da5d44397c9" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.2.4" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface - sha256: "4eae912628763eb48fc214522e58e942fd16ce195407dbf45638239523c759a6" + sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.3.2" url_launcher_web: dependency: transitive description: name: url_launcher_web - sha256: "5669882643b96bb6d5786637cac727c6e918a790053b09245fd4513b8a07df2a" + sha256: "4bd2b7b4dc4d4d0b94e5babfffbca8eac1a126c7f3d6ecbc1a11013faa3abba2" url: "https://pub.dev" source: hosted - version: "2.0.13" + version: "2.4.1" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - sha256: e3c3b16d3104260c10eea3b0e34272aaa57921f83148b0619f74c2eced9b7ef1 + sha256: "3284b6d2ac454cf34f114e1d3319866fdd1e19cdc329999057e44ffe936cfa77" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.1.4" uuid: dependency: transitive description: name: uuid - sha256: "648e103079f7c64a36dc7d39369cabb358d377078a051d6ae2ad3aa539519313" + sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff url: "https://pub.dev" source: hosted - version: "3.0.7" + version: "4.5.1" vector_math: dependency: transitive description: name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b url: "https://pub.dev" source: hosted - version: "2.1.4" - win32: + version: "2.2.0" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "45caa6c5917fa127b5dbcfbd1fa60b14e583afdc08bfc96dda38886ca252eb60" + url: "https://pub.dev" + source: hosted + version: "15.0.2" + web: dependency: transitive description: - name: win32 - sha256: ca121dbbadb3e43b449053feab0cdf3f2bff93b107cacf0290e3d29f717374b6 + name: web + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" url: "https://pub.dev" source: hosted - version: "3.1.2" + version: "1.1.1" xdg_directories: dependency: transitive description: name: xdg_directories - sha256: "11541eedefbcaec9de35aa82650b695297ce668662bbd6e3911a7fabdbde589f" + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" url: "https://pub.dev" source: hosted - version: "0.2.0+2" + version: "1.1.0" xml: dependency: transitive description: name: xml - sha256: ac0e3f4bf00ba2708c33fbabbbe766300e509f8c82dbd4ab6525039813f7e2fb + sha256: "971043b3a0d3da28727e40ed3e0b5d18b742fa5a68665cca88e74b7876d5e025" url: "https://pub.dev" source: hosted - version: "6.1.0" + version: "6.6.1" yaml: dependency: transitive description: name: yaml - sha256: "23812a9b125b48d4007117254bca50abb6c712352927eece9e155207b1db2370" + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce url: "https://pub.dev" source: hosted - version: "3.1.1" + version: "3.1.3" sdks: - dart: ">=2.18.0 <3.0.0" - flutter: ">=3.3.0" + dart: ">=3.9.0 <4.0.0" + flutter: ">=3.35.0" diff --git a/pubspec.yaml b/pubspec.yaml index 1e1afed..84cc4f4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,10 +11,10 @@ description: A new Flutter project. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.0.5+7 +version: 2.0.0+8 environment: - sdk: ">=2.1.0 <3.0.0" + sdk: ">=3.1.0 <4.0.0" dependencies: flutter: @@ -23,22 +23,21 @@ dependencies: # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.5 - provider: ^6.0.4 - dio: ^4.0.6 - get_it: ^7.2.0 - flutter_hooks: ^0.18.5+1 - http: ^0.13.5 - flutter_spinkit: ^5.1.0 + provider: ^6.1.5+1 + get_it: ^8.2.0 + flutter_hooks: ^0.21.3+1 + http: ^1.5.0 + flutter_spinkit: ^5.2.2 hive: ^2.2.3 hive_flutter: ^1.1.0 - jiffy: ^5.0.0 - table_calendar: ^3.0.8 - photo_view: ^0.14.0 - fluttertoast: ^8.1.1 - url_launcher: ^6.1.7 - rename: ^2.0.1 - flutter_launcher_icons: ^0.11.0 - cached_network_image: ^3.2.3 + jiffy: ^6.4.3 + table_calendar: ^3.2.0 + photo_view: ^0.15.0 + fluttertoast: ^9.0.0 + url_launcher: ^6.3.2 + rename: ^3.1.0 + flutter_launcher_icons: ^0.14.4 + cached_network_image: ^3.4.1 dev_dependencies: flutter_test: