Compare commits
No commits in common. 'master' and 'fatima' have entirely different histories.
@ -1,57 +0,0 @@
|
|||||||
{
|
|
||||||
"agcgw_all":{
|
|
||||||
"CN":"connect-drcn.dbankcloud.cn",
|
|
||||||
"CN_back":"connect-drcn.hispace.hicloud.com",
|
|
||||||
"DE":"connect-dre.dbankcloud.cn",
|
|
||||||
"DE_back":"connect-dre.hispace.hicloud.com",
|
|
||||||
"RU":"connect-drru.hispace.dbankcloud.ru",
|
|
||||||
"RU_back":"connect-drru.hispace.dbankcloud.cn",
|
|
||||||
"SG":"connect-dra.dbankcloud.cn",
|
|
||||||
"SG_back":"connect-dra.hispace.hicloud.com"
|
|
||||||
},
|
|
||||||
"websocketgw_all":{
|
|
||||||
"CN":"connect-ws-drcn.hispace.dbankcloud.cn",
|
|
||||||
"CN_back":"connect-ws-drcn.hispace.dbankcloud.com",
|
|
||||||
"DE":"connect-ws-dre.hispace.dbankcloud.cn",
|
|
||||||
"DE_back":"connect-ws-dre.hispace.dbankcloud.com",
|
|
||||||
"RU":"connect-ws-drru.hispace.dbankcloud.ru",
|
|
||||||
"RU_back":"connect-ws-drru.hispace.dbankcloud.cn",
|
|
||||||
"SG":"connect-ws-dra.hispace.dbankcloud.cn",
|
|
||||||
"SG_back":"connect-ws-dra.hispace.dbankcloud.com"
|
|
||||||
},
|
|
||||||
"client":{
|
|
||||||
"cp_id":"2640966000002322881",
|
|
||||||
"product_id":"737518067793559971",
|
|
||||||
"client_id":"715996003571874624",
|
|
||||||
"client_secret":"B5B89A56A53847C6BB9D216A8747E75952760DF9A8232239D8744CD847A8FFDA",
|
|
||||||
"project_id":"737518067793559971",
|
|
||||||
"app_id":"104737117",
|
|
||||||
"api_key":"DAEDACKDrYgyco9mjPV9ZUjCSh1kCr/GBV0nseHH0z2mnxlZ41RksOKmyTi+PUTwmGEPK+VxCup4F9oUf4VbDnCsjB7aNBShYcjR+g==",
|
|
||||||
"package_name":"hmg.cloudSolutions.mohem"
|
|
||||||
},
|
|
||||||
"oauth_client":{
|
|
||||||
"client_id":"104737117",
|
|
||||||
"client_type":1
|
|
||||||
},
|
|
||||||
"app_info":{
|
|
||||||
"app_id":"104737117",
|
|
||||||
"package_name":"hmg.cloudSolutions.mohem"
|
|
||||||
},
|
|
||||||
"configuration_version":"3.0",
|
|
||||||
"appInfos":[
|
|
||||||
{
|
|
||||||
"package_name":"hmg.cloudSolutions.mohem",
|
|
||||||
"client":{
|
|
||||||
"app_id":"104737117"
|
|
||||||
},
|
|
||||||
"app_info":{
|
|
||||||
"package_name":"hmg.cloudSolutions.mohem",
|
|
||||||
"app_id":"104737117"
|
|
||||||
},
|
|
||||||
"oauth_client":{
|
|
||||||
"client_type":1,
|
|
||||||
"client_id":"104737117"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
Before Width: | Height: | Size: 732 B |
|
Before Width: | Height: | Size: 702 B |
|
Before Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 610 B |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 518 B |
|
Before Width: | Height: | Size: 187 KiB |
|
Before Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 17 KiB |
@ -1,522 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"id": "b8f10b10-221c-495d-b99b-6a8094892549",
|
|
||||||
"titleEn": "How many time Uruguay won FIFA World Cups?",
|
|
||||||
"titleAr": "How many time Uruguay won FIFA World Cups?",
|
|
||||||
"marathonId": "979813be-eafa-4d3e-d27e-08dae8a08a3b",
|
|
||||||
"questionTypeId": 1,
|
|
||||||
"questionTime": 10,
|
|
||||||
"nextQuestGap": 5,
|
|
||||||
"gapType": 0,
|
|
||||||
"gapText": null,
|
|
||||||
"gapImage": "Questions/51b598b6-c837-45be-8734-1374978bd426_congratulations-gif.gif",
|
|
||||||
"questOptionsLimit": 0,
|
|
||||||
"remainingParticipantCount": 1,
|
|
||||||
"questionOptions": [
|
|
||||||
{
|
|
||||||
"id": "772e6062-543c-4ddc-e516-08dae8b36b35",
|
|
||||||
"titleEn": "1",
|
|
||||||
"titleAr": "1",
|
|
||||||
"questionId": "b8f10b10-221c-495d-b99b-6a8094892549",
|
|
||||||
"sequence": 1,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "ea3c673e-78c7-41dd-e517-08dae8b36b35",
|
|
||||||
"titleEn": "2",
|
|
||||||
"titleAr": "2",
|
|
||||||
"questionId": "b8f10b10-221c-495d-b99b-6a8094892549",
|
|
||||||
"sequence": 3,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "7adbdfec-ef77-417e-e518-08dae8b36b35",
|
|
||||||
"titleEn": "3",
|
|
||||||
"titleAr": "3",
|
|
||||||
"questionId": "b8f10b10-221c-495d-b99b-6a8094892549",
|
|
||||||
"sequence": 2,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "895eab85-e321-4d3e-e519-08dae8b36b35",
|
|
||||||
"titleEn": "4",
|
|
||||||
"titleAr": "4",
|
|
||||||
"questionId": "b8f10b10-221c-495d-b99b-6a8094892549",
|
|
||||||
"sequence": 4,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "0d60d55f-4067-48f9-9ace-b6309c6a7cf0",
|
|
||||||
"titleEn": "Who is the current FIFA World Cup Winner?",
|
|
||||||
"titleAr": "Who is the current FIFA World Cup Winner?",
|
|
||||||
"marathonId": "979813be-eafa-4d3e-d27e-08dae8a08a3b",
|
|
||||||
"questionTypeId": 1,
|
|
||||||
"questionTime": 10,
|
|
||||||
"nextQuestGap": 5,
|
|
||||||
"gapType": 0,
|
|
||||||
"gapText": null,
|
|
||||||
"gapImage": "Questions/24dddc50-7583-48b4-9fec-8a490d246191_great-thumbs.gif",
|
|
||||||
"questOptionsLimit": 0,
|
|
||||||
"remainingParticipantCount": 0,
|
|
||||||
"questionOptions": [
|
|
||||||
{
|
|
||||||
"id": "dd0ba127-26ed-4308-e50e-08dae8b36b35",
|
|
||||||
"titleEn": "Brazil",
|
|
||||||
"titleAr": "Brazil",
|
|
||||||
"questionId": "0d60d55f-4067-48f9-9ace-b6309c6a7cf0",
|
|
||||||
"sequence": 1,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "4748df31-95f0-4fee-e50f-08dae8b36b35",
|
|
||||||
"titleEn": "Argentina",
|
|
||||||
"titleAr": "Argentina",
|
|
||||||
"questionId": "0d60d55f-4067-48f9-9ace-b6309c6a7cf0",
|
|
||||||
"sequence": 4,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "4079d32a-891b-4e83-e510-08dae8b36b35",
|
|
||||||
"titleEn": "Germany",
|
|
||||||
"titleAr": "Germany",
|
|
||||||
"questionId": "0d60d55f-4067-48f9-9ace-b6309c6a7cf0",
|
|
||||||
"sequence": 3,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "1c17cfcd-9f19-4020-e511-08dae8b36b35",
|
|
||||||
"titleEn": "France",
|
|
||||||
"titleAr": "France",
|
|
||||||
"questionId": "0d60d55f-4067-48f9-9ace-b6309c6a7cf0",
|
|
||||||
"sequence": 2,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "489659b0-0400-4b64-8ce2-e6fe48db61db",
|
|
||||||
"titleEn": "How many times England won FIFA World Cups?",
|
|
||||||
"titleAr": "How many times England won FIFA World Cups?",
|
|
||||||
"marathonId": "979813be-eafa-4d3e-d27e-08dae8a08a3b",
|
|
||||||
"questionTypeId": 1,
|
|
||||||
"questionTime": 10,
|
|
||||||
"nextQuestGap": 5,
|
|
||||||
"gapType": 0,
|
|
||||||
"gapText": null,
|
|
||||||
"gapImage": "Questions/a9ffa364-231c-4877-824f-84febac51086_thumbs-up-simon-cowell.gif",
|
|
||||||
"questOptionsLimit": 0,
|
|
||||||
"remainingParticipantCount": 0,
|
|
||||||
"questionOptions": [
|
|
||||||
{
|
|
||||||
"id": "7f63cd45-ce2c-417f-e502-08dae8b36b35",
|
|
||||||
"titleEn": "1",
|
|
||||||
"titleAr": "1",
|
|
||||||
"questionId": "489659b0-0400-4b64-8ce2-e6fe48db61db",
|
|
||||||
"sequence": 1,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "34690bfa-0ffd-453f-e503-08dae8b36b35",
|
|
||||||
"titleEn": "2",
|
|
||||||
"titleAr": "2",
|
|
||||||
"questionId": "489659b0-0400-4b64-8ce2-e6fe48db61db",
|
|
||||||
"sequence": 2,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "4526efdd-ff6f-4340-e504-08dae8b36b35",
|
|
||||||
"titleEn": "3",
|
|
||||||
"titleAr": "3",
|
|
||||||
"questionId": "489659b0-0400-4b64-8ce2-e6fe48db61db",
|
|
||||||
"sequence": 3,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "65d06188-fa63-49fd-e505-08dae8b36b35",
|
|
||||||
"titleEn": "4",
|
|
||||||
"titleAr": "4",
|
|
||||||
"questionId": "489659b0-0400-4b64-8ce2-e6fe48db61db",
|
|
||||||
"sequence": 4,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "253fc396-dab9-41ca-82bd-511f98c5dee8",
|
|
||||||
"titleEn": "How many time Germany won FIFA World Cups?",
|
|
||||||
"titleAr": "How many time Germany won FIFA World Cups?",
|
|
||||||
"marathonId": "979813be-eafa-4d3e-d27e-08dae8a08a3b",
|
|
||||||
"questionTypeId": 1,
|
|
||||||
"questionTime": 10,
|
|
||||||
"nextQuestGap": 5,
|
|
||||||
"gapType": 0,
|
|
||||||
"gapText": null,
|
|
||||||
"gapImage": "Questions/012d6493-3612-42c9-8f6f-84417d4736d4_good-job-well-done.gif",
|
|
||||||
"questOptionsLimit": 0,
|
|
||||||
"remainingParticipantCount": 0,
|
|
||||||
"questionOptions": [
|
|
||||||
{
|
|
||||||
"id": "dce4999c-5629-45f4-e4f6-08dae8b36b35",
|
|
||||||
"titleEn": "1",
|
|
||||||
"titleAr": "1",
|
|
||||||
"questionId": "253fc396-dab9-41ca-82bd-511f98c5dee8",
|
|
||||||
"sequence": 1,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "00913ba1-5ccc-4d7c-e4f7-08dae8b36b35",
|
|
||||||
"titleEn": "2",
|
|
||||||
"titleAr": "2",
|
|
||||||
"questionId": "253fc396-dab9-41ca-82bd-511f98c5dee8",
|
|
||||||
"sequence": 2,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "9e5f5e89-608e-4fc9-e4f8-08dae8b36b35",
|
|
||||||
"titleEn": "3",
|
|
||||||
"titleAr": "3",
|
|
||||||
"questionId": "253fc396-dab9-41ca-82bd-511f98c5dee8",
|
|
||||||
"sequence": 3,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "a535cacf-ee4d-4895-e4f9-08dae8b36b35",
|
|
||||||
"titleEn": "4",
|
|
||||||
"titleAr": "4",
|
|
||||||
"questionId": "253fc396-dab9-41ca-82bd-511f98c5dee8",
|
|
||||||
"sequence": 4,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "669c4fe2-a3e6-4e29-8c56-ae09efa9ba6c",
|
|
||||||
"titleEn": "How many times Portugal won FIFA World Cups?",
|
|
||||||
"titleAr": "How many times Portugal won FIFA World Cups?",
|
|
||||||
"marathonId": "979813be-eafa-4d3e-d27e-08dae8a08a3b",
|
|
||||||
"questionTypeId": 1,
|
|
||||||
"questionTime": 10,
|
|
||||||
"nextQuestGap": 5,
|
|
||||||
"gapType": 0,
|
|
||||||
"gapText": null,
|
|
||||||
"gapImage": "Questions/ca3f32a1-ed9f-45df-b2fb-3d1df78d5651_congrats-14.gif",
|
|
||||||
"questOptionsLimit": 0,
|
|
||||||
"remainingParticipantCount": 0,
|
|
||||||
"questionOptions": [
|
|
||||||
{
|
|
||||||
"id": "597c308e-3f09-4a05-e506-08dae8b36b35",
|
|
||||||
"titleEn": "0",
|
|
||||||
"titleAr": "0",
|
|
||||||
"questionId": "669c4fe2-a3e6-4e29-8c56-ae09efa9ba6c",
|
|
||||||
"sequence": 1,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "2face927-7c8e-4945-e507-08dae8b36b35",
|
|
||||||
"titleEn": "1",
|
|
||||||
"titleAr": "1",
|
|
||||||
"questionId": "669c4fe2-a3e6-4e29-8c56-ae09efa9ba6c",
|
|
||||||
"sequence": 2,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "bde21640-798e-4750-e508-08dae8b36b35",
|
|
||||||
"titleEn": "2",
|
|
||||||
"titleAr": "2",
|
|
||||||
"questionId": "669c4fe2-a3e6-4e29-8c56-ae09efa9ba6c",
|
|
||||||
"sequence": 3,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "9312acac-f0c3-4ed4-e509-08dae8b36b35",
|
|
||||||
"titleEn": "3",
|
|
||||||
"titleAr": "3",
|
|
||||||
"questionId": "669c4fe2-a3e6-4e29-8c56-ae09efa9ba6c",
|
|
||||||
"sequence": 4,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "f91774ce-14f0-4af0-9a77-e649bc013b44",
|
|
||||||
"titleEn": "How many times Spain won FIFA World Cups?",
|
|
||||||
"titleAr": "How many times Spain won FIFA World Cups?",
|
|
||||||
"marathonId": "979813be-eafa-4d3e-d27e-08dae8a08a3b",
|
|
||||||
"questionTypeId": 1,
|
|
||||||
"questionTime": 10,
|
|
||||||
"nextQuestGap": 5,
|
|
||||||
"gapType": 0,
|
|
||||||
"gapText": null,
|
|
||||||
"gapImage": "Questions/6484c5bc-09fd-4586-8036-67868afbe27b_good-job-well-done.gif",
|
|
||||||
"questOptionsLimit": 0,
|
|
||||||
"remainingParticipantCount": 0,
|
|
||||||
"questionOptions": [
|
|
||||||
{
|
|
||||||
"id": "2f968964-ce91-4478-e512-08dae8b36b35",
|
|
||||||
"titleEn": "1",
|
|
||||||
"titleAr": "1",
|
|
||||||
"questionId": "f91774ce-14f0-4af0-9a77-e649bc013b44",
|
|
||||||
"sequence": 1,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "4fed9355-2c9f-458d-e513-08dae8b36b35",
|
|
||||||
"titleEn": "2",
|
|
||||||
"titleAr": "2",
|
|
||||||
"questionId": "f91774ce-14f0-4af0-9a77-e649bc013b44",
|
|
||||||
"sequence": 2,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "8f232a43-3792-4cd0-e514-08dae8b36b35",
|
|
||||||
"titleEn": "3",
|
|
||||||
"titleAr": "3",
|
|
||||||
"questionId": "f91774ce-14f0-4af0-9a77-e649bc013b44",
|
|
||||||
"sequence": 3,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "24478e43-bf4c-4852-e515-08dae8b36b35",
|
|
||||||
"titleEn": "4",
|
|
||||||
"titleAr": "4",
|
|
||||||
"questionId": "f91774ce-14f0-4af0-9a77-e649bc013b44",
|
|
||||||
"sequence": 4,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "fd3a90e6-5b35-4035-bc1c-4483facaf6d3",
|
|
||||||
"titleEn": "How many times France won FIFA World Cups?",
|
|
||||||
"titleAr": "How many times France won FIFA World Cups?",
|
|
||||||
"marathonId": "979813be-eafa-4d3e-d27e-08dae8a08a3b",
|
|
||||||
"questionTypeId": 1,
|
|
||||||
"questionTime": 10,
|
|
||||||
"nextQuestGap": 5,
|
|
||||||
"gapType": 0,
|
|
||||||
"gapText": null,
|
|
||||||
"gapImage": "Questions/24dddc50-7583-48b4-9fec-8a490d246191_great-thumbs.gif",
|
|
||||||
"questOptionsLimit": 0,
|
|
||||||
"remainingParticipantCount": 0,
|
|
||||||
"questionOptions": [
|
|
||||||
{
|
|
||||||
"id": "9d0743e0-9f3f-48d0-e4fa-08dae8b36b35",
|
|
||||||
"titleEn": "1",
|
|
||||||
"titleAr": "1",
|
|
||||||
"questionId": "fd3a90e6-5b35-4035-bc1c-4483facaf6d3",
|
|
||||||
"sequence": 1,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "a81eda99-d9ad-49e0-e4fb-08dae8b36b35",
|
|
||||||
"titleEn": "2",
|
|
||||||
"titleAr": "2",
|
|
||||||
"questionId": "fd3a90e6-5b35-4035-bc1c-4483facaf6d3",
|
|
||||||
"sequence": 2,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "7ca78891-890d-4023-e4fc-08dae8b36b35",
|
|
||||||
"titleEn": "3",
|
|
||||||
"titleAr": "3",
|
|
||||||
"questionId": "fd3a90e6-5b35-4035-bc1c-4483facaf6d3",
|
|
||||||
"sequence": 3,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "d1a98bd9-8afa-49c1-e4fd-08dae8b36b35",
|
|
||||||
"titleEn": "4",
|
|
||||||
"titleAr": "4",
|
|
||||||
"questionId": "fd3a90e6-5b35-4035-bc1c-4483facaf6d3",
|
|
||||||
"sequence": 4,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "3a35855d-3ed7-4d45-8864-9135d71378de",
|
|
||||||
"titleEn": "How many time Argentina won FIFA World Cups?",
|
|
||||||
"titleAr": "How many time Argentina won FIFA World Cups?",
|
|
||||||
"marathonId": "979813be-eafa-4d3e-d27e-08dae8a08a3b",
|
|
||||||
"questionTypeId": 1,
|
|
||||||
"questionTime": 10,
|
|
||||||
"nextQuestGap": 5,
|
|
||||||
"gapType": 0,
|
|
||||||
"gapText": null,
|
|
||||||
"gapImage": "Questions/24dddc50-7583-48b4-9fec-8a490d246191_great-thumbs.gif",
|
|
||||||
"questOptionsLimit": 0,
|
|
||||||
"remainingParticipantCount": 0,
|
|
||||||
"questionOptions": [
|
|
||||||
{
|
|
||||||
"id": "f0766816-837f-47e6-e51a-08dae8b36b35",
|
|
||||||
"titleEn": "1",
|
|
||||||
"titleAr": "1",
|
|
||||||
"questionId": "3a35855d-3ed7-4d45-8864-9135d71378de",
|
|
||||||
"sequence": 1,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "dc9c68de-afa4-4b63-e51b-08dae8b36b35",
|
|
||||||
"titleEn": "2",
|
|
||||||
"titleAr": "2",
|
|
||||||
"questionId": "3a35855d-3ed7-4d45-8864-9135d71378de",
|
|
||||||
"sequence": 2,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "52f2d024-8a29-4781-e51c-08dae8b36b35",
|
|
||||||
"titleEn": "3",
|
|
||||||
"titleAr": "3",
|
|
||||||
"questionId": "3a35855d-3ed7-4d45-8864-9135d71378de",
|
|
||||||
"sequence": 3,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "122636e4-5e98-499e-e51d-08dae8b36b35",
|
|
||||||
"titleEn": "4",
|
|
||||||
"titleAr": "4",
|
|
||||||
"questionId": "3a35855d-3ed7-4d45-8864-9135d71378de",
|
|
||||||
"sequence": 4,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "6c9d809d-683b-4d77-b98e-62a0d083488a",
|
|
||||||
"titleEn": "How many times Brazil won FIFA World Cups?",
|
|
||||||
"titleAr": "How many times Brazil won FIFA World Cups?",
|
|
||||||
"marathonId": "979813be-eafa-4d3e-d27e-08dae8a08a3b",
|
|
||||||
"questionTypeId": 1,
|
|
||||||
"questionTime": 10,
|
|
||||||
"nextQuestGap": 5,
|
|
||||||
"gapType": 0,
|
|
||||||
"gapText": null,
|
|
||||||
"gapImage": "Questions/a9ffa364-231c-4877-824f-84febac51086_thumbs-up-simon-cowell.gif",
|
|
||||||
"questOptionsLimit": 0,
|
|
||||||
"remainingParticipantCount": 0,
|
|
||||||
"questionOptions": [
|
|
||||||
{
|
|
||||||
"id": "4e94437a-b10d-46c6-e4fe-08dae8b36b35",
|
|
||||||
"titleEn": "2",
|
|
||||||
"titleAr": "2",
|
|
||||||
"questionId": "6c9d809d-683b-4d77-b98e-62a0d083488a",
|
|
||||||
"sequence": 1,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "6e0e8baa-c13e-45f1-e4ff-08dae8b36b35",
|
|
||||||
"titleEn": "3",
|
|
||||||
"titleAr": "3",
|
|
||||||
"questionId": "6c9d809d-683b-4d77-b98e-62a0d083488a",
|
|
||||||
"sequence": 2,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "3065d26a-9aa4-4626-e500-08dae8b36b35",
|
|
||||||
"titleEn": "4",
|
|
||||||
"titleAr": "4",
|
|
||||||
"questionId": "6c9d809d-683b-4d77-b98e-62a0d083488a",
|
|
||||||
"sequence": 3,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "6cc3ff60-02cc-4e59-e501-08dae8b36b35",
|
|
||||||
"titleEn": "5",
|
|
||||||
"titleAr": "5",
|
|
||||||
"questionId": "6c9d809d-683b-4d77-b98e-62a0d083488a",
|
|
||||||
"sequence": 4,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "e8c8442e-f370-444d-bee9-f7f75d146e5c",
|
|
||||||
"titleEn": "How many times Italy won FIFA World Cups?",
|
|
||||||
"titleAr": "How many times Italy won FIFA World Cups?",
|
|
||||||
"marathonId": "979813be-eafa-4d3e-d27e-08dae8a08a3b",
|
|
||||||
"questionTypeId": 1,
|
|
||||||
"questionTime": 10,
|
|
||||||
"nextQuestGap": 5,
|
|
||||||
"gapType": 0,
|
|
||||||
"gapText": null,
|
|
||||||
"gapImage": "Questions/34f3c402-1244-4320-98c2-751cb2a347c5_congrats-1.gif",
|
|
||||||
"questOptionsLimit": 0,
|
|
||||||
"remainingParticipantCount": 0,
|
|
||||||
"questionOptions": [
|
|
||||||
{
|
|
||||||
"id": "53d456b7-8f56-4c58-e50a-08dae8b36b35",
|
|
||||||
"titleEn": "1",
|
|
||||||
"titleAr": "1",
|
|
||||||
"questionId": "e8c8442e-f370-444d-bee9-f7f75d146e5c",
|
|
||||||
"sequence": 1,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "280df6d7-ca61-4d78-e50b-08dae8b36b35",
|
|
||||||
"titleEn": "2",
|
|
||||||
"titleAr": "2",
|
|
||||||
"questionId": "e8c8442e-f370-444d-bee9-f7f75d146e5c",
|
|
||||||
"sequence": 2,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "769939dc-4a46-4f4f-e50c-08dae8b36b35",
|
|
||||||
"titleEn": "3",
|
|
||||||
"titleAr": "3",
|
|
||||||
"questionId": "e8c8442e-f370-444d-bee9-f7f75d146e5c",
|
|
||||||
"sequence": 3,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "c389fae7-0019-4922-e50d-08dae8b36b35",
|
|
||||||
"titleEn": "4",
|
|
||||||
"titleAr": "4",
|
|
||||||
"questionId": "e8c8442e-f370-444d-bee9-f7f75d146e5c",
|
|
||||||
"sequence": 4,
|
|
||||||
"image": "null",
|
|
||||||
"isCorrectOption": true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@ -1,46 +0,0 @@
|
|||||||
{
|
|
||||||
"id": "979813be-eafa-4d3e-d27e-08dae8a08a3b",
|
|
||||||
"titleEn": "FIFA World Cup",
|
|
||||||
"titleAr": "undefined",
|
|
||||||
"descEn": "FIFA World Cup Description",
|
|
||||||
"descAr": "undefined",
|
|
||||||
"questionTime": 10,
|
|
||||||
"winDeciderTime": 30,
|
|
||||||
"winnersCount": 1,
|
|
||||||
"questGapTime": 5,
|
|
||||||
"startTime": "2022-12-28T10:44:41",
|
|
||||||
"endTime": null,
|
|
||||||
"marathoneStatusId": 4,
|
|
||||||
"scheduleTime": "2022-12-28T10:14:41",
|
|
||||||
"selectedLanguage": 0,
|
|
||||||
"projects": {
|
|
||||||
"id": "b1cd3fa3-bb27-422e-a4c1-08dac09254df",
|
|
||||||
"nameEn": "Cloud Solutions",
|
|
||||||
"nameAr": "333شركة حلول السحابة للاتصالات وتقنية المعلومات",
|
|
||||||
"projectCode": "CS"
|
|
||||||
},
|
|
||||||
"sponsors": [
|
|
||||||
{
|
|
||||||
"id": "3272b127-b388-4f09-425b-08dac2eb788e",
|
|
||||||
"nameEn": "Cloud Solutions",
|
|
||||||
"nameAr": "حل السحابة",
|
|
||||||
"image": "SponsorImage/b9aed4a8-42b2-45fc-b6f1-47ee0c7b4138_sponsor.jpeg",
|
|
||||||
"video": "SponsorVideo/9ab678ab-1b4c-4ea4-aaf2-32ce1353d3fe_sample-10s.mp4",
|
|
||||||
"logo": "SponsorLogo/eb029f0d-bce1-4a61-b0c0-abaa484912a0_sponsor.jpeg",
|
|
||||||
"videoDuration": null,
|
|
||||||
"sponsorPrizes": [
|
|
||||||
{
|
|
||||||
"id": "e657a18c-6fb2-4099-07c8-08dae89efcd3",
|
|
||||||
"marathonPrizeEn": "SAR 500",
|
|
||||||
"marathonPrizeAr": "SAR 500"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"questions": null,
|
|
||||||
"isEmailSent": false,
|
|
||||||
"totalQuestions": 10,
|
|
||||||
"cancelReason": null,
|
|
||||||
"marathonBufferTime": 30,
|
|
||||||
"currentTime": "2022-12-28T08:03:24.3671803Z"
|
|
||||||
}
|
|
||||||
@ -1,25 +0,0 @@
|
|||||||
import 'dart:convert';
|
|
||||||
|
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
import 'package:logger/logger.dart' as L;
|
|
||||||
import 'package:mohem_flutter_app/models/marathon/marathon_model.dart';
|
|
||||||
import 'package:mohem_flutter_app/models/marathon/question_model.dart';
|
|
||||||
|
|
||||||
class DemoMarathonRepo {
|
|
||||||
L.Logger logger = L.Logger();
|
|
||||||
|
|
||||||
Future<MarathonDetailModel> getDemoMarathonDetails() async {
|
|
||||||
String response = await rootBundle.loadString('assets/json/demo_upcoming_marathon');
|
|
||||||
var json = jsonDecode(response);
|
|
||||||
MarathonDetailModel marathonDetailModel = MarathonDetailModel.fromJson(json);
|
|
||||||
return marathonDetailModel;
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<QuestionModel> getDemoNextQuestion({required int currentQuestionNumber}) async {
|
|
||||||
String response = await rootBundle.loadString('assets/json/demo_questions_marathon');
|
|
||||||
List json = jsonDecode(response);
|
|
||||||
QuestionModel currentQuestion = QuestionModel.fromJson(json.elementAt(currentQuestionNumber));
|
|
||||||
|
|
||||||
return currentQuestion;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,279 +0,0 @@
|
|||||||
// import 'dart:io';
|
|
||||||
//
|
|
||||||
// import 'package:firebase_core/firebase_core.dart';
|
|
||||||
// import 'package:firebase_messaging/firebase_messaging.dart';
|
|
||||||
// import 'package:flutter/foundation.dart';
|
|
||||||
// import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
|
||||||
// import 'package:huawei_hmsavailability/huawei_hmsavailability.dart';
|
|
||||||
// import 'package:huawei_push/huawei_push.dart' as huawei_push;
|
|
||||||
// import 'package:mohem_flutter_app/app_state/app_state.dart';
|
|
||||||
// import 'package:mohem_flutter_app/classes/utils.dart';
|
|
||||||
// import 'package:permission_handler/permission_handler.dart';
|
|
||||||
//
|
|
||||||
// final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin();
|
|
||||||
//
|
|
||||||
// class AppNotifications {
|
|
||||||
// static final AppNotifications _instance = AppNotifications._internal();
|
|
||||||
//
|
|
||||||
// AppNotifications._internal();
|
|
||||||
//
|
|
||||||
// factory AppNotifications() => _instance;
|
|
||||||
//
|
|
||||||
// late HmsApiAvailability hmsApiAvailability;
|
|
||||||
//
|
|
||||||
// String _huaweiToken = '';
|
|
||||||
//
|
|
||||||
// Future<void> requestPermissions() async {
|
|
||||||
// if (Platform.isIOS) {
|
|
||||||
// await flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation<IOSFlutterLocalNotificationsPlugin>()?.requestPermissions(alert: true, badge: true, sound: true);
|
|
||||||
// } else if (Platform.isAndroid) {
|
|
||||||
// AndroidFlutterLocalNotificationsPlugin? androidImplementation = flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation<AndroidFlutterLocalNotificationsPlugin>();
|
|
||||||
// bool? granted = await androidImplementation?.requestPermission();
|
|
||||||
// if (granted == false) {
|
|
||||||
// if (kDebugMode) {
|
|
||||||
// print("-------------------- Permission Granted ------------------------");
|
|
||||||
// print(granted);
|
|
||||||
// }
|
|
||||||
// await Permission.notification.request();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// void init(String? firebaseToken) async {
|
|
||||||
// hmsApiAvailability = HmsApiAvailability();
|
|
||||||
// await requestPermissions();
|
|
||||||
// AppState().setDeviceToken = firebaseToken;
|
|
||||||
// await Permission.notification.isDenied.then((bool value) {
|
|
||||||
// if (value) {
|
|
||||||
// Permission.notification.request();
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// RemoteMessage? initialMessage = await FirebaseMessaging.instance.getInitialMessage();
|
|
||||||
//
|
|
||||||
// if (initialMessage != null) _handleMessage(initialMessage);
|
|
||||||
//
|
|
||||||
// FirebaseMessaging.onMessage.listen((RemoteMessage message) {
|
|
||||||
// if (message.notification != null) _handleMessage(message);
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// FirebaseMessaging.onMessageOpenedApp.listen(_handleOpenApp);
|
|
||||||
//
|
|
||||||
// FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler);
|
|
||||||
//
|
|
||||||
// FirebaseMessaging.instance.onTokenRefresh.listen((String token) {
|
|
||||||
// AppState().setDeviceToken = token;
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// if (Platform.isAndroid) {
|
|
||||||
// await hmsApiAvailability.isHMSAvailable().then((value) async {
|
|
||||||
// if (value == 0) {
|
|
||||||
// huawei_push.Push.enableLogger();
|
|
||||||
// var result = await huawei_push.Push.setAutoInitEnabled(true);
|
|
||||||
//
|
|
||||||
// huawei_push.Push.onNotificationOpenedApp.listen((message) {
|
|
||||||
// // newMessage(toFirebaseRemoteMessage(message));
|
|
||||||
// }, onError: (e) => print(e.toString()));
|
|
||||||
//
|
|
||||||
// huawei_push.Push.onMessageReceivedStream.listen((message) {
|
|
||||||
// // newMessage(toFirebaseRemoteMessage(message));
|
|
||||||
// }, onError: (e) => print(e.toString()));
|
|
||||||
// }
|
|
||||||
// }).catchError((err) {
|
|
||||||
// print(err);
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// void initHuaweiPush(Function loginCallback) {
|
|
||||||
// AppState().setIsHuawei = true;
|
|
||||||
// initTokenStream(loginCallback);
|
|
||||||
// huawei_push.Push.getToken("");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // HUAWEI PUSH TOKEN IMPLEMENTATION
|
|
||||||
// void _onTokenEvent(String event) {
|
|
||||||
// _huaweiToken = event;
|
|
||||||
// AppState().setHuaweiPushToken = _huaweiToken;
|
|
||||||
// debugPrint("HUAWEI PUSH TOKEN: $_huaweiToken");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// void _onTokenError(Object error) {}
|
|
||||||
//
|
|
||||||
// Future<void> initTokenStream(Function loginCallback) async {
|
|
||||||
// huawei_push.Push.getTokenStream.listen(_onTokenEvent, onError: _onTokenError).onData((data) {
|
|
||||||
// AppState().setHuaweiPushToken = data;
|
|
||||||
// debugPrint("HUAWEI PUSH TOKEN: $data");
|
|
||||||
// loginCallback();
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// void _handleMessage(RemoteMessage message) {
|
|
||||||
// Utils.saveStringFromPrefs("isAppOpendByChat", "false");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// void _handleOpenApp(RemoteMessage message) {
|
|
||||||
// Utils.saveStringFromPrefs("isAppOpendByChat", "true");
|
|
||||||
// Utils.saveStringFromPrefs("notificationData", message.data["user_chat_history_response"].toString());
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// AndroidNotificationChannel channel = const AndroidNotificationChannel(
|
|
||||||
// "high_importance_channel",
|
|
||||||
// "High Importance Notifications",
|
|
||||||
// importance: Importance.high,
|
|
||||||
// );
|
|
||||||
//
|
|
||||||
// Future<dynamic> backgroundMessageHandler(RemoteMessage message) async {
|
|
||||||
// await Firebase.initializeApp();
|
|
||||||
// Utils.saveStringFromPrefs("isAppOpendByChat", "false");
|
|
||||||
// Utils.saveStringFromPrefs("notificationData", message.data["user_chat_history_response"].toString());
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//************** NEW fILE *****************
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import 'dart:io';
|
|
||||||
|
|
||||||
import 'package:firebase_core/firebase_core.dart';
|
|
||||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
|
||||||
import 'package:flutter/foundation.dart';
|
|
||||||
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
|
||||||
|
|
||||||
// import 'package:huawei_hmsavailability/huawei_hmsavailability.dart';
|
|
||||||
import 'package:huawei_push/huawei_push.dart' as huawei_push;
|
|
||||||
import 'package:mohem_flutter_app/app_state/app_state.dart';
|
|
||||||
import 'package:mohem_flutter_app/classes/utils.dart';
|
|
||||||
import 'package:permission_handler/permission_handler.dart';
|
|
||||||
|
|
||||||
final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin();
|
|
||||||
|
|
||||||
class AppNotifications {
|
|
||||||
static final AppNotifications _instance = AppNotifications._internal();
|
|
||||||
|
|
||||||
AppNotifications._internal();
|
|
||||||
|
|
||||||
factory AppNotifications() => _instance;
|
|
||||||
|
|
||||||
// late HmsApiAvailability hmsApiAvailability;
|
|
||||||
|
|
||||||
String _huaweiToken = '';
|
|
||||||
|
|
||||||
Future<void> requestPermissions() async {
|
|
||||||
if (Platform.isIOS) {
|
|
||||||
await flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation<IOSFlutterLocalNotificationsPlugin>()?.requestPermissions(alert: true, badge: true, sound: true);
|
|
||||||
} else if (Platform.isAndroid) {
|
|
||||||
AndroidFlutterLocalNotificationsPlugin? androidImplementation = flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation<AndroidFlutterLocalNotificationsPlugin>();
|
|
||||||
bool? granted = await androidImplementation?.requestPermission();
|
|
||||||
if (granted == false) {
|
|
||||||
if (kDebugMode) {
|
|
||||||
print("-------------------- Permission Granted ------------------------");
|
|
||||||
print(granted);
|
|
||||||
}
|
|
||||||
await Permission.notification.request();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void init(String? firebaseToken) async {
|
|
||||||
// if (Platform.isAndroid) {
|
|
||||||
// hmsApiAvailability = HmsApiAvailability();
|
|
||||||
// }
|
|
||||||
|
|
||||||
await requestPermissions();
|
|
||||||
AppState().setDeviceToken = firebaseToken;
|
|
||||||
await Permission.notification.isDenied.then((bool value) {
|
|
||||||
if (value) {
|
|
||||||
Permission.notification.request();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
RemoteMessage? initialMessage = await FirebaseMessaging.instance.getInitialMessage();
|
|
||||||
|
|
||||||
if (initialMessage != null) _handleMessage(initialMessage);
|
|
||||||
|
|
||||||
FirebaseMessaging.onMessage.listen((RemoteMessage message) {
|
|
||||||
if (message.notification != null) _handleMessage(message);
|
|
||||||
});
|
|
||||||
|
|
||||||
FirebaseMessaging.onMessageOpenedApp.listen(_handleOpenApp);
|
|
||||||
|
|
||||||
FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler);
|
|
||||||
|
|
||||||
FirebaseMessaging.instance.onTokenRefresh.listen((String token) {
|
|
||||||
AppState().setDeviceToken = token;
|
|
||||||
});
|
|
||||||
|
|
||||||
if (Platform.isAndroid) {
|
|
||||||
// await hmsApiAvailability.isHMSAvailable().then((value) async {
|
|
||||||
if (!(await Utils.isGoogleServicesAvailable())) {
|
|
||||||
huawei_push.Push.enableLogger();
|
|
||||||
var result = await huawei_push.Push.setAutoInitEnabled(true);
|
|
||||||
|
|
||||||
huawei_push.Push.onNotificationOpenedApp.listen((message) {
|
|
||||||
// newMessage(toFirebaseRemoteMessage(message));
|
|
||||||
}, onError: (e) => print(e.toString()));
|
|
||||||
|
|
||||||
huawei_push.Push.onMessageReceivedStream.listen((message) {
|
|
||||||
// newMessage(toFirebaseRemoteMessage(message));
|
|
||||||
}, onError: (e) => print(e.toString()));
|
|
||||||
}
|
|
||||||
// }).catchError((err) {
|
|
||||||
// print(err);
|
|
||||||
// });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void initHuaweiPush(Function loginCallback) {
|
|
||||||
AppState().setIsHuawei = true;
|
|
||||||
initTokenStream(loginCallback);
|
|
||||||
huawei_push.Push.getToken("");
|
|
||||||
}
|
|
||||||
|
|
||||||
// HUAWEI PUSH TOKEN IMPLEMENTATION
|
|
||||||
void _onTokenEvent(String event) {
|
|
||||||
_huaweiToken = event;
|
|
||||||
AppState().setHuaweiPushToken = _huaweiToken;
|
|
||||||
debugPrint("HUAWEI PUSH TOKEN: $_huaweiToken");
|
|
||||||
}
|
|
||||||
|
|
||||||
void _onTokenError(Object error) {}
|
|
||||||
|
|
||||||
Future<void> initTokenStream(Function loginCallback) async {
|
|
||||||
huawei_push.Push.getTokenStream.listen(_onTokenEvent, onError: _onTokenError).onData((data) {
|
|
||||||
AppState().setHuaweiPushToken = data;
|
|
||||||
debugPrint("HUAWEI PUSH TOKEN: $data");
|
|
||||||
loginCallback();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
void _handleMessage(RemoteMessage message) {
|
|
||||||
Utils.saveStringFromPrefs("isAppOpendByChat", "false");
|
|
||||||
}
|
|
||||||
|
|
||||||
void _handleOpenApp(RemoteMessage message) {
|
|
||||||
if (message.data.isNotEmpty && message.data["type"] == 'chat') {
|
|
||||||
Utils.saveStringFromPrefs("isAppOpendByChat", "true");
|
|
||||||
Utils.saveStringFromPrefs("notificationData", message.data["user_chat_history_response"].toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
AndroidNotificationChannel channel = const AndroidNotificationChannel(
|
|
||||||
"high_importance_channel",
|
|
||||||
"High Importance Notifications",
|
|
||||||
importance: Importance.high,
|
|
||||||
);
|
|
||||||
|
|
||||||
Future<dynamic> backgroundMessageHandler(RemoteMessage message) async {
|
|
||||||
await Firebase.initializeApp();
|
|
||||||
Utils.saveStringFromPrefs("isAppOpendByChat", "false");
|
|
||||||
Utils.saveStringFromPrefs("notificationData", message.data["user_chat_history_response"].toString());
|
|
||||||
if (message.data.isNotEmpty && message.data["type"] == 'call') {
|
|
||||||
// ChatVoipCall().showCallkitIncoming(uuid: const Uuid().v4(), data: message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1 +0,0 @@
|
|||||||
var json = {};
|
|
||||||
@ -1,206 +0,0 @@
|
|||||||
// ignore_for_file: prefer_single_quotes, lines_longer_than_80_chars final
|
|
||||||
// link to generate dart class https://www.webinovers.com/web-tools/json-to-dart-convertor
|
|
||||||
|
|
||||||
Map<String, dynamic> _env = {
|
|
||||||
"appConfig": "lib/config/config_en.json",
|
|
||||||
"login": {
|
|
||||||
"verification": true,
|
|
||||||
"verificationMethod": {
|
|
||||||
"whatsapp": false,
|
|
||||||
},
|
|
||||||
"forgetPassword": false
|
|
||||||
},
|
|
||||||
"bottomBar": false,
|
|
||||||
"dashboard": {
|
|
||||||
"attendance": false,
|
|
||||||
"worklist": true,
|
|
||||||
"ticketBalance": false,
|
|
||||||
"leaveBalance": true,
|
|
||||||
"missingSwipe": false,
|
|
||||||
"monthlyAttendance": false,
|
|
||||||
"vocationRules": false,
|
|
||||||
},
|
|
||||||
"itg": false,
|
|
||||||
"marathon": false,
|
|
||||||
"offersDiscount": false,
|
|
||||||
"myTeams": false,
|
|
||||||
"modifiy": false,
|
|
||||||
"myRequest": false,
|
|
||||||
"pendingTransactions": false,
|
|
||||||
"myProfile": false,
|
|
||||||
"itemsForSale": false,
|
|
||||||
"chat": false,
|
|
||||||
"monthlyAttendance": true,
|
|
||||||
"vocationRules": false,
|
|
||||||
"canEdit": false,
|
|
||||||
};
|
|
||||||
|
|
||||||
Env env = Env.fromJson(_env);
|
|
||||||
|
|
||||||
class Env {
|
|
||||||
Env({
|
|
||||||
required this.appConfig,
|
|
||||||
required this.login,
|
|
||||||
required this.bottomBar,
|
|
||||||
required this.dashboard,
|
|
||||||
required this.itg,
|
|
||||||
required this.marathon,
|
|
||||||
required this.offersDiscount,
|
|
||||||
required this.myTeams,
|
|
||||||
required this.modifiy,
|
|
||||||
required this.myRequest,
|
|
||||||
required this.pendingTransactions,
|
|
||||||
required this.myProfile,
|
|
||||||
required this.itemsForSale,
|
|
||||||
required this.chat,
|
|
||||||
required this.monthlyAttendance,
|
|
||||||
required this.vocationRules,
|
|
||||||
required this.canEdit,
|
|
||||||
});
|
|
||||||
|
|
||||||
late final String appConfig;
|
|
||||||
late final Login login;
|
|
||||||
late final bool bottomBar;
|
|
||||||
late final Dashboard dashboard;
|
|
||||||
late final bool itg;
|
|
||||||
late final bool marathon;
|
|
||||||
late final bool offersDiscount;
|
|
||||||
late final bool myTeams;
|
|
||||||
late final bool modifiy;
|
|
||||||
late final bool myRequest;
|
|
||||||
late final bool pendingTransactions;
|
|
||||||
late final bool myProfile;
|
|
||||||
late final bool itemsForSale;
|
|
||||||
late final bool chat;
|
|
||||||
late final bool monthlyAttendance;
|
|
||||||
late final bool vocationRules;
|
|
||||||
late final bool canEdit;
|
|
||||||
|
|
||||||
Env.fromJson(Map<String, dynamic> json) {
|
|
||||||
appConfig = json['appConfig'];
|
|
||||||
login = Login.fromJson(json['login']);
|
|
||||||
bottomBar = json['bottomBar'];
|
|
||||||
dashboard = Dashboard.fromJson(json['dashboard']);
|
|
||||||
marathon = json['marathon'];
|
|
||||||
itg = json['itg'];
|
|
||||||
offersDiscount = json['offersDiscount'];
|
|
||||||
myTeams = json['myTeams'];
|
|
||||||
modifiy = json['modifiy'];
|
|
||||||
myRequest = json['myRequest'];
|
|
||||||
pendingTransactions = json['pendingTransactions'];
|
|
||||||
myProfile = json['myProfile'];
|
|
||||||
itemsForSale = json['itemsForSale'];
|
|
||||||
chat = json['chat'];
|
|
||||||
monthlyAttendance = json['monthlyAttendance'];
|
|
||||||
vocationRules = json['vocationRules'];
|
|
||||||
canEdit = json['canEdit'];
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
|
||||||
var _data = <String, dynamic>{};
|
|
||||||
_data['appConfig'] = appConfig;
|
|
||||||
_data['login'] = login.toJson();
|
|
||||||
_data['bottomBar'] = bottomBar;
|
|
||||||
_data['dashboard'] = dashboard.toJson();
|
|
||||||
_data['marathon'] = marathon;
|
|
||||||
_data['itg'] = itg;
|
|
||||||
_data['offersDiscount'] = offersDiscount;
|
|
||||||
_data['myTeams'] = myTeams;
|
|
||||||
_data['modifiy'] = modifiy;
|
|
||||||
_data['myRequest'] = myRequest;
|
|
||||||
_data['pendingTransactions'] = pendingTransactions;
|
|
||||||
_data['myProfile'] = myProfile;
|
|
||||||
_data['itemsForSale'] = itemsForSale;
|
|
||||||
_data['chat'] = chat;
|
|
||||||
_data['monthlyAttendance'] = monthlyAttendance;
|
|
||||||
_data['vocationRules'] = vocationRules;
|
|
||||||
_data['canEdit'] = canEdit;
|
|
||||||
return _data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class Login {
|
|
||||||
Login({
|
|
||||||
required this.verification,
|
|
||||||
required this.verificationMethod,
|
|
||||||
required this.forgetPassword,
|
|
||||||
});
|
|
||||||
|
|
||||||
late final bool verification;
|
|
||||||
late final VerificationMethod verificationMethod;
|
|
||||||
late final bool forgetPassword;
|
|
||||||
|
|
||||||
Login.fromJson(Map<String, dynamic> json) {
|
|
||||||
verification = json['verification'];
|
|
||||||
verificationMethod = VerificationMethod.fromJson(json['verificationMethod']);
|
|
||||||
forgetPassword = json['forgetPassword'];
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
|
||||||
var _data = <String, dynamic>{};
|
|
||||||
_data['verification'] = verification;
|
|
||||||
_data['verificationMethod'] = verificationMethod.toJson();
|
|
||||||
_data['forgetPassword'] = forgetPassword;
|
|
||||||
return _data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class VerificationMethod {
|
|
||||||
VerificationMethod({
|
|
||||||
required this.whatsapp,
|
|
||||||
});
|
|
||||||
|
|
||||||
late final bool whatsapp;
|
|
||||||
|
|
||||||
VerificationMethod.fromJson(Map<String, dynamic> json) {
|
|
||||||
whatsapp = json['whatsapp'];
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
|
||||||
var _data = <String, dynamic>{};
|
|
||||||
_data['whatsapp'] = whatsapp;
|
|
||||||
return _data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class Dashboard {
|
|
||||||
Dashboard({
|
|
||||||
required this.attendance,
|
|
||||||
required this.worklist,
|
|
||||||
required this.ticketBalance,
|
|
||||||
required this.leaveBalance,
|
|
||||||
required this.missingSwipe,
|
|
||||||
required this.monthlyAttendance,
|
|
||||||
required this.vocationRules,
|
|
||||||
});
|
|
||||||
|
|
||||||
late final bool attendance;
|
|
||||||
late final bool worklist;
|
|
||||||
late final bool ticketBalance;
|
|
||||||
late final bool leaveBalance;
|
|
||||||
late final bool missingSwipe;
|
|
||||||
late final bool monthlyAttendance;
|
|
||||||
late final bool vocationRules;
|
|
||||||
|
|
||||||
Dashboard.fromJson(Map<String, dynamic> json) {
|
|
||||||
attendance = json['attendance'];
|
|
||||||
worklist = json['worklist'];
|
|
||||||
ticketBalance = json['ticketBalance'];
|
|
||||||
leaveBalance = json['leaveBalance'];
|
|
||||||
missingSwipe = json['missingSwipe'];
|
|
||||||
monthlyAttendance = json['monthlyAttendance'];
|
|
||||||
vocationRules = json['vocationRules'];
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
|
||||||
var _data = <String, dynamic>{};
|
|
||||||
_data['attendance'] = attendance;
|
|
||||||
_data['worklist'] = worklist;
|
|
||||||
_data['ticketBalance'] = ticketBalance;
|
|
||||||
_data['leaveBalance'] = leaveBalance;
|
|
||||||
_data['missingSwipe'] = missingSwipe;
|
|
||||||
_data['monthlyAttendance'] = monthlyAttendance;
|
|
||||||
_data['vocationRules'] = vocationRules;
|
|
||||||
return _data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,45 +0,0 @@
|
|||||||
// To parse this JSON data, do
|
|
||||||
//
|
|
||||||
// final employeeLeavesList = employeeLeavesListFromJson(jsonString);
|
|
||||||
|
|
||||||
import 'dart:convert';
|
|
||||||
|
|
||||||
EmployeeLeavesList employeeLeavesListFromJson(String str) => EmployeeLeavesList.fromJson(json.decode(str));
|
|
||||||
|
|
||||||
String employeeLeavesListToJson(EmployeeLeavesList data) => json.encode(data.toJson());
|
|
||||||
|
|
||||||
class EmployeeLeavesList {
|
|
||||||
EmployeeLeavesList({
|
|
||||||
this.absenceAttendanceTypeName,
|
|
||||||
this.dateEnd,
|
|
||||||
this.dateStart,
|
|
||||||
this.eventDate,
|
|
||||||
this.holidayType,
|
|
||||||
this.leaveType,
|
|
||||||
});
|
|
||||||
|
|
||||||
String? absenceAttendanceTypeName;
|
|
||||||
String? dateEnd;
|
|
||||||
String? dateStart;
|
|
||||||
String? eventDate;
|
|
||||||
String? holidayType;
|
|
||||||
String? leaveType;
|
|
||||||
|
|
||||||
factory EmployeeLeavesList.fromJson(Map<String, dynamic> json) => EmployeeLeavesList(
|
|
||||||
absenceAttendanceTypeName: json["ABSENCE_ATTENDANCE_TYPE_NAME"],
|
|
||||||
dateEnd: json["DATE_END"],
|
|
||||||
dateStart: json["DATE_START"],
|
|
||||||
eventDate: json["EVENT_DATE"],
|
|
||||||
holidayType: json["HOLIDAY_TYPE"],
|
|
||||||
leaveType: json["LEAVE_TYPE"],
|
|
||||||
);
|
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => {
|
|
||||||
"ABSENCE_ATTENDANCE_TYPE_NAME": absenceAttendanceTypeName,
|
|
||||||
"DATE_END": dateEnd,
|
|
||||||
"DATE_START": dateStart,
|
|
||||||
"EVENT_DATE": eventDate,
|
|
||||||
"HOLIDAY_TYPE": holidayType,
|
|
||||||
"LEAVE_TYPE": leaveType,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@ -1,71 +0,0 @@
|
|||||||
class SupervisorHierarchyLists {
|
|
||||||
SupervisorHierarchyLists({
|
|
||||||
this.subordinateHierarchyList,
|
|
||||||
this.supervisorHierarchyList,
|
|
||||||
});
|
|
||||||
|
|
||||||
List<HierarchyList>? subordinateHierarchyList;
|
|
||||||
List<HierarchyList>? supervisorHierarchyList;
|
|
||||||
|
|
||||||
factory SupervisorHierarchyLists.fromJson(Map<String, dynamic> json) => SupervisorHierarchyLists(
|
|
||||||
subordinateHierarchyList: json["SubordinateHierarchyList"] == null ? [] : List<HierarchyList>.from(json["SubordinateHierarchyList"]!.map((x) => HierarchyList.fromJson(x))),
|
|
||||||
supervisorHierarchyList: json["SupervisorHierarchyList"] == null ? [] : List<HierarchyList>.from(json["SupervisorHierarchyList"]!.map((x) => HierarchyList.fromJson(x))),
|
|
||||||
);
|
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => {
|
|
||||||
"SubordinateHierarchyList": subordinateHierarchyList == null ? [] : List<dynamic>.from(subordinateHierarchyList!.map((x) => x.toJson())),
|
|
||||||
"SupervisorHierarchyList": supervisorHierarchyList == null ? [] : List<dynamic>.from(supervisorHierarchyList!.map((x) => x.toJson())),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
class HierarchyList {
|
|
||||||
HierarchyList({
|
|
||||||
this.employeeEmailAddress,
|
|
||||||
this.employeeImage,
|
|
||||||
this.employeeMobileNumber,
|
|
||||||
this.employeeName,
|
|
||||||
this.employeeNumber,
|
|
||||||
this.employeeWorkNumber,
|
|
||||||
this.lvl,
|
|
||||||
this.numOfSubordinates,
|
|
||||||
this.organizationName,
|
|
||||||
this.positionName,
|
|
||||||
});
|
|
||||||
|
|
||||||
String? employeeEmailAddress;
|
|
||||||
dynamic employeeImage;
|
|
||||||
String? employeeMobileNumber;
|
|
||||||
String? employeeName;
|
|
||||||
String? employeeNumber;
|
|
||||||
String? employeeWorkNumber;
|
|
||||||
int? lvl;
|
|
||||||
int? numOfSubordinates;
|
|
||||||
String? organizationName;
|
|
||||||
String? positionName;
|
|
||||||
|
|
||||||
factory HierarchyList.fromJson(Map<String, dynamic> json) => HierarchyList(
|
|
||||||
employeeEmailAddress: json["EMPLOYEE_EMAIL_ADDRESS"],
|
|
||||||
employeeImage: json["EMPLOYEE_IMAGE"],
|
|
||||||
employeeMobileNumber: json["EMPLOYEE_MOBILE_NUMBER"],
|
|
||||||
employeeName: json["EMPLOYEE_NAME"],
|
|
||||||
employeeNumber: json["EMPLOYEE_NUMBER"],
|
|
||||||
employeeWorkNumber: json["EMPLOYEE_WORK_NUMBER"],
|
|
||||||
lvl: json["LVL"],
|
|
||||||
numOfSubordinates: json["NUM_OF_SUBORDINATES"],
|
|
||||||
organizationName: json["ORGANIZATION_NAME"],
|
|
||||||
positionName: json["POSITION_NAME"],
|
|
||||||
);
|
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => {
|
|
||||||
"EMPLOYEE_EMAIL_ADDRESS": employeeEmailAddress,
|
|
||||||
"EMPLOYEE_IMAGE": employeeImage,
|
|
||||||
"EMPLOYEE_MOBILE_NUMBER": employeeMobileNumber,
|
|
||||||
"EMPLOYEE_NAME": employeeName,
|
|
||||||
"EMPLOYEE_NUMBER": employeeNumber,
|
|
||||||
"EMPLOYEE_WORK_NUMBER": employeeWorkNumber,
|
|
||||||
"LVL": lvl,
|
|
||||||
"NUM_OF_SUBORDINATES": numOfSubordinates,
|
|
||||||
"ORGANIZATION_NAME": organizationName,
|
|
||||||
"POSITION_NAME": positionName,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@ -1,192 +1,96 @@
|
|||||||
class OffersListModel {
|
class OffersListModel {
|
||||||
int? offersDiscountId;
|
String? title;
|
||||||
String? titleEn;
|
String? titleAR;
|
||||||
String? titleAr;
|
String? description;
|
||||||
String? descriptionEn;
|
String? descriptionAR;
|
||||||
String? descriptionAr;
|
|
||||||
String? startDate;
|
String? startDate;
|
||||||
String? endDate;
|
String? endDate;
|
||||||
int? categoryId;
|
String? logo;
|
||||||
|
String? bannerImage;
|
||||||
|
String? discount;
|
||||||
|
String? rowID;
|
||||||
String? categoryNameEn;
|
String? categoryNameEn;
|
||||||
String? categoryNameAr;
|
String? categoryNameAr;
|
||||||
String? discount;
|
String? categoryID;
|
||||||
String? location;
|
String? isHasLocation;
|
||||||
int? statusId;
|
|
||||||
String? statusTitle;
|
|
||||||
bool? isHasLocation;
|
|
||||||
String? discountDescription;
|
|
||||||
String? websiteUrl;
|
|
||||||
bool? bookMarked;
|
|
||||||
bool? isHotDeal;
|
|
||||||
List<OffersDiscountImageColl>? offersDiscountImageColl;
|
|
||||||
dynamic locationList;
|
|
||||||
String? created;
|
String? created;
|
||||||
String? bannerImage;
|
String? publishedDesc;
|
||||||
String? logo;
|
String? published;
|
||||||
bool? isActive;
|
String? expireAfter;
|
||||||
int? pageSize;
|
String? status;
|
||||||
int? pageNo;
|
String? isActive;
|
||||||
int? languageId;
|
String? totalItems;
|
||||||
|
|
||||||
OffersListModel(
|
OffersListModel(
|
||||||
{this.offersDiscountId,
|
{this.title,
|
||||||
this.titleEn,
|
this.titleAR,
|
||||||
this.titleAr,
|
this.description,
|
||||||
this.descriptionEn,
|
this.descriptionAR,
|
||||||
this.descriptionAr,
|
|
||||||
this.startDate,
|
this.startDate,
|
||||||
this.endDate,
|
this.endDate,
|
||||||
this.categoryId,
|
this.logo,
|
||||||
|
this.bannerImage,
|
||||||
|
this.discount,
|
||||||
|
this.rowID,
|
||||||
this.categoryNameEn,
|
this.categoryNameEn,
|
||||||
this.categoryNameAr,
|
this.categoryNameAr,
|
||||||
this.discount,
|
this.categoryID,
|
||||||
this.location,
|
|
||||||
this.statusId,
|
|
||||||
this.statusTitle,
|
|
||||||
this.isHasLocation,
|
this.isHasLocation,
|
||||||
this.discountDescription,
|
|
||||||
this.websiteUrl,
|
|
||||||
this.bookMarked,
|
|
||||||
this.isHotDeal,
|
|
||||||
this.offersDiscountImageColl,
|
|
||||||
this.locationList,
|
|
||||||
this.created,
|
this.created,
|
||||||
this.bannerImage,
|
this.publishedDesc,
|
||||||
this.logo,
|
this.published,
|
||||||
|
this.expireAfter,
|
||||||
|
this.status,
|
||||||
this.isActive,
|
this.isActive,
|
||||||
this.pageSize,
|
this.totalItems});
|
||||||
this.pageNo,
|
|
||||||
this.languageId});
|
|
||||||
|
|
||||||
OffersListModel.fromJson(Map<String, dynamic> json) {
|
OffersListModel.fromJson(Map<String, dynamic> json) {
|
||||||
offersDiscountId = json['offersDiscountId'];
|
title = json['Title'];
|
||||||
titleEn = json['titleEn'];
|
titleAR = json['Title_AR'];
|
||||||
titleAr = json['titleAr'];
|
description = json['Description'];
|
||||||
descriptionEn = json['descriptionEn'];
|
descriptionAR = json['Description_AR'];
|
||||||
descriptionAr = json['descriptionAr'];
|
startDate = json['Start Date'];
|
||||||
startDate = json['startDate'];
|
endDate = json['End Date'];
|
||||||
endDate = json['endDate'];
|
logo = json['Logo'];
|
||||||
categoryId = json['categoryId'];
|
bannerImage = json['Banner_Image'];
|
||||||
|
discount = json['Discount'];
|
||||||
|
rowID = json['rowID'];
|
||||||
categoryNameEn = json['categoryName_en'];
|
categoryNameEn = json['categoryName_en'];
|
||||||
categoryNameAr = json['categoryName_ar'];
|
categoryNameAr = json['categoryName_ar'];
|
||||||
discount = json['discount'];
|
categoryID = json['categoryID'];
|
||||||
location = json['location'];
|
isHasLocation = json['IsHasLocation'];
|
||||||
statusId = json['statusId'];
|
|
||||||
statusTitle = json['statusTitle'];
|
|
||||||
isHasLocation = json['isHasLocation'];
|
|
||||||
discountDescription = json['discountDescription'];
|
|
||||||
websiteUrl = json['websiteUrl'];
|
|
||||||
bookMarked = json['bookMarked'];
|
|
||||||
isHotDeal = json['isHotDeal'];
|
|
||||||
if (json['offersDiscountImageColl'] != null) {
|
|
||||||
offersDiscountImageColl = <OffersDiscountImageColl>[];
|
|
||||||
json['offersDiscountImageColl'].forEach((v) {
|
|
||||||
offersDiscountImageColl!.add(new OffersDiscountImageColl.fromJson(v));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
locationList = json['locationList'];
|
|
||||||
created = json['created'];
|
created = json['created'];
|
||||||
bannerImage = json['banner_Image'];
|
publishedDesc = json['PublishedDesc'];
|
||||||
logo = json['logo'];
|
published = json['Published'];
|
||||||
isActive = json['isActive'];
|
expireAfter = json['ExpireAfter'];
|
||||||
pageSize = json['pageSize'];
|
status = json['Status'];
|
||||||
pageNo = json['pageNo'];
|
isActive = json['IsActive'];
|
||||||
languageId = json['languageId'];
|
totalItems = json['TotalItems'];
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
Map<String, dynamic> data = new Map<String, dynamic>();
|
Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
data['offersDiscountId'] = this.offersDiscountId;
|
data['Title'] = this.title;
|
||||||
data['titleEn'] = this.titleEn;
|
data['Title_AR'] = this.titleAR;
|
||||||
data['titleAr'] = this.titleAr;
|
data['Description'] = this.description;
|
||||||
data['descriptionEn'] = this.descriptionEn;
|
data['Description_AR'] = this.descriptionAR;
|
||||||
data['descriptionAr'] = this.descriptionAr;
|
data['Start Date'] = this.startDate;
|
||||||
data['startDate'] = this.startDate;
|
data['End Date'] = this.endDate;
|
||||||
data['endDate'] = this.endDate;
|
data['Logo'] = this.logo;
|
||||||
data['categoryId'] = this.categoryId;
|
data['Banner_Image'] = this.bannerImage;
|
||||||
|
data['Discount'] = this.discount;
|
||||||
|
data['rowID'] = this.rowID;
|
||||||
data['categoryName_en'] = this.categoryNameEn;
|
data['categoryName_en'] = this.categoryNameEn;
|
||||||
data['categoryName_ar'] = this.categoryNameAr;
|
data['categoryName_ar'] = this.categoryNameAr;
|
||||||
data['discount'] = this.discount;
|
data['categoryID'] = this.categoryID;
|
||||||
data['location'] = this.location;
|
data['IsHasLocation'] = this.isHasLocation;
|
||||||
data['statusId'] = this.statusId;
|
|
||||||
data['statusTitle'] = this.statusTitle;
|
|
||||||
data['isHasLocation'] = this.isHasLocation;
|
|
||||||
data['discountDescription'] = this.discountDescription;
|
|
||||||
data['websiteUrl'] = this.websiteUrl;
|
|
||||||
data['bookMarked'] = this.bookMarked;
|
|
||||||
data['isHotDeal'] = this.isHotDeal;
|
|
||||||
if (this.offersDiscountImageColl != null) {
|
|
||||||
data['offersDiscountImageColl'] = this.offersDiscountImageColl!.map((v) => v.toJson()).toList();
|
|
||||||
}
|
|
||||||
data['locationList'] = this.locationList;
|
|
||||||
data['created'] = this.created;
|
data['created'] = this.created;
|
||||||
data['banner_Image'] = this.bannerImage;
|
data['PublishedDesc'] = this.publishedDesc;
|
||||||
data['logo'] = this.logo;
|
data['Published'] = this.published;
|
||||||
data['isActive'] = this.isActive;
|
data['ExpireAfter'] = this.expireAfter;
|
||||||
data['pageSize'] = this.pageSize;
|
data['Status'] = this.status;
|
||||||
data['pageNo'] = this.pageNo;
|
data['IsActive'] = this.isActive;
|
||||||
data['languageId'] = this.languageId;
|
data['TotalItems'] = this.totalItems;
|
||||||
return data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class OffersDiscountImageColl {
|
|
||||||
int? imageAttachmentId;
|
|
||||||
String? fileName;
|
|
||||||
String? contentType;
|
|
||||||
String? attachFileStream;
|
|
||||||
String? base64String;
|
|
||||||
int? referenceItemId;
|
|
||||||
String? filePath;
|
|
||||||
String? imageTag;
|
|
||||||
bool? isActive;
|
|
||||||
int? pageSize;
|
|
||||||
int? pageNo;
|
|
||||||
int? languageId;
|
|
||||||
|
|
||||||
OffersDiscountImageColl(
|
|
||||||
{this.imageAttachmentId,
|
|
||||||
this.fileName,
|
|
||||||
this.contentType,
|
|
||||||
this.attachFileStream,
|
|
||||||
this.base64String,
|
|
||||||
this.referenceItemId,
|
|
||||||
this.filePath,
|
|
||||||
this.imageTag,
|
|
||||||
this.isActive,
|
|
||||||
this.pageSize,
|
|
||||||
this.pageNo,
|
|
||||||
this.languageId});
|
|
||||||
|
|
||||||
OffersDiscountImageColl.fromJson(Map<String, dynamic> json) {
|
|
||||||
imageAttachmentId = json['imageAttachmentId'];
|
|
||||||
fileName = json['fileName'];
|
|
||||||
contentType = json['contentType'];
|
|
||||||
attachFileStream = json['attachFileStream'];
|
|
||||||
base64String = json['base64String'];
|
|
||||||
referenceItemId = json['referenceItemId'];
|
|
||||||
filePath = json['filePath'];
|
|
||||||
imageTag = json['imageTag'];
|
|
||||||
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['imageAttachmentId'] = this.imageAttachmentId;
|
|
||||||
data['fileName'] = this.fileName;
|
|
||||||
data['contentType'] = this.contentType;
|
|
||||||
data['attachFileStream'] = this.attachFileStream;
|
|
||||||
data['base64String'] = this.base64String;
|
|
||||||
data['referenceItemId'] = this.referenceItemId;
|
|
||||||
data['filePath'] = this.filePath;
|
|
||||||
data['imageTag'] = this.imageTag;
|
|
||||||
data['isActive'] = this.isActive;
|
|
||||||
data['pageSize'] = this.pageSize;
|
|
||||||
data['pageNo'] = this.pageNo;
|
|
||||||
data['languageId'] = this.languageId;
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,41 +0,0 @@
|
|||||||
// To parse this JSON data, do
|
|
||||||
//
|
|
||||||
// final employeeQualificationsList = employeeQualificationsListFromJson(jsonString);
|
|
||||||
|
|
||||||
import 'dart:convert';
|
|
||||||
|
|
||||||
EmployeeQualificationsList employeeQualificationsListFromJson(String str) => EmployeeQualificationsList.fromJson(json.decode(str));
|
|
||||||
|
|
||||||
String employeeQualificationsListToJson(EmployeeQualificationsList data) => json.encode(data.toJson());
|
|
||||||
|
|
||||||
class EmployeeQualificationsList {
|
|
||||||
EmployeeQualificationsList({
|
|
||||||
this.establishment,
|
|
||||||
this.grade,
|
|
||||||
this.gradeDescription,
|
|
||||||
this.qualificationType,
|
|
||||||
this.status,
|
|
||||||
});
|
|
||||||
|
|
||||||
String? establishment;
|
|
||||||
String? grade;
|
|
||||||
String? gradeDescription;
|
|
||||||
String? qualificationType;
|
|
||||||
String? status;
|
|
||||||
|
|
||||||
factory EmployeeQualificationsList.fromJson(Map<String, dynamic> json) => EmployeeQualificationsList(
|
|
||||||
establishment: json["ESTABLISHMENT"],
|
|
||||||
grade: json["GRADE"],
|
|
||||||
gradeDescription: json["GRADE_DESCRIPTION"],
|
|
||||||
qualificationType: json["QUALIFICATION_TYPE"],
|
|
||||||
status: json["STATUS"],
|
|
||||||
);
|
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => {
|
|
||||||
"ESTABLISHMENT": establishment,
|
|
||||||
"GRADE": grade,
|
|
||||||
"GRADE_DESCRIPTION": gradeDescription,
|
|
||||||
"QUALIFICATION_TYPE": qualificationType,
|
|
||||||
"STATUS": status,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@ -1,187 +0,0 @@
|
|||||||
import 'dart:convert';
|
|
||||||
import 'dart:ui';
|
|
||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/foundation.dart';
|
|
||||||
import 'package:flutter_webrtc/flutter_webrtc.dart';
|
|
||||||
import 'package:mohem_flutter_app/ui/landing/dashboard_screen.dart';
|
|
||||||
|
|
||||||
class ChatCallProvider with ChangeNotifier, DiagnosticableTreeMixin {
|
|
||||||
///////////////////// Web RTC Video Calling //////////////////////
|
|
||||||
// Video Call
|
|
||||||
late RTCPeerConnection _peerConnection;
|
|
||||||
RTCVideoRenderer _localVideoRenderer = RTCVideoRenderer();
|
|
||||||
final RTCVideoRenderer _remoteRenderer = RTCVideoRenderer();
|
|
||||||
|
|
||||||
MediaStream? _localStream;
|
|
||||||
MediaStream? _remoteStream;
|
|
||||||
|
|
||||||
void initCallListeners() {
|
|
||||||
chatHubConnection.on("OnCallAcceptedAsync", onCallAcceptedAsync);
|
|
||||||
chatHubConnection.on("OnIceCandidateAsync", onIceCandidateAsync);
|
|
||||||
chatHubConnection.on("OnOfferAsync", onOfferAsync);
|
|
||||||
chatHubConnection.on("OnAnswerOffer", onAnswerOffer);
|
|
||||||
chatHubConnection.on("OnHangUpAsync", onHangUpAsync);
|
|
||||||
chatHubConnection.on("OnCallDeclinedAsync", onCallDeclinedAsync);
|
|
||||||
}
|
|
||||||
|
|
||||||
//Video Constraints
|
|
||||||
var videoConstraints = {
|
|
||||||
"video": {
|
|
||||||
"mandatory": {
|
|
||||||
"width": {"min": 320},
|
|
||||||
"height": {"min": 180}
|
|
||||||
},
|
|
||||||
"optional": [
|
|
||||||
{
|
|
||||||
"width": {"max": 1280}
|
|
||||||
},
|
|
||||||
{"frameRate": 25},
|
|
||||||
{"facingMode": "user"}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"frameRate": 25,
|
|
||||||
"width": 420, //420,//640,//1280,
|
|
||||||
"height": 240 //240//480//720
|
|
||||||
};
|
|
||||||
|
|
||||||
// Audio Constraints
|
|
||||||
var audioConstraints = {
|
|
||||||
"sampleRate": 8000,
|
|
||||||
"sampleSize": 16,
|
|
||||||
"channelCount": 2,
|
|
||||||
"echoCancellation": true,
|
|
||||||
"audio": true,
|
|
||||||
};
|
|
||||||
|
|
||||||
Future<RTCPeerConnection> _createPeerConnection() async {
|
|
||||||
// {"url": "stun:stun.l.google.com:19302"},
|
|
||||||
Map<String, dynamic> configuration = {
|
|
||||||
"iceServers": [
|
|
||||||
{"urls": 'stun:15.185.116.59:3478'},
|
|
||||||
{"urls": "turn:15.185.116.59:3479", "username": "admin", "credential": "admin"}
|
|
||||||
]
|
|
||||||
};
|
|
||||||
|
|
||||||
Map<String, dynamic> offerSdpConstraints = {
|
|
||||||
"mandatory": {
|
|
||||||
"OfferToReceiveAudio": true,
|
|
||||||
"OfferToReceiveVideo": true,
|
|
||||||
},
|
|
||||||
"optional": [],
|
|
||||||
};
|
|
||||||
|
|
||||||
RTCPeerConnection pc = await createPeerConnection(configuration, offerSdpConstraints);
|
|
||||||
// if (pc != null) print(pc);
|
|
||||||
//pc.addStream(widget.localStream);
|
|
||||||
|
|
||||||
pc.onIceCandidate = (e) {
|
|
||||||
if (e.candidate != null) {
|
|
||||||
print(json.encode({
|
|
||||||
'candidate': e.candidate.toString(),
|
|
||||||
'sdpMid': e.sdpMid.toString(),
|
|
||||||
'sdpMlineIndex': e.sdpMLineIndex,
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
pc.onIceConnectionState = (e) {
|
|
||||||
print(e);
|
|
||||||
};
|
|
||||||
pc.onAddStream = (stream) {
|
|
||||||
print('addStream: ' + stream.id);
|
|
||||||
_remoteRenderer.srcObject = stream;
|
|
||||||
};
|
|
||||||
return pc;
|
|
||||||
}
|
|
||||||
|
|
||||||
void init() {
|
|
||||||
initRenderers();
|
|
||||||
_createPeerConnection().then((pc) {
|
|
||||||
_peerConnection = pc;
|
|
||||||
// _setRemoteDescription(widget.info);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
void initRenderers() {
|
|
||||||
_localVideoRenderer.initialize();
|
|
||||||
_remoteRenderer.initialize();
|
|
||||||
initLocalCamera();
|
|
||||||
}
|
|
||||||
|
|
||||||
void initLocalCamera() async {
|
|
||||||
_localStream = await navigator.mediaDevices.getUserMedia({'video': true, 'audio': true});
|
|
||||||
_localVideoRenderer.srcObject = _localStream;
|
|
||||||
// _localVideoRenderer.srcObject = await navigator.mediaDevices
|
|
||||||
// .getUserMedia({'video': true, 'audio': true});
|
|
||||||
print('this source Object');
|
|
||||||
print('this suarce ${_localVideoRenderer.srcObject != null}');
|
|
||||||
notifyListeners();
|
|
||||||
}
|
|
||||||
|
|
||||||
void startCall({required String callType}) {}
|
|
||||||
|
|
||||||
void endCall() {}
|
|
||||||
|
|
||||||
void checkCall(Map<String, dynamic> message) {
|
|
||||||
switch (message["callStatus"]) {
|
|
||||||
case 'connected':
|
|
||||||
{}
|
|
||||||
break;
|
|
||||||
case 'offer':
|
|
||||||
{}
|
|
||||||
break;
|
|
||||||
case 'accept':
|
|
||||||
{}
|
|
||||||
break;
|
|
||||||
case 'candidate':
|
|
||||||
{}
|
|
||||||
break;
|
|
||||||
case 'bye':
|
|
||||||
{}
|
|
||||||
break;
|
|
||||||
case 'leave':
|
|
||||||
{}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//// Listeners Methods ////
|
|
||||||
|
|
||||||
void onCallAcceptedAsync(List<Object?>? params) {}
|
|
||||||
|
|
||||||
void onIceCandidateAsync(List<Object?>? params) {}
|
|
||||||
|
|
||||||
void onOfferAsync(List<Object?>? params) {}
|
|
||||||
|
|
||||||
void onAnswerOffer(List<Object?>? params) {}
|
|
||||||
|
|
||||||
void onHangUpAsync(List<Object?>? params) {}
|
|
||||||
|
|
||||||
void onCallDeclinedAsync(List<Object?>? params) {}
|
|
||||||
|
|
||||||
//// Invoke Methods
|
|
||||||
|
|
||||||
Future<void> invoke({required String invokeMethod, required String currentUserID, required String targetUserID, bool isVideoCall = false, var data}) async {
|
|
||||||
List<Object> args = [];
|
|
||||||
if (invokeMethod == "answerCallAsync") {
|
|
||||||
args = [currentUserID, targetUserID];
|
|
||||||
} else if (invokeMethod == "CallUserAsync") {
|
|
||||||
args = [currentUserID, targetUserID, isVideoCall];
|
|
||||||
} else if (invokeMethod == "IceCandidateAsync") {
|
|
||||||
args = [targetUserID, data];
|
|
||||||
} else if (invokeMethod == "OfferAsync") {
|
|
||||||
args = [targetUserID, data];
|
|
||||||
} else if (invokeMethod == "AnswerOfferAsync") {
|
|
||||||
args = [targetUserID, data];
|
|
||||||
//json In Data
|
|
||||||
}
|
|
||||||
await chatHubConnection.invoke(invokeMethod, args: args);
|
|
||||||
}
|
|
||||||
|
|
||||||
void stopListeners() async {
|
|
||||||
chatHubConnection.off('OnCallDeclinedAsync');
|
|
||||||
chatHubConnection.off('OnCallAcceptedAsync');
|
|
||||||
chatHubConnection.off('OnIceCandidateAsync');
|
|
||||||
chatHubConnection.off('OnAnswerOffer');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,358 +0,0 @@
|
|||||||
import 'package:easy_localization/easy_localization.dart';
|
|
||||||
import 'package:easy_localization/src/public_ext.dart';
|
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter/painting.dart';
|
|
||||||
import 'package:flutter_html/flutter_html.dart';
|
|
||||||
import 'package:intl/intl.dart';
|
|
||||||
import 'package:mohem_flutter_app/api/monthly_attendance_api_client.dart';
|
|
||||||
import 'package:mohem_flutter_app/classes/colors.dart';
|
|
||||||
import 'package:mohem_flutter_app/classes/date_uitl.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/employee_leaves_list.dart';
|
|
||||||
import 'package:mohem_flutter_app/models/get_day_hours_type_details_list_model.dart';
|
|
||||||
import 'package:mohem_flutter_app/models/get_schedule_shifts_details_list_model.dart';
|
|
||||||
import 'package:mohem_flutter_app/models/get_time_card_summary_list_model.dart';
|
|
||||||
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
|
|
||||||
import 'package:mohem_flutter_app/widgets/circular_step_progress_bar.dart';
|
|
||||||
import 'package:month_picker_dialog_2/month_picker_dialog_2.dart';
|
|
||||||
import 'package:pie_chart/pie_chart.dart';
|
|
||||||
import 'package:sizer/sizer.dart';
|
|
||||||
import 'package:syncfusion_flutter_calendar/calendar.dart';
|
|
||||||
|
|
||||||
enum LeaveType { ABSENCE, BUSINESS_TRIP, HOLIDAY, NORMAL }
|
|
||||||
|
|
||||||
class MoeMonthlyAttendanceScreen extends StatefulWidget {
|
|
||||||
@override
|
|
||||||
State<MoeMonthlyAttendanceScreen> createState() => _MoeMonthlyAttendanceScreenState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _MoeMonthlyAttendanceScreenState extends State<MoeMonthlyAttendanceScreen> {
|
|
||||||
DateTime currentDate = DateTime.now();
|
|
||||||
int searchYear = DateTime.now().year;
|
|
||||||
final CalendarController _calendarController = CalendarController();
|
|
||||||
|
|
||||||
List<EmployeeLeavesList> employeeLeavesList = [];
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
getLeavesData(currentDate);
|
|
||||||
// callTimeCardAndHourDetails(date.day, searchMonth, searchYear);
|
|
||||||
}
|
|
||||||
|
|
||||||
void getLeavesData(DateTime date) async {
|
|
||||||
try {
|
|
||||||
Utils.showLoading(context);
|
|
||||||
String startDate = '${date.year}-${date.month}-${date.day}';
|
|
||||||
int lastday = DateTime(date.year, date.month + 1, 0).day;
|
|
||||||
String endDate = '${date.year}-${date.month}-$lastday';
|
|
||||||
employeeLeavesList = await MonthlyAttendanceApiClient().getEmployeeLeaves(startDate, endDate);
|
|
||||||
Utils.hideLoading(context);
|
|
||||||
_calendarController.displayDate = date;
|
|
||||||
setState(() {});
|
|
||||||
} catch (ex) {
|
|
||||||
Utils.hideLoading(context);
|
|
||||||
Utils.handleException(ex, context, null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Scaffold(
|
|
||||||
backgroundColor: Colors.white,
|
|
||||||
appBar: AppBarWidget(
|
|
||||||
context,
|
|
||||||
// title: LocaleKeys.mowadhafhiRequest.tr(),
|
|
||||||
title: "",
|
|
||||||
// showHomeButton: true,
|
|
||||||
),
|
|
||||||
body: ListView(
|
|
||||||
scrollDirection: Axis.vertical,
|
|
||||||
children: [
|
|
||||||
Column(
|
|
||||||
children: [
|
|
||||||
Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
LocaleKeys.attendance.tr().toText24(isBold: true, color: MyColors.grey3AColor),
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
"${DateFormat("MMMM-yyyy").format(currentDate)}".toText16(color: MyColors.greyACColor),
|
|
||||||
const Icon(Icons.keyboard_arrow_down_rounded, color: MyColors.greyACColor),
|
|
||||||
],
|
|
||||||
).onPress(() async {
|
|
||||||
showMonthPicker(
|
|
||||||
context: context,
|
|
||||||
//locale: EasyLocalization.of(context)?.locale,
|
|
||||||
initialDate: currentDate,
|
|
||||||
firstDate: DateTime(searchYear - 2),
|
|
||||||
lastDate: DateTime.now(),
|
|
||||||
confirmText: Text(LocaleKeys.confirm.tr()),
|
|
||||||
cancelText: Text(LocaleKeys.cancel.tr()),
|
|
||||||
).then((selectedDate) {
|
|
||||||
if (selectedDate != null) {
|
|
||||||
getLeavesData(selectedDate);
|
|
||||||
setState(() {
|
|
||||||
currentDate = selectedDate;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}),
|
|
||||||
18.height,
|
|
||||||
AspectRatio(aspectRatio: 304 / 244, child: calendarWidget()),
|
|
||||||
12.height,
|
|
||||||
SizedBox(
|
|
||||||
width: double.infinity,
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
||||||
children: [
|
|
||||||
showColorItem("Absence", MyColors.pinkDarkColor),
|
|
||||||
showColorItem("Business Trip", MyColors.gradiantStartColor),
|
|
||||||
showColorItem("Holiday", MyColors.gradiantEndColor),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
).paddingOnly(left: 21, right: 21, top: 21),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget showColorItem(String title, Color color) {
|
|
||||||
return Row(
|
|
||||||
children: [
|
|
||||||
Container(
|
|
||||||
width: 20,
|
|
||||||
height: 20,
|
|
||||||
color: color,
|
|
||||||
).circle(2000),
|
|
||||||
8.width,
|
|
||||||
title.toText12()
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget calendarWidget() {
|
|
||||||
return SfCalendar(
|
|
||||||
view: CalendarView.month,
|
|
||||||
showDatePickerButton: false,
|
|
||||||
controller: _calendarController,
|
|
||||||
backgroundColor: Colors.white,
|
|
||||||
headerHeight: 0,
|
|
||||||
viewNavigationMode: ViewNavigationMode.none,
|
|
||||||
todayHighlightColor: MyColors.grey3AColor,
|
|
||||||
showNavigationArrow: false,
|
|
||||||
showCurrentTimeIndicator: false,
|
|
||||||
showWeekNumber: false,
|
|
||||||
cellBorderColor: Colors.white,
|
|
||||||
onTap: (v) {
|
|
||||||
dynamic index = v.date?.day;
|
|
||||||
if (index != null) {
|
|
||||||
index = index - 1;
|
|
||||||
}
|
|
||||||
EmployeeLeavesList leaves = employeeLeavesList[index];
|
|
||||||
if (leaves.leaveType != LeaveType.NORMAL.name) {
|
|
||||||
showModalBottomSheet(
|
|
||||||
context: context,
|
|
||||||
shape: const RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.only(
|
|
||||||
topLeft: Radius.circular(25.0),
|
|
||||||
topRight: Radius.circular(25.0),
|
|
||||||
)),
|
|
||||||
isScrollControlled: true,
|
|
||||||
backgroundColor: MyColors.white,
|
|
||||||
builder: (_) {
|
|
||||||
return DraggableScrollableSheet(
|
|
||||||
maxChildSize: 0.75,
|
|
||||||
expand: false,
|
|
||||||
initialChildSize: 0.75,
|
|
||||||
builder: (_, controller) {
|
|
||||||
return Column(
|
|
||||||
children: [
|
|
||||||
Container(
|
|
||||||
width: 49,
|
|
||||||
height: 7,
|
|
||||||
margin: const EdgeInsets.symmetric(vertical: 10),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(25),
|
|
||||||
color: MyColors.darkGreyColor,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
16.height,
|
|
||||||
Container(
|
|
||||||
padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 40),
|
|
||||||
margin: const EdgeInsets.only(left: 20, right: 20),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
border: Border.all(
|
|
||||||
color: Colors.black,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(12)),
|
|
||||||
child: Column(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
DateUtil.getWeekDay(DateUtil.convertStringToDateTime(leaves.eventDate ?? "").weekday).toString().toText14(),
|
|
||||||
DateUtil.convertStringToDateTime(leaves.eventDate ?? "").day.toString().toText20(),
|
|
||||||
DateUtil.getMonth(DateUtil.convertStringToDateTime(leaves.eventDate ?? "").month).toString().toText14(),
|
|
||||||
DateUtil.convertStringToDateTime(leaves.eventDate ?? "").year.toString().toText14(),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
6.height,
|
|
||||||
showText(LocaleKeys.leaveType.tr(), leaves.leaveType.toString()),
|
|
||||||
// if (leaves.absenceAttendanceTypeName.toString().isNotEmpty)
|
|
||||||
// const Divider(
|
|
||||||
// color: MyColors.borderCEColor,
|
|
||||||
// ),
|
|
||||||
// if (leaves.absenceAttendanceTypeName.toString().isNotEmpty) showText(LocaleKeys.attendanceType.tr(), leaves.absenceAttendanceTypeName.toString()),
|
|
||||||
const Divider(
|
|
||||||
color: MyColors.borderCEColor,
|
|
||||||
),
|
|
||||||
showText(LocaleKeys.startDateT.tr(), leaves.dateStart.toString()),
|
|
||||||
const Divider(
|
|
||||||
color: MyColors.borderCEColor,
|
|
||||||
),
|
|
||||||
showText(LocaleKeys.endDate.tr(), leaves.dateEnd.toString()),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
selectionDecoration: BoxDecoration(
|
|
||||||
border: Border.all(color: MyColors.white, width: 1),
|
|
||||||
shape: BoxShape.circle,
|
|
||||||
),
|
|
||||||
dataSource: MeetingDataSource(_getDataSource()),
|
|
||||||
// onTap: calendarTapped,
|
|
||||||
monthViewSettings: const MonthViewSettings(
|
|
||||||
dayFormat: 'EEE',
|
|
||||||
showTrailingAndLeadingDates: false,
|
|
||||||
showAgenda: false,
|
|
||||||
),
|
|
||||||
viewHeaderStyle: const ViewHeaderStyle(
|
|
||||||
dayTextStyle: TextStyle(color: MyColors.grey3AColor, fontSize: 13, fontWeight: FontWeight.w600),
|
|
||||||
),
|
|
||||||
monthCellBuilder: (build, details) {
|
|
||||||
LeaveType leaveType = LeaveType.NORMAL;
|
|
||||||
for (int i = 0; i < employeeLeavesList.length; i++) {
|
|
||||||
if (details.date.day == DateUtil.convertSimpleStringDateToDateddMMyyyy(employeeLeavesList[i].eventDate ?? "").day) {
|
|
||||||
if (employeeLeavesList[i].leaveType == LeaveType.ABSENCE.name) {
|
|
||||||
leaveType = LeaveType.ABSENCE;
|
|
||||||
} else if (employeeLeavesList[i].leaveType == LeaveType.BUSINESS_TRIP.name) {
|
|
||||||
leaveType = LeaveType.BUSINESS_TRIP;
|
|
||||||
} else if (employeeLeavesList[i].leaveType == LeaveType.HOLIDAY.name) {
|
|
||||||
leaveType = LeaveType.HOLIDAY;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return Container(
|
|
||||||
margin: const EdgeInsets.all(4),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: leaveType == LeaveType.ABSENCE
|
|
||||||
? MyColors.pinkDarkColor
|
|
||||||
: leaveType == LeaveType.BUSINESS_TRIP
|
|
||||||
? MyColors.gradiantStartColor
|
|
||||||
: leaveType == LeaveType.HOLIDAY
|
|
||||||
? MyColors.gradiantEndColor
|
|
||||||
: MyColors.white,
|
|
||||||
shape: BoxShape.circle,
|
|
||||||
border: Border.all(
|
|
||||||
color: leaveType == LeaveType.ABSENCE
|
|
||||||
? MyColors.pinkDarkColor
|
|
||||||
: leaveType == LeaveType.BUSINESS_TRIP
|
|
||||||
? MyColors.gradiantStartColor
|
|
||||||
: leaveType == LeaveType.HOLIDAY
|
|
||||||
? MyColors.gradiantEndColor
|
|
||||||
: MyColors.black,
|
|
||||||
width: 2,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
alignment: Alignment.center,
|
|
||||||
child: Text(
|
|
||||||
"${details.date.day}",
|
|
||||||
style: TextStyle(fontSize: 13, fontWeight: FontWeight.w500, color: leaveType == LeaveType.NORMAL ? MyColors.black : MyColors.white),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
List<Meeting> _getDataSource() {
|
|
||||||
List<Meeting> meetings = <Meeting>[];
|
|
||||||
return meetings;
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget showText(String title, String value) {
|
|
||||||
return Padding(
|
|
||||||
padding: const EdgeInsets.all(16.0),
|
|
||||||
child: Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
value.toText18(color: MyColors.gradiantEndColor, isBold: true),
|
|
||||||
title.toText14(color: MyColors.greyACColor, isBold: false),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class MeetingDataSource extends CalendarDataSource {
|
|
||||||
MeetingDataSource(List<Meeting> source) {
|
|
||||||
appointments = source;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
DateTime getStartTime(int index) {
|
|
||||||
return _getMeetingData(index).from;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
DateTime getEndTime(int index) {
|
|
||||||
return _getMeetingData(index).to;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
String getSubject(int index) {
|
|
||||||
return _getMeetingData(index).eventName;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Color getColor(int index) {
|
|
||||||
return _getMeetingData(index).background;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool isAllDay(int index) {
|
|
||||||
return _getMeetingData(index).isAllDay;
|
|
||||||
}
|
|
||||||
|
|
||||||
Meeting _getMeetingData(int index) {
|
|
||||||
dynamic meeting = appointments;
|
|
||||||
Meeting meetingData;
|
|
||||||
if (meeting is Meeting) {
|
|
||||||
meetingData = meeting;
|
|
||||||
}
|
|
||||||
return meeting;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class Meeting {
|
|
||||||
Meeting(this.eventName, this.from, this.to, this.background, this.isAllDay);
|
|
||||||
|
|
||||||
String eventName;
|
|
||||||
DateTime from;
|
|
||||||
DateTime to;
|
|
||||||
Color background;
|
|
||||||
bool isAllDay;
|
|
||||||
}
|
|
||||||
@ -1,38 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:intl/intl.dart' as intl;
|
|
||||||
|
|
||||||
class CustomAutoDirection extends StatefulWidget {
|
|
||||||
final String text;
|
|
||||||
final Widget child;
|
|
||||||
final void Function(bool isRTL)? onDirectionChange;
|
|
||||||
|
|
||||||
const CustomAutoDirection({Key? key, required this.text, required this.child, this.onDirectionChange}) : super(key: key);
|
|
||||||
|
|
||||||
@override
|
|
||||||
_CustomAutoDirectionState createState() => _CustomAutoDirectionState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _CustomAutoDirectionState extends State<CustomAutoDirection> {
|
|
||||||
late String text;
|
|
||||||
late Widget childWidget;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
text = widget.text;
|
|
||||||
childWidget = widget.child;
|
|
||||||
return Directionality(textDirection: isRTL(text) ? TextDirection.rtl : TextDirection.ltr, child: childWidget);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void didUpdateWidget(CustomAutoDirection oldWidget) {
|
|
||||||
if (isRTL(oldWidget.text) != isRTL(widget.text)) {
|
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) => widget.onDirectionChange?.call(isRTL(widget.text)));
|
|
||||||
}
|
|
||||||
super.didUpdateWidget(oldWidget);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isRTL(String text) {
|
|
||||||
if (text.isEmpty) return Directionality.of(context) == TextDirection.rtl;
|
|
||||||
return intl.Bidi.detectRtlDirectionality(text);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,594 +0,0 @@
|
|||||||
// import 'dart:async';
|
|
||||||
// import 'dart:io';
|
|
||||||
//
|
|
||||||
// import 'dart:ui' as ui;
|
|
||||||
// import 'package:easy_localization/easy_localization.dart';
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:flutter_countdown_timer/flutter_countdown_timer.dart';
|
|
||||||
// import 'package:flutter_svg/flutter_svg.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/config/env.dart';
|
|
||||||
// import 'package:mohem_flutter_app/config/routes.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/offers_and_discounts/get_offers_list.dart';
|
|
||||||
// import 'package:mohem_flutter_app/provider/chat_provider_model.dart';
|
|
||||||
// import 'package:mohem_flutter_app/provider/dashboard_provider_model.dart';
|
|
||||||
// import 'package:mohem_flutter_app/ui/landing/widget/app_drawer.dart';
|
|
||||||
// import 'package:mohem_flutter_app/ui/landing/widget/menus_widget.dart';
|
|
||||||
// import 'package:mohem_flutter_app/ui/landing/widget/services_widget.dart';
|
|
||||||
// import 'package:mohem_flutter_app/ui/marathon/marathon_provider.dart';
|
|
||||||
// import 'package:mohem_flutter_app/ui/marathon/widgets/marathon_banner.dart';
|
|
||||||
// import 'package:mohem_flutter_app/widgets/bottom_sheet.dart';
|
|
||||||
// import 'package:mohem_flutter_app/widgets/mark_attendance_widget.dart';
|
|
||||||
// import 'package:mohem_flutter_app/widgets/shimmer/dashboard_shimmer_widget.dart';
|
|
||||||
// import 'package:mohem_flutter_app/widgets/shimmer/offers_shimmer_widget.dart';
|
|
||||||
// import 'package:provider/provider.dart';
|
|
||||||
// import 'package:pull_to_refresh/pull_to_refresh.dart';
|
|
||||||
// import 'package:signalr_netcore/signalr_client.dart';
|
|
||||||
//
|
|
||||||
// late HubConnection chatHubConnection;
|
|
||||||
//
|
|
||||||
// class DashboardScreen extends StatefulWidget {
|
|
||||||
// DashboardScreen({Key? key}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// _DashboardScreenState createState() {
|
|
||||||
// return _DashboardScreenState();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class _DashboardScreenState extends State<DashboardScreen> {
|
|
||||||
// late DashboardProviderModel data;
|
|
||||||
// late MarathonProvider marathonProvider;
|
|
||||||
// late ChatProviderModel cProvider;
|
|
||||||
// final GlobalKey<ScaffoldState> _scaffoldState = GlobalKey();
|
|
||||||
//
|
|
||||||
// final RefreshController _refreshController = RefreshController(initialRefresh: false);
|
|
||||||
//
|
|
||||||
// int currentIndex = 0;
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void initState() {
|
|
||||||
// super.initState();
|
|
||||||
// scheduleMicrotask(() {
|
|
||||||
// data = Provider.of<DashboardProviderModel>(context, listen: false);
|
|
||||||
// if (env["marathon"]) {
|
|
||||||
// marathonProvider = Provider.of<MarathonProvider>(context, listen: false);
|
|
||||||
// }
|
|
||||||
// if (env["chat"]) {
|
|
||||||
// cProvider = Provider.of<ChatProviderModel>(context, listen: false);
|
|
||||||
// }
|
|
||||||
// _onRefresh();
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void dispose() {
|
|
||||||
// super.dispose();
|
|
||||||
// chatHubConnection.stop();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// void _bHubCon() {
|
|
||||||
// cProvider.getUserAutoLoginToken().whenComplete(() {
|
|
||||||
// cProvider.buildHubConnection();
|
|
||||||
// Future.delayed(const Duration(seconds: 2), () {
|
|
||||||
// cProvider.invokeChatCounter(userId: AppState().chatDetails!.response!.id!);
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// void _onRefresh() async {
|
|
||||||
// data.initProvider();
|
|
||||||
// if (env["chat"]) {
|
|
||||||
// _bHubCon();
|
|
||||||
// }
|
|
||||||
// // data.getITGNotification().then((value) {
|
|
||||||
// // print("--------------------detail_1-----------------");
|
|
||||||
// // print(value!.result!.data!.notificationMasterId);
|
|
||||||
// // print(value.result!.data!.notificationTitle);
|
|
||||||
// // });
|
|
||||||
// data.fetchListMenu();
|
|
||||||
// if (env["dashboard"]["attendance"]) {
|
|
||||||
// data.fetchAttendanceTracking(context);
|
|
||||||
// }
|
|
||||||
// data.fetchWorkListCounter(context);
|
|
||||||
// if (env["dashboard"]["missingSwipe"]) {
|
|
||||||
// data.fetchMissingSwipe(context);
|
|
||||||
// }
|
|
||||||
// data.fetchLeaveTicketBalance(context, DateTime.now());
|
|
||||||
// data.fetchMenuEntries();
|
|
||||||
// data.getCategoryOffersListAPI(context);
|
|
||||||
// if (env["marathon"]) {
|
|
||||||
// marathonProvider.getMarathonDetailsFromApi();
|
|
||||||
// }
|
|
||||||
// _refreshController.refreshCompleted();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return Scaffold(
|
|
||||||
// key: _scaffoldState,
|
|
||||||
// // appBar: AppBar(
|
|
||||||
// // actions: [
|
|
||||||
// // IconButton(
|
|
||||||
// // onPressed: () {
|
|
||||||
// // data.getITGNotification().then((val) {
|
|
||||||
// // if (val!.result!.data != null) {
|
|
||||||
// // print("-------------------- Survey ----------------------------");
|
|
||||||
// // if (val.result!.data!.notificationType == "Survey") {
|
|
||||||
// // Navigator.pushNamed(context, AppRoutes.survey, arguments: val.result!.data);
|
|
||||||
// // } else {
|
|
||||||
// // print("------------------------------------------- Ads --------------------");
|
|
||||||
// // DashboardApiClient().getAdvertisementDetail(val.result!.data!.notificationMasterId ?? "").then(
|
|
||||||
// // (value) {
|
|
||||||
// // if (value!.mohemmItgResponseItem!.statusCode == 200) {
|
|
||||||
// // if (value.mohemmItgResponseItem!.result!.data != null) {
|
|
||||||
// // Navigator.pushNamed(context, AppRoutes.advertisement, arguments: {
|
|
||||||
// // "masterId": val.result!.data!.notificationMasterId,
|
|
||||||
// // "advertisement": value.mohemmItgResponseItem!.result!.data!.advertisement,
|
|
||||||
// // });
|
|
||||||
// //
|
|
||||||
// // // Navigator.push(
|
|
||||||
// // // context,
|
|
||||||
// // // MaterialPageRoute(
|
|
||||||
// // // builder: (BuildContext context) => ITGAdsScreen(
|
|
||||||
// // // addMasterId: val.result!.data!.notificationMasterId!,
|
|
||||||
// // // advertisement: value.mohemmItgResponseItem!.result!.data!.advertisement!,
|
|
||||||
// // // ),
|
|
||||||
// // // ),
|
|
||||||
// // // );
|
|
||||||
// // }
|
|
||||||
// // }
|
|
||||||
// // },
|
|
||||||
// // );
|
|
||||||
// // }
|
|
||||||
// // }
|
|
||||||
// // });
|
|
||||||
// // },
|
|
||||||
// // icon: Icon(Icons.add))
|
|
||||||
// // ],
|
|
||||||
// // ),
|
|
||||||
// body: Column(
|
|
||||||
// children: [
|
|
||||||
// Row(
|
|
||||||
// children: [
|
|
||||||
// Builder(builder: (BuildContext context) {
|
|
||||||
// return Row(
|
|
||||||
// mainAxisSize: MainAxisSize.min,
|
|
||||||
// children: [
|
|
||||||
// Image.memory(
|
|
||||||
// Utils.dataFromBase64String(
|
|
||||||
// AppState().memberInformationList!.eMPLOYEEIMAGE ?? "",
|
|
||||||
// ),
|
|
||||||
// errorBuilder: (BuildContext context, Object error, StackTrace? stackTrace) {
|
|
||||||
// return SvgPicture.asset(
|
|
||||||
// "assets/images/user.svg",
|
|
||||||
// height: 34,
|
|
||||||
// width: 34,
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// width: 34,
|
|
||||||
// height: 34,
|
|
||||||
// fit: BoxFit.cover,
|
|
||||||
// ).circle(50),
|
|
||||||
// // CircularAvatar(
|
|
||||||
// // width: 34,
|
|
||||||
// // height: 34,
|
|
||||||
// // url: "https://cdn4.iconfinder.com/data/icons/professions-2-2/151/89-512.png",
|
|
||||||
// // ),
|
|
||||||
// 8.width,
|
|
||||||
// SvgPicture.asset("assets/images/side_nav.svg"),
|
|
||||||
// ],
|
|
||||||
// ).onPress(() {
|
|
||||||
// _scaffoldState.currentState!.openDrawer();
|
|
||||||
// });
|
|
||||||
// }),
|
|
||||||
// Image.asset("assets/images/logos/main_mohemm_logo.png", width: 134, height: 28).expanded,
|
|
||||||
// SvgPicture.asset(
|
|
||||||
// "assets/images/announcements.svg",
|
|
||||||
// matchTextDirection: true,
|
|
||||||
// ).onPress(
|
|
||||||
// () async {
|
|
||||||
// await Navigator.pushNamed(context, AppRoutes.announcements);
|
|
||||||
// },
|
|
||||||
// )
|
|
||||||
// ],
|
|
||||||
// ).paddingOnly(left: 21, right: 21, top: 48, bottom: 7),
|
|
||||||
// Expanded(
|
|
||||||
// child: SmartRefresher(
|
|
||||||
// enablePullDown: true,
|
|
||||||
// enablePullUp: false,
|
|
||||||
// header: const MaterialClassicHeader(
|
|
||||||
// color: MyColors.gradiantEndColor,
|
|
||||||
// ),
|
|
||||||
// controller: _refreshController,
|
|
||||||
// onRefresh: _onRefresh,
|
|
||||||
// child: SingleChildScrollView(
|
|
||||||
// child: Column(
|
|
||||||
// children: [
|
|
||||||
// Column(
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
// children: [
|
|
||||||
// LocaleKeys.welcomeBack.tr().toText14(color: MyColors.grey77Color),
|
|
||||||
// (AppState().memberInformationList!.eMPLOYEENAME ?? "").toText24(isBold: true),
|
|
||||||
// 16.height,
|
|
||||||
// Row(
|
|
||||||
// children: [
|
|
||||||
// if (env["dashboard"]["attendance"])
|
|
||||||
// Expanded(
|
|
||||||
// child: AspectRatio(
|
|
||||||
// aspectRatio: 159 / 159,
|
|
||||||
// child: Consumer<DashboardProviderModel>(
|
|
||||||
// builder: (BuildContext context, DashboardProviderModel model, Widget? child) {
|
|
||||||
// return (model.isAttendanceTrackingLoading
|
|
||||||
// ? GetAttendanceTrackingShimmer()
|
|
||||||
// : Container(
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// borderRadius: BorderRadius.circular(15),
|
|
||||||
// gradient: const LinearGradient(
|
|
||||||
// transform: GradientRotation(.46),
|
|
||||||
// begin: Alignment.topRight,
|
|
||||||
// end: Alignment.bottomLeft,
|
|
||||||
// colors: [
|
|
||||||
// MyColors.gradiantEndColor,
|
|
||||||
// MyColors.gradiantStartColor,
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// child: Stack(
|
|
||||||
// alignment: Alignment.center,
|
|
||||||
// children: [
|
|
||||||
// if (model.isTimeRemainingInSeconds == 0) SvgPicture.asset("assets/images/thumb.svg"),
|
|
||||||
// Column(
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
// children: [
|
|
||||||
// Expanded(
|
|
||||||
// child: Column(
|
|
||||||
// mainAxisSize: MainAxisSize.min,
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
// children: [
|
|
||||||
// LocaleKeys.markAttendance.tr().toText14(color: Colors.white, isBold: true),
|
|
||||||
// if (model.isTimeRemainingInSeconds == 0) DateTime.now().toString().split(" ")[0].toText12(color: Colors.white),
|
|
||||||
// if (model.isTimeRemainingInSeconds != 0)
|
|
||||||
// Column(
|
|
||||||
// mainAxisSize: MainAxisSize.min,
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
// children: [
|
|
||||||
// 9.height,
|
|
||||||
// Directionality(
|
|
||||||
// textDirection: ui.TextDirection.ltr,
|
|
||||||
// child: CountdownTimer(
|
|
||||||
// endTime: model.endTime,
|
|
||||||
// onEnd: null,
|
|
||||||
// endWidget: "00:00:00".toText14(color: Colors.white, isBold: true),
|
|
||||||
// textStyle: const TextStyle(color: Colors.white, fontSize: 14, letterSpacing: -0.48, fontWeight: FontWeight.bold),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// LocaleKeys.timeLeftToday.tr().toText12(color: Colors.white),
|
|
||||||
// 9.height,
|
|
||||||
// ClipRRect(
|
|
||||||
// borderRadius: const BorderRadius.all(Radius.circular(20)),
|
|
||||||
// child: LinearProgressIndicator(
|
|
||||||
// value: model.progress,
|
|
||||||
// minHeight: 8,
|
|
||||||
// valueColor: const AlwaysStoppedAnimation<Color>(Colors.white),
|
|
||||||
// backgroundColor: const Color(0xff196D73),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ).paddingOnly(top: 12, right: 15, left: 12),
|
|
||||||
// ),
|
|
||||||
// Row(
|
|
||||||
// children: [
|
|
||||||
// Expanded(
|
|
||||||
// child: Column(
|
|
||||||
// mainAxisSize: MainAxisSize.min,
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
// children: [
|
|
||||||
// LocaleKeys.checkIn.tr().toText12(color: Colors.white),
|
|
||||||
// (model.attendanceTracking!.pSwipeIn == null ? "--:--" : model.attendanceTracking!.pSwipeIn)
|
|
||||||
// .toString()
|
|
||||||
// .toText14(color: Colors.white, isBold: true),
|
|
||||||
// 4.height,
|
|
||||||
// ],
|
|
||||||
// ).paddingOnly(left: 12, right: 12),
|
|
||||||
// ),
|
|
||||||
// Container(
|
|
||||||
// margin: EdgeInsets.only(top: AppState().isArabic(context) ? 6 : 0),
|
|
||||||
// width: 45,
|
|
||||||
// height: 45,
|
|
||||||
// padding: const EdgeInsets.only(left: 10, right: 10),
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// color: Color(0xff259EA4),
|
|
||||||
// borderRadius: BorderRadius.only(
|
|
||||||
// bottomRight: AppState().isArabic(context) ? Radius.circular(0) : Radius.circular(15),
|
|
||||||
// bottomLeft: AppState().isArabic(context) ? Radius.circular(15) : Radius.circular(0),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// child: SvgPicture.asset(model.isTimeRemainingInSeconds == 0 ? "assets/images/attendance.svg" : "assets/images/attendance.svg"),
|
|
||||||
// ).onPress(() {
|
|
||||||
// showMyBottomSheet(
|
|
||||||
// context,
|
|
||||||
// callBackFunc: () {},
|
|
||||||
// child: MarkAttendanceWidget(model, isFromDashboard: true),
|
|
||||||
// );
|
|
||||||
// }),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ).onPress(
|
|
||||||
// () {
|
|
||||||
// Navigator.pushNamed(context, AppRoutes.todayAttendance);
|
|
||||||
// },
|
|
||||||
// ))
|
|
||||||
// .animatedSwither();
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// if (env["dashboard"]["attendance"]) 9.width,
|
|
||||||
// Expanded(
|
|
||||||
// child: MenusWidget(),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ).paddingOnly(left: 21, right: 21, top: 7),
|
|
||||||
// if (env["marathon"])
|
|
||||||
// context.watch<MarathonProvider>().isLoading
|
|
||||||
// ? const MarathonBannerShimmer().paddingAll(20)
|
|
||||||
// : MarathonBanner(isMarathonUpcoming: context.watch<MarathonProvider>().isUpComingMarathon).paddingAll(20),
|
|
||||||
// ServicesWidget(),
|
|
||||||
// 8.height,
|
|
||||||
// if (env["offersDiscount"])
|
|
||||||
// Container(
|
|
||||||
// width: double.infinity,
|
|
||||||
// padding: const EdgeInsets.only(top: 31),
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// color: Colors.white,
|
|
||||||
// borderRadius: const BorderRadius.only(topRight: Radius.circular(50), topLeft: Radius.circular(50)),
|
|
||||||
// border: Border.all(color: MyColors.lightGreyEDColor, width: 1),
|
|
||||||
// ),
|
|
||||||
// child: Column(
|
|
||||||
// mainAxisSize: MainAxisSize.min,
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
// children: [
|
|
||||||
// Row(
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
// children: [
|
|
||||||
// Expanded(
|
|
||||||
// child: Column(
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
// mainAxisSize: MainAxisSize.min,
|
|
||||||
// children: [
|
|
||||||
// LocaleKeys.offers.tr().toText12(),
|
|
||||||
// Row(
|
|
||||||
// children: [
|
|
||||||
// LocaleKeys.discounts.tr().toText24(isBold: true),
|
|
||||||
// 6.width,
|
|
||||||
// Container(
|
|
||||||
// padding: const EdgeInsets.only(left: 8, right: 8),
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// color: MyColors.yellowColor,
|
|
||||||
// borderRadius: BorderRadius.circular(10),
|
|
||||||
// ),
|
|
||||||
// child: LocaleKeys.newString.tr().toText10(isBold: true)),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true).onPress(() {
|
|
||||||
// Navigator.pushNamed(context, AppRoutes.offersAndDiscounts);
|
|
||||||
// })
|
|
||||||
// ],
|
|
||||||
// ).paddingOnly(left: 21, right: 21),
|
|
||||||
// Consumer<DashboardProviderModel>(
|
|
||||||
// builder: (BuildContext context, DashboardProviderModel model, Widget? child) {
|
|
||||||
// return SizedBox(
|
|
||||||
// height: 103 + 33,
|
|
||||||
// child: ListView.separated(
|
|
||||||
// shrinkWrap: true,
|
|
||||||
// physics: const BouncingScrollPhysics(),
|
|
||||||
// padding: const EdgeInsets.only(left: 21, right: 21, top: 13),
|
|
||||||
// scrollDirection: Axis.horizontal,
|
|
||||||
// itemBuilder: (BuildContext cxt, int index) {
|
|
||||||
// return model.isOffersLoading
|
|
||||||
// ? const OffersShimmerWidget()
|
|
||||||
// : InkWell(
|
|
||||||
// onTap: () {
|
|
||||||
// navigateToDetails(data.getOffersList[index]);
|
|
||||||
// },
|
|
||||||
// child: SizedBox(
|
|
||||||
// width: 73,
|
|
||||||
// child: Column(
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
// children: [
|
|
||||||
// Container(
|
|
||||||
// width: 73,
|
|
||||||
// height: 73,
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// borderRadius: const BorderRadius.all(
|
|
||||||
// Radius.circular(100),
|
|
||||||
// ),
|
|
||||||
// border: Border.all(color: MyColors.lightGreyE3Color, width: 1),
|
|
||||||
// ),
|
|
||||||
// child: ClipRRect(
|
|
||||||
// borderRadius: const BorderRadius.all(
|
|
||||||
// Radius.circular(50),
|
|
||||||
// ),
|
|
||||||
// child: Hero(
|
|
||||||
// tag: "ItemImage" + data.getOffersList[index].rowID!,
|
|
||||||
// transitionOnUserGestures: true,
|
|
||||||
// child: Image.network(
|
|
||||||
// data.getOffersList[index].bannerImage!,
|
|
||||||
// fit: BoxFit.contain,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// 4.height,
|
|
||||||
// Expanded(
|
|
||||||
// child: AppState().isArabic(context)
|
|
||||||
// ? data.getOffersList[index].titleAR!.toText12(isCenter: true, maxLine: 1)
|
|
||||||
// : data.getOffersList[index].title!.toText12(isCenter: true, maxLine: 1),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// separatorBuilder: (BuildContext cxt, int index) => 8.width,
|
|
||||||
// itemCount: 6),
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// )
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// )
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// drawer: SafeArea(
|
|
||||||
// child: AppDrawer(onLanguageChange: _onRefresh),
|
|
||||||
// ),
|
|
||||||
// bottomNavigationBar: !env["bottomBar"]
|
|
||||||
// ? null
|
|
||||||
// : SizedBox(
|
|
||||||
// height: Platform.isAndroid ? 70 : 100,
|
|
||||||
// child: BottomNavigationBar(
|
|
||||||
// items: <BottomNavigationBarItem>[
|
|
||||||
// BottomNavigationBarItem(
|
|
||||||
// icon: SvgPicture.asset(
|
|
||||||
// "assets/icons/home.svg",
|
|
||||||
// color: currentIndex == 0 ? MyColors.grey3AColor : MyColors.grey98Color,
|
|
||||||
// ).paddingAll(4),
|
|
||||||
// label: LocaleKeys.home.tr(),
|
|
||||||
// ),
|
|
||||||
// BottomNavigationBarItem(
|
|
||||||
// icon: SvgPicture.asset(
|
|
||||||
// "assets/icons/create_req.svg",
|
|
||||||
// color: currentIndex == 1 ? MyColors.grey3AColor : MyColors.grey98Color,
|
|
||||||
// ).paddingAll(4),
|
|
||||||
// label: LocaleKeys.createRequest.tr(),
|
|
||||||
// ),
|
|
||||||
// BottomNavigationBarItem(
|
|
||||||
// icon: Stack(
|
|
||||||
// alignment: Alignment.centerLeft,
|
|
||||||
// children: [
|
|
||||||
// SvgPicture.asset(
|
|
||||||
// "assets/icons/work_list.svg",
|
|
||||||
// color: currentIndex == 2 ? MyColors.grey3AColor : MyColors.grey98Color,
|
|
||||||
// ).paddingAll(4),
|
|
||||||
// Consumer<DashboardProviderModel>(
|
|
||||||
// builder: (BuildContext cxt, DashboardProviderModel data, Widget? child) {
|
|
||||||
// if (data.workListCounter == 0) {
|
|
||||||
// return const SizedBox();
|
|
||||||
// }
|
|
||||||
// return Positioned(
|
|
||||||
// right: 0,
|
|
||||||
// top: 0,
|
|
||||||
// child: Container(
|
|
||||||
// padding: const EdgeInsets.only(left: 4, right: 4),
|
|
||||||
// alignment: Alignment.center,
|
|
||||||
// decoration: BoxDecoration(color: MyColors.redColor, borderRadius: BorderRadius.circular(17)),
|
|
||||||
// child: data.workListCounter.toString().toText10(color: Colors.white),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// label: LocaleKeys.workList.tr(),
|
|
||||||
// ),
|
|
||||||
// BottomNavigationBarItem(
|
|
||||||
// icon: SvgPicture.asset(
|
|
||||||
// "assets/icons/item_for_sale.svg",
|
|
||||||
// color: currentIndex == 3 ? MyColors.grey3AColor : MyColors.grey98Color,
|
|
||||||
// ).paddingAll(4),
|
|
||||||
// label: LocaleKeys.itemsForSale.tr(),
|
|
||||||
// ),
|
|
||||||
// BottomNavigationBarItem(
|
|
||||||
// icon: Stack(
|
|
||||||
// alignment: Alignment.centerLeft,
|
|
||||||
// children: [
|
|
||||||
// SvgPicture.asset(
|
|
||||||
// "assets/icons/chat/chat.svg",
|
|
||||||
// color: currentIndex == 4 ? MyColors.grey3AColor : MyColors.grey98Color,
|
|
||||||
// ).paddingAll(4),
|
|
||||||
// Consumer<ChatProviderModel>(
|
|
||||||
// builder: (BuildContext cxt, ChatProviderModel data, Widget? child) {
|
|
||||||
// return Positioned(
|
|
||||||
// right: 0,
|
|
||||||
// top: 0,
|
|
||||||
// child: Container(
|
|
||||||
// padding: const EdgeInsets.only(left: 4, right: 4),
|
|
||||||
// alignment: Alignment.center,
|
|
||||||
// decoration: BoxDecoration(color: MyColors.redColor, borderRadius: BorderRadius.circular(17)),
|
|
||||||
// child: data.chatUConvCounter.toString().toText10(color: Colors.white),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// label: LocaleKeys.chat.tr(),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// currentIndex: currentIndex,
|
|
||||||
// selectedLabelStyle: const TextStyle(fontSize: 10, color: MyColors.grey3AColor, fontWeight: FontWeight.w600),
|
|
||||||
// unselectedLabelStyle: const TextStyle(fontSize: 10, color: MyColors.grey98Color, fontWeight: FontWeight.w600),
|
|
||||||
// type: BottomNavigationBarType.fixed,
|
|
||||||
// selectedItemColor: MyColors.grey3AColor,
|
|
||||||
// backgroundColor: MyColors.backgroundColor,
|
|
||||||
// selectedIconTheme: const IconThemeData(color: MyColors.grey3AColor, size: 28),
|
|
||||||
// unselectedIconTheme: const IconThemeData(color: MyColors.grey98Color, size: 28),
|
|
||||||
// onTap: (int index) {
|
|
||||||
// if (index == 1) {
|
|
||||||
// Navigator.pushNamed(context, AppRoutes.mowadhafhi);
|
|
||||||
// } else if (index == 2) {
|
|
||||||
// Navigator.pushNamed(context, AppRoutes.workList);
|
|
||||||
// } else if (index == 3) {
|
|
||||||
// Navigator.pushNamed(context, AppRoutes.itemsForSale);
|
|
||||||
// } else if (index == 4) {
|
|
||||||
// Navigator.pushNamed(context, AppRoutes.chat);
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// void navigateToDetails(OffersListModel offersListModelObj) {
|
|
||||||
// List<OffersListModel> getOffersDetailList = [];
|
|
||||||
// getOffersDetailList.clear();
|
|
||||||
// int counter = 1;
|
|
||||||
//
|
|
||||||
// getOffersDetailList.add(offersListModelObj);
|
|
||||||
//
|
|
||||||
// for (OffersListModel element in data.getOffersList) {
|
|
||||||
// if (counter <= 4) {
|
|
||||||
// if (element.rowID != offersListModelObj.rowID) {
|
|
||||||
// getOffersDetailList.add(element);
|
|
||||||
// counter++;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// Navigator.pushNamed(context, AppRoutes.offersAndDiscountsDetails, arguments: getOffersDetailList);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||