Merge pull request 'Finish implementing Pass check operations' (#15) from feature/unit2/UNIT2-#14Implement-Pass-Check_Role into develop
Reviewed-on: http://git.agusandelnorte.gov.ph:3000/SoftwareDevelopmentSection/unit2-null-safety-repository/pulls/15feature/passo/PASSO-#1-Sync-data-from-device-to-postgre-and-vice-versa
commit
33db598f6e
|
@ -15,7 +15,9 @@
|
|||
android:authorities = "${applicationId}.fileprovider"
|
||||
android:exported = "false"
|
||||
android:grantUriPermissions = "true"
|
||||
android:name = "androidx.core.content.FileProvider">
|
||||
android:name = "androidx.core.content.FileProvider"
|
||||
android:usesCleartextTraffic="true">
|
||||
|
||||
<meta-data
|
||||
android:name = "android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource = "@xml/file_provider_path" />
|
||||
|
|
|
@ -2,4 +2,5 @@ distributionBase=GRADLE_USER_HOME
|
|||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
android.enableDexingArtifactTransform=false
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,4 +1,10 @@
|
|||
PODS:
|
||||
- assets_audio_player (0.0.1):
|
||||
- Flutter
|
||||
- assets_audio_player_web (0.0.1):
|
||||
- Flutter
|
||||
- audioplayers_darwin (0.0.1):
|
||||
- Flutter
|
||||
- barcode_scan2 (0.0.1):
|
||||
- Flutter
|
||||
- MTBBarcodeScanner
|
||||
|
@ -24,20 +30,25 @@ PODS:
|
|||
- path_provider_foundation (0.0.1):
|
||||
- Flutter
|
||||
- FlutterMacOS
|
||||
- permission_handler_apple (9.0.4):
|
||||
- permission_handler_apple (9.1.0):
|
||||
- Flutter
|
||||
- platform_device_id (0.0.1):
|
||||
- Flutter
|
||||
- rive_common (0.0.1):
|
||||
- Flutter
|
||||
- shared_preferences_foundation (0.0.1):
|
||||
- Flutter
|
||||
- FlutterMacOS
|
||||
- sqflite (0.0.2):
|
||||
- sqflite (0.0.3):
|
||||
- Flutter
|
||||
- FMDB (>= 2.7.5)
|
||||
- SwiftProtobuf (1.20.3)
|
||||
- Toast (4.0.0)
|
||||
|
||||
DEPENDENCIES:
|
||||
- assets_audio_player (from `.symlinks/plugins/assets_audio_player/ios`)
|
||||
- assets_audio_player_web (from `.symlinks/plugins/assets_audio_player_web/ios`)
|
||||
- audioplayers_darwin (from `.symlinks/plugins/audioplayers_darwin/ios`)
|
||||
- barcode_scan2 (from `.symlinks/plugins/barcode_scan2/ios`)
|
||||
- device_info (from `.symlinks/plugins/device_info/ios`)
|
||||
- easy_app_installer (from `.symlinks/plugins/easy_app_installer/ios`)
|
||||
|
@ -49,6 +60,7 @@ DEPENDENCIES:
|
|||
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/ios`)
|
||||
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
|
||||
- platform_device_id (from `.symlinks/plugins/platform_device_id/ios`)
|
||||
- rive_common (from `.symlinks/plugins/rive_common/ios`)
|
||||
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/ios`)
|
||||
- sqflite (from `.symlinks/plugins/sqflite/ios`)
|
||||
|
||||
|
@ -60,6 +72,12 @@ SPEC REPOS:
|
|||
- Toast
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
assets_audio_player:
|
||||
:path: ".symlinks/plugins/assets_audio_player/ios"
|
||||
assets_audio_player_web:
|
||||
:path: ".symlinks/plugins/assets_audio_player_web/ios"
|
||||
audioplayers_darwin:
|
||||
:path: ".symlinks/plugins/audioplayers_darwin/ios"
|
||||
barcode_scan2:
|
||||
:path: ".symlinks/plugins/barcode_scan2/ios"
|
||||
device_info:
|
||||
|
@ -82,27 +100,33 @@ EXTERNAL SOURCES:
|
|||
:path: ".symlinks/plugins/permission_handler_apple/ios"
|
||||
platform_device_id:
|
||||
:path: ".symlinks/plugins/platform_device_id/ios"
|
||||
rive_common:
|
||||
:path: ".symlinks/plugins/rive_common/ios"
|
||||
shared_preferences_foundation:
|
||||
:path: ".symlinks/plugins/shared_preferences_foundation/ios"
|
||||
sqflite:
|
||||
:path: ".symlinks/plugins/sqflite/ios"
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
assets_audio_player: edee322b9cb625571b830b35872ead1a295fd917
|
||||
assets_audio_player_web: 19826380c44375761aa0b9053665c1e3fbc3b86b
|
||||
audioplayers_darwin: 877d9a4d06331c5c374595e46e16453ac7eafa40
|
||||
barcode_scan2: 0af2bb63c81b4565aab6cd78278e4c0fa136dbb0
|
||||
device_info: d7d233b645a32c40dfdc212de5cf646ca482f175
|
||||
easy_app_installer: 29abe397da7d86721fee853281202f414373f45c
|
||||
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
|
||||
fluttertoast: eb263d302cc92e04176c053d2385237e9f43fad0
|
||||
fluttertoast: fafc4fa4d01a6a9e4f772ecd190ffa525e9e2d9c
|
||||
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
|
||||
location: 3a2eed4dd2fab25e7b7baf2a9efefe82b512d740
|
||||
modal_progress_hud_nsn: f6fb744cd060653d66ed8f325360ef3650eb2fde
|
||||
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
|
||||
package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e
|
||||
path_provider_foundation: c68054786f1b4f3343858c1e1d0caaded73f0be9
|
||||
permission_handler_apple: 44366e37eaf29454a1e7b1b7d736c2cceaeb17ce
|
||||
path_provider_foundation: eaf5b3e458fc0e5fbb9940fb09980e853fe058b8
|
||||
permission_handler_apple: 8f116445eff3c0e7c65ad60f5fef5490aa94b4e4
|
||||
platform_device_id: 81b3e2993881f87d0c82ef151dc274df4869aef5
|
||||
shared_preferences_foundation: 986fc17f3d3251412d18b0265f9c64113a8c2472
|
||||
sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
|
||||
rive_common: 60ae7896ab40f9513974f36f015de33f70d2c5c5
|
||||
shared_preferences_foundation: e2dae3258e06f44cc55f49d42024fd8dd03c590c
|
||||
sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a
|
||||
SwiftProtobuf: b02b5075dcf60c9f5f403000b3b0c202a11b6ae1
|
||||
Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
|
||||
|
||||
|
|
|
@ -323,6 +323,7 @@
|
|||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
|
@ -341,7 +342,7 @@
|
|||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SUPPORTED_PLATFORMS = iphoneos;
|
||||
|
@ -362,7 +363,7 @@
|
|||
DEVELOPMENT_TEAM = 2WLSMMLG6W;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
|
@ -404,6 +405,7 @@
|
|||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
|
@ -428,7 +430,7 @@
|
|||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
|
@ -459,6 +461,7 @@
|
|||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
|
@ -477,7 +480,7 @@
|
|||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SUPPORTED_PLATFORMS = iphoneos;
|
||||
|
@ -500,7 +503,7 @@
|
|||
DEVELOPMENT_TEAM = 2WLSMMLG6W;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
|
@ -532,7 +535,7 @@
|
|||
DEVELOPMENT_TEAM = 2WLSMMLG6W;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>NSCameraUsageDescription</key>
|
||||
<string>Camera permission is required for barcode scanning.</string>
|
||||
<key>CADisableMinimumFrameDurationOnPhone</key>
|
||||
<true/>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
|
|
|
@ -120,5 +120,8 @@ class FamilyBloc extends Bloc<FamilyEvent, FamilyState> {
|
|||
emit(FamilyErrorState(message: e.toString()));
|
||||
}
|
||||
});
|
||||
on<CallErrorState>((event,emit){
|
||||
emit(FamilyErrorState(message: state.toString()));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,3 +64,8 @@ class AddEmergencyEvent extends FamilyEvent{
|
|||
@override
|
||||
List<Object> get props => [profileId,token,relatedPersonId];
|
||||
}
|
||||
|
||||
class CallErrorState extends FamilyEvent{
|
||||
final String message;
|
||||
const CallErrorState({required this.message});
|
||||
}
|
||||
|
|
|
@ -1,14 +1,8 @@
|
|||
import 'package:bloc/bloc.dart';
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:unit2/model/location/country.dart';
|
||||
import 'package:unit2/model/location/region.dart';
|
||||
import 'package:unit2/screens/profile/components/other_information/org_membership/add_modal.dart';
|
||||
import 'package:unit2/screens/unit2/login/components/update_required.dart';
|
||||
import 'package:unit2/sevices/profile/learningDevelopment_service.dart';
|
||||
import 'package:unit2/test_data.dart';
|
||||
import 'package:unit2/utils/text_container.dart';
|
||||
|
||||
import '../../../model/location/barangay.dart';
|
||||
import '../../../model/location/city.dart';
|
||||
import '../../../model/location/provinces.dart';
|
||||
|
@ -17,7 +11,6 @@ import '../../../model/utils/agency.dart';
|
|||
import '../../../model/utils/category.dart';
|
||||
import '../../../utils/location_utilities.dart';
|
||||
import '../../../utils/profile_utilities.dart';
|
||||
|
||||
part 'learning_development_event.dart';
|
||||
part 'learning_development_state.dart';
|
||||
|
||||
|
@ -44,7 +37,6 @@ class LearningDevelopmentBloc
|
|||
on<GetLearningDevelopments>((event, emit) async {
|
||||
emit(LearningDevelopmentLoadingState());
|
||||
try {
|
||||
|
||||
List<LearningDevelopement> learnings = await LearningDevelopmentServices
|
||||
.instance
|
||||
.getLearningDevelopments(event.profileId, event.token);
|
||||
|
@ -93,7 +85,6 @@ class LearningDevelopmentBloc
|
|||
await ProfileUtilities.instance.agencyCategory();
|
||||
agencyCategory = categoryAgencies;
|
||||
}
|
||||
|
||||
emit(LearningDevelopmentAddingState(
|
||||
types: types,
|
||||
topics: topics,
|
||||
|
@ -103,12 +94,12 @@ class LearningDevelopmentBloc
|
|||
sponsorAgencies: agencies,
|
||||
agencyCategory: agencyCategory));
|
||||
} catch (e) {
|
||||
emit(LeaningDevelopmentErrorState(message: e.toString()));
|
||||
emit(LearningDevelopmentErrorState(message: e.toString()));
|
||||
}
|
||||
});
|
||||
////Show edit form
|
||||
on<ShowEditLearningDevelopmentForm>((event, emit) async {
|
||||
try{
|
||||
try {
|
||||
if (globalRegions.isEmpty) {
|
||||
List<Region> regions = await LocationUtils.instance.getRegions();
|
||||
globalRegions = regions;
|
||||
|
@ -145,7 +136,8 @@ class LearningDevelopmentBloc
|
|||
globalBarangay = await LocationUtils.instance
|
||||
.getBarangay(code: currentCity!.code.toString());
|
||||
|
||||
if (event.learningDevelopment.conductedTraining?.venue?.barangay?.cityMunicipality !=
|
||||
if (event.learningDevelopment.conductedTraining?.venue?.barangay
|
||||
?.cityMunicipality !=
|
||||
null) {
|
||||
currentBarangay = globalBarangay.firstWhere((Barangay barangay) =>
|
||||
event.learningDevelopment.conductedTraining!.venue!.barangay!
|
||||
|
@ -167,7 +159,8 @@ class LearningDevelopmentBloc
|
|||
types = newTypes;
|
||||
}
|
||||
if (agencies.isEmpty) {
|
||||
List<Agency> newAgencies = await ProfileUtilities.instance.getAgecies();
|
||||
List<Agency> newAgencies =
|
||||
await ProfileUtilities.instance.getAgecies();
|
||||
agencies = newAgencies;
|
||||
}
|
||||
if (agencyCategory.isEmpty) {
|
||||
|
@ -179,7 +172,6 @@ class LearningDevelopmentBloc
|
|||
cities: globalCities,
|
||||
currentBarangay: currentBarangay,
|
||||
barangay: globalBarangay,
|
||||
|
||||
provinces: globalProvinces,
|
||||
types: types,
|
||||
topics: topics,
|
||||
|
@ -198,7 +190,7 @@ class LearningDevelopmentBloc
|
|||
currentProvince: currentProvince,
|
||||
currentCity: currentCity,
|
||||
overseas: event.isOverseas));
|
||||
}catch(e){
|
||||
} catch (e) {
|
||||
emit(LearningDevelopmentErrorState(message: e.toString()));
|
||||
}
|
||||
});
|
||||
|
@ -234,8 +226,10 @@ class LearningDevelopmentBloc
|
|||
profileId: event.profileId);
|
||||
if (status['success']) {
|
||||
learningsAndDevelopments.removeWhere((LearningDevelopement element) =>
|
||||
element.conductedTraining!.id == event.learningDevelopement.conductedTraining!.id &&
|
||||
element.conductedTraining!.totalHours == event.learningDevelopement.conductedTraining!.totalHours);
|
||||
element.conductedTraining!.id ==
|
||||
event.learningDevelopement.conductedTraining!.id &&
|
||||
element.conductedTraining!.totalHours ==
|
||||
event.learningDevelopement.conductedTraining!.totalHours);
|
||||
LearningDevelopement learningDevelopement =
|
||||
LearningDevelopement.fromJson(status['data']);
|
||||
learningsAndDevelopments.add(learningDevelopement);
|
||||
|
@ -270,7 +264,7 @@ class LearningDevelopmentBloc
|
|||
});
|
||||
//// call errror
|
||||
on<CallErrorState>((event, emit) {
|
||||
emit(LeaningDevelopmentErrorState(message: event.message));
|
||||
emit(LearningDevelopmentErrorState(message: event.message));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,13 +16,6 @@ class LearningDevelopmentLoadedState extends LearningDevelopmentState {
|
|||
List<Object> get props => [learningsAndDevelopment];
|
||||
}
|
||||
|
||||
class LeaningDevelopmentErrorState extends LearningDevelopmentState {
|
||||
final String message;
|
||||
const LeaningDevelopmentErrorState({required this.message});
|
||||
@override
|
||||
List<Object> get props => [message];
|
||||
}
|
||||
|
||||
class LearningDevelopmentLoadingState extends LearningDevelopmentState {}
|
||||
|
||||
////added State
|
||||
|
|
|
@ -107,11 +107,11 @@ class ContactBloc extends Bloc<ContactEvent, ContactState> {
|
|||
ContactInfo contactInfo =
|
||||
ContactInfo.fromJson(responseStatus['data']['contact_info']);
|
||||
contactInformations.add(contactInfo);
|
||||
emit(ContactEditedState(
|
||||
emit(ContactAddedState(
|
||||
|
||||
response: responseStatus));
|
||||
} else {
|
||||
emit(ContactEditedState(
|
||||
emit(ContactAddedState(
|
||||
|
||||
response: responseStatus));
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import 'package:bloc/bloc.dart';
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:unit2/sevices/profile/volunatary_services.dart';
|
||||
import 'package:unit2/utils/profile_utilities.dart';
|
||||
|
|
|
@ -0,0 +1,180 @@
|
|||
|
||||
import 'package:barcode_scan2/model/scan_result.dart';
|
||||
import 'package:bloc/bloc.dart';
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
import 'package:unit2/model/roles/pass_check/passer_info.dart';
|
||||
import 'package:unit2/sevices/roles/pass_check_services.dart';
|
||||
import '../../../utils/scanner.dart';
|
||||
part 'pass_check_event.dart';
|
||||
part 'pass_check_state.dart';
|
||||
|
||||
class PassCheckBloc extends Bloc<PassCheckEvent, PassCheckState> {
|
||||
PassCheckBloc() : super(PassCheckInitial()) {
|
||||
int? roleId;
|
||||
String? uuid;
|
||||
bool? otherInputs;
|
||||
String? io;
|
||||
dynamic assignedArea;
|
||||
int? checkerId;
|
||||
String? token;
|
||||
int? stationId;
|
||||
String? cpId;
|
||||
on<GetPassCheckAreas>((event, emit) async {
|
||||
try {
|
||||
emit(PassCheckLoadingState());
|
||||
List<dynamic> response = await PassCheckServices.instance
|
||||
.getPassCheckArea(roleId: event.roleId, userId: event.userId);
|
||||
roleId = event.roleId;
|
||||
emit(AssignAreaLoaded(assignedArea: response, roleId: roleId!));
|
||||
} catch (e) {
|
||||
emit(PassCheckErrorState(message: e.toString()));
|
||||
}
|
||||
});
|
||||
on<SetScannerSettings>((event, emit) {
|
||||
otherInputs = event.includeOtherInputs;
|
||||
checkerId = event.checkerId;
|
||||
io = event.entranceExit;
|
||||
token = event.token;
|
||||
roleId = event.roleId;
|
||||
assignedArea = event.assignedArea;
|
||||
emit(SettingSaved(
|
||||
assignedArea: assignedArea,
|
||||
checker: checkerId!,
|
||||
io: io!,
|
||||
otherInputs: otherInputs!,
|
||||
roleId: roleId!,
|
||||
token: token!));
|
||||
});
|
||||
on<ScanError>((event, emit) {
|
||||
emit(SettingSaved(
|
||||
assignedArea: assignedArea,
|
||||
checker: checkerId!,
|
||||
io: io!,
|
||||
otherInputs: otherInputs!,
|
||||
roleId: roleId!,
|
||||
token: token!));
|
||||
});
|
||||
on<PerformIncomingPostLog>((event, emit) {
|
||||
add(PerformPostLogs(
|
||||
checkerId: checkerId!,
|
||||
cpId: cpId,
|
||||
destination: null,
|
||||
io: io!.toLowerCase() == "incoming" ? "i" : "o",
|
||||
otherInputs: otherInputs!,
|
||||
passerId: uuid!,
|
||||
roleId: roleId!,
|
||||
stationId: stationId,
|
||||
temp: event.temp));
|
||||
});
|
||||
|
||||
on<PerformOutgoingPostLog>((event, emit) {
|
||||
add(PerformPostLogs(
|
||||
checkerId: checkerId!,
|
||||
cpId: cpId,
|
||||
destination: event.destination,
|
||||
io: io!.toLowerCase() == "incoming" ? "i" : "o",
|
||||
otherInputs: otherInputs!,
|
||||
passerId: uuid!,
|
||||
roleId: roleId!,
|
||||
stationId: stationId,
|
||||
temp: null));
|
||||
});
|
||||
on<ScanQr>((event, emit) async {
|
||||
ScanResult result = await QRCodeBarCodeScanner.instance.scanner();
|
||||
if (result.rawContent.toString().isNotEmpty) {
|
||||
uuid = result.rawContent.toString();
|
||||
emit(PassCheckLoadingState());
|
||||
try {
|
||||
PasserInfo? passerInfo = await PassCheckServices.instance
|
||||
.getPasserInfo(uuid: uuid!, token: event.token);
|
||||
if (roleId == 41 || roleId == 13 || roleId == 17 || roleId == 22) {
|
||||
stationId = assignedArea.id;
|
||||
} else if (roleId == 7) {
|
||||
cpId = assignedArea.brgycode;
|
||||
} else if (roleId == 10) {
|
||||
cpId = assignedArea.purokdesc;
|
||||
} else if (roleId == 16) {
|
||||
cpId = assignedArea.id;
|
||||
}
|
||||
if (passerInfo == null) {
|
||||
Fluttertoast.showToast(
|
||||
msg: "QR CODE IS INVALID",
|
||||
fontSize: 24,
|
||||
toastLength: Toast.LENGTH_SHORT,
|
||||
gravity: ToastGravity.CENTER,
|
||||
backgroundColor: Colors.black,
|
||||
textColor: Colors.white);
|
||||
emit(QRInvalid(token: token!));
|
||||
} else {
|
||||
if (otherInputs!) {
|
||||
if (io?.toLowerCase() == 'incoming') {
|
||||
emit(IncomingScanState());
|
||||
} else {
|
||||
emit(OutGoingScanState());
|
||||
}
|
||||
} else {
|
||||
add(PerformPostLogs(
|
||||
checkerId: checkerId!,
|
||||
cpId: cpId,
|
||||
destination: null,
|
||||
io: io!.toLowerCase() == "incoming" ? "i" : "o",
|
||||
otherInputs: otherInputs!,
|
||||
passerId: uuid!,
|
||||
roleId: roleId!,
|
||||
stationId: stationId,
|
||||
temp: null));
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
emit(PassCheckErrorState(message: e.toString()));
|
||||
}
|
||||
} else {
|
||||
emit(SettingSaved(
|
||||
assignedArea: assignedArea,
|
||||
checker: checkerId!,
|
||||
io: io!,
|
||||
otherInputs: otherInputs!,
|
||||
roleId: roleId!,
|
||||
token: token!));
|
||||
}
|
||||
});
|
||||
on<PerformPostLogs>((event, emit) async {
|
||||
emit(PassCheckLoadingState());
|
||||
try {
|
||||
final bool success = await PassCheckServices.instance.performPostLogs(
|
||||
passerId: event.passerId,
|
||||
chekerId: event.checkerId,
|
||||
temp: event.temp,
|
||||
destination: event.destination,
|
||||
io: event.io,
|
||||
stationId: event.stationId,
|
||||
cpId: event.cpId,
|
||||
otherInputs: event.otherInputs,
|
||||
roleid: event.roleId);
|
||||
if (success) {
|
||||
Fluttertoast.showToast(
|
||||
msg: "SUCCESSFULLY SAVED",
|
||||
fontSize: 24,
|
||||
toastLength: Toast.LENGTH_SHORT,
|
||||
gravity: ToastGravity.CENTER,
|
||||
backgroundColor: Colors.black,
|
||||
textColor: Colors.white);
|
||||
emit(ScanSuccess(token: token!));
|
||||
} else {
|
||||
Fluttertoast.showToast(
|
||||
msg: "SCAN FAILED",
|
||||
fontSize: 24,
|
||||
toastLength: Toast.LENGTH_SHORT,
|
||||
gravity: ToastGravity.CENTER,
|
||||
backgroundColor: Colors.black,
|
||||
textColor: Colors.white);
|
||||
emit(ScanFailed(token: token!));
|
||||
}
|
||||
} catch (e) {
|
||||
emit(PassCheckErrorState(message: e.toString()));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
|
@ -0,0 +1,70 @@
|
|||
part of 'pass_check_bloc.dart';
|
||||
|
||||
abstract class PassCheckEvent extends Equatable {
|
||||
const PassCheckEvent();
|
||||
|
||||
@override
|
||||
List<Object> get props => [];
|
||||
}
|
||||
|
||||
class GetPassCheckAreas extends PassCheckEvent {
|
||||
final int roleId;
|
||||
final int userId;
|
||||
const GetPassCheckAreas({required this.roleId, required this.userId});
|
||||
}
|
||||
|
||||
class SetScannerSettings extends PassCheckEvent {
|
||||
final int roleId;
|
||||
final String token;
|
||||
final dynamic assignedArea;
|
||||
final bool includeOtherInputs;
|
||||
final String entranceExit;
|
||||
final int checkerId;
|
||||
const SetScannerSettings(
|
||||
{required this.assignedArea,
|
||||
required this.checkerId,
|
||||
required this.entranceExit,
|
||||
required this.includeOtherInputs,
|
||||
required this.roleId,
|
||||
required this.token});
|
||||
}
|
||||
|
||||
class ScanQr extends PassCheckEvent {
|
||||
final String token;
|
||||
|
||||
const ScanQr({required this.token});
|
||||
}
|
||||
|
||||
class PerformPostLogs extends PassCheckEvent {
|
||||
final String passerId;
|
||||
final int checkerId;
|
||||
final String io;
|
||||
final bool otherInputs;
|
||||
final String? cpId;
|
||||
final int? stationId;
|
||||
final String? destination;
|
||||
final double? temp;
|
||||
final int roleId;
|
||||
const PerformPostLogs(
|
||||
{required this.checkerId,
|
||||
required this.cpId,
|
||||
required this.destination,
|
||||
required this.io,
|
||||
required this.otherInputs,
|
||||
required this.passerId,
|
||||
required this.roleId,
|
||||
required this.stationId,
|
||||
required this.temp});
|
||||
}
|
||||
|
||||
class PerformIncomingPostLog extends PassCheckEvent{
|
||||
final double temp;
|
||||
const PerformIncomingPostLog({required this.temp});
|
||||
}
|
||||
class PerformOutgoingPostLog extends PassCheckEvent{
|
||||
final String destination;
|
||||
const PerformOutgoingPostLog({required this.destination});
|
||||
}
|
||||
class ScanError extends PassCheckEvent{
|
||||
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
part of 'pass_check_bloc.dart';
|
||||
|
||||
abstract class PassCheckState extends Equatable {
|
||||
const PassCheckState();
|
||||
|
||||
@override
|
||||
List<Object> get props => [];
|
||||
}
|
||||
|
||||
class PassCheckInitial extends PassCheckState {}
|
||||
|
||||
class PassCheckErrorState extends PassCheckState {
|
||||
final String message;
|
||||
const PassCheckErrorState({required this.message});
|
||||
}
|
||||
|
||||
class QRInvalid extends PassCheckState{
|
||||
final String token;
|
||||
const QRInvalid({required this.token});
|
||||
}
|
||||
|
||||
class PassCheckLoadingState extends PassCheckState {}
|
||||
|
||||
class AssignAreaLoaded extends PassCheckState {
|
||||
final List<dynamic> assignedArea;
|
||||
final int roleId;
|
||||
const AssignAreaLoaded({required this.assignedArea, required this.roleId});
|
||||
}
|
||||
|
||||
class SettingSaved extends PassCheckState {
|
||||
final dynamic assignedArea;
|
||||
final String token;
|
||||
final String io;
|
||||
final int checker;
|
||||
final bool otherInputs;
|
||||
final int roleId;
|
||||
const SettingSaved(
|
||||
{required this.assignedArea,
|
||||
required this.checker,
|
||||
required this.io,
|
||||
required this.otherInputs,
|
||||
required this.roleId,
|
||||
required this.token});
|
||||
}
|
||||
|
||||
class IncomingScanState extends PassCheckState {
|
||||
|
||||
}
|
||||
|
||||
class OutGoingScanState extends PassCheckState {
|
||||
|
||||
}
|
||||
|
||||
class ScanSuccess extends PassCheckState{
|
||||
final String token;
|
||||
const ScanSuccess({required this.token});
|
||||
}
|
||||
|
||||
class ScanFailed extends PassCheckState{
|
||||
final String token;
|
||||
const ScanFailed({required this.token});
|
||||
}
|
||||
|
||||
class QRCodeInvalid extends PassCheckState{
|
||||
final String token;
|
||||
const QRCodeInvalid({required this.token});
|
||||
}
|
|
@ -85,6 +85,8 @@ class UserBloc extends Bloc<UserEvent, UserState> {
|
|||
emit(InternetTimeout(message: timeoutError));
|
||||
} on SocketException catch (_) {
|
||||
emit(InternetTimeout(message: timeoutError));
|
||||
}on Error catch(e){
|
||||
emit(LoginErrorState(message: e.toString()));
|
||||
}
|
||||
});
|
||||
on<UuidLogin>((event, emit) async {
|
||||
|
@ -110,8 +112,8 @@ class UserBloc extends Bloc<UserEvent, UserState> {
|
|||
emit(InternetTimeout(message: timeoutError));
|
||||
} on SocketException catch (_) {
|
||||
emit(InternetTimeout(message: timeoutError));
|
||||
} on Error catch (_) {
|
||||
emit(InvalidCredentials(message: "Invalid username or password"));
|
||||
} on Error catch(e){
|
||||
emit(LoginErrorState(message: e.toString()));
|
||||
}
|
||||
});
|
||||
on<LoadLoggedInUser>((event, emit) {
|
||||
|
|
|
@ -66,3 +66,7 @@ class InvalidCredentials extends UserState{
|
|||
final String message ;
|
||||
InvalidCredentials ({required this.message});
|
||||
}
|
||||
class LoginErrorState extends UserState{
|
||||
final String message;
|
||||
LoginErrorState({required this.message});
|
||||
}
|
||||
|
|
|
@ -0,0 +1,96 @@
|
|||
|
||||
class AgencyAssignedArea {
|
||||
final bool? isactive;
|
||||
final Area? area;
|
||||
|
||||
AgencyAssignedArea({
|
||||
required this.isactive,
|
||||
required this.area,
|
||||
});
|
||||
|
||||
factory AgencyAssignedArea.fromJson(Map<String, dynamic> json) => AgencyAssignedArea(
|
||||
isactive: json["isactive"],
|
||||
area: json["area"] == null? null:Area.fromJson(json["area"]),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"isactive": isactive,
|
||||
"area": area?.toJson(),
|
||||
};
|
||||
}
|
||||
|
||||
class Area {
|
||||
final int? id;
|
||||
final String? name;
|
||||
final Category? category;
|
||||
final bool? privateEntity;
|
||||
final String? contactInfo;
|
||||
|
||||
Area({
|
||||
required this.id,
|
||||
required this.name,
|
||||
required this.category,
|
||||
required this.privateEntity,
|
||||
required this.contactInfo,
|
||||
});
|
||||
|
||||
factory Area.fromJson(Map<String, dynamic> json) => Area(
|
||||
id: json["id"],
|
||||
name: json["name"],
|
||||
category: json["category"]==null?null:Category.fromJson(json["category"]),
|
||||
privateEntity: json["private_entity"],
|
||||
contactInfo: json["contact_info"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"name": name,
|
||||
"category": category?.toJson(),
|
||||
"private_entity": privateEntity,
|
||||
"contact_info": contactInfo,
|
||||
};
|
||||
}
|
||||
|
||||
class Category {
|
||||
final int? id;
|
||||
final IndustryClass? industryClass;
|
||||
|
||||
Category({
|
||||
required this.id,
|
||||
required this.industryClass,
|
||||
});
|
||||
|
||||
factory Category.fromJson(Map<String, dynamic> json) => Category(
|
||||
id: json["id"],
|
||||
industryClass: json["industry_class"] == null?null:IndustryClass.fromJson(json["industry_class"]),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"industry_class": industryClass?.toJson(),
|
||||
};
|
||||
}
|
||||
|
||||
class IndustryClass {
|
||||
final int? id;
|
||||
final String? name;
|
||||
final String? description;
|
||||
|
||||
IndustryClass({
|
||||
required this.id,
|
||||
required this.name,
|
||||
required this.description,
|
||||
});
|
||||
|
||||
factory IndustryClass.fromJson(Map<String, dynamic> json) => IndustryClass(
|
||||
id: json["id"],
|
||||
name: json["name"],
|
||||
description: json["description"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"name": name,
|
||||
"description": description,
|
||||
};
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
// To parse this JSON data, do
|
||||
//
|
||||
// final assignRoleAreaType = assignRoleAreaTypeFromJson(jsonString);
|
||||
|
||||
|
||||
class AssignRoleAreaType {
|
||||
final String areaTypeName;
|
||||
final Details details;
|
||||
|
||||
AssignRoleAreaType({
|
||||
required this.areaTypeName,
|
||||
required this.details,
|
||||
});
|
||||
|
||||
factory AssignRoleAreaType.fromJson(Map<String, dynamic> json) => AssignRoleAreaType(
|
||||
areaTypeName: json["area_type_name"],
|
||||
details: Details.fromJson(json["details"]),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"area_type_name": areaTypeName,
|
||||
"details": details.toJson(),
|
||||
};
|
||||
}
|
||||
|
||||
class Details {
|
||||
final String? table;
|
||||
final String? schema;
|
||||
final String? dataType;
|
||||
final String? idColumn;
|
||||
|
||||
Details({
|
||||
required this.table,
|
||||
required this.schema,
|
||||
required this.dataType,
|
||||
required this.idColumn,
|
||||
});
|
||||
|
||||
factory Details.fromJson(Map<String, dynamic> json) => Details(
|
||||
table: json["table"],
|
||||
schema: json["schema"],
|
||||
dataType: json["data_type"],
|
||||
idColumn: json["id_column"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"table": table,
|
||||
"schema": schema,
|
||||
"data_type": dataType,
|
||||
"id_column": idColumn,
|
||||
};
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
|
||||
class BaragayAssignArea {
|
||||
final String? brgycode;
|
||||
final String? brgydesc;
|
||||
final String? citymuncode;
|
||||
|
||||
BaragayAssignArea({
|
||||
required this.brgycode,
|
||||
required this.brgydesc,
|
||||
required this.citymuncode,
|
||||
});
|
||||
|
||||
factory BaragayAssignArea.fromJson(Map<String, dynamic> json) => BaragayAssignArea(
|
||||
brgycode: json["brgycode"],
|
||||
brgydesc: json["brgydesc"],
|
||||
citymuncode: json["citymuncode"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"brgycode": brgycode,
|
||||
"brgydesc": brgydesc,
|
||||
"citymuncode": citymuncode,
|
||||
};
|
||||
}
|
|
@ -0,0 +1,120 @@
|
|||
|
||||
class PasserInfo {
|
||||
final int personid;
|
||||
final String familyname;
|
||||
final String givenname;
|
||||
final String? middlename;
|
||||
final String sex;
|
||||
final DateTime? birthdate;
|
||||
final String? extension;
|
||||
final String? civilstatus;
|
||||
final double? heightM;
|
||||
final double weightKg;
|
||||
final String? bloodtype;
|
||||
final String? photoPath;
|
||||
final String? uuid;
|
||||
final String? encryptionKey;
|
||||
final bool? deceased;
|
||||
final dynamic encryptedProfile;
|
||||
final String? addedby;
|
||||
final DateTime? addedat;
|
||||
final String? updateby;
|
||||
final DateTime? updatedat;
|
||||
final String? deletedby;
|
||||
final DateTime? deletedat;
|
||||
final String? encryptSignature;
|
||||
final String? esigPath;
|
||||
final String? titlePrefix;
|
||||
final String? titleSuffix;
|
||||
final bool? showTitleId;
|
||||
|
||||
PasserInfo({
|
||||
required this.personid,
|
||||
required this.familyname,
|
||||
required this.givenname,
|
||||
required this.middlename,
|
||||
required this.sex,
|
||||
required this.birthdate,
|
||||
required this.extension,
|
||||
required this.civilstatus,
|
||||
required this.heightM,
|
||||
required this.weightKg,
|
||||
required this.bloodtype,
|
||||
required this.photoPath,
|
||||
required this.uuid,
|
||||
required this.encryptionKey,
|
||||
required this.deceased,
|
||||
required this.encryptedProfile,
|
||||
required this.addedby,
|
||||
required this.addedat,
|
||||
required this.updateby,
|
||||
required this.updatedat,
|
||||
required this.deletedby,
|
||||
required this.deletedat,
|
||||
required this.encryptSignature,
|
||||
required this.esigPath,
|
||||
required this.titlePrefix,
|
||||
required this.titleSuffix,
|
||||
required this.showTitleId,
|
||||
});
|
||||
|
||||
factory PasserInfo.fromJson(Map<String, dynamic> json) => PasserInfo(
|
||||
personid: json["personid"],
|
||||
familyname: json["familyname"],
|
||||
givenname: json["givenname"],
|
||||
middlename: json["middlename"],
|
||||
sex: json["sex"],
|
||||
birthdate: json['birthdate'] == null?null: DateTime.parse(json["birthdate"]),
|
||||
extension: json["extension"],
|
||||
civilstatus: json["civilstatus"],
|
||||
heightM: json["height_m"]?.toDouble(),
|
||||
weightKg: json["weight_kg"]?.toDouble(),
|
||||
bloodtype: json["bloodtype"],
|
||||
photoPath: json["photo_path"],
|
||||
uuid: json["uuid"],
|
||||
encryptionKey: json["encryption_key"],
|
||||
deceased: json["deceased"],
|
||||
encryptedProfile: json["encrypted_profile"],
|
||||
addedby: json["addedby"],
|
||||
addedat: json["addedat"] == null? null:DateTime.tryParse(json["addedat"]),
|
||||
updateby:json["updateby"],
|
||||
updatedat:json["updatedat"]==null?null: DateTime.tryParse(json["updatedat"]),
|
||||
deletedby: json["deletedby"],
|
||||
deletedat: json['deletedat'] == null?null:DateTime.tryParse(json["deletedat"]),
|
||||
encryptSignature: json["encrypt_signature"],
|
||||
esigPath: json["esig_path"],
|
||||
titlePrefix: json["title_prefix"],
|
||||
titleSuffix: json["title_suffix"],
|
||||
showTitleId: json["show_title_id"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"personid": personid,
|
||||
"familyname": familyname,
|
||||
"givenname": givenname,
|
||||
"middlename": middlename,
|
||||
"sex": sex,
|
||||
"birthdate": "${birthdate?.year.toString().padLeft(4, '0')}-${birthdate?.month.toString().padLeft(2, '0')}-${birthdate?.day.toString().padLeft(2, '0')}",
|
||||
"extension": extension,
|
||||
"civilstatus": civilstatus,
|
||||
"height_m": heightM,
|
||||
"weight_kg": weightKg,
|
||||
"bloodtype": bloodtype,
|
||||
"photo_path": photoPath,
|
||||
"uuid": uuid,
|
||||
"encryption_key": encryptionKey,
|
||||
"deceased": deceased,
|
||||
"encrypted_profile": encryptedProfile,
|
||||
"addedby": addedby,
|
||||
"addedat": addedat?.toIso8601String(),
|
||||
"updateby": updateby,
|
||||
"updatedat": updatedat?.toIso8601String(),
|
||||
"deletedby": deletedby,
|
||||
"deletedat": deletedat,
|
||||
"encrypt_signature": encryptSignature,
|
||||
"esig_path": esigPath,
|
||||
"title_prefix": titlePrefix,
|
||||
"title_suffix": titleSuffix,
|
||||
"show_title_id": showTitleId,
|
||||
};
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
|
||||
|
||||
import 'barangay_assign_area.dart';
|
||||
|
||||
class Purok {
|
||||
final String? purokid;
|
||||
final String? purokdesc;
|
||||
final BaragayAssignArea? brgy;
|
||||
final dynamic purokLeader;
|
||||
final bool? writelock;
|
||||
final dynamic recordsignature;
|
||||
|
||||
Purok({
|
||||
required this.purokid,
|
||||
required this.purokdesc,
|
||||
required this.brgy,
|
||||
required this.purokLeader,
|
||||
required this.writelock,
|
||||
required this.recordsignature,
|
||||
});
|
||||
|
||||
factory Purok.fromJson(Map<String, dynamic> json) => Purok(
|
||||
purokid: json["purokid"],
|
||||
purokdesc: json["purokdesc"],
|
||||
brgy: json["brgy"]==null?null:BaragayAssignArea.fromJson(json["brgy"]),
|
||||
purokLeader: json["purok_leader"],
|
||||
writelock: json["writelock"],
|
||||
recordsignature: json["recordsignature"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"purokid": purokid,
|
||||
"purokdesc": purokdesc,
|
||||
"brgy": brgy?.toJson(),
|
||||
"purok_leader": purokLeader,
|
||||
"writelock": writelock,
|
||||
"recordsignature": recordsignature,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,182 @@
|
|||
// To parse this JSON data, do
|
||||
//
|
||||
// final assignArea = assignAreaFromJson(jsonString);
|
||||
|
||||
class StationAssignArea {
|
||||
final bool? isactive;
|
||||
final Area? area;
|
||||
|
||||
StationAssignArea({
|
||||
required this.isactive,
|
||||
required this.area,
|
||||
});
|
||||
|
||||
factory StationAssignArea.fromJson(Map<String, dynamic> json) => StationAssignArea(
|
||||
isactive: json["isactive"],
|
||||
area: json["area"] == null?null: Area.fromJson(json["area"]),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"isactive": isactive,
|
||||
"area": area?.toJson(),
|
||||
};
|
||||
}
|
||||
|
||||
class Area {
|
||||
final int? id;
|
||||
final String? stationName;
|
||||
final StationType? stationType;
|
||||
final int? hierarchyOrderNo;
|
||||
final String? headPosition;
|
||||
final GovernmentAgency? governmentAgency;
|
||||
final String? acronym;
|
||||
final int? parentStation;
|
||||
final String? code;
|
||||
final String? fullcode;
|
||||
final List<ChildStationInfo>? childStationInfo;
|
||||
final bool? islocationUnderParent;
|
||||
final int? mainParentStation;
|
||||
final String? description;
|
||||
final bool? ishospital;
|
||||
final bool? isactive;
|
||||
final bool? sellingStation;
|
||||
|
||||
Area({
|
||||
required this.id,
|
||||
required this.stationName,
|
||||
required this.stationType,
|
||||
required this.hierarchyOrderNo,
|
||||
required this.headPosition,
|
||||
required this.governmentAgency,
|
||||
required this.acronym,
|
||||
required this.parentStation,
|
||||
required this.code,
|
||||
required this.fullcode,
|
||||
required this.childStationInfo,
|
||||
required this.islocationUnderParent,
|
||||
required this.mainParentStation,
|
||||
required this.description,
|
||||
required this.ishospital,
|
||||
required this.isactive,
|
||||
required this.sellingStation,
|
||||
});
|
||||
|
||||
factory Area.fromJson(Map<String, dynamic> json) => Area(
|
||||
id: json["id"],
|
||||
stationName: json["station_name"],
|
||||
stationType:json["station_type"] ==null?null: StationType.fromJson(json["station_type"]),
|
||||
hierarchyOrderNo: json["hierarchy_order_no"],
|
||||
headPosition: json["head_position"],
|
||||
governmentAgency: json["government_agency"] == null?null:GovernmentAgency.fromJson(json["government_agency"]),
|
||||
acronym: json["acronym"],
|
||||
parentStation: json["parent_station"],
|
||||
code: json["code"],
|
||||
fullcode: json["fullcode"],
|
||||
childStationInfo: json['child_station_info']==null?[]:List<ChildStationInfo>.from(json["child_station_info"].map((x) => ChildStationInfo.fromJson(x))),
|
||||
islocationUnderParent: json["islocation_under_parent"],
|
||||
mainParentStation: json["main_parent_station"],
|
||||
description: json["description"],
|
||||
ishospital: json["ishospital"],
|
||||
isactive: json["isactive"],
|
||||
sellingStation: json["selling_station"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"station_name": stationName,
|
||||
"station_type": stationType?.toJson(),
|
||||
"hierarchy_order_no": hierarchyOrderNo,
|
||||
"head_position": headPosition,
|
||||
"government_agency": governmentAgency?.toJson(),
|
||||
"acronym": acronym,
|
||||
"parent_station": parentStation,
|
||||
"code": code,
|
||||
"fullcode": fullcode,
|
||||
"child_station_info": List<dynamic>.from(childStationInfo!.map((x) => x.toJson())),
|
||||
"islocation_under_parent": islocationUnderParent,
|
||||
"main_parent_station": mainParentStation,
|
||||
"description": description,
|
||||
"ishospital": ishospital,
|
||||
"isactive": isactive,
|
||||
"selling_station": sellingStation,
|
||||
};
|
||||
}
|
||||
|
||||
class ChildStationInfo {
|
||||
final int? id;
|
||||
final String? stationName;
|
||||
final String? acroym;
|
||||
bool? motherStation;
|
||||
|
||||
ChildStationInfo({
|
||||
required this.id,
|
||||
required this.stationName,
|
||||
required this.acroym,
|
||||
this.motherStation
|
||||
});
|
||||
|
||||
factory ChildStationInfo.fromJson(Map<String, dynamic> json) => ChildStationInfo(
|
||||
id: json["id"],
|
||||
stationName: json["station_name"],
|
||||
acroym: json["acroym"],
|
||||
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"station_name": stationName,
|
||||
"acroym": acroym,
|
||||
};
|
||||
}
|
||||
|
||||
class GovernmentAgency {
|
||||
final int? agencyid;
|
||||
final String? agencyname;
|
||||
final int? agencycatid;
|
||||
final bool? privateEntity;
|
||||
final int? contactinfoid;
|
||||
|
||||
GovernmentAgency({
|
||||
required this.agencyid,
|
||||
required this.agencyname,
|
||||
required this.agencycatid,
|
||||
required this.privateEntity,
|
||||
required this.contactinfoid,
|
||||
});
|
||||
|
||||
factory GovernmentAgency.fromJson(Map<String, dynamic> json) => GovernmentAgency(
|
||||
agencyid: json["agencyid"],
|
||||
agencyname: json["agencyname"],
|
||||
agencycatid: json["agencycatid"],
|
||||
privateEntity: json["private_entity"],
|
||||
contactinfoid: json["contactinfoid"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"agencyid": agencyid,
|
||||
"agencyname": agencyname,
|
||||
"agencycatid": agencycatid,
|
||||
"private_entity": privateEntity,
|
||||
"contactinfoid": contactinfoid,
|
||||
};
|
||||
}
|
||||
|
||||
class StationType {
|
||||
final int? id;
|
||||
final String? typeName;
|
||||
|
||||
StationType({
|
||||
required this.id,
|
||||
required this.typeName,
|
||||
});
|
||||
|
||||
factory StationType.fromJson(Map<String, dynamic> json) => StationType(
|
||||
id: json["id"],
|
||||
typeName: json["type_name"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"type_name": typeName,
|
||||
};
|
||||
}
|
|
@ -8,6 +8,7 @@ import 'package:unit2/bloc/profile/primary_information/address/address_bloc.dart
|
|||
import 'package:unit2/model/location/address_category.dart';
|
||||
import 'package:unit2/model/profile/basic_information/adress.dart';
|
||||
import 'package:unit2/utils/global.dart';
|
||||
import 'package:unit2/utils/global_context.dart';
|
||||
import '../../../../../model/location/barangay.dart';
|
||||
import '../../../../../model/location/city.dart';
|
||||
import '../../../../../model/location/country.dart';
|
||||
|
@ -281,12 +282,16 @@ class _EditAddressScreenState extends State<EditAddressScreen> {
|
|||
});
|
||||
selectedRegion = region;
|
||||
//// GET PROVINCES
|
||||
try{
|
||||
provinces = await LocationUtils
|
||||
.instance
|
||||
.getProvinces(
|
||||
regionCode:
|
||||
selectedRegion!.code
|
||||
.toString());
|
||||
}catch(e){
|
||||
NavigationService.navigatorKey.currentContext?.read<AddressBloc>().add(CallErrorState());
|
||||
}
|
||||
selectedProvince =
|
||||
provinces![0];
|
||||
setState(() {
|
||||
|
@ -294,11 +299,15 @@ class _EditAddressScreenState extends State<EditAddressScreen> {
|
|||
cityCall = true;
|
||||
});
|
||||
//// GET CITIES
|
||||
try{
|
||||
citymuns = await LocationUtils
|
||||
.instance
|
||||
.getCities(
|
||||
code: selectedProvince!
|
||||
.code!);
|
||||
}catch(e){
|
||||
NavigationService.navigatorKey.currentContext?.read<AddressBloc>().add(CallErrorState());
|
||||
}
|
||||
selectedMunicipality =
|
||||
citymuns![0];
|
||||
setState(() {
|
||||
|
@ -306,23 +315,31 @@ class _EditAddressScreenState extends State<EditAddressScreen> {
|
|||
barangayCall = true;
|
||||
});
|
||||
//// GET BARANGAY
|
||||
try{
|
||||
barangays = await LocationUtils
|
||||
.instance
|
||||
.getBarangay(
|
||||
code:
|
||||
selectedMunicipality!
|
||||
.code!);
|
||||
}catch(e){
|
||||
NavigationService.navigatorKey.currentContext?.read<AddressBloc>().add(CallErrorState());
|
||||
}
|
||||
selectedBarangay =
|
||||
barangays![0];
|
||||
setState(() {
|
||||
barangayCall = false;
|
||||
});
|
||||
////GET CITY MUNICIPALITY
|
||||
try{
|
||||
citymuns = await LocationUtils
|
||||
.instance
|
||||
.getCities(
|
||||
code: selectedProvince!
|
||||
.code!);
|
||||
}catch(e){
|
||||
NavigationService.navigatorKey.currentContext?.read<AddressBloc>().add(CallErrorState());
|
||||
}
|
||||
selectedMunicipality =
|
||||
citymuns![0];
|
||||
setState(() {
|
||||
|
@ -330,12 +347,16 @@ class _EditAddressScreenState extends State<EditAddressScreen> {
|
|||
barangayCall = true;
|
||||
});
|
||||
//// GET BARANGAYS
|
||||
try{
|
||||
barangays = await LocationUtils
|
||||
.instance
|
||||
.getBarangay(
|
||||
code:
|
||||
selectedMunicipality!
|
||||
.code!);
|
||||
}catch(e){
|
||||
NavigationService.navigatorKey.currentContext?.read<AddressBloc>().add(CallErrorState());
|
||||
}
|
||||
selectedBarangay =
|
||||
barangays![0];
|
||||
setState(() {
|
||||
|
@ -385,12 +406,16 @@ class _EditAddressScreenState extends State<EditAddressScreen> {
|
|||
});
|
||||
|
||||
//// GET CITIES
|
||||
try{
|
||||
citymuns = await LocationUtils
|
||||
.instance
|
||||
.getCities(
|
||||
code:
|
||||
selectedProvince!
|
||||
.code!);
|
||||
}catch(e){
|
||||
NavigationService.navigatorKey.currentContext?.read<AddressBloc>().add(CallErrorState());
|
||||
}
|
||||
selectedMunicipality =
|
||||
citymuns![0];
|
||||
setState(() {
|
||||
|
@ -398,12 +423,16 @@ class _EditAddressScreenState extends State<EditAddressScreen> {
|
|||
barangayCall = true;
|
||||
});
|
||||
//// GET BARANGAY
|
||||
try{
|
||||
barangays = await LocationUtils
|
||||
.instance
|
||||
.getBarangay(
|
||||
code:
|
||||
selectedMunicipality!
|
||||
.code!);
|
||||
}catch(e){
|
||||
NavigationService.navigatorKey.currentContext?.read<AddressBloc>().add(CallErrorState());
|
||||
}
|
||||
selectedBarangay =
|
||||
barangays![0];
|
||||
setState(() {
|
||||
|
@ -453,12 +482,16 @@ class _EditAddressScreenState extends State<EditAddressScreen> {
|
|||
selectedMunicipality = city;
|
||||
selectedMunicipality = city;
|
||||
//// GET BARANGAYS
|
||||
try{
|
||||
barangays = await LocationUtils
|
||||
.instance
|
||||
.getBarangay(
|
||||
code:
|
||||
selectedMunicipality!
|
||||
.code!);
|
||||
}catch(e){
|
||||
NavigationService.navigatorKey.currentContext?.read<AddressBloc>().add(CallErrorState());
|
||||
}
|
||||
selectedBarangay =
|
||||
barangays![0];
|
||||
setState(() {
|
||||
|
|
|
@ -90,7 +90,7 @@ class ContactInformationScreen extends StatelessWidget {
|
|||
.add(LoadContacts());
|
||||
});
|
||||
} else {
|
||||
errorAlert(context, "Update Failed",
|
||||
errorAlert(context, "Adding Failed",
|
||||
"Something went wrong. Please try again.",
|
||||
() {
|
||||
Navigator.of(context).pop();
|
||||
|
@ -331,7 +331,7 @@ class ContactInformationScreen extends StatelessWidget {
|
|||
);
|
||||
});
|
||||
} else {
|
||||
const EmptyData(
|
||||
return const EmptyData(
|
||||
message:
|
||||
"You don't have contact information added. Please click + to add");
|
||||
}
|
||||
|
|
|
@ -157,7 +157,7 @@ class _EditBasicProfileInfoScreenState
|
|||
UpperCaseTextFormatter()
|
||||
],
|
||||
name: "middlename",
|
||||
initialValue: state.primaryInformation.middleName!,
|
||||
initialValue: state.primaryInformation.middleName??'',
|
||||
decoration: normalTextFieldStyle("Middle name", ""),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
import 'package:date_time_picker/date_time_picker.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:fluttericon/font_awesome_icons.dart';
|
||||
import 'package:form_builder_validators/form_builder_validators.dart';
|
||||
import 'package:searchfield/searchfield.dart';
|
||||
|
||||
import '../../../../../bloc/profile/family/family_bloc.dart';
|
||||
import '../../../../../model/profile/family_backround.dart';
|
||||
import '../../../../../model/utils/agency.dart';
|
||||
|
@ -17,7 +15,6 @@ import '../../../../../theme-data.dart/form-style.dart';
|
|||
import '../../../../../utils/formatters.dart';
|
||||
import '../../../../../utils/global.dart';
|
||||
import '../../../../../utils/text_container.dart';
|
||||
import '../../../../../utils/validators.dart';
|
||||
import '../../../shared/add_for_empty_search.dart';
|
||||
|
||||
class SpouseEditAlert extends StatefulWidget {
|
||||
|
|
|
@ -146,17 +146,17 @@ class _EditIdentificationScreenState extends State<EditIdentificationScreen> {
|
|||
});
|
||||
},
|
||||
selectableDayPredicate: (date) {
|
||||
if (expDate != null &&
|
||||
DateTime.parse(expDate!)
|
||||
if ((expDate != "null" && expDate != null) &&
|
||||
DateTime.tryParse(expDate!)!
|
||||
.microsecondsSinceEpoch <=
|
||||
date.microsecondsSinceEpoch) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
initialDate: expDate != null
|
||||
initialDate: expDate == "null" || expDate == null
|
||||
? DateTime.now()
|
||||
: DateTime.parse(expDate!).subtract(
|
||||
: DateTime.tryParse(expDate!)?.subtract(
|
||||
const Duration(days: 1)),
|
||||
)),
|
||||
|
||||
|
@ -187,17 +187,17 @@ class _EditIdentificationScreenState extends State<EditIdentificationScreen> {
|
|||
color: Colors.black87,
|
||||
)),
|
||||
selectableDayPredicate: (date) {
|
||||
if (issuedDate != null &&
|
||||
DateTime.parse(issuedDate!)
|
||||
if ((issuedDate != "null" && issuedDate != null) &&
|
||||
DateTime.tryParse(issuedDate!)!
|
||||
.microsecondsSinceEpoch >=
|
||||
date.microsecondsSinceEpoch) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
initialDate: issuedDate != null
|
||||
initialDate: issuedDate == null && issuedDate == "null"
|
||||
? DateTime.now()
|
||||
: DateTime.parse(issuedDate!).add(
|
||||
: DateTime.tryParse(issuedDate!)?.add(
|
||||
const Duration(days: 1)),
|
||||
)),
|
||||
],
|
||||
|
@ -259,6 +259,14 @@ class _EditIdentificationScreenState extends State<EditIdentificationScreen> {
|
|||
selectedRegion!
|
||||
.code
|
||||
.toString());
|
||||
} catch (e) {
|
||||
context
|
||||
.read<
|
||||
IdentificationBloc>()
|
||||
.add(ShowErrorState(
|
||||
message:
|
||||
e.toString()));
|
||||
}
|
||||
selectedProvince =
|
||||
provinces![0];
|
||||
setState(() {
|
||||
|
@ -287,14 +295,7 @@ class _EditIdentificationScreenState extends State<EditIdentificationScreen> {
|
|||
message: e
|
||||
.toString()));
|
||||
}
|
||||
} catch (e) {
|
||||
context
|
||||
.read<
|
||||
IdentificationBloc>()
|
||||
.add(ShowErrorState(
|
||||
message:
|
||||
e.toString()));
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
value: selectedRegion,
|
||||
|
|
|
@ -219,7 +219,7 @@ class IdentificationsScreen extends StatelessWidget {
|
|||
const SizedBox(height: 8,),
|
||||
Badge(
|
||||
backgroundColor:
|
||||
success2,
|
||||
government != true?success2:second,
|
||||
label: Text(
|
||||
government == true
|
||||
? privateText
|
||||
|
|
|
@ -1,15 +1,12 @@
|
|||
import 'package:date_time_picker/date_time_picker.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:flutter_progress_hud/flutter_progress_hud.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:form_builder_validators/form_builder_validators.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:unit2/bloc/profile/profile_bloc.dart';
|
||||
import 'package:unit2/model/profile/basic_information/primary-information.dart';
|
||||
import 'package:unit2/screens/profile/components/basic_information/edit_basic_info_modal.dart';
|
||||
import 'package:unit2/theme-data.dart/btn-style.dart';
|
||||
import 'package:unit2/theme-data.dart/colors.dart';
|
||||
import 'package:unit2/theme-data.dart/form-style.dart';
|
||||
import 'package:unit2/utils/global.dart';
|
||||
|
@ -132,8 +129,8 @@ class _PrimaryInfoState extends State<PrimaryInfo> {
|
|||
child: FormBuilderTextField(
|
||||
enabled: enabled,
|
||||
name: middlename,
|
||||
initialValue:
|
||||
state.primaryBasicInformation.middleName!,
|
||||
initialValue: state.primaryBasicInformation.middleName??''
|
||||
,
|
||||
decoration:
|
||||
normalTextFieldStyle("Middle name", ""),
|
||||
),
|
||||
|
|
|
@ -9,6 +9,7 @@ import 'package:modal_progress_hud_nsn/modal_progress_hud_nsn.dart';
|
|||
import 'package:unit2/model/location/city.dart';
|
||||
import 'package:unit2/model/profile/eligibility.dart';
|
||||
import 'package:unit2/model/utils/eligibility.dart';
|
||||
import 'package:unit2/utils/global_context.dart';
|
||||
import 'package:unit2/utils/location_utilities.dart';
|
||||
import '../../../../bloc/profile/eligibility/eligibility_bloc.dart';
|
||||
import '../../../../model/location/country.dart';
|
||||
|
@ -315,22 +316,30 @@ class _EditEligibilityScreenState extends State<EditEligibilityScreen> {
|
|||
provinceCall = true;
|
||||
});
|
||||
selectedRegion = region;
|
||||
try{
|
||||
provinces = await LocationUtils
|
||||
.instance
|
||||
.getProvinces(
|
||||
regionCode:
|
||||
selectedRegion!.code
|
||||
.toString());
|
||||
}catch(e){
|
||||
context.read<EligibilityBloc>().add(CallErrorState());
|
||||
}
|
||||
selectedProvince = provinces![0];
|
||||
setState(() {
|
||||
provinceCall = false;
|
||||
cityCall = true;
|
||||
});
|
||||
try{
|
||||
citymuns = await LocationUtils
|
||||
.instance
|
||||
.getCities(
|
||||
code: selectedProvince!
|
||||
.code!);
|
||||
}catch(e){
|
||||
NavigationService.navigatorKey.currentContext?.read<EligibilityBloc>().add(CallErrorState());
|
||||
}
|
||||
selectedMunicipality =
|
||||
citymuns![0];
|
||||
setState(() {
|
||||
|
@ -376,6 +385,9 @@ class _EditEligibilityScreenState extends State<EditEligibilityScreen> {
|
|||
cityCall = true;
|
||||
});
|
||||
selectedProvince = province;
|
||||
try{
|
||||
|
||||
|
||||
citymuns = await LocationUtils
|
||||
.instance
|
||||
.getCities(
|
||||
|
@ -383,6 +395,9 @@ class _EditEligibilityScreenState extends State<EditEligibilityScreen> {
|
|||
selectedProvince!
|
||||
.code
|
||||
.toString());
|
||||
}catch(e){
|
||||
context.read<EligibilityBloc>().add(CallErrorState());
|
||||
}
|
||||
selectedMunicipality =
|
||||
citymuns![0];
|
||||
setState(() {
|
||||
|
|
|
@ -328,7 +328,7 @@ class _FamilyBackgroundScreenState extends State<FamilyBackgroundScreen> {
|
|||
vertical:
|
||||
-4),
|
||||
title: Text(
|
||||
"${father?.relatedPerson?.firstName} ${father?.relatedPerson?.middleName??''} ${father?.relatedPerson!.lastName} ${father?.relatedPerson?.nameExtension ?? ''}",
|
||||
"${father?.relatedPerson?.firstName} ${father?.relatedPerson?.middleName ?? ''} ${father?.relatedPerson!.lastName} ${father?.relatedPerson?.nameExtension ?? ''}",
|
||||
style: Theme.of(
|
||||
context)
|
||||
.textTheme
|
||||
|
@ -612,7 +612,7 @@ class _FamilyBackgroundScreenState extends State<FamilyBackgroundScreen> {
|
|||
vertical:
|
||||
-4),
|
||||
title: Text(
|
||||
"${mother?.relatedPerson?.firstName} ${mother?.relatedPerson?.middleName??''} ${mother?.relatedPerson?.lastName} ${mother?.relatedPerson?.nameExtension ?? ''}",
|
||||
"${mother?.relatedPerson?.firstName} ${mother?.relatedPerson?.middleName ?? ''} ${mother?.relatedPerson?.lastName} ${mother?.relatedPerson?.nameExtension ?? ''}",
|
||||
style: Theme.of(
|
||||
context)
|
||||
.textTheme
|
||||
|
@ -860,14 +860,17 @@ class _FamilyBackgroundScreenState extends State<FamilyBackgroundScreen> {
|
|||
context);
|
||||
progress!.showWithText(
|
||||
"Loading...");
|
||||
if (positions.isEmpty) {
|
||||
try {
|
||||
if (positions
|
||||
.isEmpty) {
|
||||
positions =
|
||||
await ProfileUtilities
|
||||
.instance
|
||||
.getAgencyPosition();
|
||||
}
|
||||
|
||||
if (agencices.isEmpty) {
|
||||
if (agencices
|
||||
.isEmpty) {
|
||||
agencices =
|
||||
await ProfileUtilities
|
||||
.instance
|
||||
|
@ -880,6 +883,16 @@ class _FamilyBackgroundScreenState extends State<FamilyBackgroundScreen> {
|
|||
.instance
|
||||
.agencyCategory();
|
||||
}
|
||||
} catch (e) {
|
||||
NavigationService
|
||||
.navigatorKey
|
||||
.currentContext
|
||||
?.read<
|
||||
FamilyBloc>()
|
||||
.add(CallErrorState(
|
||||
message: e
|
||||
.toString()));
|
||||
}
|
||||
progress.dismiss();
|
||||
showDialog(
|
||||
context: NavigationService
|
||||
|
@ -938,7 +951,7 @@ class _FamilyBackgroundScreenState extends State<FamilyBackgroundScreen> {
|
|||
vertical:
|
||||
-4),
|
||||
title: Text(
|
||||
"${spouse?.relatedPerson?.firstName} ${spouse?.relatedPerson?.middleName??''} ${spouse?.relatedPerson!.lastName} ${spouse?.relatedPerson?.nameExtension ?? ''}",
|
||||
"${spouse?.relatedPerson?.firstName} ${spouse?.relatedPerson?.middleName ?? ''} ${spouse?.relatedPerson!.lastName} ${spouse?.relatedPerson?.nameExtension ?? ''}",
|
||||
style: Theme.of(
|
||||
context)
|
||||
.textTheme
|
||||
|
@ -1356,7 +1369,7 @@ class _FamilyBackgroundScreenState extends State<FamilyBackgroundScreen> {
|
|||
horizontal: -4,
|
||||
vertical: -4),
|
||||
title: Text(
|
||||
"${child.relatedPerson?.firstName} ${child.relatedPerson?.middleName??''} ${child.relatedPerson?.lastName} ${child.relatedPerson?.nameExtension ?? ''}",
|
||||
"${child.relatedPerson?.firstName} ${child.relatedPerson?.middleName ?? ''} ${child.relatedPerson?.lastName} ${child.relatedPerson?.nameExtension ?? ''}",
|
||||
style: Theme.of(context).textTheme.titleMedium!.copyWith(fontWeight: FontWeight.w500)),
|
||||
subtitle:
|
||||
const Text("fullname"),
|
||||
|
@ -1859,8 +1872,14 @@ class _FamilyBackgroundScreenState extends State<FamilyBackgroundScreen> {
|
|||
),
|
||||
),
|
||||
]);
|
||||
}if(state is FamilyErrorState){
|
||||
return SomethingWentWrong(message: state.message, onpressed: (){context.read<FamilyBloc>().add(GetFamilies(profileId: profileId!, token: token!));});
|
||||
}
|
||||
if (state is FamilyErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: state.message,
|
||||
onpressed: () {
|
||||
context.read<FamilyBloc>().add(GetFamilies(
|
||||
profileId: profileId!, token: token!));
|
||||
});
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
|
|
|
@ -35,19 +35,39 @@ class LearningAndDevelopmentScreen extends StatelessWidget {
|
|||
DateFormat dteFormat2 = DateFormat.yMMMMd('en_US');
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: context.watch<LearningDevelopmentBloc>().state is LearningDevelopmentAddingState? const FittedBox(child: Text("Add $learningAndDevelopmentScreenTitle")):context.watch<LearningDevelopmentBloc>().state is LearningDevelopmentUpdatingState?const FittedBox(child: Text("Edit $learningAndDevelopmentScreenTitle")):const FittedBox(child: Text(learningAndDevelopmentScreenTitle)),
|
||||
title: context.watch<LearningDevelopmentBloc>().state
|
||||
is LearningDevelopmentAddingState
|
||||
? const FittedBox(
|
||||
child: Text("Add $learningAndDevelopmentScreenTitle"))
|
||||
: context.watch<LearningDevelopmentBloc>().state
|
||||
is LearningDevelopmentUpdatingState
|
||||
? const FittedBox(
|
||||
child: Text("Edit $learningAndDevelopmentScreenTitle"))
|
||||
: const FittedBox(
|
||||
child: Text(learningAndDevelopmentScreenTitle)),
|
||||
centerTitle: true,
|
||||
backgroundColor: primary,
|
||||
actions: (context.watch<LearningDevelopmentBloc>().state is LearningDevelopmentLoadedState)?[
|
||||
actions: (context.watch<LearningDevelopmentBloc>().state
|
||||
is LearningDevelopmentLoadedState)
|
||||
? [
|
||||
AddLeading(onPressed: () {
|
||||
context.read<LearningDevelopmentBloc>().add(ShowAddLearningDevelopmentForm());
|
||||
context
|
||||
.read<LearningDevelopmentBloc>()
|
||||
.add(ShowAddLearningDevelopmentForm());
|
||||
})
|
||||
]:(context.watch<LearningDevelopmentBloc>().state is LearningDevelopmentAddingState || context.watch<LearningDevelopmentBloc>().state is LearningDevelopmentUpdatingState)?[
|
||||
CloseLeading(onPressed:() {
|
||||
context.read<LearningDevelopmentBloc>().add(LoadLearniningDevelopment());
|
||||
]
|
||||
: (context.watch<LearningDevelopmentBloc>().state
|
||||
is LearningDevelopmentAddingState ||
|
||||
context.watch<LearningDevelopmentBloc>().state
|
||||
is LearningDevelopmentUpdatingState)
|
||||
? [
|
||||
CloseLeading(onPressed: () {
|
||||
context
|
||||
.read<LearningDevelopmentBloc>()
|
||||
.add(LoadLearniningDevelopment());
|
||||
})
|
||||
]:[]
|
||||
),
|
||||
]
|
||||
: []),
|
||||
body: ProgressHUD(
|
||||
padding: const EdgeInsets.all(24),
|
||||
indicatorWidget: const SpinKitFadingCircle(
|
||||
|
@ -56,11 +76,13 @@ class LearningAndDevelopmentScreen extends StatelessWidget {
|
|||
backgroundColor: Colors.black87,
|
||||
child: BlocBuilder<UserBloc, UserState>(
|
||||
builder: (context, state) {
|
||||
|
||||
if (state is UserLoggedIn) {
|
||||
token = state.userData!.user!.login!.token!;
|
||||
profileId = state.userData!.user!.login!.user!.profileId!;
|
||||
return BlocBuilder<ProfileBloc, ProfileState>(
|
||||
builder: (context, state) {
|
||||
|
||||
if (state is ProfileLoaded) {
|
||||
return BlocConsumer<LearningDevelopmentBloc,
|
||||
LearningDevelopmentState>(
|
||||
|
@ -73,7 +95,8 @@ class LearningAndDevelopmentScreen extends StatelessWidget {
|
|||
state is LearningDevelopmentErrorState ||
|
||||
state is LearningDevelopmentAddingState ||
|
||||
state is LearningDevelopmentAddedState ||
|
||||
state is LearningDevelopmentUpdatingState) {
|
||||
state is LearningDevelopmentUpdatingState ||
|
||||
state is LearningDevelopmentUpdatedState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.dismiss();
|
||||
}
|
||||
|
@ -123,7 +146,8 @@ class LearningAndDevelopmentScreen extends StatelessWidget {
|
|||
if (state is DeleteLearningDevelopmentState) {
|
||||
if (state.success) {
|
||||
successAlert(context, "Deletion Successfull!",
|
||||
"Learning Development Has Been Deleted Successfully", () {
|
||||
"Learning Development Has Been Deleted Successfully",
|
||||
() {
|
||||
Navigator.of(context).pop();
|
||||
context
|
||||
.read<LearningDevelopmentBloc>()
|
||||
|
@ -143,7 +167,9 @@ class LearningAndDevelopmentScreen extends StatelessWidget {
|
|||
// TODO: implement listener
|
||||
},
|
||||
builder: (context, state) {
|
||||
print(state);
|
||||
if (state is LearningDevelopmentLoadedState) {
|
||||
|
||||
if (state.learningsAndDevelopment.isNotEmpty) {
|
||||
return ListView.builder(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
|
@ -200,9 +226,9 @@ class LearningAndDevelopmentScreen extends StatelessWidget {
|
|||
.copyWith(
|
||||
fontWeight:
|
||||
FontWeight
|
||||
.w600,color: primary),
|
||||
.w600,
|
||||
color: primary),
|
||||
),
|
||||
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
|
@ -309,7 +335,6 @@ class LearningAndDevelopmentScreen extends StatelessWidget {
|
|||
text: "Attach",
|
||||
value: 2,
|
||||
icon: Icons.attach_file),
|
||||
|
||||
],
|
||||
icon: const Icon(
|
||||
Icons.more_vert,
|
||||
|
@ -334,7 +359,12 @@ class LearningAndDevelopmentScreen extends StatelessWidget {
|
|||
}
|
||||
if (state is LearningDevelopmentErrorState) {
|
||||
return (SomethingWentWrong(
|
||||
message: state.message, onpressed: () {context.read<LearningDevelopmentBloc>().add(GetLearningDevelopments(profileId: profileId, token: token));}));
|
||||
message: state.message,
|
||||
onpressed: () {
|
||||
context.read<LearningDevelopmentBloc>().add(
|
||||
GetLearningDevelopments(
|
||||
profileId: profileId, token: token));
|
||||
}));
|
||||
}
|
||||
if (state is LearningDevelopmentAddingState) {
|
||||
return AddLearningAndDevelopmentScreen(
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import 'package:date_time_picker/date_time_picker.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:flutter_progress_hud/flutter_progress_hud.dart';
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import 'package:date_time_picker/date_time_picker.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:flutter_progress_hud/flutter_progress_hud.dart';
|
||||
|
@ -11,6 +10,7 @@ import 'package:searchfield/searchfield.dart';
|
|||
import 'package:unit2/bloc/profile/learningDevelopment/learning_development_bloc.dart';
|
||||
import 'package:unit2/model/profile/learning_development.dart';
|
||||
import 'package:unit2/theme-data.dart/btn-style.dart';
|
||||
import 'package:unit2/utils/global_context.dart';
|
||||
import 'package:unit2/utils/text_container.dart';
|
||||
import 'package:unit2/utils/validators.dart';
|
||||
import '../../../../model/location/barangay.dart';
|
||||
|
@ -379,7 +379,7 @@ class _EditLearningAndDevelopmentScreenState
|
|||
selectableDayPredicate:
|
||||
(date) {
|
||||
if (to != null &&
|
||||
to!.microsecondsSinceEpoch <=
|
||||
to!.microsecondsSinceEpoch <
|
||||
date.microsecondsSinceEpoch) {
|
||||
return false;
|
||||
}
|
||||
|
@ -388,14 +388,10 @@ class _EditLearningAndDevelopmentScreenState
|
|||
onChanged: (value) {
|
||||
setState(() {
|
||||
from =
|
||||
DateTime.parse(value);
|
||||
DateTime.tryParse(value);
|
||||
});
|
||||
},
|
||||
initialDate: to == null
|
||||
? DateTime.now()
|
||||
: to!.subtract(
|
||||
const Duration(
|
||||
days: 1)),
|
||||
initialDate: to??=DateTime.now(),
|
||||
timeHintText:
|
||||
"Date of Examination/Conferment",
|
||||
decoration:
|
||||
|
@ -442,7 +438,7 @@ class _EditLearningAndDevelopmentScreenState
|
|||
),
|
||||
selectableDayPredicate: (date) {
|
||||
if (from != null &&
|
||||
from!.microsecondsSinceEpoch >=
|
||||
from!.microsecondsSinceEpoch >
|
||||
date.microsecondsSinceEpoch) {
|
||||
return false;
|
||||
}
|
||||
|
@ -450,13 +446,10 @@ class _EditLearningAndDevelopmentScreenState
|
|||
},
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
to = DateTime.parse(value);
|
||||
to = DateTime.tryParse(value);
|
||||
});
|
||||
},
|
||||
initialDate: from == null
|
||||
? DateTime.now()
|
||||
: from!.add(const Duration(
|
||||
days: 1)),
|
||||
initialDate: from??=DateTime.now()
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -545,12 +538,21 @@ class _EditLearningAndDevelopmentScreenState
|
|||
selectedRegion =
|
||||
region;
|
||||
//// GET PROVINCES
|
||||
try {
|
||||
provinces = await LocationUtils
|
||||
.instance
|
||||
.getProvinces(
|
||||
regionCode: selectedRegion!
|
||||
.code
|
||||
.toString());
|
||||
} catch (e) {
|
||||
context
|
||||
.read<
|
||||
LearningDevelopmentBloc>()
|
||||
.add(CallErrorState(
|
||||
message:
|
||||
e.toString()));
|
||||
}
|
||||
selectedProvince =
|
||||
provinces![0];
|
||||
setState(() {
|
||||
|
@ -559,11 +561,22 @@ class _EditLearningAndDevelopmentScreenState
|
|||
cityCall = true;
|
||||
});
|
||||
//// GET CITIES
|
||||
try {
|
||||
citymuns = await LocationUtils
|
||||
.instance
|
||||
.getCities(
|
||||
code: selectedProvince!
|
||||
.code!);
|
||||
} catch (e) {
|
||||
NavigationService
|
||||
.navigatorKey
|
||||
.currentContext
|
||||
?.read<
|
||||
LearningDevelopmentBloc>()
|
||||
.add(CallErrorState(
|
||||
message:
|
||||
e.toString()));
|
||||
}
|
||||
selectedMunicipality =
|
||||
citymuns![0];
|
||||
setState(() {
|
||||
|
@ -573,11 +586,22 @@ class _EditLearningAndDevelopmentScreenState
|
|||
true;
|
||||
});
|
||||
//// GET BARANGAY
|
||||
try {
|
||||
barangays = await LocationUtils
|
||||
.instance
|
||||
.getBarangay(
|
||||
code: selectedMunicipality!
|
||||
.code!);
|
||||
} catch (e) {
|
||||
NavigationService
|
||||
.navigatorKey
|
||||
.currentContext
|
||||
?.read<
|
||||
LearningDevelopmentBloc>()
|
||||
.add(CallErrorState(
|
||||
message:
|
||||
e.toString()));
|
||||
}
|
||||
selectedBarangay =
|
||||
barangays![0];
|
||||
setState(() {
|
||||
|
@ -585,11 +609,22 @@ class _EditLearningAndDevelopmentScreenState
|
|||
false;
|
||||
});
|
||||
////GET CITY MUNICIPALITY
|
||||
try {
|
||||
citymuns = await LocationUtils
|
||||
.instance
|
||||
.getCities(
|
||||
code: selectedProvince!
|
||||
.code!);
|
||||
} catch (e) {
|
||||
NavigationService
|
||||
.navigatorKey
|
||||
.currentContext
|
||||
?.read<
|
||||
LearningDevelopmentBloc>()
|
||||
.add(CallErrorState(
|
||||
message:
|
||||
e.toString()));
|
||||
}
|
||||
selectedMunicipality =
|
||||
citymuns![0];
|
||||
setState(() {
|
||||
|
@ -599,11 +634,22 @@ class _EditLearningAndDevelopmentScreenState
|
|||
true;
|
||||
});
|
||||
//// GET BARANGAYS
|
||||
try {
|
||||
barangays = await LocationUtils
|
||||
.instance
|
||||
.getBarangay(
|
||||
code: selectedMunicipality!
|
||||
.code!);
|
||||
} catch (e) {
|
||||
NavigationService
|
||||
.navigatorKey
|
||||
.currentContext
|
||||
?.read<
|
||||
LearningDevelopmentBloc>()
|
||||
.add(CallErrorState(
|
||||
message:
|
||||
e.toString()));
|
||||
}
|
||||
selectedBarangay =
|
||||
barangays![0];
|
||||
setState(() {
|
||||
|
@ -645,13 +691,13 @@ class _EditLearningAndDevelopmentScreenState
|
|||
.transparent,
|
||||
inAsyncCall:
|
||||
provinceCall,
|
||||
child: DropdownButtonFormField<
|
||||
child:
|
||||
DropdownButtonFormField<
|
||||
Province?>(
|
||||
autovalidateMode:
|
||||
AutovalidateMode
|
||||
.onUserInteraction,
|
||||
validator: (value) =>
|
||||
value == null
|
||||
validator: (value) => value == null
|
||||
? 'required'
|
||||
: null,
|
||||
isExpanded:
|
||||
|
@ -672,14 +718,19 @@ class _EditLearningAndDevelopmentScreenState
|
|||
});
|
||||
|
||||
//// GET CITIES
|
||||
try {
|
||||
citymuns = await LocationUtils
|
||||
.instance
|
||||
.getCities(
|
||||
code:
|
||||
selectedProvince!.code!);
|
||||
.getCities(code: selectedProvince!.code!);
|
||||
} catch (e) {
|
||||
NavigationService
|
||||
.navigatorKey
|
||||
.currentContext
|
||||
?.read<LearningDevelopmentBloc>()
|
||||
.add(CallErrorState(message: e.toString()));
|
||||
}
|
||||
selectedMunicipality =
|
||||
citymuns![
|
||||
0];
|
||||
citymuns![0];
|
||||
setState(
|
||||
() {
|
||||
cityCall =
|
||||
|
@ -688,14 +739,19 @@ class _EditLearningAndDevelopmentScreenState
|
|||
true;
|
||||
});
|
||||
//// GET BARANGAY
|
||||
try {
|
||||
barangays = await LocationUtils
|
||||
.instance
|
||||
.getBarangay(
|
||||
code:
|
||||
selectedMunicipality!.code!);
|
||||
.getBarangay(code: selectedMunicipality!.code!);
|
||||
} catch (e) {
|
||||
NavigationService
|
||||
.navigatorKey
|
||||
.currentContext
|
||||
?.read<LearningDevelopmentBloc>()
|
||||
.add(CallErrorState(message: e.toString()));
|
||||
}
|
||||
selectedBarangay =
|
||||
barangays![
|
||||
0];
|
||||
barangays![0];
|
||||
setState(
|
||||
() {
|
||||
barangayCall =
|
||||
|
@ -703,12 +759,11 @@ class _EditLearningAndDevelopmentScreenState
|
|||
});
|
||||
}
|
||||
},
|
||||
items:
|
||||
provinces ==
|
||||
items: provinces ==
|
||||
null
|
||||
? []
|
||||
: provinces!
|
||||
.map<DropdownMenuItem<Province>>((Province province) {
|
||||
: provinces!.map<DropdownMenuItem<Province>>((Province
|
||||
province) {
|
||||
return DropdownMenuItem(
|
||||
enabled: !enabled ? overseas : true,
|
||||
value: province,
|
||||
|
@ -716,7 +771,13 @@ class _EditLearningAndDevelopmentScreenState
|
|||
child: Text(province.description!),
|
||||
));
|
||||
}).toList(),
|
||||
decoration: normalTextFieldStyle("Province*", "Province").copyWith(filled: !enabled ? !overseas : false, fillColor: Colors.grey.shade300)),
|
||||
decoration: normalTextFieldStyle("Province*", "Province").copyWith(
|
||||
filled: !enabled
|
||||
? !overseas
|
||||
: false,
|
||||
fillColor: Colors
|
||||
.grey
|
||||
.shade300)),
|
||||
),
|
||||
),
|
||||
////CITY MUNICIPALITY
|
||||
|
@ -729,7 +790,6 @@ class _EditLearningAndDevelopmentScreenState
|
|||
cityCall,
|
||||
child: DropdownButtonFormField<
|
||||
CityMunicipality>(
|
||||
|
||||
validator: FormBuilderValidators
|
||||
.required(
|
||||
errorText:
|
||||
|
@ -748,11 +808,22 @@ class _EditLearningAndDevelopmentScreenState
|
|||
city;
|
||||
|
||||
//// GET BARANGAYS
|
||||
try {
|
||||
barangays = await LocationUtils
|
||||
.instance
|
||||
.getBarangay(
|
||||
code:
|
||||
selectedMunicipality!.code!);
|
||||
} catch (e) {
|
||||
NavigationService
|
||||
.navigatorKey
|
||||
.currentContext
|
||||
?.read<
|
||||
LearningDevelopmentBloc>()
|
||||
.add(CallErrorState(
|
||||
message:
|
||||
e.toString()));
|
||||
}
|
||||
selectedBarangay =
|
||||
barangays![
|
||||
0];
|
||||
|
|
|
@ -110,7 +110,6 @@ class _AddReferenceScreenState extends State<AddReferenceScreen> {
|
|||
inputFormatters: [
|
||||
UpperCaseTextFormatter()
|
||||
],
|
||||
|
||||
decoration: normalTextFieldStyle(
|
||||
"Middle name ", ""),
|
||||
name: "middlename",
|
||||
|
|
|
@ -4,6 +4,7 @@ import 'package:flutter_form_builder/flutter_form_builder.dart';
|
|||
import 'package:flutter_progress_hud/flutter_progress_hud.dart';
|
||||
import 'package:form_builder_validators/form_builder_validators.dart';
|
||||
import 'package:modal_progress_hud_nsn/modal_progress_hud_nsn.dart';
|
||||
import 'package:unit2/utils/global_context.dart';
|
||||
import '../../../../bloc/profile/references/references_bloc.dart';
|
||||
import '../../../../model/location/address_category.dart';
|
||||
import '../../../../model/location/barangay.dart';
|
||||
|
@ -87,9 +88,7 @@ class _EditReferenceScreenState extends State<EditReferenceScreen> {
|
|||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
inputFormatters: [
|
||||
UpperCaseTextFormatter()
|
||||
],
|
||||
inputFormatters: [UpperCaseTextFormatter()],
|
||||
initialValue: state.ref.lastName,
|
||||
decoration: normalTextFieldStyle(
|
||||
"Last name *", "Last name *"),
|
||||
|
@ -105,10 +104,7 @@ class _EditReferenceScreenState extends State<EditReferenceScreen> {
|
|||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
inputFormatters: [
|
||||
UpperCaseTextFormatter()
|
||||
],
|
||||
|
||||
inputFormatters: [UpperCaseTextFormatter()],
|
||||
initialValue: state.ref.firstName,
|
||||
decoration: normalTextFieldStyle(
|
||||
"First name *", "First name *"),
|
||||
|
@ -127,15 +123,11 @@ class _EditReferenceScreenState extends State<EditReferenceScreen> {
|
|||
Flexible(
|
||||
flex: 1,
|
||||
child: FormBuilderTextField(
|
||||
inputFormatters: [
|
||||
UpperCaseTextFormatter()
|
||||
],
|
||||
|
||||
inputFormatters: [UpperCaseTextFormatter()],
|
||||
initialValue: state.ref.middleName,
|
||||
decoration: normalTextFieldStyle(
|
||||
"Middle name *", "Midlle name *"),
|
||||
name: "middlename",
|
||||
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
|
@ -160,8 +152,8 @@ class _EditReferenceScreenState extends State<EditReferenceScreen> {
|
|||
),
|
||||
FormBuilderDropdown<AddressCategory>(
|
||||
name: 'category',
|
||||
validator:
|
||||
FormBuilderValidators.required(errorText: "This field is required"),
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required"),
|
||||
decoration: normalTextFieldStyle(
|
||||
"Address Category", "Address Category"),
|
||||
items: state.categories
|
||||
|
@ -209,62 +201,95 @@ class _EditReferenceScreenState extends State<EditReferenceScreen> {
|
|||
////REGION DROPDOWN
|
||||
DropdownButtonFormField<Region?>(
|
||||
isExpanded: true,
|
||||
autovalidateMode: AutovalidateMode
|
||||
autovalidateMode:
|
||||
AutovalidateMode
|
||||
.onUserInteraction,
|
||||
validator:
|
||||
FormBuilderValidators.required(
|
||||
validator: FormBuilderValidators
|
||||
.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
onChanged: (Region? region) async {
|
||||
onChanged:
|
||||
(Region? region) async {
|
||||
setState(() {
|
||||
provinceCall = true;
|
||||
|
||||
selectedRegion = region;
|
||||
});
|
||||
//// GET PROVINCES
|
||||
try {
|
||||
provinces = await LocationUtils
|
||||
.instance
|
||||
.getProvinces(
|
||||
regionCode: selectedRegion!
|
||||
regionCode:
|
||||
selectedRegion!
|
||||
.code
|
||||
.toString());
|
||||
selectedProvince = provinces![0];
|
||||
} catch (e) {
|
||||
context
|
||||
.read<ReferencesBloc>()
|
||||
.add(CallErrorState());
|
||||
}
|
||||
selectedProvince =
|
||||
provinces![0];
|
||||
setState(() {
|
||||
provinceCall = false;
|
||||
cityCall = true;
|
||||
});
|
||||
////GET CITY MUNICIPALITY
|
||||
try {
|
||||
citymuns = await LocationUtils
|
||||
.instance
|
||||
.getCities(
|
||||
code: selectedProvince!
|
||||
code:
|
||||
selectedProvince!
|
||||
.code!);
|
||||
selectedMunicipality = citymuns![0];
|
||||
} catch (e) {
|
||||
NavigationService
|
||||
.navigatorKey
|
||||
.currentContext
|
||||
?.read<ReferencesBloc>()
|
||||
.add(CallErrorState());
|
||||
}
|
||||
selectedMunicipality =
|
||||
citymuns![0];
|
||||
setState(() {
|
||||
cityCall = false;
|
||||
barangayCall = true;
|
||||
});
|
||||
//// GET BARANGAYS
|
||||
try {
|
||||
barangays = await LocationUtils
|
||||
.instance
|
||||
.getBarangay(
|
||||
code: selectedMunicipality!
|
||||
code:
|
||||
selectedMunicipality!
|
||||
.code!);
|
||||
selectedBarangay = barangays![0];
|
||||
selectedBarangay =
|
||||
barangays![0];
|
||||
} catch (e) {
|
||||
NavigationService
|
||||
.navigatorKey
|
||||
.currentContext
|
||||
?.read<ReferencesBloc>()
|
||||
.add(CallErrorState());
|
||||
}
|
||||
setState(() {
|
||||
barangayCall = false;
|
||||
});
|
||||
},
|
||||
value: selectedRegion,
|
||||
decoration: normalTextFieldStyle(
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Region*", "Region"),
|
||||
items: state.regions
|
||||
.map<DropdownMenuItem<Region>>(
|
||||
items: state.regions.map<
|
||||
DropdownMenuItem<
|
||||
Region>>(
|
||||
(Region region) {
|
||||
return DropdownMenuItem<Region>(
|
||||
return DropdownMenuItem<
|
||||
Region>(
|
||||
value: region,
|
||||
child:
|
||||
Text(region.description!));
|
||||
child: Text(
|
||||
region.description!));
|
||||
}).toList(),
|
||||
),
|
||||
const SizedBox(
|
||||
|
@ -286,19 +311,30 @@ class _EditReferenceScreenState extends State<EditReferenceScreen> {
|
|||
? 'required'
|
||||
: null,
|
||||
isExpanded: true,
|
||||
onChanged:
|
||||
(Province? province) async {
|
||||
selectedProvince = province;
|
||||
onChanged: (Province?
|
||||
province) async {
|
||||
selectedProvince =
|
||||
province;
|
||||
setState(() {
|
||||
cityCall = true;
|
||||
});
|
||||
//// GET CITIES
|
||||
citymuns = await LocationUtils
|
||||
try {
|
||||
citymuns =
|
||||
await LocationUtils
|
||||
.instance
|
||||
.getCities(
|
||||
code:
|
||||
selectedProvince!
|
||||
code: selectedProvince!
|
||||
.code!);
|
||||
} catch (e) {
|
||||
NavigationService
|
||||
.navigatorKey
|
||||
.currentContext
|
||||
?.read<
|
||||
ReferencesBloc>()
|
||||
.add(
|
||||
CallErrorState());
|
||||
}
|
||||
selectedMunicipality =
|
||||
citymuns![0];
|
||||
setState(() {
|
||||
|
@ -306,12 +342,22 @@ class _EditReferenceScreenState extends State<EditReferenceScreen> {
|
|||
barangayCall = true;
|
||||
});
|
||||
//// GET BARANGAY
|
||||
barangays = await LocationUtils
|
||||
try {
|
||||
barangays =
|
||||
await LocationUtils
|
||||
.instance
|
||||
.getBarangay(
|
||||
code:
|
||||
selectedMunicipality!
|
||||
code: selectedMunicipality!
|
||||
.code!);
|
||||
} catch (e) {
|
||||
NavigationService
|
||||
.navigatorKey
|
||||
.currentContext
|
||||
?.read<
|
||||
ReferencesBloc>()
|
||||
.add(
|
||||
CallErrorState());
|
||||
}
|
||||
selectedBarangay =
|
||||
barangays![0];
|
||||
setState(() {
|
||||
|
@ -324,11 +370,15 @@ class _EditReferenceScreenState extends State<EditReferenceScreen> {
|
|||
: provinces!.map<
|
||||
DropdownMenuItem<
|
||||
Province>>(
|
||||
(Province province) {
|
||||
(Province
|
||||
province) {
|
||||
return DropdownMenuItem(
|
||||
value: province,
|
||||
child: FittedBox(
|
||||
child: Text(province
|
||||
value:
|
||||
province,
|
||||
child:
|
||||
FittedBox(
|
||||
child: Text(
|
||||
province
|
||||
.description!),
|
||||
));
|
||||
}).toList(),
|
||||
|
@ -344,33 +394,47 @@ class _EditReferenceScreenState extends State<EditReferenceScreen> {
|
|||
child: ModalProgressHUD(
|
||||
color: Colors.white,
|
||||
inAsyncCall: cityCall,
|
||||
child: DropdownButtonFormField<
|
||||
child:
|
||||
DropdownButtonFormField<
|
||||
CityMunicipality>(
|
||||
validator: FormBuilderValidators
|
||||
.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
isExpanded: true,
|
||||
onChanged: (CityMunicipality?
|
||||
onChanged:
|
||||
(CityMunicipality?
|
||||
city) async {
|
||||
setState(() {
|
||||
barangayCall = true;
|
||||
});
|
||||
selectedMunicipality = city;
|
||||
selectedMunicipality =
|
||||
city;
|
||||
//// GET BARANGAYS
|
||||
barangays = await LocationUtils
|
||||
try {
|
||||
barangays =
|
||||
await LocationUtils
|
||||
.instance
|
||||
.getBarangay(
|
||||
code:
|
||||
selectedMunicipality!
|
||||
code: selectedMunicipality!
|
||||
.code!);
|
||||
} catch (e) {
|
||||
NavigationService
|
||||
.navigatorKey
|
||||
.currentContext
|
||||
?.read<
|
||||
ReferencesBloc>()
|
||||
.add(
|
||||
CallErrorState());
|
||||
}
|
||||
selectedBarangay =
|
||||
barangays![0];
|
||||
setState(() {
|
||||
barangayCall = false;
|
||||
});
|
||||
},
|
||||
decoration: normalTextFieldStyle(
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Municipality*",
|
||||
"Municipality"),
|
||||
value: selectedMunicipality,
|
||||
|
@ -379,11 +443,12 @@ class _EditReferenceScreenState extends State<EditReferenceScreen> {
|
|||
: citymuns!.map<
|
||||
DropdownMenuItem<
|
||||
CityMunicipality>>(
|
||||
(CityMunicipality c) {
|
||||
(CityMunicipality
|
||||
c) {
|
||||
return DropdownMenuItem(
|
||||
value: c,
|
||||
child: Text(
|
||||
c.description!));
|
||||
child: Text(c
|
||||
.description!));
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
|
@ -394,25 +459,31 @@ class _EditReferenceScreenState extends State<EditReferenceScreen> {
|
|||
child: ModalProgressHUD(
|
||||
color: Colors.white,
|
||||
inAsyncCall: barangayCall,
|
||||
child: DropdownButtonFormField<
|
||||
child:
|
||||
DropdownButtonFormField<
|
||||
Barangay>(
|
||||
validator: FormBuilderValidators
|
||||
.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
isExpanded: true,
|
||||
onChanged: (Barangay? baragay) {
|
||||
selectedBarangay = baragay;
|
||||
onChanged:
|
||||
(Barangay? baragay) {
|
||||
selectedBarangay =
|
||||
baragay;
|
||||
},
|
||||
decoration: normalTextFieldStyle(
|
||||
"Barangay*", "Barangay"),
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Barangay*",
|
||||
"Barangay"),
|
||||
value: selectedBarangay,
|
||||
items: barangays == null
|
||||
? []
|
||||
: barangays!.map<
|
||||
DropdownMenuItem<
|
||||
Barangay>>(
|
||||
(Barangay barangay) {
|
||||
(Barangay
|
||||
barangay) {
|
||||
return DropdownMenuItem(
|
||||
value: barangay,
|
||||
child: Text(barangay
|
||||
|
@ -426,20 +497,26 @@ class _EditReferenceScreenState extends State<EditReferenceScreen> {
|
|||
//// COUNTRY DROPDOWN
|
||||
: SizedBox(
|
||||
height: 60,
|
||||
child: DropdownButtonFormField<Country>(
|
||||
child: DropdownButtonFormField<
|
||||
Country>(
|
||||
isExpanded: true,
|
||||
value: selectedCountry?.id==175?null:selectedCountry,
|
||||
validator:
|
||||
FormBuilderValidators.required(
|
||||
value: selectedCountry?.id == 175
|
||||
? null
|
||||
: selectedCountry,
|
||||
validator: FormBuilderValidators
|
||||
.required(
|
||||
errorText:
|
||||
"This field is required"),
|
||||
items: state.countries
|
||||
.map<DropdownMenuItem<Country>>(
|
||||
items: state.countries.map<
|
||||
DropdownMenuItem<
|
||||
Country>>(
|
||||
(Country country) {
|
||||
return DropdownMenuItem<Country>(
|
||||
return DropdownMenuItem<
|
||||
Country>(
|
||||
value: country,
|
||||
child: FittedBox(
|
||||
child: Text(country.name!)));
|
||||
child: Text(
|
||||
country.name!)));
|
||||
}).toList(),
|
||||
|
||||
decoration: normalTextFieldStyle(
|
||||
|
@ -455,8 +532,6 @@ class _EditReferenceScreenState extends State<EditReferenceScreen> {
|
|||
);
|
||||
}),
|
||||
|
||||
|
||||
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
|
|
|
@ -71,6 +71,7 @@ class ReferencesScreen extends StatelessWidget {
|
|||
return BlocConsumer<ReferencesBloc, ReferencesState>(
|
||||
//listener
|
||||
listener: (context, state) {
|
||||
print(state);
|
||||
if (state is ReferencesLoadingState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Please wait...");
|
||||
|
|
|
@ -578,6 +578,11 @@ class _EditVoluntaryWorkScreenState extends State<EditVoluntaryWorkScreen> {
|
|||
selectedRegion!
|
||||
.code
|
||||
.toString());
|
||||
}catch(e){
|
||||
context
|
||||
.read<VoluntaryWorkBloc>()
|
||||
.add(ShowErrorState(message: e.toString()));
|
||||
}
|
||||
selectedProvince =
|
||||
provinces![0];
|
||||
setState(() {
|
||||
|
@ -606,14 +611,7 @@ class _EditVoluntaryWorkScreenState extends State<EditVoluntaryWorkScreen> {
|
|||
message: e
|
||||
.toString()));
|
||||
}
|
||||
} catch (e) {
|
||||
context
|
||||
.read<
|
||||
VoluntaryWorkBloc>()
|
||||
.add(ShowErrorState(
|
||||
message: e
|
||||
.toString()));
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
value: selectedRegion,
|
||||
|
|
|
@ -268,7 +268,8 @@ class VolunataryWorkScreen extends StatelessWidget {
|
|||
icon: Icons.edit),
|
||||
popMenuItem(
|
||||
text: "Remove",
|
||||
value: 2,)
|
||||
value: 2,
|
||||
icon: Icons.delete)
|
||||
|
||||
|
||||
],
|
||||
|
|
|
@ -36,16 +36,13 @@ class AddMobile extends StatelessWidget {
|
|||
Container(
|
||||
height: screenHeight,
|
||||
padding: isMobile()
|
||||
? const EdgeInsets.symmetric(horizontal: 24)
|
||||
? const EdgeInsets.symmetric(horizontal: 60)
|
||||
: const EdgeInsets.symmetric(horizontal: 60),
|
||||
width: double.infinity,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: isMobile()
|
||||
? screenHeight * .12
|
||||
: screenHeight * .20),
|
||||
const SizedBox(height: 100,),
|
||||
SvgPicture.asset(
|
||||
'assets/svgs/add_mobile.svg',
|
||||
height: isMobile()
|
||||
|
@ -56,13 +53,13 @@ class AddMobile extends StatelessWidget {
|
|||
const SizedBox(
|
||||
height: 24,
|
||||
),
|
||||
Text(addMobile, style: titleTextStyle()),
|
||||
Text(addMobile,textAlign: TextAlign.center, style: titleTextStyle()),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Text(addMobileCaption,
|
||||
textAlign: TextAlign.center,
|
||||
style: Theme.of(context).textTheme.caption),
|
||||
style: Theme.of(context).textTheme.bodySmall),
|
||||
const SizedBox(
|
||||
height: 24,
|
||||
),
|
||||
|
@ -78,9 +75,7 @@ class AddMobile extends StatelessWidget {
|
|||
maxLength: 11,
|
||||
decoration:
|
||||
normalTextFieldStyle(mobile1, "09")),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
|
||||
//// Mobile number 2
|
||||
FormBuilderTextField(
|
||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||
|
@ -89,10 +84,7 @@ class AddMobile extends StatelessWidget {
|
|||
decoration:
|
||||
normalTextFieldStyle(mobile2, "09")),
|
||||
|
||||
SizedBox(
|
||||
height: isMobile()
|
||||
? blockSizeVertical * 3
|
||||
: blockSizeHorizontal * 5),
|
||||
const SizedBox(height: 30,),
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
height: screenHeight * .06,
|
||||
|
|
|
@ -40,7 +40,7 @@ class _RequestSOSState extends State<RequestSOS> {
|
|||
return SingleChildScrollView(
|
||||
child: Container(
|
||||
height: screenHeight * .82,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 10),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 42, vertical: 10),
|
||||
child: FormBuilder(
|
||||
key: formKey,
|
||||
child: Column(
|
||||
|
|
|
@ -47,7 +47,7 @@ class _SosScreenState extends State<SosScreen> {
|
|||
Widget build(BuildContext context) {
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(backgroundColor: primary),
|
||||
appBar: AppBar(title:const Text("SOS"),backgroundColor: primary,centerTitle: true,),
|
||||
resizeToAvoidBottomInset: true,
|
||||
body: ProgressHUD(
|
||||
padding: const EdgeInsets.all(32),
|
||||
|
|
|
@ -42,7 +42,7 @@ class BasicInfo extends StatelessWidget {
|
|||
children: [
|
||||
const CoverImage(),
|
||||
Positioned(
|
||||
top: blockSizeVertical * 17.5,
|
||||
top: blockSizeVertical * 15.5,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
|
@ -115,8 +115,8 @@ class BuildInformation extends StatelessWidget {
|
|||
final String firstName =
|
||||
userData.user!.login!.user!.firstName!.toUpperCase();
|
||||
final String lastname = userData.user!.login!.user!.lastName!.toUpperCase();
|
||||
final String middlename =
|
||||
userData.employeeInfo!.profile!.middleName!.toUpperCase();
|
||||
final String? middlename = userData.employeeInfo == null?'':
|
||||
userData.employeeInfo!.profile?.middleName?.toUpperCase();
|
||||
final String sex = userData.employeeInfo!.profile!.sex!.toUpperCase();
|
||||
final DateTime? bday = userData.employeeInfo!.profile!.birthdate;
|
||||
final uuid = userData.employeeInfo!.uuid;
|
||||
|
@ -129,11 +129,11 @@ class BuildInformation extends StatelessWidget {
|
|||
height: 25,
|
||||
),
|
||||
Text(
|
||||
"$firstName $middlename $lastname",
|
||||
"$firstName ${middlename??''} $lastname",
|
||||
textAlign: TextAlign.center,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.headline5!
|
||||
.headlineSmall!
|
||||
.copyWith(fontWeight: FontWeight.bold),
|
||||
),
|
||||
const SizedBox(
|
||||
|
@ -141,7 +141,7 @@ class BuildInformation extends StatelessWidget {
|
|||
),
|
||||
Text(
|
||||
"${dteFormat2.format(bday!)} | $sex",
|
||||
style: Theme.of(context).textTheme.caption!.copyWith(fontSize: 18),
|
||||
style: Theme.of(context).textTheme.bodySmall!.copyWith(fontSize: 18),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 15,
|
||||
|
@ -162,7 +162,7 @@ class BuildInformation extends StatelessWidget {
|
|||
mainBtnStyle(third, Colors.transparent, Colors.white54),
|
||||
onPressed: () {
|
||||
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context){
|
||||
return SignaturePad();
|
||||
return const SignaturePad();
|
||||
}));
|
||||
},
|
||||
icon: const Icon(
|
||||
|
|
|
@ -1,20 +1,18 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:fluttericon/font_awesome5_icons.dart';
|
||||
import 'package:unit2/screens/docsms/components/request_receipt.dart';
|
||||
import 'package:unit2/screens/docsms/index.dart';
|
||||
import 'package:unit2/screens/unit2/homepage.dart/module-screen.dart';
|
||||
import 'package:unit2/theme-data.dart/colors.dart';
|
||||
import 'package:unit2/utils/global.dart';
|
||||
import 'package:unit2/utils/global_context.dart';
|
||||
import 'package:unit2/utils/qr_scanner.dart';
|
||||
import 'package:unit2/utils/text_container.dart';
|
||||
|
||||
import '../../../../bloc/docsms/docsms_bloc.dart';
|
||||
|
||||
class DashBoard extends StatelessWidget {
|
||||
final List<Module> roles;
|
||||
const DashBoard({super.key, required this.roles});
|
||||
final int userId;
|
||||
const DashBoard({super.key, required this.roles,required this.userId});
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
List<String> finishRoles = [];
|
||||
|
@ -27,6 +25,7 @@ class DashBoard extends StatelessWidget {
|
|||
shrinkWrap: true,
|
||||
itemCount: roles.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
|
||||
//// gridview.count
|
||||
return roles[index].roles.isNotEmpty
|
||||
? SizedBox(
|
||||
|
@ -53,25 +52,21 @@ class DashBoard extends StatelessWidget {
|
|||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 5, horizontal: 5),
|
||||
children: roles[index].roles.map((role) {
|
||||
//// if role name is qr code && finishRoles not contain security
|
||||
//// this card will visible if the user has qr code scanner or security roleπurls
|
||||
if (role.role.name!.toLowerCase() ==
|
||||
'qr code scanner' &&
|
||||
!finishRoles.contains("security")) {
|
||||
print("1 true");
|
||||
finishRoles.add('scanner');
|
||||
//// loop thru module to find unit module exist
|
||||
for (var element in role.role.modules!) {
|
||||
if (element!.name!.toLowerCase() == 'unit2') {
|
||||
for (var element in element.objects!) {
|
||||
//// loop thru objects to find pass check exist
|
||||
if (element!.id == 9 &&
|
||||
//// check if operations contains read and write
|
||||
element.operations!
|
||||
.contains("read")) {
|
||||
//// if all conditions are true return card
|
||||
return CardLabel(
|
||||
ontap: () {
|
||||
Navigator.pushNamed(context, '/pass-check');
|
||||
PassCheckArguments passCheckArguments = PassCheckArguments(roleId: role.role.id!, userId: userId);
|
||||
Navigator.pushNamed(context, '/pass-check',arguments: passCheckArguments);
|
||||
},
|
||||
icon: role.icon,
|
||||
title: "Pass Check",
|
||||
|
@ -81,11 +76,10 @@ class DashBoard extends StatelessWidget {
|
|||
}
|
||||
}
|
||||
return Container();
|
||||
//// if role name is security
|
||||
//// this card will visible if the user has qr code scanner or security role
|
||||
} else if (role.role.name!.toLowerCase() ==
|
||||
'security guard' &&
|
||||
!finishRoles.contains('scanner')) {
|
||||
print("2 true");
|
||||
finishRoles.add('security');
|
||||
for (var element in role.role.modules!) {
|
||||
if (element!.name!.toLowerCase() == 'unit2') {
|
||||
|
@ -102,10 +96,10 @@ class DashBoard extends StatelessWidget {
|
|||
}
|
||||
}
|
||||
}
|
||||
return Container();
|
||||
//// if role name is field surveyor
|
||||
return Container(color: Colors.red,);
|
||||
} else if (role.role.name!.toLowerCase() ==
|
||||
'field surveyor') {
|
||||
print("3 true");
|
||||
for (var element in role.role.modules!) {
|
||||
if (element!.name!.toLowerCase() == 'rpass') {
|
||||
for (var element in element.objects!) {
|
||||
|
@ -122,9 +116,9 @@ class DashBoard extends StatelessWidget {
|
|||
}
|
||||
}
|
||||
return Container();
|
||||
//// if role name is process server
|
||||
} else if (role.role.name!.toLowerCase() ==
|
||||
'process server') {
|
||||
print("4 true");
|
||||
for (var element in role.role.modules!) {
|
||||
if (element!.name!.toLowerCase() ==
|
||||
'document management') {
|
||||
|
@ -158,15 +152,16 @@ class DashBoard extends StatelessWidget {
|
|||
}
|
||||
return Container();
|
||||
} else if (role.role.name!.toLowerCase() ==
|
||||
'establishment point person' &&
|
||||
'establishment point-person' &&
|
||||
!finishRoles.contains('superadmin')) {
|
||||
finishRoles.add('establishment point person');
|
||||
finishRoles.add('establishment point-person');
|
||||
for (var element in role.role.modules!) {
|
||||
print("5 true");
|
||||
if (element!.name!.toLowerCase() == 'unit2') {
|
||||
for (var element in element.objects!) {
|
||||
if (element!.id == 9 &&
|
||||
if (element!.id == 7 &&
|
||||
element.operations!
|
||||
.contains("read")) {
|
||||
.contains("upload")) {
|
||||
return CardLabel(
|
||||
ontap: () {},
|
||||
icon: FontAwesome5.building,
|
||||
|
@ -177,13 +172,33 @@ class DashBoard extends StatelessWidget {
|
|||
}
|
||||
}
|
||||
return Container();
|
||||
//// if role name is field surveyor
|
||||
|
||||
} else if (role.role.name!.toLowerCase() ==
|
||||
'establishment point-person' &&
|
||||
!finishRoles.contains('superadmin')) {
|
||||
finishRoles.add('establishment point-person');
|
||||
for (var element in role.role.modules!) {
|
||||
if (element!.name!.toLowerCase() == 'unit2') {
|
||||
for (var element in element.objects!) {
|
||||
if (element!.id == 7 &&
|
||||
element.operations!
|
||||
.contains("upload")) {
|
||||
return CardLabel(
|
||||
ontap: () {},
|
||||
icon: FontAwesome5.building,
|
||||
title: "Establishment",
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
else {
|
||||
return Container();
|
||||
|
||||
} else{
|
||||
return Wrap();
|
||||
}
|
||||
|
||||
|
||||
}).toList()),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
|
@ -197,6 +212,12 @@ class DashBoard extends StatelessWidget {
|
|||
}
|
||||
}
|
||||
|
||||
class PassCheckArguments{
|
||||
final int roleId;
|
||||
final int userId;
|
||||
const PassCheckArguments({required this.roleId, required this.userId});
|
||||
}
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class CardLabel extends StatelessWidget {
|
||||
final String title;
|
||||
|
|
|
@ -27,8 +27,7 @@ class _MenuScreenState extends State<MenuScreen> {
|
|||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Flexible(
|
||||
child: ListView(
|
||||
Column(
|
||||
// ignore: prefer_const_literals_to_create_immutables
|
||||
children: <Widget>[
|
||||
UserAccountsDrawerHeader(
|
||||
|
@ -64,13 +63,14 @@ class _MenuScreenState extends State<MenuScreen> {
|
|||
|
||||
],
|
||||
),
|
||||
),
|
||||
const Expanded(child: SizedBox()),
|
||||
const Divider(),
|
||||
Align(
|
||||
alignment: FractionalOffset.bottomLeft,
|
||||
child: getTile(WebSymbols.logout, "Logout", '/', context,
|
||||
widget.userData!),
|
||||
),
|
||||
const SizedBox(height: 10,),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:unit2/model/login_data/employee_info/employee_info.dart';
|
||||
import 'package:unit2/model/login_data/user_info/user_data.dart';
|
||||
import 'package:unit2/utils/alerts.dart';
|
||||
import '../../../../model/profile/basic_information/primary-information.dart';
|
||||
import 'package:unit2/utils/global_context.dart';
|
||||
import '../../../../theme-data.dart/colors.dart';
|
||||
import '../../../../utils/global.dart';
|
||||
|
||||
|
@ -23,7 +22,7 @@ Widget getTile(
|
|||
confirmAlert(context, () async{
|
||||
await CREDENTIALS!.clear();
|
||||
await CREDENTIALS!.deleteAll(['username','password','saved']);
|
||||
Navigator.pushReplacementNamed (context,"/");
|
||||
Navigator.pushReplacementNamed (NavigationService.navigatorKey.currentContext!,"/");
|
||||
},"Logout","Are You sure you want to logout?");
|
||||
}if(title.toLowerCase() == 'profile'){
|
||||
ProfileArguments profileArguments = ProfileArguments(token: userData.user!.login!.token!, userID:userData.user!.login!.user!.profileId!);
|
||||
|
|
|
@ -25,6 +25,7 @@ class _MainScreenState extends State<MainScreen> {
|
|||
Module(name: 'DocSms module operations', roles: []),
|
||||
Module(name: "RPAss module operations",roles:[] )
|
||||
];
|
||||
int? userId;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return WillPopScope(
|
||||
|
@ -33,6 +34,7 @@ class _MainScreenState extends State<MainScreen> {
|
|||
},
|
||||
child: BlocBuilder<UserBloc, UserState>(builder: (context, state) {
|
||||
if (state is UserLoggedIn) {
|
||||
userId = state.userData!.user!.login!.user!.id;
|
||||
for (var element in roles) {
|
||||
element.roles.clear();
|
||||
}
|
||||
|
@ -78,6 +80,7 @@ class _MainScreenState extends State<MainScreen> {
|
|||
),
|
||||
body: state.userData!.user!.login!.user!.roles!.isNotEmpty
|
||||
? DashBoard(
|
||||
userId: userId!,
|
||||
roles: roles,
|
||||
)
|
||||
: const NoModule(),
|
||||
|
|
|
@ -273,7 +273,7 @@ class _UniT2LoginState extends State<UniT2Login> {
|
|||
SizedBox(
|
||||
height: blockSizeVertical * 1.5,
|
||||
),
|
||||
|
||||
//// Login via Scan QR
|
||||
SizedBox(
|
||||
height: blockSizeVertical * 7,
|
||||
child: SizedBox(
|
||||
|
@ -367,6 +367,16 @@ class _UniT2LoginState extends State<UniT2Login> {
|
|||
if (state is SplashScreen) {
|
||||
return const UniTSplashScreen();
|
||||
}
|
||||
if(state is LoginErrorState){
|
||||
return SomethingWentWrong(message: state.message, onpressed: () {
|
||||
BlocProvider.of<UserBloc>(
|
||||
NavigationService.navigatorKey.currentContext!)
|
||||
.add(GetApkVersion());
|
||||
return MaterialPageRoute(builder: (_) {
|
||||
return const UniT2Login();
|
||||
});
|
||||
},);
|
||||
}
|
||||
return Container();
|
||||
}),
|
||||
),
|
||||
|
|
|
@ -15,8 +15,10 @@ import '../../../theme-data.dart/colors.dart';
|
|||
import '../../../theme-data.dart/form-style.dart';
|
||||
import '../../../utils/alerts.dart';
|
||||
import '../../../utils/global.dart';
|
||||
import '../../../utils/internet_time_out.dart';
|
||||
import '../../../utils/text_container.dart';
|
||||
import '../../../utils/validators.dart';
|
||||
import '../../../widgets/error_state.dart';
|
||||
|
||||
class QRLogin extends StatefulWidget {
|
||||
const QRLogin({super.key});
|
||||
|
@ -96,7 +98,7 @@ class _QRLoginState extends State<QRLogin> {
|
|||
bottom: 0,
|
||||
child: WaveReverse(height: blockSizeVertical * 8)),
|
||||
Container(
|
||||
height: screenHeight * .90,
|
||||
height: screenHeight * .87,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 32),
|
||||
child: FormBuilder(
|
||||
key: _formKey,
|
||||
|
@ -221,6 +223,22 @@ class _QRLoginState extends State<QRLogin> {
|
|||
],
|
||||
),
|
||||
);
|
||||
} if (state is InternetTimeout) {
|
||||
return SomethingWentWrong(message: state.message, onpressed: () {
|
||||
context
|
||||
.read<UserBloc>()
|
||||
.add(LoadUuid());
|
||||
Navigator.of(context).pop();
|
||||
},);
|
||||
}
|
||||
|
||||
if(state is LoginErrorState){
|
||||
return SomethingWentWrong(message: state.message, onpressed: () {
|
||||
context
|
||||
.read<UserBloc>()
|
||||
.add(LoadUuid());
|
||||
Navigator.of(context).pop();
|
||||
},);
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
|
|
|
@ -1,23 +1,196 @@
|
|||
import 'package:assets_audio_player/assets_audio_player.dart';
|
||||
import 'package:audioplayers/audioplayers.dart';
|
||||
import 'package:cool_alert/cool_alert.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:flutter_progress_hud/flutter_progress_hud.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:fluttericon/entypo_icons.dart';
|
||||
import 'package:form_builder_validators/form_builder_validators.dart';
|
||||
import 'package:unit2/bloc/role/pass_check/pass_check_bloc.dart';
|
||||
import 'package:unit2/theme-data.dart/btn-style.dart';
|
||||
import 'package:unit2/theme-data.dart/form-style.dart';
|
||||
import 'package:unit2/utils/text_container.dart';
|
||||
|
||||
import 'package:unit2/utils/validators.dart';
|
||||
import 'package:unit2/widgets/error_state.dart';
|
||||
import '../../../../theme-data.dart/colors.dart';
|
||||
import '../../../../utils/global.dart';
|
||||
import 'components/save_settings.dart';
|
||||
|
||||
class QRCodeScanner extends StatelessWidget {
|
||||
class QRCodeScanner extends StatefulWidget {
|
||||
const QRCodeScanner({super.key});
|
||||
|
||||
@override
|
||||
State<QRCodeScanner> createState() => _QRCodeScannerState();
|
||||
}
|
||||
|
||||
final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
|
||||
final formKey = GlobalKey<FormBuilderState>();
|
||||
AudioPlayer? player;
|
||||
|
||||
class _QRCodeScannerState extends State<QRCodeScanner> {
|
||||
@override
|
||||
void initState() {
|
||||
player = AudioPlayer();
|
||||
super.initState();
|
||||
}
|
||||
@override
|
||||
void dispose() {
|
||||
player?.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
key: scaffoldKey,
|
||||
appBar: AppBar(
|
||||
title: const Text(qrScannerTitle),
|
||||
centerTitle: true,
|
||||
backgroundColor: primary,
|
||||
),
|
||||
body: SizedBox(
|
||||
body: ProgressHUD(
|
||||
padding: const EdgeInsets.all(24),
|
||||
indicatorWidget: const SpinKitFadingCircle(
|
||||
color: Colors.white,
|
||||
),
|
||||
backgroundColor: Colors.black87,
|
||||
child: BlocConsumer<PassCheckBloc, PassCheckState>(
|
||||
listener: (context, state) {
|
||||
if (state is PassCheckLoadingState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Please wait...");
|
||||
}
|
||||
if (state is SettingSaved ||
|
||||
state is IncomingScanState ||
|
||||
state is OutGoingScanState ||
|
||||
state is ScanSuccess ||
|
||||
state is ScanFailed ||
|
||||
state is PassCheckErrorState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.dismiss();
|
||||
}
|
||||
if (state is ScanSuccess) {
|
||||
Future.delayed(const Duration(seconds: 1), () async{
|
||||
await player?.play(AssetSource("success.mp3"));
|
||||
});
|
||||
context.read<PassCheckBloc>().add(ScanQr(token: state.token));
|
||||
}
|
||||
if (state is QRInvalid) {
|
||||
Future.delayed(const Duration(seconds: 1), ()async {
|
||||
await player?.play(AssetSource("invalid.mp3"));
|
||||
});
|
||||
context.read<PassCheckBloc>().add(ScanQr(token: state.token));
|
||||
}
|
||||
if (state is ScanFailed) {
|
||||
Future.delayed(const Duration(seconds: 1), ()async {
|
||||
await player?.play(AssetSource("fail.mp3"));
|
||||
});
|
||||
|
||||
context.read<PassCheckBloc>().add(ScanQr(token: state.token));
|
||||
}
|
||||
if (state is IncomingScanState) {
|
||||
CoolAlert.show(
|
||||
barrierDismissible: false,
|
||||
context: context,
|
||||
type: CoolAlertType.loading,
|
||||
text: "Enter Temperature",
|
||||
widget: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24),
|
||||
child: FormBuilder(
|
||||
key: formKey,
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(
|
||||
height: 24,
|
||||
),
|
||||
FormBuilderTextField(
|
||||
keyboardType: TextInputType.number,
|
||||
name: "temp",
|
||||
decoration:
|
||||
normalTextFieldStyle("Temperature", ""),
|
||||
validator: numericRequired),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
SizedBox(
|
||||
height: 50,
|
||||
width: double.infinity,
|
||||
child: ElevatedButton(
|
||||
style: mainBtnStyle(
|
||||
primary, Colors.transparent, second),
|
||||
child: const Text(submit),
|
||||
onPressed: () {
|
||||
if (formKey.currentState!.saveAndValidate()) {
|
||||
double temperature = double.parse(
|
||||
formKey.currentState!.value['temp']);
|
||||
context.read<PassCheckBloc>().add(
|
||||
PerformIncomingPostLog(
|
||||
temp: temperature));
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
)),
|
||||
));
|
||||
}
|
||||
if (state is OutGoingScanState) {
|
||||
CoolAlert.show(
|
||||
barrierDismissible: false,
|
||||
context: context,
|
||||
type: CoolAlertType.loading,
|
||||
text: "Enter Destination",
|
||||
widget: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24),
|
||||
child: FormBuilder(
|
||||
key: formKey,
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(
|
||||
height: 24,
|
||||
),
|
||||
FormBuilderTextField(
|
||||
textCapitalization:
|
||||
TextCapitalization.sentences,
|
||||
name: "destination",
|
||||
decoration:
|
||||
normalTextFieldStyle("Destination", ""),
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: "This field is required")),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
SizedBox(
|
||||
height: 50,
|
||||
width: double.infinity,
|
||||
child: ElevatedButton(
|
||||
style: mainBtnStyle(
|
||||
primary, Colors.transparent, second),
|
||||
child: const Text(submit),
|
||||
onPressed: () {
|
||||
if (formKey.currentState!.saveAndValidate()) {
|
||||
String destination = formKey
|
||||
.currentState!.value['destination'];
|
||||
context.read<PassCheckBloc>().add(
|
||||
PerformOutgoingPostLog(
|
||||
destination: destination));
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
)),
|
||||
));
|
||||
}
|
||||
},
|
||||
builder: (context, state) {
|
||||
if (state is SettingSaved) {
|
||||
return SizedBox(
|
||||
height: screenHeight * 100,
|
||||
width: double.infinity,
|
||||
child: Column(
|
||||
|
@ -33,7 +206,13 @@ class QRCodeScanner extends StatelessWidget {
|
|||
children: [
|
||||
SizedBox(
|
||||
height: 160,
|
||||
child: Image.asset('assets/pngs/qr-scan.png')),
|
||||
child: GestureDetector(
|
||||
child: Image.asset('assets/pngs/qr-scan.png'),
|
||||
onTap: () {
|
||||
context
|
||||
.read<PassCheckBloc>()
|
||||
.add(ScanQr(token: state.token));
|
||||
})),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
|
@ -52,7 +231,7 @@ class QRCodeScanner extends StatelessWidget {
|
|||
height: 8,
|
||||
),
|
||||
//TODO add API data
|
||||
"INCOMING" == "INCOMING"
|
||||
state.io == "INCOMING"
|
||||
? SizedBox(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
|
@ -80,8 +259,7 @@ class QRCodeScanner extends StatelessWidget {
|
|||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
//TODO add API data
|
||||
"INCOMING",
|
||||
"OUTGOING",
|
||||
textAlign: TextAlign.center,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
|
@ -116,33 +294,67 @@ class QRCodeScanner extends StatelessWidget {
|
|||
topLeft: Radius.circular(15),
|
||||
topRight: Radius.circular(15))),
|
||||
width: double.infinity,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: const [
|
||||
children: [
|
||||
SelectedState(
|
||||
//TODO add api data
|
||||
title: state.roleId == 41 ||
|
||||
state.roleId == 13 ||
|
||||
state.roleId == 17 ||
|
||||
state.roleId == 22
|
||||
? state.assignedArea.stationName
|
||||
: state.roleId == 7
|
||||
? state.assignedArea.brgydesc
|
||||
: state.roleId == 10
|
||||
? state.assignedArea.purokdesc
|
||||
: state.roleId == 16
|
||||
? "Agency"
|
||||
: "",
|
||||
subtitle: state.roleId == 41 ||
|
||||
state.roleId == 13 ||
|
||||
state.roleId == 17 ||
|
||||
state.roleId == 22
|
||||
? "Station"
|
||||
: state.roleId == 7
|
||||
? "Barangay"
|
||||
: state.roleId == 10
|
||||
? "Purok"
|
||||
: state.roleId == 16
|
||||
? "Agency"
|
||||
: "",
|
||||
),
|
||||
SelectedState(
|
||||
//TODO add api data
|
||||
|
||||
title: "Provincial Government of ADN",
|
||||
subtitle: establishment,
|
||||
title: state.otherInputs ? "YES" : "NO",
|
||||
subtitle: "Include other inputs",
|
||||
),
|
||||
Center(
|
||||
child: SelectedState(
|
||||
//TODO add api data
|
||||
title: "Agusan Up",
|
||||
subtitle: checkpointArea,
|
||||
),
|
||||
),
|
||||
SelectedState(
|
||||
//TODO add api data
|
||||
title: "INCOMING",
|
||||
subtitle: scanMode,
|
||||
const SizedBox(
|
||||
height: 54,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
));
|
||||
);
|
||||
}
|
||||
if (state is PassCheckErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: state.message,
|
||||
onpressed: () {
|
||||
context.read<PassCheckBloc>().add(ScanError());
|
||||
});
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,19 +1,28 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:flutter_progress_hud/flutter_progress_hud.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:fluttericon/entypo_icons.dart';
|
||||
import 'package:fluttericon/modern_pictograms_icons.dart';
|
||||
import 'package:form_builder_validators/form_builder_validators.dart';
|
||||
import 'package:unit2/bloc/role/pass_check/pass_check_bloc.dart';
|
||||
import 'package:unit2/bloc/user/user_bloc.dart';
|
||||
import 'package:unit2/screens/unit2/homepage.dart/components/dashboard.dart';
|
||||
import 'package:unit2/screens/unit2/roles/qr_code_scanner.dart/components/custom_switch.dart';
|
||||
import 'package:unit2/test_data.dart';
|
||||
import 'package:unit2/screens/unit2/roles/qr_code_scanner.dart/scan.dart';
|
||||
import 'package:unit2/utils/text_container.dart';
|
||||
import 'package:unit2/widgets/error_state.dart';
|
||||
import '../../../../theme-data.dart/btn-style.dart';
|
||||
import '../../../../theme-data.dart/colors.dart';
|
||||
import '../../../../theme-data.dart/form-style.dart';
|
||||
import '../../../../utils/global.dart';
|
||||
|
||||
class QRCodeScannerSettings extends StatefulWidget {
|
||||
const QRCodeScannerSettings({super.key});
|
||||
final int roleId;
|
||||
final int userId;
|
||||
const QRCodeScannerSettings({super.key, required this.roleId, required this.userId});
|
||||
|
||||
@override
|
||||
State<QRCodeScannerSettings> createState() => _QRCodeScannerSettingsState();
|
||||
|
@ -25,6 +34,9 @@ class _QRCodeScannerSettingsState extends State<QRCodeScannerSettings> {
|
|||
String selectedLevel = '';
|
||||
String selectedEstablishment = '';
|
||||
String selectedArea = '';
|
||||
dynamic assignedArea;
|
||||
int? checkerId;
|
||||
String? token;
|
||||
final _formKey = GlobalKey<FormBuilderState>();
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -35,16 +47,44 @@ class _QRCodeScannerSettingsState extends State<QRCodeScannerSettings> {
|
|||
centerTitle: true,
|
||||
backgroundColor: primary,
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
child: Container(
|
||||
height: screenHeight * .84,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 30,vertical: 10),
|
||||
body: ProgressHUD(
|
||||
padding: const EdgeInsets.all(24),
|
||||
indicatorWidget: const SpinKitFadingCircle(
|
||||
color: Colors.white,
|
||||
),
|
||||
backgroundColor: Colors.black87,
|
||||
child: BlocBuilder<UserBloc, UserState>(
|
||||
builder: (context, state) {
|
||||
if (state is UserLoggedIn) {
|
||||
token = state.userData!.user!.login!.token;
|
||||
checkerId = state.userData!.user!.login!.user!.id;
|
||||
return BlocConsumer<PassCheckBloc, PassCheckState>(
|
||||
listener: (context, state) {
|
||||
if (state is PassCheckLoadingState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.showWithText("Please wait...");
|
||||
}
|
||||
if (state is AssignAreaLoaded ||
|
||||
state is PassCheckErrorState) {
|
||||
final progress = ProgressHUD.of(context);
|
||||
progress!.dismiss();
|
||||
}
|
||||
},
|
||||
builder: (context, state) {
|
||||
if (state is AssignAreaLoaded) {
|
||||
return Container(
|
||||
height: screenHeight * .90,
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 42, vertical: 10),
|
||||
child: FormBuilder(
|
||||
key: _formKey,
|
||||
child: Column(
|
||||
children: [
|
||||
Flexible(
|
||||
child: ListView(
|
||||
children: [
|
||||
const SizedBox(
|
||||
height:24,
|
||||
height: 32,
|
||||
),
|
||||
SvgPicture.asset(
|
||||
'assets/svgs/switch.svg',
|
||||
|
@ -62,10 +102,14 @@ class _QRCodeScannerSettingsState extends State<QRCodeScannerSettings> {
|
|||
),
|
||||
),
|
||||
Text(includeOtherInputs,
|
||||
style: Theme.of(context).textTheme.titleMedium),
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.titleMedium),
|
||||
Text(
|
||||
includeOtherInputsSubTitle,
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodySmall,
|
||||
),
|
||||
SizedBox(
|
||||
child: FittedBox(
|
||||
|
@ -74,8 +118,12 @@ class _QRCodeScannerSettingsState extends State<QRCodeScannerSettings> {
|
|||
Colors.green[800]!,
|
||||
Colors.red[800]!
|
||||
],
|
||||
initialLabelIndex: _includeOtherInputs ? 0 : 1,
|
||||
icons: const [Entypo.check, ModernPictograms.cancel],
|
||||
initialLabelIndex:
|
||||
_includeOtherInputs ? 0 : 1,
|
||||
icons: const [
|
||||
Entypo.check,
|
||||
ModernPictograms.cancel
|
||||
],
|
||||
labels: const ['YES', 'NO'],
|
||||
onToggle: (value) {
|
||||
value == 0
|
||||
|
@ -87,20 +135,31 @@ class _QRCodeScannerSettingsState extends State<QRCodeScannerSettings> {
|
|||
),
|
||||
// Incoming or outgoing
|
||||
Text(incomingORoutgoing,
|
||||
style: Theme.of(context).textTheme.titleMedium),
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.titleMedium),
|
||||
Text(
|
||||
incomingORoutgoingSubTitle,
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodySmall,
|
||||
),
|
||||
FittedBox(
|
||||
child: CostumToggleSwitch(
|
||||
activeBGColors: [ Colors.red[800]!,Colors.green[800]!],
|
||||
initialLabelIndex: scanMode == 'INCOMING' ? 0 : 1,
|
||||
activeBGColors: [
|
||||
Colors.red[800]!,
|
||||
Colors.green[800]!
|
||||
],
|
||||
initialLabelIndex:
|
||||
scanMode == 'INCOMING' ? 0 : 1,
|
||||
icons: const [
|
||||
Entypo.down_bold,
|
||||
Entypo.up_bold,
|
||||
],
|
||||
labels: const ['INCOMING', 'OUTGOING'],
|
||||
labels: const [
|
||||
'INCOMING',
|
||||
'OUTGOING'
|
||||
],
|
||||
onToggle: (value) {
|
||||
value == 0
|
||||
? scanMode = 'INCOMING'
|
||||
|
@ -109,97 +168,463 @@ class _QRCodeScannerSettingsState extends State<QRCodeScannerSettings> {
|
|||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
height: 24,
|
||||
),
|
||||
|
||||
//SELECT LEVEL
|
||||
|
||||
FormBuilderDropdown<String?>(
|
||||
name: 'level',
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: fieldIsRequired),
|
||||
decoration: normalTextFieldStyle(selectLevel, "level"),
|
||||
items: levels
|
||||
.map((level) => DropdownMenuItem(
|
||||
value: level,
|
||||
child: Text(level),
|
||||
))
|
||||
.toList(),
|
||||
////STATION
|
||||
Container(
|
||||
child: state.roleId == 41
|
||||
? DropdownButtonFormField(
|
||||
isExpanded: true,
|
||||
validator: FormBuilderValidators
|
||||
.required(
|
||||
errorText:
|
||||
fieldIsRequired),
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"station", "station"),
|
||||
items: state.assignedArea
|
||||
.map((station) {
|
||||
if (station.motherStation) {
|
||||
return DropdownMenuItem<
|
||||
dynamic>(
|
||||
enabled: false,
|
||||
value: station,
|
||||
child: Text(
|
||||
station.stationName
|
||||
.toUpperCase(),
|
||||
style:
|
||||
const TextStyle(
|
||||
color: Colors
|
||||
.grey),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return DropdownMenuItem<
|
||||
dynamic>(
|
||||
value: station,
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets
|
||||
.only(
|
||||
left: 10),
|
||||
child: Text(station
|
||||
.stationName),
|
||||
),
|
||||
);
|
||||
}
|
||||
}).toList(),
|
||||
// value: selectedLevel,
|
||||
onChanged: (value) async {
|
||||
selectedLevel = value!;
|
||||
assignedArea = value;
|
||||
},
|
||||
////BARANGAY
|
||||
)
|
||||
: state.roleId == 7
|
||||
? Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment
|
||||
.start,
|
||||
children: [
|
||||
Text(
|
||||
"Select Barangay",
|
||||
textAlign:
|
||||
TextAlign.start,
|
||||
style:
|
||||
Theme.of(context)
|
||||
.textTheme
|
||||
.titleMedium,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
DropdownButtonFormField(
|
||||
isExpanded: true,
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Barangay",
|
||||
"Barangay"),
|
||||
items: state
|
||||
.assignedArea
|
||||
.map((barangay) {
|
||||
return DropdownMenuItem<
|
||||
dynamic>(
|
||||
value: barangay,
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets
|
||||
.only(
|
||||
left:
|
||||
5),
|
||||
child: Text(
|
||||
barangay
|
||||
.brgydesc),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
onChanged: (value) {
|
||||
assignedArea =
|
||||
value;
|
||||
},
|
||||
),
|
||||
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
],
|
||||
)
|
||||
:
|
||||
////PUROK
|
||||
state.roleId == 10
|
||||
? Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment
|
||||
.start,
|
||||
children: [
|
||||
Text(
|
||||
"Select Purok",
|
||||
textAlign:
|
||||
TextAlign
|
||||
.start,
|
||||
style: Theme.of(
|
||||
context)
|
||||
.textTheme
|
||||
.titleMedium,
|
||||
),
|
||||
|
||||
FormBuilderDropdown<String?>(
|
||||
name: 'establishment',
|
||||
decoration: normalTextFieldStyle(
|
||||
selectedEstablishment, "establishments"),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
DropdownButtonFormField(
|
||||
isExpanded: true,
|
||||
validator: FormBuilderValidators.required(
|
||||
decoration:
|
||||
normalTextFieldStyle(
|
||||
"Purok",
|
||||
"Purok"),
|
||||
items: state
|
||||
.assignedArea
|
||||
.map((purok) {
|
||||
return DropdownMenuItem<
|
||||
dynamic>(
|
||||
value: purok,
|
||||
child:
|
||||
Padding(
|
||||
padding: const EdgeInsets
|
||||
.only(
|
||||
left:
|
||||
5),
|
||||
child: Text(
|
||||
purok
|
||||
.purokdesc),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
onChanged:
|
||||
(value) {
|
||||
assignedArea =
|
||||
value;
|
||||
},
|
||||
),
|
||||
],
|
||||
)
|
||||
:
|
||||
////Registration InCharge
|
||||
state.roleId == 22
|
||||
? Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment
|
||||
.start,
|
||||
children: [
|
||||
Text(
|
||||
"Select Station",
|
||||
textAlign:
|
||||
TextAlign
|
||||
.start,
|
||||
style: Theme.of(
|
||||
context)
|
||||
.textTheme
|
||||
.titleMedium,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
DropdownButtonFormField(
|
||||
isExpanded:
|
||||
true,
|
||||
validator: FormBuilderValidators
|
||||
.required(
|
||||
errorText:
|
||||
fieldIsRequired),
|
||||
decoration: normalTextFieldStyle(
|
||||
"station",
|
||||
"station"),
|
||||
items: state
|
||||
.assignedArea
|
||||
.map(
|
||||
(station) {
|
||||
if (station
|
||||
.motherStation) {
|
||||
return DropdownMenuItem<
|
||||
dynamic>(
|
||||
enabled:
|
||||
false,
|
||||
value:
|
||||
station,
|
||||
child:
|
||||
Text(
|
||||
station
|
||||
.stationName
|
||||
.toUpperCase(),
|
||||
style:
|
||||
const TextStyle(color: Colors.grey),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return DropdownMenuItem<
|
||||
dynamic>(
|
||||
value:
|
||||
station,
|
||||
child:
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsets.only(left: 5),
|
||||
child:
|
||||
Text(station.stationName),
|
||||
),
|
||||
);
|
||||
}
|
||||
}).toList(),
|
||||
// value: selectedLevel,
|
||||
onChanged:
|
||||
(value) async {
|
||||
assignedArea =
|
||||
value;
|
||||
},
|
||||
),
|
||||
],
|
||||
)
|
||||
: ////QR Code Scanner
|
||||
state.roleId == 13
|
||||
? Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment
|
||||
.start,
|
||||
children: [
|
||||
Text(
|
||||
"Select Station",
|
||||
textAlign:
|
||||
TextAlign
|
||||
.start,
|
||||
style: Theme.of(
|
||||
context)
|
||||
.textTheme
|
||||
.titleMedium,
|
||||
),
|
||||
const SizedBox(
|
||||
height:
|
||||
12,
|
||||
),
|
||||
DropdownButtonFormField(
|
||||
isExpanded:
|
||||
true,
|
||||
validator:
|
||||
FormBuilderValidators.required(
|
||||
errorText: fieldIsRequired),
|
||||
items: establishments
|
||||
.map((est) => DropdownMenuItem(
|
||||
value: est,
|
||||
child: Text(est),
|
||||
))
|
||||
.toList(),
|
||||
// value: selectedArea,
|
||||
onChanged: (value) async {
|
||||
selectedArea = value!;
|
||||
}),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
DropdownButtonFormField<String?>(
|
||||
decoration: normalTextFieldStyle(
|
||||
selectEstablishment, "establishments"),
|
||||
"station",
|
||||
"station"),
|
||||
items: state
|
||||
.assignedArea
|
||||
.map(
|
||||
(station) {
|
||||
if (station
|
||||
.motherStation) {
|
||||
return DropdownMenuItem<
|
||||
dynamic>(
|
||||
enabled:
|
||||
false,
|
||||
value:
|
||||
station,
|
||||
child:
|
||||
Text(
|
||||
station.stationName.toUpperCase(),
|
||||
style: const TextStyle(color: Colors.grey),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return DropdownMenuItem<
|
||||
dynamic>(
|
||||
value:
|
||||
station,
|
||||
child:
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 5),
|
||||
child: Text(station.stationName),
|
||||
),
|
||||
);
|
||||
}
|
||||
}).toList(),
|
||||
// value: selectedLevel,
|
||||
onChanged:
|
||||
(value) async {
|
||||
assignedArea =
|
||||
value;
|
||||
},
|
||||
),
|
||||
],
|
||||
)
|
||||
:
|
||||
////Establishment Point-Person
|
||||
state.roleId == 16
|
||||
? Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment
|
||||
.start,
|
||||
children: [
|
||||
Text(
|
||||
"Select Agency",
|
||||
textAlign:
|
||||
TextAlign.start,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.titleMedium,
|
||||
),
|
||||
const SizedBox(
|
||||
height:
|
||||
12,
|
||||
),
|
||||
DropdownButtonFormField(
|
||||
isExpanded:
|
||||
true,
|
||||
validator:
|
||||
FormBuilderValidators.required(errorText: fieldIsRequired),
|
||||
decoration: normalTextFieldStyle(
|
||||
"Agency",
|
||||
"Agency"),
|
||||
items: state
|
||||
.assignedArea
|
||||
.map((agency) {
|
||||
return DropdownMenuItem<dynamic>(
|
||||
value: agency,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 5),
|
||||
child: Text(agency.area.name),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
// value: selectedLevel,
|
||||
onChanged:
|
||||
(value) async {
|
||||
assignedArea =
|
||||
value;
|
||||
},
|
||||
),
|
||||
],
|
||||
)
|
||||
: ////Office Branch Chief
|
||||
state.roleId ==
|
||||
17
|
||||
? Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Select Station",
|
||||
textAlign: TextAlign.start,
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
DropdownButtonFormField(
|
||||
isExpanded: true,
|
||||
items: establishments
|
||||
.map((est) => DropdownMenuItem(
|
||||
value: est,
|
||||
child: Text(est),
|
||||
))
|
||||
.toList(),
|
||||
// value: selectedArea,
|
||||
validator: FormBuilderValidators.required(errorText: fieldIsRequired),
|
||||
decoration: normalTextFieldStyle("station", "station"),
|
||||
items: state.assignedArea.map((station) {
|
||||
if (station.motherStation) {
|
||||
return DropdownMenuItem<dynamic>(
|
||||
enabled: false,
|
||||
value: station,
|
||||
child: Text(
|
||||
station.stationName.toUpperCase(),
|
||||
style: const TextStyle(color: Colors.grey),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return DropdownMenuItem<dynamic>(
|
||||
value: station,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 5),
|
||||
child: Text(station.stationName),
|
||||
),
|
||||
);
|
||||
}
|
||||
}).toList(),
|
||||
// value: selectedLevel,
|
||||
onChanged: (value) async {
|
||||
selectedArea = value!;
|
||||
}),
|
||||
const Expanded(
|
||||
child: SizedBox(),
|
||||
assignedArea = value;
|
||||
},
|
||||
),
|
||||
],
|
||||
)
|
||||
: Container())
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
height: 60,
|
||||
child: ElevatedButton(
|
||||
style: mainBtnStyle(
|
||||
primary, Colors.transparent, Colors.white54),
|
||||
style: mainBtnStyle(primary,
|
||||
Colors.transparent, Colors.white54),
|
||||
child: const Text(
|
||||
submit,
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
onPressed: () {
|
||||
// if (_formKey.currentState.validate()) {
|
||||
// _formKey.currentState.save();
|
||||
// BlocProvider.of<UserBloc>(context)
|
||||
// .add(UserWebLogin(
|
||||
// password: password,
|
||||
// username: username));
|
||||
// }
|
||||
if (_formKey.currentState!
|
||||
.saveAndValidate()) {
|
||||
print(scanMode);
|
||||
print(_includeOtherInputs);
|
||||
print(checkerId);
|
||||
print(assignedArea);
|
||||
Navigator.push(context,
|
||||
MaterialPageRoute(builder:
|
||||
(BuildContext context) {
|
||||
return BlocProvider<
|
||||
PassCheckBloc>.value(
|
||||
value: PassCheckBloc()
|
||||
..add(SetScannerSettings(
|
||||
token: token!,
|
||||
assignedArea: assignedArea,
|
||||
checkerId: checkerId!,
|
||||
entranceExit: scanMode,
|
||||
includeOtherInputs:
|
||||
_includeOtherInputs,
|
||||
roleId: state.roleId)),
|
||||
child: const QRCodeScanner(),
|
||||
);
|
||||
}));
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
height: 52,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
if (state is PassCheckErrorState) {
|
||||
return SomethingWentWrong(
|
||||
message: state.message, onpressed: () {
|
||||
|
||||
context.read<PassCheckBloc>().add(GetPassCheckAreas(roleId: widget.roleId, userId: widget.userId));
|
||||
});
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
),
|
||||
)),
|
||||
);
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import 'dart:convert';
|
||||
|
||||
import 'package:unit2/theme-data.dart/colors.dart';
|
||||
|
||||
import '../../model/profile/basic_information/adress.dart';
|
||||
import '../../utils/request.dart';
|
||||
import '../../utils/urls.dart';
|
||||
|
@ -123,7 +121,7 @@ class AddressService {
|
|||
try {
|
||||
http.Response response = await http.patch(
|
||||
Uri.parse(
|
||||
'http://${Url.instance.host()}${Url.instance.addressPath()}$profileId/'),
|
||||
'https://${Url.instance.host()}${Url.instance.addressPath()}$profileId/'),
|
||||
headers: headers,
|
||||
body: jsonEncode(<String, dynamic>{
|
||||
"id": address.id,
|
||||
|
|
|
@ -106,7 +106,7 @@ class ProfileService {
|
|||
Map body = {
|
||||
"profile_id": profileId,
|
||||
"first_name": profileInfo.firstName,
|
||||
"middle_name": profileInfo.middleName,
|
||||
"middle_name": profileInfo.middleName!.isEmpty?null:profileInfo.middleName,
|
||||
"last_name": profileInfo.lastName,
|
||||
"name_extension": profileInfo.nameExtension,
|
||||
"birthdate": profileInfo.birthdate.toString(),
|
||||
|
|
|
@ -0,0 +1,265 @@
|
|||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'package:audioplayers/audioplayers.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:unit2/model/location/barangay.dart';
|
||||
import 'package:unit2/model/roles/pass_check/agency_area_type.dart';
|
||||
import 'package:unit2/model/roles/pass_check/assign_role_area_type.dart';
|
||||
import 'package:unit2/model/roles/pass_check/barangay_assign_area.dart';
|
||||
import 'package:unit2/model/roles/pass_check/passer_info.dart';
|
||||
import 'package:unit2/utils/global.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:unit2/utils/request.dart';
|
||||
import '../../model/roles/pass_check/purok_assign_area.dart';
|
||||
import '../../model/roles/pass_check/station_assign_area.dart';
|
||||
import '../../utils/urls.dart';
|
||||
|
||||
class PassCheckServices {
|
||||
static final PassCheckServices _instance = PassCheckServices();
|
||||
static PassCheckServices get instance => _instance;
|
||||
|
||||
Future<List<dynamic>> getPassCheckArea(
|
||||
{required int roleId, required int userId}) async {
|
||||
String path = Url.instance.getAssignAreas();
|
||||
Map<String, String> params = {
|
||||
"assigned_role__role__id": roleId.toString(),
|
||||
"assigned_role__user__id": userId.toString()
|
||||
};
|
||||
List<dynamic>? statusResponse;
|
||||
Map<String, String> headers = {
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
'X-Client-Key': xClientKey,
|
||||
'X-Client-Secret': xClientSecret
|
||||
};
|
||||
try {
|
||||
http.Response response = await Request.instance
|
||||
.getRequest(param: params, headers: headers, path: path);
|
||||
if (response.statusCode == 200) {
|
||||
Map data = jsonDecode(response.body);
|
||||
AssignRoleAreaType assignRoleAreaType = AssignRoleAreaType.fromJson(
|
||||
data['data'][0]['assigned_role_area_type']);
|
||||
////station
|
||||
if (assignRoleAreaType.areaTypeName.toLowerCase() == "station") {
|
||||
List<ChildStationInfo> assignedArea = [];
|
||||
data['data'][0]['assigned_area'].forEach((element) {
|
||||
StationAssignArea stationAssignArea =
|
||||
StationAssignArea.fromJson(element);
|
||||
ChildStationInfo headStation = ChildStationInfo(
|
||||
id: stationAssignArea.area!.id,
|
||||
stationName: stationAssignArea.area!.stationName,
|
||||
acroym: stationAssignArea.area!.acronym,
|
||||
motherStation: true);
|
||||
ChildStationInfo childStationInfo = ChildStationInfo(
|
||||
id: stationAssignArea.area!.id,
|
||||
stationName: stationAssignArea.area!.stationName,
|
||||
acroym: stationAssignArea.area!.acronym,
|
||||
motherStation: false);
|
||||
assignedArea.add(headStation);
|
||||
assignedArea.add(childStationInfo);
|
||||
if (stationAssignArea.area?.childStationInfo != null) {
|
||||
for (var element in stationAssignArea.area!.childStationInfo!) {
|
||||
ChildStationInfo newStationInfo = ChildStationInfo(
|
||||
id: element.id,
|
||||
stationName: element.stationName,
|
||||
acroym: element.acroym,
|
||||
motherStation: false);
|
||||
assignedArea.add(newStationInfo);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
statusResponse = assignedArea;
|
||||
}
|
||||
////registration in-chage
|
||||
if (assignRoleAreaType.areaTypeName.toLowerCase() ==
|
||||
"registration in-charge") {
|
||||
List<ChildStationInfo> assignedArea = [];
|
||||
data['data'][0]['assigned_area'].forEach((element) {
|
||||
StationAssignArea stationAssignArea =
|
||||
StationAssignArea.fromJson(element);
|
||||
ChildStationInfo headStation = ChildStationInfo(
|
||||
id: stationAssignArea.area!.id,
|
||||
stationName: stationAssignArea.area!.stationName,
|
||||
acroym: stationAssignArea.area!.acronym,
|
||||
motherStation: true);
|
||||
ChildStationInfo childStationInfo = ChildStationInfo(
|
||||
id: stationAssignArea.area!.id,
|
||||
stationName: stationAssignArea.area!.stationName,
|
||||
acroym: stationAssignArea.area!.acronym,
|
||||
motherStation: false);
|
||||
assignedArea.add(headStation);
|
||||
assignedArea.add(childStationInfo);
|
||||
if (stationAssignArea.area?.childStationInfo != null) {
|
||||
for (var element in stationAssignArea.area!.childStationInfo!) {
|
||||
ChildStationInfo newStationInfo = ChildStationInfo(
|
||||
id: element.id,
|
||||
stationName: element.stationName,
|
||||
acroym: element.acroym,
|
||||
motherStation: false);
|
||||
assignedArea.add(newStationInfo);
|
||||
}
|
||||
}
|
||||
});
|
||||
statusResponse = assignedArea;
|
||||
}
|
||||
////Barangay
|
||||
if (assignRoleAreaType.areaTypeName.toLowerCase() == "baranggay") {
|
||||
List<BaragayAssignArea> assignedArea = [];
|
||||
data['data'][0]['assigned_area'].forEach((var element) {
|
||||
BaragayAssignArea baragayAssignArea =
|
||||
BaragayAssignArea.fromJson(element['area']);
|
||||
assignedArea.add(baragayAssignArea);
|
||||
});
|
||||
statusResponse = assignedArea;
|
||||
}
|
||||
////PUROK
|
||||
if (assignRoleAreaType.areaTypeName.toLowerCase() == 'purok') {
|
||||
List<Purok> assignedArea = [];
|
||||
data['data'][0]['assigned_area'].forEach((var element) {
|
||||
Purok purok = Purok.fromJson(element['area']);
|
||||
assignedArea.add(purok);
|
||||
});
|
||||
statusResponse = assignedArea;
|
||||
}
|
||||
////AGENCY
|
||||
if (assignRoleAreaType.areaTypeName.toLowerCase() == 'agency') {
|
||||
List<AgencyAssignedArea> assignedArea = [];
|
||||
data['data'][0]['assigned_area'].forEach((var element) {
|
||||
AgencyAssignedArea agencyAssignedArea =
|
||||
AgencyAssignedArea.fromJson(element);
|
||||
assignedArea.add(agencyAssignedArea);
|
||||
});
|
||||
statusResponse = assignedArea;
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
throw e.toString();
|
||||
}
|
||||
return statusResponse!;
|
||||
}
|
||||
|
||||
Future<PasserInfo?> getPasserInfo(
|
||||
{required String uuid, required String token}) async {
|
||||
PasserInfo? passerInfo;
|
||||
String path = Url.instance.getPasserInfo();
|
||||
String authtoken = "Token $token";
|
||||
Map<String, String> params = {"uuid": uuid};
|
||||
Map<String, String> headers = {
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
'Authorization': authtoken
|
||||
};
|
||||
try {
|
||||
http.Response response = await Request.instance
|
||||
.getRequest(param: params, path: path, headers: headers);
|
||||
if (response.statusCode == 200) {
|
||||
Map body = jsonDecode(response.body);
|
||||
passerInfo = PasserInfo.fromJson(body['data'][0]);
|
||||
}
|
||||
} catch (e) {
|
||||
throw (e.toString());
|
||||
}
|
||||
return passerInfo;
|
||||
}
|
||||
|
||||
Future<bool> performPostLogs(
|
||||
{required String passerId,
|
||||
required int chekerId,
|
||||
required String io,
|
||||
required bool otherInputs,
|
||||
String? destination,
|
||||
double? temp,
|
||||
int? stationId,
|
||||
String? cpId,
|
||||
required int roleid}) async {
|
||||
String path = Url.instance.postLogs();
|
||||
bool success;
|
||||
Map<String, String> headers = {
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
'X-Client-Key': xClientKey,
|
||||
'X-Client-Secret': xClientSecret
|
||||
};
|
||||
Map body;
|
||||
if (otherInputs) {
|
||||
if (roleid == 41 || roleid == 13 || roleid == 17 || roleid == 22) {
|
||||
if (io == "i") {
|
||||
print("1");
|
||||
body = {
|
||||
"station_id": stationId,
|
||||
"temperature": temp,
|
||||
"passer": passerId,
|
||||
"checkedby_user_id": chekerId,
|
||||
"io": io
|
||||
};
|
||||
} else {
|
||||
print("2");
|
||||
body = {
|
||||
"station_id": stationId,
|
||||
"destination": destination,
|
||||
"passer": passerId,
|
||||
"checkedby_user_id": chekerId,
|
||||
"io": io
|
||||
};
|
||||
}
|
||||
} else {
|
||||
print("3");
|
||||
if (io == "i") {
|
||||
body = {
|
||||
"cp_id": cpId,
|
||||
"temperature": temp,
|
||||
"passer": passerId,
|
||||
"checkedby_user_id": chekerId,
|
||||
"io": io
|
||||
};
|
||||
} else {
|
||||
print("4");
|
||||
body = {
|
||||
"cp_id": cpId,
|
||||
"destination": destination,
|
||||
"passer": passerId,
|
||||
"checkedby_user_id": chekerId,
|
||||
"io": io
|
||||
};
|
||||
}
|
||||
}
|
||||
} else {
|
||||
print("5");
|
||||
if (roleid == 41 || roleid == 13 || roleid == 17 || roleid == 22) {
|
||||
body = {
|
||||
"station_id": stationId,
|
||||
"passer": passerId,
|
||||
"checkedby_user_id": chekerId,
|
||||
"io": io
|
||||
};
|
||||
} else {
|
||||
print("6");
|
||||
body = {
|
||||
"cp_id": cpId,
|
||||
"temperature": temp,
|
||||
"passer": passerId,
|
||||
"checkedby_user_id": chekerId,
|
||||
"io": io
|
||||
};
|
||||
}
|
||||
}
|
||||
try {
|
||||
http.Response response = await Request.instance
|
||||
.postRequest(path: path, headers: headers, body: body, param: {});
|
||||
if (response.statusCode == 201) {
|
||||
success = true;
|
||||
} else {
|
||||
success = false;
|
||||
}
|
||||
} catch (e) {
|
||||
throw e.toString();
|
||||
}
|
||||
return success;
|
||||
}
|
||||
}
|
||||
|
||||
Future setFailedAudio(AudioPlayer audioPlayer) async {
|
||||
AudioCache player = AudioCache();
|
||||
|
||||
final url = await player.load("ScanFailed.mp3");
|
||||
audioPlayer.play(AssetSource(url.path));
|
||||
}
|
|
@ -1,8 +1,10 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:unit2/bloc/profile/profile_bloc.dart';
|
||||
import 'package:unit2/bloc/role/pass_check/pass_check_bloc.dart';
|
||||
import 'package:unit2/bloc/sos/sos_bloc.dart';
|
||||
import 'package:unit2/screens/sos/index.dart';
|
||||
import 'package:unit2/screens/unit2/homepage.dart/components/dashboard.dart';
|
||||
import 'package:unit2/screens/unit2/homepage.dart/components/menu.dart';
|
||||
import 'package:unit2/screens/unit2/login/login.dart';
|
||||
import 'package:unit2/utils/global_context.dart';
|
||||
|
@ -53,8 +55,12 @@ class AppRouter {
|
|||
);
|
||||
});
|
||||
case '/pass-check':
|
||||
return MaterialPageRoute(builder: (BuildContext context){
|
||||
return const QRCodeScannerSettings();
|
||||
PassCheckArguments arguments = routeSettings.arguments as PassCheckArguments;
|
||||
return MaterialPageRoute(builder: (BuildContext context) {
|
||||
return BlocProvider(
|
||||
create: (context) => PassCheckBloc()..add(GetPassCheckAreas(roleId: arguments.roleId, userId: arguments.userId)),
|
||||
child: QRCodeScannerSettings(roleId: arguments.roleId, userId: arguments.userId,),
|
||||
);
|
||||
});
|
||||
default:
|
||||
return MaterialPageRoute(builder: (context) {
|
||||
|
|
|
@ -9,6 +9,8 @@ double safeAreaVertical = 0;
|
|||
double safeBlockHorizontal = 0;
|
||||
double safeBlockVertical = 0;
|
||||
|
||||
const xClientKey = "unitK3CQaXiWlPReDsBzmmwBZPd9Re1z";
|
||||
const xClientSecret = "unitcYqAN7GGalyz";
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -5,10 +5,10 @@ class Url {
|
|||
|
||||
String host() {
|
||||
// return '192.168.10.183:3000';
|
||||
// return 'agusandelnorte.gov.ph';
|
||||
return 'agusandelnorte.gov.ph';
|
||||
// return "192.168.10.219:3000";
|
||||
// return "192.168.10.241";
|
||||
return "192.168.10.221:3004";
|
||||
// return "192.168.10.221:3004";
|
||||
// return "playweb.agusandelnorte.gov.ph";
|
||||
// return 'devapi.agusandelnorte.gov.ph:3004';
|
||||
}
|
||||
|
@ -190,6 +190,20 @@ String getGenders(){
|
|||
return "/api/profile_app/gender/";
|
||||
}
|
||||
|
||||
/////ROLES
|
||||
// pass check
|
||||
String getAssignAreas(){
|
||||
return "/api/account/auth/assigned_role_area/";
|
||||
}
|
||||
|
||||
String getPasserInfo(){
|
||||
return "/api/profile_app/person_basicinfo/";
|
||||
}
|
||||
|
||||
String postLogs(){
|
||||
return "/api/unit2_app/monitoring/pass_check/";
|
||||
}
|
||||
|
||||
|
||||
//// location utils path
|
||||
String getCounties(){
|
||||
|
|
|
@ -6,10 +6,14 @@
|
|||
|
||||
#include "generated_plugin_registrant.h"
|
||||
|
||||
#include <audioplayers_linux/audioplayers_linux_plugin.h>
|
||||
#include <modal_progress_hud_nsn/modal_progress_hud_nsn_plugin.h>
|
||||
#include <platform_device_id_linux/platform_device_id_linux_plugin.h>
|
||||
|
||||
void fl_register_plugins(FlPluginRegistry* registry) {
|
||||
g_autoptr(FlPluginRegistrar) audioplayers_linux_registrar =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "AudioplayersLinuxPlugin");
|
||||
audioplayers_linux_plugin_register_with_registrar(audioplayers_linux_registrar);
|
||||
g_autoptr(FlPluginRegistrar) modal_progress_hud_nsn_registrar =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "ModalProgressHudNsnPlugin");
|
||||
modal_progress_hud_nsn_plugin_register_with_registrar(modal_progress_hud_nsn_registrar);
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#
|
||||
|
||||
list(APPEND FLUTTER_PLUGIN_LIST
|
||||
audioplayers_linux
|
||||
modal_progress_hud_nsn
|
||||
platform_device_id_linux
|
||||
)
|
||||
|
|
|
@ -5,22 +5,30 @@
|
|||
import FlutterMacOS
|
||||
import Foundation
|
||||
|
||||
import assets_audio_player
|
||||
import assets_audio_player_web
|
||||
import audioplayers_darwin
|
||||
import location
|
||||
import modal_progress_hud_nsn
|
||||
import package_info_plus
|
||||
import path_provider_foundation
|
||||
import platform_device_id
|
||||
import platform_device_id_macos
|
||||
import rive_common
|
||||
import shared_preferences_foundation
|
||||
import sqflite
|
||||
|
||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||
AssetsAudioPlayerPlugin.register(with: registry.registrar(forPlugin: "AssetsAudioPlayerPlugin"))
|
||||
AssetsAudioPlayerWebPlugin.register(with: registry.registrar(forPlugin: "AssetsAudioPlayerWebPlugin"))
|
||||
AudioplayersDarwinPlugin.register(with: registry.registrar(forPlugin: "AudioplayersDarwinPlugin"))
|
||||
LocationPlugin.register(with: registry.registrar(forPlugin: "LocationPlugin"))
|
||||
ModalProgressHudNsnPlugin.register(with: registry.registrar(forPlugin: "ModalProgressHudNsnPlugin"))
|
||||
FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin"))
|
||||
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
||||
PlatformDeviceIdMacosPlugin.register(with: registry.registrar(forPlugin: "PlatformDeviceIdMacosPlugin"))
|
||||
PlatformDeviceIdMacosPlugin.register(with: registry.registrar(forPlugin: "PlatformDeviceIdMacosPlugin"))
|
||||
RivePlugin.register(with: registry.registrar(forPlugin: "RivePlugin"))
|
||||
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
||||
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
|
||||
}
|
||||
|
|
276
pubspec.lock
276
pubspec.lock
|
@ -45,10 +45,26 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: args
|
||||
sha256: "4cab82a83ffef80b262ddedf47a0a8e56ee6fbf7fe21e6e768b02792034dd440"
|
||||
sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.4.0"
|
||||
version: "2.4.2"
|
||||
assets_audio_player:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: assets_audio_player
|
||||
sha256: dcea8cd9c11cd9c34586f2446bfcdf099362159c56f97517ba941ac151974ea9
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.6"
|
||||
assets_audio_player_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: assets_audio_player_web
|
||||
sha256: "4575ec40033d818ff022d48f7d46e24c01bc632bd1cd36a4f8b58b38e9aa4a81"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.6"
|
||||
async:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -57,6 +73,62 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.10.0"
|
||||
audioplayers:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: audioplayers
|
||||
sha256: "61583554386721772f9309f509e17712865b38565a903c761f96b1115a979282"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.1.0"
|
||||
audioplayers_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: audioplayers_android
|
||||
sha256: dbdc9b7f2aa2440314c638aa55aadd45c7705e8340d5eddf2e3fb8da32d4ae2c
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.2"
|
||||
audioplayers_darwin:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: audioplayers_darwin
|
||||
sha256: "6aea96df1d12f7ad5a71d88c6d1b22a216211a9564219920124c16768e456e9d"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.1.0"
|
||||
audioplayers_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: audioplayers_linux
|
||||
sha256: "396b62ac62c92dd26c3bc5106583747f57a8b325ebd2b41e5576f840cfc61338"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
audioplayers_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: audioplayers_platform_interface
|
||||
sha256: f7daaed4659143094151ecf6bacd927d29ab8acffba98c110c59f0b81ae51143
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.0.1"
|
||||
audioplayers_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: audioplayers_web
|
||||
sha256: ec84fd46eed1577148ed4113f5998a36a18da4fce7170c37ce3e21b631393339
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.0"
|
||||
audioplayers_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: audioplayers_windows
|
||||
sha256: "1d3aaac98a192b8488167711ba1e67d8b96333e8d0572ede4e2912e5bbce69a3"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.2"
|
||||
auto_size_text:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
@ -69,10 +141,10 @@ packages:
|
|||
dependency: "direct main"
|
||||
description:
|
||||
name: awesome_dialog
|
||||
sha256: ac08268b991f228fc6b8880b68ec030d2941bcc8df8b6a6551fb79f2bd36b7da
|
||||
sha256: "7da175ea284fa5da0a4d0cbdfe835c5b71d30c7b38c1770c0f27f48272ff5a08"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.2"
|
||||
version: "3.1.0"
|
||||
azlistview:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
@ -85,10 +157,10 @@ packages:
|
|||
dependency: "direct main"
|
||||
description:
|
||||
name: badges
|
||||
sha256: d33d4e07197d6e61ddc940640f2b4dc303d3c80887011344940e24d7522f8d26
|
||||
sha256: "6e7f3ec561ec08f47f912cfe349d4a1707afdc8dda271e17b046aa6d42c89e77"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.3"
|
||||
version: "3.1.1"
|
||||
barcode_scan2:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
@ -101,10 +173,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: bloc
|
||||
sha256: "658a5ae59edcf1e58aac98b000a71c762ad8f46f1394c34a52050cafb3e11a80"
|
||||
sha256: "3820f15f502372d979121de1f6b97bfcf1630ebff8fe1d52fb2b0bfa49be5b49"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "8.1.1"
|
||||
version: "8.1.2"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -157,10 +229,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: build_runner_core
|
||||
sha256: "14febe0f5bac5ae474117a36099b4de6f1dbc52df6c5e55534b3da9591bf4292"
|
||||
sha256: "0671ad4162ed510b70d0eb4ad6354c249f8429cab4ae7a4cec86bbc2886eb76e"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "7.2.7"
|
||||
version: "7.2.7+1"
|
||||
built_collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -173,10 +245,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: built_value
|
||||
sha256: "31b7c748fd4b9adf8d25d72a4c4a59ef119f12876cf414f94f8af5131d5fa2b0"
|
||||
sha256: "598a2a682e2a7a90f08ba39c0aaa9374c5112340f0a2e275f61b59389543d166"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "8.4.4"
|
||||
version: "8.6.1"
|
||||
cached_network_image:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
@ -213,10 +285,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: checked_yaml
|
||||
sha256: "3d1505d91afa809d177efd4eed5bb0eb65805097a1463abdd2add076effae311"
|
||||
sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.2"
|
||||
version: "2.0.3"
|
||||
clock:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -229,10 +301,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: code_builder
|
||||
sha256: "0d43dd1288fd145de1ecc9a3948ad4a6d5a82f0a14c4fdd0892260787d975cbe"
|
||||
sha256: "4ad01d6e56db961d29661561effde45e519939fdaeb46c351275b182eac70189"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.4.0"
|
||||
version: "4.5.0"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -269,10 +341,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: crypto
|
||||
sha256: aa274aa7774f8964e4f4f38cc994db7b6158dd36e9187aaceaddc994b35c6c67
|
||||
sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.2"
|
||||
version: "3.0.3"
|
||||
dart_style:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -365,10 +437,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: ffi
|
||||
sha256: a38574032c5f1dd06c4aee541789906c12ccaab8ba01446e800d9c5b79c4a978
|
||||
sha256: ed5337a5660c506388a9f012be0288fb38b49020ce2b45fe1f8b8323fe429f99
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
version: "2.0.2"
|
||||
file:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -418,10 +490,10 @@ packages:
|
|||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_bloc
|
||||
sha256: "434951eea948dbe87f737b674281465f610b8259c16c097b8163ce138749a775"
|
||||
sha256: e74efb89ee6945bcbce74a5b3a5a3376b088e5f21f55c263fc38cbdc6237faae
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "8.1.2"
|
||||
version: "8.1.3"
|
||||
flutter_blurhash:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -471,10 +543,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: flutter_plugin_android_lifecycle
|
||||
sha256: c224ac897bed083dabf11f238dd11a239809b446740be0c2044608c50029ffdf
|
||||
sha256: "950e77c2bbe1692bc0874fc7fb491b96a4dc340457f4ea1641443d0a6c1ea360"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.9"
|
||||
version: "2.0.15"
|
||||
flutter_progress_hud:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
@ -487,10 +559,10 @@ packages:
|
|||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_spinkit
|
||||
sha256: "77a2117c0517ff909221f3160b8eb20052ab5216107581168af574ac1f05dff8"
|
||||
sha256: b39c753e909d4796906c5696a14daf33639a76e017136c8d82bf3e620ce5bb8e
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.1.0"
|
||||
version: "5.2.0"
|
||||
flutter_svg:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
@ -529,18 +601,18 @@ packages:
|
|||
dependency: "direct main"
|
||||
description:
|
||||
name: fluttertoast
|
||||
sha256: "2f9c4d3f4836421f7067a28f8939814597b27614e021da9d63e5d3fb6e212d25"
|
||||
sha256: "474f7d506230897a3cd28c965ec21c5328ae5605fc9c400cd330e9e9d6ac175c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "8.2.1"
|
||||
version: "8.2.2"
|
||||
form_builder_validators:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: form_builder_validators
|
||||
sha256: d0a940d77231723fcb203ad6f5319ff30cd0c4412a6e74d29d826957b1f9afe0
|
||||
sha256: f2d90439c56345c23ad8d0c2912e4002cd02563d816f4387c9495051c10d3321
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "8.5.0"
|
||||
version: "8.6.1"
|
||||
freezed_annotation:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -561,10 +633,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: glob
|
||||
sha256: "4515b5b6ddb505ebdd242a5f2cc5d22d3d6a80013789debfbda7777f47ea308c"
|
||||
sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
version: "2.1.2"
|
||||
globbing:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -577,10 +649,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: graphs
|
||||
sha256: f9e130f3259f52d26f0cfc0e964513796dafed572fa52e45d2f8d6ca14db39b2
|
||||
sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.0"
|
||||
version: "2.3.1"
|
||||
hive:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
@ -609,10 +681,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: http
|
||||
sha256: "6aa2946395183537c8b880962d935877325d6a09a2867c3970c05c0fed6ac482"
|
||||
sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.13.5"
|
||||
version: "0.13.6"
|
||||
http_multi_server:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -665,10 +737,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: json_annotation
|
||||
sha256: c33da08e136c3df0190bd5bbe51ae1df4a7d96e7954d1d7249fea2968a72d317
|
||||
sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.8.0"
|
||||
version: "4.8.1"
|
||||
lints:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -705,10 +777,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: logging
|
||||
sha256: "04094f2eb032cbb06c6f6e8d3607edcfcb0455e2bb6cbc010cb01171dcb64e6d"
|
||||
sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.1"
|
||||
version: "1.2.0"
|
||||
lottie:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -801,10 +873,10 @@ packages:
|
|||
dependency: "direct main"
|
||||
description:
|
||||
name: package_info_plus
|
||||
sha256: cbff87676c352d97116af6dbea05aa28c4d65eb0f6d5677a520c11a69ca9a24d
|
||||
sha256: "10259b111176fba5c505b102e3a5b022b51dd97e30522e906d6922c745584745"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.0"
|
||||
version: "3.1.2"
|
||||
package_info_plus_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -841,34 +913,34 @@ packages:
|
|||
dependency: "direct main"
|
||||
description:
|
||||
name: path_provider
|
||||
sha256: c7edf82217d4b2952b2129a61d3ad60f1075b9299e629e149a8d2e39c2e6aad4
|
||||
sha256: "3087813781ab814e4157b172f1a11c46be20179fcc9bea043e0fba36bc0acaa2"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.14"
|
||||
version: "2.0.15"
|
||||
path_provider_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_android
|
||||
sha256: "019f18c9c10ae370b08dce1f3e3b73bc9f58e7f087bb5e921f06529438ac0ae7"
|
||||
sha256: "2cec049d282c7f13c594b4a73976b0b4f2d7a1838a6dd5aaf7bd9719196bee86"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.24"
|
||||
version: "2.0.27"
|
||||
path_provider_foundation:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_foundation
|
||||
sha256: "818b2dc38b0f178e0ea3f7cf3b28146faab11375985d815942a68eee11c2d0f7"
|
||||
sha256: "1995d88ec2948dac43edf8fe58eb434d35d22a2940ecee1a9fefcd62beee6eb3"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.1"
|
||||
version: "2.2.3"
|
||||
path_provider_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_linux
|
||||
sha256: "2ae08f2216225427e64ad224a24354221c2c7907e448e6e0e8b57b1eb9f10ad1"
|
||||
sha256: ffbb8cc9ed2c9ec0e4b7a541e56fd79b138e8f47d2fb86815f15358a349b3b57
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.10"
|
||||
version: "2.1.11"
|
||||
path_provider_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -881,10 +953,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_windows
|
||||
sha256: f53720498d5a543f9607db4b0e997c4b5438884de25b0f73098cc2671a51b130
|
||||
sha256: "1cb68ba4cd3a795033de62ba1b7b4564dace301f952de6bfb3cd91b202b6ee96"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.5"
|
||||
version: "2.1.7"
|
||||
pedantic:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -897,34 +969,34 @@ packages:
|
|||
dependency: "direct main"
|
||||
description:
|
||||
name: permission_handler
|
||||
sha256: "33c6a1253d1f95fd06fa74b65b7ba907ae9811f9d5c1d3150e51417d04b8d6a8"
|
||||
sha256: "1b6b3e73f0bcbc856548bbdfb1c33084a401c4f143e220629a9055233d76c331"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "10.2.0"
|
||||
version: "10.3.0"
|
||||
permission_handler_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: permission_handler_android
|
||||
sha256: "8028362b40c4a45298f1cbfccd227c8dd6caf0e27088a69f2ba2ab15464159e2"
|
||||
sha256: "8f6a95ccbca13766882f95d32684d7c9bfe6c45650c32bedba948ef1c6a4ddf7"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "10.2.0"
|
||||
version: "10.2.3"
|
||||
permission_handler_apple:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: permission_handler_apple
|
||||
sha256: ee96ac32f5a8e6f80756e25b25b9f8e535816c8e6665a96b6d70681f8c4f7e85
|
||||
sha256: "08dcb6ce628ac0b257e429944b4c652c2a4e6af725bdf12b498daa2c6b2b1edb"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "9.0.8"
|
||||
version: "9.1.0"
|
||||
permission_handler_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: permission_handler_platform_interface
|
||||
sha256: "68abbc472002b5e6dfce47fe9898c6b7d8328d58b5d2524f75e277c07a97eb84"
|
||||
sha256: de20a5c3269229c1ae2e5a6b822f6cb59578b23e8255c93fbeebfc82116e6b11
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.9.0"
|
||||
version: "3.10.0"
|
||||
permission_handler_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -1009,10 +1081,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: pointycastle
|
||||
sha256: c3120a968135aead39699267f4c74bc9a08e4e909e86bc1b0af5bfd78691123c
|
||||
sha256: "7c1e5f0d23c9016c5bbd8b1473d0d3fb3fc851b876046039509e18e0c7485f2c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.7.2"
|
||||
version: "3.7.3"
|
||||
pool:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -1049,18 +1121,18 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: pub_semver
|
||||
sha256: "307de764d305289ff24ad257ad5c5793ce56d04947599ad68b3baa124105fc17"
|
||||
sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.3"
|
||||
version: "2.1.4"
|
||||
pubspec_parse:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: pubspec_parse
|
||||
sha256: ec85d7d55339d85f44ec2b682a82fea340071e8978257e5a43e69f79e98ef50c
|
||||
sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.2"
|
||||
version: "1.2.3"
|
||||
qr:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -1081,10 +1153,18 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: rive
|
||||
sha256: "22e3755b75f4ea4492d2fecf4fc2acf1c8d0073df39781d290a20cbfe74c3760"
|
||||
sha256: bb7a16bc6a88484fe3136890030b71776ffea368edd2a8368fe99d6430e4a802
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.9.1"
|
||||
version: "0.11.2"
|
||||
rive_common:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: rive_common
|
||||
sha256: "5a0dbf689527c51ee5430608181d81460c9c45ab6cc3bd52dd9bbb3d8c4455b6"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.0.9"
|
||||
rxdart:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -1113,34 +1193,34 @@ packages:
|
|||
dependency: "direct main"
|
||||
description:
|
||||
name: searchfield
|
||||
sha256: deb363c95b9e64ea9ffd1a3b69926b0fe0344daedab872fc42014755a8199de9
|
||||
sha256: "62b6653d7194de5a7ea724124846b996d0d211cd3eeeec2e5ca84423650f66f8"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.7.5"
|
||||
version: "0.7.8"
|
||||
shared_preferences:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: shared_preferences
|
||||
sha256: "858aaa72d8f61637d64e776aca82e1c67e6d9ee07979123c5d17115031c1b13b"
|
||||
sha256: "396f85b8afc6865182610c0a2fc470853d56499f75f7499e2a73a9f0539d23d0"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
version: "2.1.2"
|
||||
shared_preferences_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: shared_preferences_android
|
||||
sha256: "8304d8a1f7d21a429f91dee552792249362b68a331ac5c3c1caf370f658873f6"
|
||||
sha256: "6478c6bbbecfe9aced34c483171e90d7c078f5883558b30ec3163cf18402c749"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
version: "2.1.4"
|
||||
shared_preferences_foundation:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: shared_preferences_foundation
|
||||
sha256: cf2a42fb20148502022861f71698db12d937c7459345a1bdaa88fc91a91b3603
|
||||
sha256: e014107bb79d6d3297196f4f2d0db54b5d1f85b8ea8ff63b8e8b391a02700feb
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.0"
|
||||
version: "2.2.2"
|
||||
shared_preferences_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -1177,18 +1257,18 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: shelf
|
||||
sha256: c24a96135a2ccd62c64b69315a14adc5c3419df63b4d7c05832a346fdb73682c
|
||||
sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.4.0"
|
||||
version: "1.4.1"
|
||||
shelf_web_socket:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: shelf_web_socket
|
||||
sha256: a988c0e8d8ffbdb8a28aa7ec8e449c260f3deb808781fe1284d22c5bba7156e8
|
||||
sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.3"
|
||||
version: "1.0.4"
|
||||
signature:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
@ -1201,10 +1281,10 @@ packages:
|
|||
dependency: "direct main"
|
||||
description:
|
||||
name: simple_chips_input
|
||||
sha256: "522b2e715fe67f325693e003acfd09fc0b8ab25a2c0c87fb8e5ce5b23a8a2ec1"
|
||||
sha256: "758c2439c74f9105ebb18407095c028e247631108195c38480ea3fb4967c8f6f"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
version: "1.1.0"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
|
@ -1238,18 +1318,18 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: sqflite
|
||||
sha256: "500d6fec583d2c021f2d25a056d96654f910662c64f836cd2063167b8f1fa758"
|
||||
sha256: b4d6710e1200e96845747e37338ea8a819a12b51689a3bcf31eff0003b37a0b9
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.6"
|
||||
version: "2.2.8+4"
|
||||
sqflite_common:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: sqflite_common
|
||||
sha256: "963dad8c4aa2f814ce7d2d5b1da2f36f31bd1a439d8f27e3dc189bb9d26bc684"
|
||||
sha256: e77abf6ff961d69dfef41daccbb66b51e9983cdd5cb35bf30733598057401555
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.4.3"
|
||||
version: "2.4.5"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -1286,10 +1366,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: synchronized
|
||||
sha256: "33b31b6beb98100bf9add464a36a8dd03eb10c7a8cf15aeec535e9b054aaf04b"
|
||||
sha256: "5fcbd27688af6082f5abd611af56ee575342c30e87541d0245f7ff99faa02c60"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.1"
|
||||
version: "3.1.0"
|
||||
system_info2:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
@ -1326,18 +1406,18 @@ packages:
|
|||
dependency: "direct main"
|
||||
description:
|
||||
name: toggle_switch
|
||||
sha256: "82c778c4bfe93af154a41e346ccd1d5b0cb6a50f8f187941412edd0a9bbf51ee"
|
||||
sha256: "9e6af1f0c5a97d9de41109dc7b9e1b3bbe73417f89b10e0e44dc834fb493d4cb"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
version: "2.1.0"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: typed_data
|
||||
sha256: "26f87ade979c47a150c9eaab93ccd2bebe70a27dc0b4b29517f2904f04eb11a5"
|
||||
sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.1"
|
||||
version: "1.3.2"
|
||||
uuid:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -1366,18 +1446,18 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: web_socket_channel
|
||||
sha256: ca49c0bc209c687b887f30527fb6a9d80040b072cc2990f34b9bec3e7663101b
|
||||
sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.3.0"
|
||||
version: "2.4.0"
|
||||
win32:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: win32
|
||||
sha256: a6f0236dbda0f63aa9a25ad1ff9a9d8a4eaaa5012da0dc59d21afdb1dc361ca4
|
||||
sha256: "5a751eddf9db89b3e5f9d50c20ab8612296e4e8db69009788d6c8b060a84191c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.4"
|
||||
version: "4.1.4"
|
||||
xdg_directories:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -1398,10 +1478,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: yaml
|
||||
sha256: "23812a9b125b48d4007117254bca50abb6c712352927eece9e155207b1db2370"
|
||||
sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.1"
|
||||
version: "3.1.2"
|
||||
sdks:
|
||||
dart: ">2.19.0 <3.0.0"
|
||||
flutter: ">=3.7.0"
|
||||
|
|
|
@ -80,6 +80,9 @@ dependencies:
|
|||
platform_device_id: ^1.0.1
|
||||
multi_dropdown: ^1.0.9
|
||||
searchable_paginated_dropdown: ^1.2.0
|
||||
audioplayers: ^4.1.0
|
||||
assets_audio_player: ^3.0.6
|
||||
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
@ -110,6 +113,7 @@ flutter:
|
|||
- assets/svgs/
|
||||
- assets/pngs/
|
||||
- assets/fonts/
|
||||
- assets/
|
||||
# - images/a_dot_ham.jpeg
|
||||
|
||||
# An image asset can refer to one or more resolution-specific "variants", see
|
||||
|
|
|
@ -6,15 +6,21 @@
|
|||
|
||||
#include "generated_plugin_registrant.h"
|
||||
|
||||
#include <audioplayers_windows/audioplayers_windows_plugin.h>
|
||||
#include <modal_progress_hud_nsn/modal_progress_hud_nsn_plugin.h>
|
||||
#include <permission_handler_windows/permission_handler_windows_plugin.h>
|
||||
#include <platform_device_id_windows/platform_device_id_windows_plugin.h>
|
||||
#include <rive_common/rive_plugin.h>
|
||||
|
||||
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
||||
AudioplayersWindowsPluginRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("AudioplayersWindowsPlugin"));
|
||||
ModalProgressHudNsnPluginRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("ModalProgressHudNsnPlugin"));
|
||||
PermissionHandlerWindowsPluginRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin"));
|
||||
PlatformDeviceIdWindowsPluginRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("PlatformDeviceIdWindowsPlugin"));
|
||||
RivePluginRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("RivePlugin"));
|
||||
}
|
||||
|
|
|
@ -3,9 +3,11 @@
|
|||
#
|
||||
|
||||
list(APPEND FLUTTER_PLUGIN_LIST
|
||||
audioplayers_windows
|
||||
modal_progress_hud_nsn
|
||||
permission_handler_windows
|
||||
platform_device_id_windows
|
||||
rive_common
|
||||
)
|
||||
|
||||
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
||||
|
|
Loading…
Reference in New Issue