Merge branch 'development_haroon' into 'master'
Development haroon See merge request Cloud_Solution/hmg-mohemm-flutter-app!3merge-requests/3/merge
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 68 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 6.6 KiB |
|
After Width: | Height: | Size: 6.9 KiB |
|
After Width: | Height: | Size: 7.5 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 775 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
@ -0,0 +1 @@
|
|||||||
|
{"images":[{"size":"60x60","expected-size":"180","filename":"180.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"40x40","expected-size":"80","filename":"80.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"40x40","expected-size":"120","filename":"120.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"60x60","expected-size":"120","filename":"120.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"57x57","expected-size":"57","filename":"57.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"58","filename":"58.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"29x29","expected-size":"29","filename":"29.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"87","filename":"87.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"57x57","expected-size":"114","filename":"114.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"40","filename":"40.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"60","filename":"60.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"1024x1024","filename":"1024.png","expected-size":"1024","idiom":"ios-marketing","folder":"Assets.xcassets/AppIcon.appiconset/","scale":"1x"},{"size":"40x40","expected-size":"80","filename":"80.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"72x72","expected-size":"72","filename":"72.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"76x76","expected-size":"152","filename":"152.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"50x50","expected-size":"100","filename":"100.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"29x29","expected-size":"58","filename":"58.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"76x76","expected-size":"76","filename":"76.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"29x29","expected-size":"29","filename":"29.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"50x50","expected-size":"50","filename":"50.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"72x72","expected-size":"144","filename":"144.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"40x40","expected-size":"40","filename":"40.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"83.5x83.5","expected-size":"167","filename":"167.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"20x20","expected-size":"20","filename":"20.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"20x20","expected-size":"40","filename":"40.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"}]}
|
||||||
|
After Width: | Height: | Size: 68 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 60 KiB |
@ -0,0 +1,21 @@
|
|||||||
|
import 'package:flutter/foundation.dart';
|
||||||
|
import 'package:just_audio/just_audio.dart';
|
||||||
|
|
||||||
|
class MyCustomStream extends StreamAudioSource {
|
||||||
|
final Uint8List bytes;
|
||||||
|
|
||||||
|
MyCustomStream(this.bytes);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<StreamAudioResponse> request([int? start, int? end]) async {
|
||||||
|
start ??= 0;
|
||||||
|
end ??= bytes.length;
|
||||||
|
return StreamAudioResponse(
|
||||||
|
sourceLength: bytes.length,
|
||||||
|
contentLength: end - start,
|
||||||
|
offset: start,
|
||||||
|
stream: Stream.value(bytes.sublist(start, end)),
|
||||||
|
contentType: 'audio/aac',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,68 @@
|
|||||||
|
class GetPRActionHistoryList {
|
||||||
|
String? aCTION;
|
||||||
|
String? aCTIONCODE;
|
||||||
|
String? aPPROVALDATE;
|
||||||
|
String? eMAILADDRESS;
|
||||||
|
String? eMPLOYEEIMAGE;
|
||||||
|
int? fROMROWNUM;
|
||||||
|
String? nAME;
|
||||||
|
String? nOTE;
|
||||||
|
int? nOOFROWS;
|
||||||
|
String? pOSITIONTITLE;
|
||||||
|
int? rOWNUM;
|
||||||
|
int? sEQUENCE;
|
||||||
|
int? tOROWNUM;
|
||||||
|
Null? uSERNAME;
|
||||||
|
|
||||||
|
GetPRActionHistoryList(
|
||||||
|
{this.aCTION,
|
||||||
|
this.aCTIONCODE,
|
||||||
|
this.aPPROVALDATE,
|
||||||
|
this.eMAILADDRESS,
|
||||||
|
this.eMPLOYEEIMAGE,
|
||||||
|
this.fROMROWNUM,
|
||||||
|
this.nAME,
|
||||||
|
this.nOTE,
|
||||||
|
this.nOOFROWS,
|
||||||
|
this.pOSITIONTITLE,
|
||||||
|
this.rOWNUM,
|
||||||
|
this.sEQUENCE,
|
||||||
|
this.tOROWNUM,
|
||||||
|
this.uSERNAME});
|
||||||
|
|
||||||
|
GetPRActionHistoryList.fromJson(Map<String, dynamic> json) {
|
||||||
|
aCTION = json['ACTION'];
|
||||||
|
aCTIONCODE = json['ACTION_CODE'];
|
||||||
|
aPPROVALDATE = json['APPROVAL_DATE'];
|
||||||
|
eMAILADDRESS = json['EMAIL_ADDRESS'];
|
||||||
|
eMPLOYEEIMAGE = json['EMPLOYEE_IMAGE'];
|
||||||
|
fROMROWNUM = json['FROM_ROW_NUM'];
|
||||||
|
nAME = json['NAME'];
|
||||||
|
nOTE = json['NOTE'];
|
||||||
|
nOOFROWS = json['NO_OF_ROWS'];
|
||||||
|
pOSITIONTITLE = json['POSITION_TITLE'];
|
||||||
|
rOWNUM = json['ROW_NUM'];
|
||||||
|
sEQUENCE = json['SEQUENCE'];
|
||||||
|
tOROWNUM = json['TO_ROW_NUM'];
|
||||||
|
uSERNAME = json['USER_NAME'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['ACTION'] = this.aCTION;
|
||||||
|
data['ACTION_CODE'] = this.aCTIONCODE;
|
||||||
|
data['APPROVAL_DATE'] = this.aPPROVALDATE;
|
||||||
|
data['EMAIL_ADDRESS'] = this.eMAILADDRESS;
|
||||||
|
data['EMPLOYEE_IMAGE'] = this.eMPLOYEEIMAGE;
|
||||||
|
data['FROM_ROW_NUM'] = this.fROMROWNUM;
|
||||||
|
data['NAME'] = this.nAME;
|
||||||
|
data['NOTE'] = this.nOTE;
|
||||||
|
data['NO_OF_ROWS'] = this.nOOFROWS;
|
||||||
|
data['POSITION_TITLE'] = this.pOSITIONTITLE;
|
||||||
|
data['ROW_NUM'] = this.rOWNUM;
|
||||||
|
data['SEQUENCE'] = this.sEQUENCE;
|
||||||
|
data['TO_ROW_NUM'] = this.tOROWNUM;
|
||||||
|
data['USER_NAME'] = this.uSERNAME;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,125 @@
|
|||||||
|
class GetPRInformationList {
|
||||||
|
List<PRHeader>? pRHeader;
|
||||||
|
List<PRLines>? pRLines;
|
||||||
|
String? pCURRENCYCODE;
|
||||||
|
|
||||||
|
GetPRInformationList({this.pRHeader, this.pRLines, this.pCURRENCYCODE});
|
||||||
|
|
||||||
|
GetPRInformationList.fromJson(Map<String, dynamic> json) {
|
||||||
|
if (json['PRHeader'] != null) {
|
||||||
|
pRHeader = <PRHeader>[];
|
||||||
|
json['PRHeader'].forEach((v) {
|
||||||
|
pRHeader!.add(new PRHeader.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (json['PRLines'] != null) {
|
||||||
|
pRLines = <PRLines>[];
|
||||||
|
json['PRLines'].forEach((v) {
|
||||||
|
pRLines!.add(new PRLines.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
pCURRENCYCODE = json['P_CURRENCY_CODE'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
if (this.pRHeader != null) {
|
||||||
|
data['PRHeader'] = this.pRHeader!.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
if (this.pRLines != null) {
|
||||||
|
data['PRLines'] = this.pRLines!.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
data['P_CURRENCY_CODE'] = this.pCURRENCYCODE;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class PRHeader {
|
||||||
|
String? dESCRIPTION;
|
||||||
|
String? pRNUMBER;
|
||||||
|
String? rEQUISITIONTOTAL;
|
||||||
|
String? tAXTOTAL;
|
||||||
|
|
||||||
|
PRHeader({this.dESCRIPTION, this.pRNUMBER, this.rEQUISITIONTOTAL, this.tAXTOTAL});
|
||||||
|
|
||||||
|
PRHeader.fromJson(Map<String, dynamic> json) {
|
||||||
|
dESCRIPTION = json['DESCRIPTION'];
|
||||||
|
pRNUMBER = json['PR_NUMBER'];
|
||||||
|
rEQUISITIONTOTAL = json['REQUISITION_TOTAL'];
|
||||||
|
tAXTOTAL = json['TAX_TOTAL'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['DESCRIPTION'] = this.dESCRIPTION;
|
||||||
|
data['PR_NUMBER'] = this.pRNUMBER;
|
||||||
|
data['REQUISITION_TOTAL'] = this.rEQUISITIONTOTAL;
|
||||||
|
data['TAX_TOTAL'] = this.tAXTOTAL;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class PRLines {
|
||||||
|
String? cOSTCENTER;
|
||||||
|
String? dESCRIPTION;
|
||||||
|
int? fROMROWNUM;
|
||||||
|
int? iTEMAMU;
|
||||||
|
String? iTEMCODE;
|
||||||
|
int? lINEAMOUNT;
|
||||||
|
int? lINENUM;
|
||||||
|
int? nOOFROWS;
|
||||||
|
int? qUANTITY;
|
||||||
|
int? rOWNUM;
|
||||||
|
int? tOROWNUM;
|
||||||
|
int? uNITPRICE;
|
||||||
|
String? uOM;
|
||||||
|
|
||||||
|
PRLines(
|
||||||
|
{this.cOSTCENTER,
|
||||||
|
this.dESCRIPTION,
|
||||||
|
this.fROMROWNUM,
|
||||||
|
this.iTEMAMU,
|
||||||
|
this.iTEMCODE,
|
||||||
|
this.lINEAMOUNT,
|
||||||
|
this.lINENUM,
|
||||||
|
this.nOOFROWS,
|
||||||
|
this.qUANTITY,
|
||||||
|
this.rOWNUM,
|
||||||
|
this.tOROWNUM,
|
||||||
|
this.uNITPRICE,
|
||||||
|
this.uOM});
|
||||||
|
|
||||||
|
PRLines.fromJson(Map<String, dynamic> json) {
|
||||||
|
cOSTCENTER = json['COST_CENTER'];
|
||||||
|
dESCRIPTION = json['DESCRIPTION'];
|
||||||
|
fROMROWNUM = json['FROM_ROW_NUM'];
|
||||||
|
iTEMAMU = json['ITEM_AMU'];
|
||||||
|
iTEMCODE = json['ITEM_CODE'];
|
||||||
|
lINEAMOUNT = json['LINE_AMOUNT'];
|
||||||
|
lINENUM = json['LINE_NUM'];
|
||||||
|
nOOFROWS = json['NO_OF_ROWS'];
|
||||||
|
qUANTITY = json['QUANTITY'];
|
||||||
|
rOWNUM = json['ROW_NUM'];
|
||||||
|
tOROWNUM = json['TO_ROW_NUM'];
|
||||||
|
uNITPRICE = json['UNIT_PRICE'];
|
||||||
|
uOM = json['UOM'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['COST_CENTER'] = this.cOSTCENTER;
|
||||||
|
data['DESCRIPTION'] = this.dESCRIPTION;
|
||||||
|
data['FROM_ROW_NUM'] = this.fROMROWNUM;
|
||||||
|
data['ITEM_AMU'] = this.iTEMAMU;
|
||||||
|
data['ITEM_CODE'] = this.iTEMCODE;
|
||||||
|
data['LINE_AMOUNT'] = this.lINEAMOUNT;
|
||||||
|
data['LINE_NUM'] = this.lINENUM;
|
||||||
|
data['NO_OF_ROWS'] = this.nOOFROWS;
|
||||||
|
data['QUANTITY'] = this.qUANTITY;
|
||||||
|
data['ROW_NUM'] = this.rOWNUM;
|
||||||
|
data['TO_ROW_NUM'] = this.tOROWNUM;
|
||||||
|
data['UNIT_PRICE'] = this.uNITPRICE;
|
||||||
|
data['UOM'] = this.uOM;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,148 @@
|
|||||||
|
class SurveyModel {
|
||||||
|
int? surveyId;
|
||||||
|
String? referenceNo;
|
||||||
|
String? title;
|
||||||
|
String? description;
|
||||||
|
List<Questions>? questions;
|
||||||
|
bool? isActive;
|
||||||
|
Null? pageSize;
|
||||||
|
Null? pageNo;
|
||||||
|
Null? languageId;
|
||||||
|
|
||||||
|
SurveyModel({this.surveyId, this.referenceNo, this.title, this.description, this.questions, this.isActive, this.pageSize, this.pageNo, this.languageId});
|
||||||
|
|
||||||
|
SurveyModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
surveyId = json['surveyId'];
|
||||||
|
referenceNo = json['referenceNo'];
|
||||||
|
title = json['title'];
|
||||||
|
description = json['description'];
|
||||||
|
if (json['questions'] != null) {
|
||||||
|
questions = <Questions>[];
|
||||||
|
json['questions'].forEach((v) {
|
||||||
|
questions!.add(new Questions.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
isActive = json['isActive'];
|
||||||
|
pageSize = json['pageSize'];
|
||||||
|
pageNo = json['pageNo'];
|
||||||
|
languageId = json['languageId'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['surveyId'] = this.surveyId;
|
||||||
|
data['referenceNo'] = this.referenceNo;
|
||||||
|
data['title'] = this.title;
|
||||||
|
data['description'] = this.description;
|
||||||
|
if (this.questions != null) {
|
||||||
|
data['questions'] = this.questions!.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
data['isActive'] = this.isActive;
|
||||||
|
data['pageSize'] = this.pageSize;
|
||||||
|
data['pageNo'] = this.pageNo;
|
||||||
|
data['languageId'] = this.languageId;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Questions {
|
||||||
|
int? questionId;
|
||||||
|
String? title;
|
||||||
|
bool? isRequired;
|
||||||
|
String? type;
|
||||||
|
int? sequenceNo;
|
||||||
|
Null? surveyId;
|
||||||
|
List<Options>? options;
|
||||||
|
Null? rspPercentage;
|
||||||
|
Null? isActive;
|
||||||
|
Null? pageSize;
|
||||||
|
Null? pageNo;
|
||||||
|
Null? languageId;
|
||||||
|
|
||||||
|
Questions({this.questionId, this.title, this.isRequired, this.type, this.sequenceNo, this.surveyId, this.options, this.rspPercentage, this.isActive, this.pageSize, this.pageNo, this.languageId});
|
||||||
|
|
||||||
|
Questions.fromJson(Map<String, dynamic> json) {
|
||||||
|
questionId = json['questionId'];
|
||||||
|
title = json['title'];
|
||||||
|
isRequired = json['isRequired'];
|
||||||
|
type = json['type'];
|
||||||
|
sequenceNo = json['sequenceNo'];
|
||||||
|
surveyId = json['surveyId'];
|
||||||
|
if (json['options'] != null) {
|
||||||
|
options = <Options>[];
|
||||||
|
json['options'].forEach((v) {
|
||||||
|
options!.add(new Options.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
rspPercentage = json['rspPercentage'];
|
||||||
|
isActive = json['isActive'];
|
||||||
|
pageSize = json['pageSize'];
|
||||||
|
pageNo = json['pageNo'];
|
||||||
|
languageId = json['languageId'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['questionId'] = this.questionId;
|
||||||
|
data['title'] = this.title;
|
||||||
|
data['isRequired'] = this.isRequired;
|
||||||
|
data['type'] = this.type;
|
||||||
|
data['sequenceNo'] = this.sequenceNo;
|
||||||
|
data['surveyId'] = this.surveyId;
|
||||||
|
if (this.options != null) {
|
||||||
|
data['options'] = this.options!.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
data['rspPercentage'] = this.rspPercentage;
|
||||||
|
data['isActive'] = this.isActive;
|
||||||
|
data['pageSize'] = this.pageSize;
|
||||||
|
data['pageNo'] = this.pageNo;
|
||||||
|
data['languageId'] = this.languageId;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Options {
|
||||||
|
int? optionId;
|
||||||
|
String? title;
|
||||||
|
bool? isCommentsRequired;
|
||||||
|
int? sequenceNo;
|
||||||
|
int? questionId;
|
||||||
|
Null? rspPercentage;
|
||||||
|
Null? count;
|
||||||
|
Null? isActive;
|
||||||
|
Null? pageSize;
|
||||||
|
Null? pageNo;
|
||||||
|
Null? languageId;
|
||||||
|
|
||||||
|
Options({this.optionId, this.title, this.isCommentsRequired, this.sequenceNo, this.questionId, this.rspPercentage, this.count, this.isActive, this.pageSize, this.pageNo, this.languageId});
|
||||||
|
|
||||||
|
Options.fromJson(Map<String, dynamic> json) {
|
||||||
|
optionId = json['optionId'];
|
||||||
|
title = json['title'];
|
||||||
|
isCommentsRequired = json['isCommentsRequired'];
|
||||||
|
sequenceNo = json['sequenceNo'];
|
||||||
|
questionId = json['questionId'];
|
||||||
|
rspPercentage = json['rspPercentage'];
|
||||||
|
count = json['count'];
|
||||||
|
isActive = json['isActive'];
|
||||||
|
pageSize = json['pageSize'];
|
||||||
|
pageNo = json['pageNo'];
|
||||||
|
languageId = json['languageId'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['optionId'] = this.optionId;
|
||||||
|
data['title'] = this.title;
|
||||||
|
data['isCommentsRequired'] = this.isCommentsRequired;
|
||||||
|
data['sequenceNo'] = this.sequenceNo;
|
||||||
|
data['questionId'] = this.questionId;
|
||||||
|
data['rspPercentage'] = this.rspPercentage;
|
||||||
|
data['count'] = this.count;
|
||||||
|
data['isActive'] = this.isActive;
|
||||||
|
data['pageSize'] = this.pageSize;
|
||||||
|
data['pageNo'] = this.pageNo;
|
||||||
|
data['languageId'] = this.languageId;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,46 @@
|
|||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:mohem_flutter_app/app_state/app_state.dart';
|
||||||
|
import 'package:wifi_iot/wifi_iot.dart';
|
||||||
|
|
||||||
|
class HmgConnectionProvider extends ChangeNotifier {
|
||||||
|
bool isConnectedToHMG = false;
|
||||||
|
|
||||||
|
Future<bool> checkHmgNetworkConnectivity() async {
|
||||||
|
if (await WiFiForIoTPlugin.getSSID() == AppState().getMohemmWifiSSID) {
|
||||||
|
isConnectedToHMG = true;
|
||||||
|
} else {
|
||||||
|
isConnectedToHMG = false;
|
||||||
|
}
|
||||||
|
AppState().isConnectedToHMG = isConnectedToHMG;
|
||||||
|
return isConnectedToHMG;
|
||||||
|
}
|
||||||
|
|
||||||
|
void connectWithHmgNetwork() async {
|
||||||
|
try {
|
||||||
|
bool isConnected = await WiFiForIoTPlugin.connect("MOHEMM-CONNECT", password: "0987654321", joinOnce: Platform.isIOS ? false : true, security: NetworkSecurity.WPA, withInternet: false);
|
||||||
|
|
||||||
|
if (isConnected) {
|
||||||
|
await WiFiForIoTPlugin.forceWifiUsage(true);
|
||||||
|
await Future.delayed(const Duration(seconds: 2));
|
||||||
|
isConnectedToHMG=true;
|
||||||
|
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
isConnectedToHMG = false;
|
||||||
|
AppState().isConnectedToHMG = isConnectedToHMG;
|
||||||
|
print("----------------o----");
|
||||||
|
print(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<bool> closeWifiRequest() async {
|
||||||
|
if (Platform.isAndroid) {
|
||||||
|
await WiFiForIoTPlugin.forceWifiUsage(false);
|
||||||
|
}
|
||||||
|
isConnectedToHMG = false;
|
||||||
|
AppState().isConnectedToHMG = isConnectedToHMG;
|
||||||
|
return await WiFiForIoTPlugin.disconnect();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,166 @@
|
|||||||
|
import 'package:easy_localization/src/public_ext.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:mohem_flutter_app/api/login_api_client.dart';
|
||||||
|
import 'package:mohem_flutter_app/app_state/app_state.dart';
|
||||||
|
import 'package:mohem_flutter_app/classes/colors.dart';
|
||||||
|
import 'package:mohem_flutter_app/classes/utils.dart';
|
||||||
|
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
|
||||||
|
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
|
||||||
|
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
|
||||||
|
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
|
||||||
|
import 'package:mohem_flutter_app/models/generic_response_model.dart';
|
||||||
|
import 'package:mohem_flutter_app/widgets/button/default_button.dart';
|
||||||
|
import 'package:mohem_flutter_app/widgets/input_widget.dart';
|
||||||
|
|
||||||
|
class ChangeItgAdPasswordScreen extends StatefulWidget {
|
||||||
|
ChangeItgAdPasswordScreen({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_ChangeItgAdPasswordScreenState createState() {
|
||||||
|
return _ChangeItgAdPasswordScreenState();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ChangeItgAdPasswordScreenState extends State<ChangeItgAdPasswordScreen> {
|
||||||
|
TextEditingController password = TextEditingController();
|
||||||
|
TextEditingController confirmPassword = TextEditingController();
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
void setNewPassword() async {
|
||||||
|
Utils.showLoading(context);
|
||||||
|
try {
|
||||||
|
GenericResponseModel response = await LoginApiClient().changePasswordFromActiveDirectorySession(password.text, AppState().memberInformationList!.eMPLOYEEEMAILADDRESS!);
|
||||||
|
Utils.hideLoading(context);
|
||||||
|
if ((response.messageStatus ?? 0) == 1) {
|
||||||
|
Utils.showToast(LocaleKeys.passwordChangedSuccessfully.tr());
|
||||||
|
Navigator.pop(context);
|
||||||
|
}
|
||||||
|
} catch (ex) {
|
||||||
|
Utils.hideLoading(context);
|
||||||
|
Utils.handleException(ex, context, (msg) {
|
||||||
|
Utils.confirmDialog(context, msg);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
leading: IconButton(
|
||||||
|
icon: const Icon(Icons.arrow_back_ios, color: MyColors.darkIconColor),
|
||||||
|
onPressed: () => Navigator.pop(context),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
body: Column(
|
||||||
|
children: [
|
||||||
|
ListView(
|
||||||
|
padding: const EdgeInsets.all(21),
|
||||||
|
children: [
|
||||||
|
LocaleKeys.changePassword.tr().toText24(isBold: true),
|
||||||
|
LocaleKeys.typeYourNewActiveDirectoryPasswordBelow.tr().toText16(),
|
||||||
|
16.height,
|
||||||
|
InputWidget(
|
||||||
|
LocaleKeys.password.tr(),
|
||||||
|
"**********",
|
||||||
|
password,
|
||||||
|
onChange: (value) {
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
12.height,
|
||||||
|
InputWidget(
|
||||||
|
LocaleKeys.confirmPassword.tr(),
|
||||||
|
"**********",
|
||||||
|
confirmPassword,
|
||||||
|
isTextIsPassword: true,
|
||||||
|
onChange: (value) {
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
16.height,
|
||||||
|
passwordConstraintsUI(LocaleKeys.doNotUseRecentPassword.tr(), true),
|
||||||
|
8.height,
|
||||||
|
passwordConstraintsUI(LocaleKeys.atLeastOneLowercase.tr(), checkRegEx(r'[a-z]')),
|
||||||
|
// 8.height,
|
||||||
|
// passwordConstraintsUI(LocaleKeys.atLeastOneUppercase.tr(), checkRegEx(r'[A-Z]')),
|
||||||
|
8.height,
|
||||||
|
passwordConstraintsUI(LocaleKeys.atLeastOneNumeric.tr(), checkRegEx(r'[0-9]')),
|
||||||
|
8.height,
|
||||||
|
passwordConstraintsUI(LocaleKeys.minimum8Characters.tr(), password.text.length >= 8),
|
||||||
|
8.height,
|
||||||
|
passwordConstraintsUI(LocaleKeys.doNotAddRepeatingLetters.tr(), checkRepeatedChars(password.text)),
|
||||||
|
// 8.height,
|
||||||
|
// passwordConstraintsUI(LocaleKeys.itShouldContainSpecialCharacter.tr(), checkRegEx(r'[!@#$%^&*(),.?":{}|<>]')),
|
||||||
|
8.height,
|
||||||
|
passwordConstraintsUI(LocaleKeys.confirmPasswordMustMatch.tr(), password.text.isNotEmpty && password.text == confirmPassword.text),
|
||||||
|
],
|
||||||
|
).expanded,
|
||||||
|
DefaultButton(LocaleKeys.changePassword.tr(), (!isPasswordCompliant(password.text, 8)) ? null : setNewPassword).insideContainer
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool checkRegEx(String pattern) {
|
||||||
|
return RegExp(pattern).hasMatch(password.text);
|
||||||
|
}
|
||||||
|
|
||||||
|
String recentPassword = "";
|
||||||
|
|
||||||
|
bool isPasswordCompliant(String? password, int minLength) {
|
||||||
|
if (password == null || password.isEmpty) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// bool hasUppercase = password.contains(RegExp(r'[A-Z]'));
|
||||||
|
bool hasDigits = password.contains(RegExp(r'[0-9]'));
|
||||||
|
bool hasLowercase = password.contains(RegExp(r'[a-z]'));
|
||||||
|
// bool hasSpecialCharacters = password.contains(RegExp(r'[!@#$%^&*(),.?":{}|<>]'));
|
||||||
|
bool hasMinLength = password.length >= minLength;
|
||||||
|
bool isMatched = password == confirmPassword.text;
|
||||||
|
|
||||||
|
return hasDigits && hasLowercase && hasMinLength && isMatched && checkRepeatedChars(password);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool checkRepeatedChars(String password) {
|
||||||
|
bool isNonRepeatedLetters = true;
|
||||||
|
if (password.length > 2) {
|
||||||
|
for (int i = 0; i < password.length; i++) {
|
||||||
|
String char = password[i];
|
||||||
|
try {
|
||||||
|
if (char == password[i + 1]) {
|
||||||
|
isNonRepeatedLetters = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} catch (ex) {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return isNonRepeatedLetters;
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget passwordConstraintsUI(String description, bool check) {
|
||||||
|
return Row(
|
||||||
|
children: [
|
||||||
|
4.width,
|
||||||
|
SizedBox(
|
||||||
|
width: 12,
|
||||||
|
height: 12,
|
||||||
|
child: Checkbox(fillColor: MaterialStateProperty.all(MyColors.gradiantEndColor), shape: const CircleBorder(), value: check, onChanged: null),
|
||||||
|
),
|
||||||
|
8.width,
|
||||||
|
description.toText14()
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,50 @@
|
|||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:mohem_flutter_app/classes/colors.dart';
|
||||||
|
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
|
||||||
|
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
|
||||||
|
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
|
||||||
|
import 'package:mohem_flutter_app/provider/hmg_connection_provider.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
class HmgConnectivityButton extends StatelessWidget {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
Provider.of<HmgConnectionProvider>(context, listen: false).checkHmgNetworkConnectivity();
|
||||||
|
return Consumer<HmgConnectionProvider>(
|
||||||
|
builder: (_, HmgConnectionProvider foo, __) {
|
||||||
|
return Container(
|
||||||
|
height: 45,
|
||||||
|
padding: const EdgeInsets.only(left: 12, right: 12),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(200.0),
|
||||||
|
gradient: const LinearGradient(
|
||||||
|
transform: GradientRotation(.83),
|
||||||
|
begin: Alignment.topRight,
|
||||||
|
end: Alignment.bottomLeft,
|
||||||
|
colors: <Color>[
|
||||||
|
MyColors.gradiantEndColor,
|
||||||
|
MyColors.gradiantStartColor,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: InkWell(
|
||||||
|
onTap: (){
|
||||||
|
|
||||||
|
},
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
const Icon(
|
||||||
|
Icons.wifi,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
12.width,
|
||||||
|
LocaleKeys.connectHmgWifi.tr().toText18(color: Colors.white),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||