diff --git a/assets/fonts/DoctorApp.ttf b/assets/fonts/DoctorApp.ttf index 7c3f1bf1..dbf930ff 100644 Binary files a/assets/fonts/DoctorApp.ttf and b/assets/fonts/DoctorApp.ttf differ diff --git a/lib/config/config.dart b/lib/config/config.dart index 637721b8..35c35ef3 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -4,8 +4,8 @@ const MAX_SMALL_SCREEN = 660; const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; -const BASE_URL = 'https://hmgwebservices.com/'; -//const BASE_URL = 'https://uat.hmgwebservices.com/'; +//const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 3904ed1f..01d0a58e 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -740,4 +740,10 @@ const Map> localizedValues = { }, 'no-clinic': {'en': "No Clinic", 'ar': "لا عيادة"}, 'otherStatistic': {'en': "Other Statistics", 'ar': "دیگر شماریات"}, + 'ptientsreferral': {'en': "Patient's Referrals", 'ar': "مریض کا حوالہ"}, + 'arrivalpatient': {'en': "Arrival Patients", 'ar': "مریضوں کی آمد"}, + 'searchmedicinepatient': { + 'en': "Search patient or Medicines", + 'ar': "مریض یا دوائیں تلاش کریں" + }, }; diff --git a/lib/icons_app/config.json b/lib/icons_app/config.json index 15dda748..0b02017e 100644 --- a/lib/icons_app/config.json +++ b/lib/icons_app/config.json @@ -426,6 +426,48 @@ "search_patient" ] }, + { + "uid": "acee3dc68dc70f4b268b59a42fd957ee", + "css": "referral-1", + "code": 59408, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M681.4 793.1L735.5 860.8 683 913.3 659.1 793.7C663.5 793.4 667.9 793.1 672.4 793.1ZM791.7 793.1L758.6 834.3 725.6 793.1ZM835.9 793.1H844.8C849.3 793.1 853.7 793.4 858.1 793.7L834.2 913.3 781.7 860.8ZM913.8 655.1H912.8A154.1 154.1 0 0 0 913.8 637.9V586.2A34.5 34.5 0 0 1 913.8 655.1ZM603.4 482.7A103.6 103.6 0 0 1 706.9 379.3H810.3A103.6 103.6 0 0 1 913.8 482.8V551.7H844.8A34.5 34.5 0 0 1 810.3 517.2V448.3H775.9V465.5A86.3 86.3 0 0 1 689.7 551.7H603.5ZM603.4 655.1A34.5 34.5 0 1 1 603.4 586.2V637.9A154.1 154.1 0 0 0 604.4 655.1ZM637.9 637.9V586.2H689.6A120.4 120.4 0 0 0 781.2 543.9 69 69 0 0 0 844.7 586.2H879.2V637.9A120.6 120.6 0 0 1 637.9 637.9ZM1000 1000H517.2V948.3A155.6 155.6 0 0 1 625.2 800.5L655.4 951.7A17.3 17.3 0 0 0 667.3 964.8 17.6 17.6 0 0 0 672.3 965.5 17.3 17.3 0 0 0 684.5 960.4L758.5 886.4 832.5 960.5A17.2 17.2 0 0 0 861.7 951.7L891.9 800.5A155.6 155.6 0 0 1 999.8 948.3ZM164.1 413.8L218.3 481.5 165.7 534 141.8 414.5C146.3 414.1 150.7 413.8 155.2 413.8ZM274.5 413.8L241.4 455 208.3 413.8ZM318.6 413.8H327.6C332.1 413.8 336.5 414.1 340.9 414.4L317 534 264.5 481.5ZM396.5 275.8H395.5A154 154 0 0 0 396.5 258.6V206.9A34.5 34.5 0 0 1 396.5 275.8ZM86.2 103.5A103.6 103.6 0 0 1 189.7 0H293.1A103.6 103.6 0 0 1 396.6 103.5V172.4H327.6A34.5 34.5 0 0 1 293.1 137.9V69H258.6V86.2A86.3 86.3 0 0 1 172.4 172.4H86.2ZM86.2 275.9A34.5 34.5 0 1 1 86.2 206.9V258.6A154 154 0 0 0 87.2 275.9ZM120.6 258.6V206.9H172.4A120.4 120.4 0 0 0 264 164.6 69 69 0 0 0 327.5 206.9H362V258.6A120.6 120.6 0 1 1 120.7 258.6ZM482.8 620.7H0V569A155.6 155.6 0 0 1 107.9 421.2L138.2 572.3A17.3 17.3 0 0 0 150.1 585.5 17.6 17.6 0 0 0 155.1 586.2 17.3 17.3 0 0 0 167.3 581.1L241.3 507.1 315.3 581.2A17.2 17.2 0 0 0 344.4 572.3L374.7 421.2A155.6 155.6 0 0 1 482.6 569ZM172.4 827.6A17.2 17.2 0 0 0 155.2 810.3H127.8L206.8 731.3 286.1 810.2H258.8A17.2 17.2 0 0 0 241.6 827.4 206.9 206.9 0 0 0 333.6 999.5 172.6 172.6 0 0 1 172.4 827.6Z", + "width": 1000 + }, + "search": [ + "referral" + ] + }, + { + "uid": "7c82c028b3a01309cc1ffd1eaeb1ccf8", + "css": "search", + "code": 59467, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M543.6 353.5A132.3 132.3 0 1 1 411.3 221.2 132.3 132.3 0 0 1 543.6 353.5ZM974.2 974.1A88.2 88.2 0 0 1 849.4 974.1S624.7 749.2 622.9 747A405.4 405.4 0 1 1 747 622.8C749.2 624.6 974.2 849.4 974.2 849.4A88.2 88.2 0 0 1 974.1 974.1ZM726 405.2A320.8 320.8 0 1 0 206.8 657.2 146.9 146.9 0 0 1 352.4 530H470.1A146.9 146.9 0 0 1 614.3 648.4 320 320 0 0 0 726 405.2Z", + "width": 1000 + }, + "search": [ + "search" + ] + }, + { + "uid": "898cfb6ea07e1c004d9173c59903b3c3", + "css": "arrival-patients", + "code": 59469, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M490.4 621.6L473.9 574.9A181.3 181.3 0 0 1 396.3 590.7 177.3 177.3 0 0 1 318 574.2L295.4 620.7A13.4 13.4 0 0 1 287.5 627.5Q281.1 629.6 274.2 631.7A117.4 117.4 0 0 0 304 686.6 127.3 127.3 0 0 0 493.2 682.1 264 264 0 0 1 513.3 634.8C508.1 633.1 503.1 631.4 498.5 629.9A13.2 13.2 0 0 1 490.4 621.6ZM481.4 761.4A266.9 266.9 0 0 1 483.6 727 150.9 150.9 0 0 1 396.3 753.5 149.3 149.3 0 0 1 284.6 705 146.4 146.4 0 0 1 248.5 639.3L233.3 643.5C129.3 672.7 0 708.9 0 820.9V960.9C0 977.4 7.5 1000.1 19.8 1000.1H630.7A265.8 265.8 0 0 1 481.4 761.4ZM401.9 191.2C406.8 191.6 411.8 192 416.4 192.4 457.3 196.1 484.3 198.5 510.1 141.6A13.2 13.2 0 0 1 534.3 141.2L535.6 143.8A198.4 198.4 0 0 1 571.3 227.5C572.5 212.4 573.2 199.6 573.2 194.6S573.2 184.2 573.4 178.7A151.6 151.6 0 0 0 536.5 56.1 193.6 193.6 0 0 0 393.6 0.1 191.6 191.6 0 0 0 255.3 63L251.6 67.2A164.1 164.1 0 0 0 205.3 202.8 286.8 286.8 0 0 0 212.2 239.2 145.9 145.9 0 0 1 243.7 164 70.6 70.6 0 0 1 297.3 140.8C317.2 140.8 324.1 160.7 330.7 179.6 340.6 208.7 352 241.1 399 243.9 374.8 216.8 379 207 381.1 202.3A19.2 19.2 0 0 1 401.9 191.2ZM541.8 420.1A12.9 12.9 0 0 1 549.2 418.1H549.6C571.7 418.1 597.4 385 607.1 343.9A25.6 25.6 0 0 0 599.3 314.8 13.2 13.2 0 0 0 584.1 319.6 13.4 13.4 0 0 1 572.7 328.1L571.6 328.1A13.2 13.2 0 0 1 558.4 315.9 438.1 438.1 0 0 0 524 173C491.9 225.9 452.4 222.6 414.1 219.1H413.5A270.3 270.3 0 0 0 438.7 245.5 13.2 13.2 0 0 1 431.6 268.7C337.9 281.9 317.5 223.2 305.3 188.1A89.3 89.3 0 0 0 296.5 167.3 44.1 44.1 0 0 0 263.2 181.9 131.4 131.4 0 0 0 236.7 255.8 309.2 309.2 0 0 0 235.2 305.5 15.4 15.4 0 0 1 210.2 321.5C204.3 315.3 198 313.3 192.9 316.1A24.5 24.5 0 0 0 185.5 344C195.3 385.1 221 418.2 243.1 418.2H243.7A13.2 13.2 0 0 1 257 431.2 150 150 0 0 0 318.4 544 143.4 143.4 0 0 0 396.2 564.1 146.3 146.3 0 0 0 474.1 544.5L474.3 544.5A145.9 145.9 0 0 0 535.4 431.5 13.2 13.2 0 0 1 541.7 420.4ZM746.8 522.7A238.6 238.6 0 1 0 985.4 761.3 238.6 238.6 0 0 0 746.8 522.7ZM881.7 796.9A17.9 17.9 0 0 1 863.8 814.7H792.4V888.4A17.9 17.9 0 0 1 774.5 906.2H712A17.9 17.9 0 0 1 694.1 888.4V814.7H620.5A17.9 17.9 0 0 1 602.6 796.9V734.4A17.9 17.9 0 0 1 620.5 716.5H694.1V645.1A17.9 17.9 0 0 1 712 627.2H774.5A17.9 17.9 0 0 1 792.4 645.1V716.5H863.8A17.9 17.9 0 0 1 881.7 734.4ZM765.6 725.4V654H721V725.4A17.9 17.9 0 0 1 703.1 743.3H629.5V787.9H703.1A17.9 17.9 0 0 1 721 805.8V879.5H765.6V805.8A17.9 17.9 0 0 1 783.5 787.9H854.9V743.3H783.5A17.9 17.9 0 0 1 765.6 725.4Z", + "width": 985 + }, + "search": [ + "arrival-patients" + ] + }, { "uid": "740f78c2b53c8cc100a8b0d283bbd34f", "css": "home_icon-1", @@ -471,7 +513,7 @@ { "uid": "e2f6f0a56d4570c777c8bd5c50e38ea7", "css": "menu_icon_active-1", - "code": 59408, + "code": 59409, "src": "custom_icons", "selected": false, "svg": { @@ -485,7 +527,7 @@ { "uid": "f7eb1344b3a40f36bb4d32cdd0d76496", "css": "message_icon-1", - "code": 59409, + "code": 59410, "src": "custom_icons", "selected": false, "svg": { @@ -523,6 +565,48 @@ "search": [ "scdedule_icon_active" ] + }, + { + "uid": "2661cb62f53ed61755aa809d5280808e", + "css": "referral-bg", + "code": 59466, + "src": "custom_icons", + "selected": false, + "svg": { + "path": "M681.4 793.1L735.5 860.8 683 913.3 659.1 793.8C663.5 793.4 667.9 793.1 672.4 793.1ZM791.7 793.1L758.6 834.5 725.5 793.1ZM835.9 793.1H844.8C849.4 793.1 853.7 793.4 858.1 793.8L834.2 913.3 781.7 860.8ZM913.8 655.2H912.8A154 154 0 0 0 913.8 637.9V586.2A34.5 34.5 0 0 1 913.8 655.2ZM603.4 482.8A103.6 103.6 0 0 1 706.9 379.3H810.3A103.6 103.6 0 0 1 913.8 482.8V551.7H844.8A34.5 34.5 0 0 1 810.3 517.3V448.3H775.9V465.5A86.3 86.3 0 0 1 689.7 551.7H603.4ZM603.4 655.2A34.5 34.5 0 0 1 603.4 586.2V637.9A154 154 0 0 0 604.5 655.2ZM637.9 637.9V586.2H689.6A120.4 120.4 0 0 0 781.2 543.9 69 69 0 0 0 844.8 586.2H879.3V637.9A120.7 120.7 0 1 1 637.9 637.9ZM1000 1000H517.2V948.3A155.4 155.4 0 0 1 625.3 800.5L655.5 951.7A17.3 17.3 0 0 0 667.4 964.8 17.6 17.6 0 0 0 672.4 965.5 17.3 17.3 0 0 0 684.6 960.5L758.6 886.5 832.6 960.5A17.2 17.2 0 0 0 861.7 951.7L891.9 800.5A155.5 155.5 0 0 1 999.9 948.3ZM164.1 413.8L218.3 481.5 165.8 534 141.9 414.5C146.3 414.1 150.7 413.8 155.2 413.8ZM274.5 413.8L241.4 455.2 208.3 413.8ZM318.6 413.8H327.6C332.1 413.8 336.5 414.1 340.9 414.5L317 534 264.5 481.5ZM396.6 275.9H395.5A154 154 0 0 0 396.5 258.6V206.9A34.5 34.5 0 0 1 396.5 275.9ZM86.2 103.5A103.6 103.6 0 0 1 189.7 0H293.1A103.6 103.6 0 0 1 396.6 103.5V172.4H327.6A34.5 34.5 0 0 1 293.1 137.9V69H258.6V86.2A86.3 86.3 0 0 1 172.4 172.4H86.2ZM86.2 275.9A34.5 34.5 0 1 1 86.2 206.9V258.6A154 154 0 0 0 87.2 275.9ZM120.7 258.6V206.9H172.4A120.4 120.4 0 0 0 264 164.6 69 69 0 0 0 327.6 206.9H362V258.6A120.7 120.7 0 1 1 120.7 258.6ZM482.8 620.7H0V569A155.4 155.4 0 0 1 108 421.2L138.2 572.4A17.3 17.3 0 0 0 150.2 585.5 17.6 17.6 0 0 0 155.1 586.2 17.3 17.3 0 0 0 167.3 581.2L241.3 507.2 315.3 581.2A17.2 17.2 0 0 0 344.4 572.3L374.6 421.2A155.5 155.5 0 0 1 482.7 569ZM172.4 827.6A17.2 17.2 0 0 0 155.2 810.3H127.8L206.9 731.3 286 810.3H258.6A17.2 17.2 0 0 0 241.4 827.6 206.9 206.9 0 0 0 333.5 999.6 172.6 172.6 0 0 1 172.4 827.6Z", + "width": 1000 + }, + "search": [ + "referral-bg" + ] + }, + { + "uid": "961571413453d8de8d1d6325705ef204", + "css": "search-bg", + "code": 59468, + "src": "custom_icons", + "selected": false, + "svg": { + "path": "M543.6 353.5A132.3 132.3 0 1 1 411.3 221.2 132.3 132.3 0 0 1 543.6 353.5ZM974.2 974.2A88.2 88.2 0 0 1 849.4 974.2S624.7 749.2 622.9 747A405.4 405.4 0 1 1 747 622.9C749.2 624.6 974.2 849.4 974.2 849.4A88.2 88.2 0 0 1 974.2 974.2ZM726 405.2A320.8 320.8 0 1 0 206.8 657.2 147 147 0 0 1 352.4 530H470A147.1 147.1 0 0 1 614.3 648.5 320 320 0 0 0 726 405.2Z", + "width": 1000 + }, + "search": [ + "search-bg" + ] + }, + { + "uid": "6ec3034cfbe5c91e478ef9b9437647ed", + "css": "arrival-patients-bg", + "code": 59470, + "src": "custom_icons", + "selected": false, + "svg": { + "path": "M490.4 621.6L473.9 574.8A181.3 181.3 0 0 1 396.3 590.7 177.3 177.3 0 0 1 318 574.1L295.4 620.6A13.4 13.4 0 0 1 287.5 627.5Q281.1 629.6 274.3 631.6A117.4 117.4 0 0 0 304.2 686.6 127.3 127.3 0 0 0 493.5 682 264 264 0 0 1 513.6 634.6C508.3 633 503.4 631.3 498.7 629.8A13.4 13.4 0 0 1 490.4 621.6ZM481.4 761.4A266.9 266.9 0 0 1 483.6 727 150.9 150.9 0 0 1 396.3 753.3 149.3 149.3 0 0 1 284.6 704.8 146.4 146.4 0 0 1 248.5 639.1L233.3 643.4C129.4 672.5 0 708.8 0 820.7V960.8C0 977.1 7.5 1000 19.9 1000H630.7A265.8 265.8 0 0 1 481.4 761.4ZM401.8 191.2C406.8 191.6 411.6 192 416.4 192.4 457.3 196.1 484.2 198.5 510.1 141.7A13.4 13.4 0 0 1 534.2 141.2L535.5 143.8C552.2 161.8 563.7 195.1 571.3 227.6 572.5 212.4 573.2 199.7 573.2 194.7S573.3 184.3 573.4 178.8C574.2 139.6 575 95.1 536.5 56.1A193.6 193.6 0 0 0 393.6 0 191.5 191.5 0 0 0 255.3 62.7L251.6 67C228.8 92.4 203.1 121.1 205.1 202.5A286.9 286.9 0 0 0 212 238.8 146 146 0 0 1 243.5 163.5 70.6 70.6 0 0 1 297.2 140.4C317.1 140.4 324 160.1 330.5 179.2 340.6 208.3 351.7 240.7 398.9 243.5 374.6 216.4 378.9 206.6 380.9 201.9A19.2 19.2 0 0 1 401.8 191.2ZM541.8 420.1A12.9 12.9 0 0 1 549.2 418.1H549.6C571.7 418.1 597.4 384.9 607.2 343.8A25.6 25.6 0 0 0 599.3 314.8 13.4 13.4 0 0 0 584.2 319.5 13.4 13.4 0 0 1 572.8 328C572.5 328 572.1 328 571.7 328A13.4 13.4 0 0 1 558.3 315.8C555.8 285.8 544.9 209 523.9 172.9 491.9 226 452.4 222.4 414.1 219L413.5 219A270.3 270.3 0 0 0 438.7 245.4 13.4 13.4 0 0 1 431.6 268.5C337.9 281.9 317.5 223.1 305.3 187.9A89.4 89.4 0 0 0 296.5 167.2 44.1 44.1 0 0 0 263.2 181.7 131.4 131.4 0 0 0 236.8 255.7 309.1 309.1 0 0 0 235.3 305.2 15.4 15.4 0 0 1 210.2 321.3C204.3 315.1 198 313.1 192.9 315.9A24.5 24.5 0 0 0 185.6 343.8C195.3 384.9 221 418.1 243.2 418.1H243.8A13.4 13.4 0 0 1 257.2 431C258.1 443.9 265.2 510.1 318.6 543.8A143.4 143.4 0 0 0 396.4 563.9 146.4 146.4 0 0 0 474.3 544.3L474.6 544.1C528.8 510.5 534.9 444.1 535.6 431.1A13.4 13.4 0 0 1 541.9 420.1ZM746.8 522.7A238.6 238.6 0 1 0 985.5 761.3 238.7 238.7 0 0 0 746.8 522.7ZM881.7 796.9A17.9 17.9 0 0 1 863.9 814.7H792.4V888.4A17.9 17.9 0 0 1 774.6 906.2H712.1A17.9 17.9 0 0 1 694.2 888.4V814.7H620.6A17.9 17.9 0 0 1 602.7 796.9V734.4A17.9 17.9 0 0 1 620.6 716.5H694.2V645.1A17.9 17.9 0 0 1 712.1 627.3H774.6A17.9 17.9 0 0 1 792.4 645.1V716.5H863.9A17.9 17.9 0 0 1 881.7 734.4ZM765.6 725.4V654H721V725.4A17.9 17.9 0 0 1 703.1 743.3H629.4V787.9H703.1A17.9 17.9 0 0 1 721 805.8V879.4H765.6V805.8A17.9 17.9 0 0 1 783.5 787.9H854.9V743.3H783.5A17.9 17.9 0 0 1 765.6 725.4Z", + "width": 985 + }, + "search": [ + "arrival-patients-bg" + ] } ] } \ No newline at end of file diff --git a/lib/icons_app/doctor_app_icons.dart b/lib/icons_app/doctor_app_icons.dart index 7c05c223..902de116 100644 --- a/lib/icons_app/doctor_app_icons.dart +++ b/lib/icons_app/doctor_app_icons.dart @@ -11,7 +11,7 @@ /// fonts: /// - asset: fonts/DoctorApp.ttf /// -/// +/// /// import 'package:flutter/widgets.dart'; @@ -19,36 +19,72 @@ class DoctorApp { DoctorApp._(); static const _kFontFam = 'DoctorApp'; - static const _kFontPkg = null; + static const String _kFontPkg = null; - static const IconData female_icon = IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData male = IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData reject_icon = IconData(0xe802, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData home_icon_active = IconData(0xe803, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData menu_icon = IconData(0xe804, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData menu_icon_active = IconData(0xe805, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData message_icon = IconData(0xe806, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData message_icon_active = IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData scdedule_icon_active = IconData(0xe808, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData schedule_icon = IconData(0xe809, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData discharge_patient = IconData(0xe80a, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData approved_icon = IconData(0xe80b, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData pending_icon = IconData(0xe80c, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData in_patient_white = IconData(0xe80d, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData lab_results = IconData(0xe80e, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData home_icon = IconData(0xe80f, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData operations = IconData(0xe813, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData out_patient = IconData(0xe814, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData patient = IconData(0xe815, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData qr_code = IconData(0xe816, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData radiology = IconData(0xe817, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData referral = IconData(0xe818, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData search_patient = IconData(0xe81a, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData mail = IconData(0xe81e, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData medicine_search = IconData(0xe81f, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData referred = IconData(0xe822, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData sync_icon = IconData(0xe824, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData drawer_icon = IconData(0xe825, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData leaves = IconData(0xe836, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData search_patient_1 = IconData(0xe849, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData female_icon = + IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData male = + IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData reject_icon = + IconData(0xe802, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData home_icon_active = + IconData(0xe803, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData menu_icon = + IconData(0xe804, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData menu_icon_active = + IconData(0xe805, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData message_icon = + IconData(0xe806, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData message_icon_active = + IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData scdedule_icon_active = + IconData(0xe808, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData schedule_icon = + IconData(0xe809, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData discharge_patient = + IconData(0xe80a, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData approved_icon = + IconData(0xe80b, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData pending_icon = + IconData(0xe80c, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData in_patient_white = + IconData(0xe80d, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData lab_results = + IconData(0xe80e, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData home_icon = + IconData(0xe80f, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData referral_1 = + IconData(0xe810, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData operations = + IconData(0xe813, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData out_patient = + IconData(0xe814, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData patient = + IconData(0xe815, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData qr_code = + IconData(0xe816, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData radiology = + IconData(0xe817, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData referral = + IconData(0xe818, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData search_patient = + IconData(0xe81a, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData mail = + IconData(0xe81e, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData medicine_search = + IconData(0xe81f, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData referred = + IconData(0xe822, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData sync_icon = + IconData(0xe824, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData drawer_icon = + IconData(0xe825, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData leaves = + IconData(0xe836, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData search_patient_1 = + IconData(0xe849, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData search = + IconData(0xe84b, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData arrival_patients = + IconData(0xe84d, fontFamily: _kFontFam, fontPackage: _kFontPkg); } diff --git a/lib/landing_page.dart b/lib/landing_page.dart index 4d949827..a997675a 100644 --- a/lib/landing_page.dart +++ b/lib/landing_page.dart @@ -42,15 +42,17 @@ class _LandingPageState extends State { return Scaffold( appBar: AppBar( elevation: 0, - backgroundColor: HexColor('#515B5D'), - textTheme: TextTheme(headline6: TextStyle(color: Colors.white)), - title: Text(getText(currentTab).toUpperCase()), + backgroundColor: Colors.grey[100], + //textTheme: TextTheme(headline6: TextStyle(color: Colors.white)), + title: currentTab != 0 + ? Text(getText(currentTab).toUpperCase()) + : Text(''), leading: Builder( builder: (BuildContext context) { return IconButton( icon: Icon(DoctorApp.drawer_icon), iconSize: 15, - color: Colors.white, + color: Colors.black, onPressed: () => Scaffold.of(context).openDrawer(), ); }, @@ -66,9 +68,9 @@ class _LandingPageState extends State { ShowCaseWidget( builder: Builder(builder: (context) => DashboardScreen()), ), - DoctorReplyScreen(), MyScheduleScreen(), - QrReaderScreen() + QrReaderScreen(), + DoctorReplyScreen(), ], ), bottomNavigationBar: BottomNavBar(changeIndex: _changeCurrentTab), @@ -80,11 +82,11 @@ class _LandingPageState extends State { case 0: return TranslationBase.of(context).home; case 1: - return TranslationBase.of(context).replay; - case 2: return TranslationBase.of(context).mySchedule; - case 3: + case 2: return TranslationBase.of(context).qr; + case 3: + return TranslationBase.of(context).replay; } } } diff --git a/lib/main.dart b/lib/main.dart index 79994205..e3db2e49 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -14,7 +14,7 @@ import './routes.dart'; import 'config/config.dart'; import 'locator.dart'; -void main()async { +void main() async { WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp(); setupLocator(); diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 9d8bdb2c..369f6a39 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -13,7 +13,10 @@ import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/doctor/patient_arrival_screen.dart'; +import 'package:doctor_app_flutter/screens/medicine/search_medicine_patient_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/my-referral-patient-screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/referral/patient_referral_screen.dart'; import 'package:doctor_app_flutter/screens/reschedule-leaves/add-rescheduleleave.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; @@ -21,6 +24,7 @@ import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/dashboard/guage_chart.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/cupertino.dart'; @@ -63,7 +67,7 @@ class _DashboardScreenState extends State { bool isExpanded = false; String isInpatient = ""; var clinicName = []; - + int sliderActiveIndex = 0; var clinicId; void didChangeDependencies() async { super.didChangeDependencies(); @@ -111,26 +115,6 @@ class _DashboardScreenState extends State { currentFocus.unfocus(); } - var _patientSearchFormValues = PatientModel( - FirstName: "0", - MiddleName: "0", - LastName: "0", - PatientMobileNumber: "0", - PatientIdentificationID: "0", - PatientID: 0, - From: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') - .toString(), - To: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') - .toString(), - LanguageID: 2, - stamp: "2020-03-02T13:56:39.170Z", - IPAdress: "11.11.11.11", - VersionID: 1.2, - Channel: 9, - TokenID: "2Fi7HoIHB0eDyekVa6tCJg==", - SessionID: "5G0yXn0Jnq", - IsLoginForDoctorApp: true, - PatientOutSA: false); return BaseView( onModelReady: (model) => model.getDashboard(), builder: (_, model, w) => AppScaffold( @@ -145,684 +129,743 @@ class _DashboardScreenState extends State { ProfileWelcomeWidget( Container( width: MediaQuery.of(context).size.width * .6, - // height: 100, - child: projectsProvider.doctorClinicsList.length > 0 - ? Stack( - children: [ - DropdownButtonHideUnderline( - child: DropdownButton( - dropdownColor: Colors.white, - iconEnabledColor: Colors.white, - isExpanded: true, - value: clinicId == null - ? projectsProvider - .doctorClinicsList[0].clinicID - : clinicId, - iconSize: 25, - elevation: 16, - selectedItemBuilder: - (BuildContext context) { - return projectsProvider.doctorClinicsList - .map((item) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - AppText( - item.clinicName, - fontSize: - SizeConfig.textMultiplier * - 2.1, - color: Colors.white, - ), - ], - ); - }).toList(); - }, - onChanged: (newValue) { - clinicId = newValue; - changeClinic(newValue, context, model); - }, - items: projectsProvider.doctorClinicsList - .map((item) { - return DropdownMenuItem( - child: Text( - item.clinicName, - textAlign: TextAlign.end, - ), - value: item.clinicID, - ); - }).toList(), - )), - Positioned( - right: projectsProvider.isArabic ? 35 : 0, - top: 0, - child: new Container( - padding: EdgeInsets.all(4), - decoration: new BoxDecoration( - color: Colors.red[800], - borderRadius: BorderRadius.circular(20), - ), - constraints: BoxConstraints( - minWidth: 20, - minHeight: 20, - ), - child: new Text( - projectsProvider - .doctorClinicsList.length - .toString(), - style: new TextStyle( - color: Colors.white, - fontSize: projectsProvider.isArabic - ? 10 - : 11, - ), - textAlign: TextAlign.center, - ), - ), - ) - ], - ) - : AppText(TranslationBase.of(context).noClinic), + // // height: 100, + // child: projectsProvider.doctorClinicsList.length > 0 + // ? Stack( + // children: [ + // DropdownButtonHideUnderline( + // child: DropdownButton( + // dropdownColor: Colors.white, + // iconEnabledColor: Colors.white, + // isExpanded: true, + // value: clinicId == null + // ? projectsProvider + // .doctorClinicsList[0].clinicID + // : clinicId, + // iconSize: 25, + // elevation: 16, + // selectedItemBuilder: + // (BuildContext context) { + // return projectsProvider.doctorClinicsList + // .map((item) { + // return Row( + // mainAxisSize: MainAxisSize.max, + // children: [ + // AppText( + // item.clinicName, + // fontSize: + // SizeConfig.textMultiplier * + // 2.1, + // color: Colors.white, + // ), + // ], + // ); + // }).toList(); + // }, + // onChanged: (newValue) { + // clinicId = newValue; + // changeClinic(newValue, context, model); + // }, + // items: projectsProvider.doctorClinicsList + // .map((item) { + // return DropdownMenuItem( + // child: Text( + // item.clinicName, + // textAlign: TextAlign.end, + // ), + // value: item.clinicID, + // ); + // }).toList(), + // )), + // Positioned( + // right: projectsProvider.isArabic ? 35 : 0, + // top: 0, + // child: new Container( + // padding: EdgeInsets.all(4), + // decoration: new BoxDecoration( + // color: Colors.red[800], + // borderRadius: BorderRadius.circular(20), + // ), + // constraints: BoxConstraints( + // minWidth: 20, + // minHeight: 20, + // ), + // child: new Text( + // projectsProvider + // .doctorClinicsList.length + // .toString(), + // style: new TextStyle( + // color: Colors.white, + // fontSize: projectsProvider.isArabic + // ? 10 + // : 11, + // ), + // textAlign: TextAlign.center, + // ), + // ), + // ) + // ], + // ) + // : AppText(TranslationBase.of(context).noClinic), ), ), - // InkWell( - // onTap: () async { - // showCupertinoPicker( - // decKey: '', - // context: context, - // actionList: projectsProvider.doctorClinicsList); - // }, - // child: Row( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // mainAxisAlignment: MainAxisAlignment.start, - // children: [ - // SizedBox( - // height: 4, - // ), - // InkWell( - // onTap: () async { - // // showCupertinoPicker( - // // decKey: '', - // // context: context, - // // actionList: projectsProvider - // // .doctorClinicsList); - // }, - // child: - // Container( - // alignment: projectsProvider.isArabic - // ? Alignment.topRight - // : Alignment.topLeft, - // child: Row( - // mainAxisAlignment: - // MainAxisAlignment.spaceBetween, - // children: [ - - // Container( - // child: AppText( - // authProvider.selectedClinicName != - // null - // ? authProvider - // .selectedClinicName - // : authProvider.doctorProfile - // .clinicDescription, - // fontSize: - // SizeConfig.textMultiplier * - // 1.7, - // color: Colors.white, - // textAlign: TextAlign.center, - // ), - // alignment: projectsProvider.isArabic - // ? Alignment.topRight - // : Alignment.topLeft, - // ), - // Row( - // mainAxisAlignment: - // MainAxisAlignment.start, - // mainAxisSize: MainAxisSize.max, - // crossAxisAlignment: - // CrossAxisAlignment.start, - // children: [ - // InkWell( - // child: Container( - // margin: EdgeInsets.only( - // left: 5, - // top: projectsProvider - // .isArabic - // ? 0 - // : 5, - // right: 10, - // bottom: - // projectsProvider - // .isArabic - // ? 15 - // : 7), - // child: Icon( - // Icons.arrow_drop_down, - // color: Colors.white, - // size: SizeConfig - // .textMultiplier * - // 3, - // )), - // ), - // ], - //), - // ])), - // ), - // ], - // ), - //]), - // ), - // ), Container( - color: Colors.white, - height: MediaQuery.of(context).size.height * 0.23, + height: MediaQuery.of(context).size.height * 0.20, ), ], ), Positioned( - right: 9.0, - left: 9, - top: MediaQuery.of(context).size.height * .1, - child: Container( - height: MediaQuery.of(context).size.height * 0.28, - child: model.dashboardItemsList.length > 0 - ? new Swiper( - itemBuilder: (BuildContext context, int index) { - return getSwiperWidget(model)[index]; - }, - itemCount: 3, + right: 9.0, + left: 9, + top: MediaQuery.of(context).size.height * .05, + child: Container( + height: MediaQuery.of(context).size.height * 0.30, + child: model.dashboardItemsList.length > 0 + ? new Swiper( + onIndexChanged: (index) { + if (mounted) { + setState(() { + sliderActiveIndex = index; + }); + } + }, + itemBuilder: (BuildContext context, int index) { + return getSwiperWidget(model)[index]; + }, + itemCount: 3, - pagination: new SwiperCustomPagination(builder: - (BuildContext context, - SwiperPluginConfig config) { - return new Stack( - alignment: Alignment.bottomCenter, - children: [ - Positioned( - bottom: -5, - child: Center( - child: InkWell( - onTap: () {}, - child: Container( - child: Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - Container( - height: 10, - width: 50, - margin: - EdgeInsets.all( - 2), - color: config - .activeIndex == - 0 - ? Colors.black - : Colors.grey), - Container( - height: 10, - width: 50, - margin: - EdgeInsets.all( - 2), - color: config - .activeIndex == - 1 - ? Colors.black - : Colors.grey), - Container( - height: 10, - width: 50, - margin: - EdgeInsets.all( - 2), - color: config - .activeIndex == - 2 - ? Colors.black - : Colors.grey), - ], - ))))) - ]); - }), - viewportFraction: 0.9, - // scale: 0.9, - // control: new SwiperControl(), - ) - : SizedBox()) - //ExpandableCardContainer( - // expandedChild: Container( - // margin: EdgeInsets.only(left: 10, right: 10), - // height: MediaQuery.of(context).orientation == - // Orientation.portrait - // ? MediaQuery.of(context).size.height * 0.22 - // : MediaQuery.of(context).size.height * 0.25, - // width: double.infinity, - // child: Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // DashboardItem( - // onTap: () { - // setState(() { - // this.isExpanded = false; - // }); - // }, - // child: Padding( - // padding: const EdgeInsets.all(8.0), - // child: Column( - // children: [ - // Row( - // children: [ - // Expanded( - // child: Column( - // children: [ - // AppText( - // model.dashboardItemsList - // .length > - // 0 - // ? isInpatient == 'in' - // ? model - // .dashboardItemsList[ - // 0] - // .summaryoptions[0] - // .value - // .toString() - // : model - // .dashboardItemsList[ - // 1] - // .summaryoptions[0] - // .value - // .toString() - // : "", - // fontWeight: FontWeight.bold, - // color: Colors.white, - // fontSize: 24, - // ), - // AppText( - // model.dashboardItemsList - // .length > - // 0 - // ? isInpatient == 'in' - // ? model - // .dashboardItemsList[ - // 0] - // .summaryoptions[0] - // .kPIParameter - // : model - // .dashboardItemsList[ - // 1] - // .summaryoptions[0] - // .kPIParameter - // : "", - // //'My Admitted Patient', - // color: Colors.white, - // textAlign: TextAlign.center, - // fontSize: 12, - // ) - // ], - // )), - // Expanded( - // child: Column( - // children: [ - // AppText( - // model.dashboardItemsList - // .length > - // 0 - // ? isInpatient == 'in' - // ? model - // .dashboardItemsList[ - // 0] - // .summaryoptions[1] - // .value - // .toString() - // : model - // .dashboardItemsList[ - // 1] - // .summaryoptions[1] - // .value - // .toString() - // : "", - // fontWeight: FontWeight.bold, - // color: Colors.white, - // fontSize: 28, - // ), - // AppText( - // model.dashboardItemsList - // .length > - // 0 - // ? isInpatient == 'in' - // ? model - // .dashboardItemsList[ - // 0] - // .summaryoptions[1] - // .kPIParameter - // : model - // .dashboardItemsList[ - // 1] - // .summaryoptions[1] - // .kPIParameter - // : "", - // color: Colors.white, - // textAlign: TextAlign.center, - // fontSize: 12, - // ) - // ], - // )), - // Expanded( - // child: Column( - // children: [ - // AppText( - // model.dashboardItemsList - // .length > - // 0 - // ? isInpatient == 'in' - // ? model - // .dashboardItemsList[ - // 0] - // .summaryoptions[2] - // .value - // .toString() - // : model - // .dashboardItemsList[ - // 1] - // .summaryoptions[2] - // .value - // .toString() - // : "", - // fontWeight: FontWeight.bold, - // color: Colors.white, - // fontSize: 28), - // AppText( - // model.dashboardItemsList - // .length > - // 0 - // ? isInpatient == 'in' - // ? model - // .dashboardItemsList[ - // 0] - // .summaryoptions[2] - // .kPIParameter - // .toString() - // : model - // .dashboardItemsList[ - // 1] - // .summaryoptions[2] - // .kPIParameter - // .toString() - // : "", - // color: Colors.white, - // fontSize: 12, - // textAlign: TextAlign.center) - // ], - // )) - // ], - // ), - // Row( - // children: [ - // Expanded( - // child: Column( - // children: [ - // AppText( - // model.dashboardItemsList - // .length > - // 0 - // ? isInpatient == 'in' - // ? model - // .dashboardItemsList[ - // 0] - // .summaryoptions[3] - // .value - // .toString() - // : model - // .dashboardItemsList[ - // 1] - // .summaryoptions[3] - // .value - // .toString() - // : "", - // fontWeight: FontWeight.bold, - // color: Colors.white, - // fontSize: 28), - // AppText( - // model.dashboardItemsList - // .length > - // 0 - // ? isInpatient == 'in' - // ? model - // .dashboardItemsList[ - // 0] - // .summaryoptions[3] - // .kPIParameter - // .toString() - // : model - // .dashboardItemsList[ - // 1] - // .summaryoptions[3] - // .kPIParameter - // .toString() - // : "", - // color: Colors.white, - // fontSize: 12, - // textAlign: TextAlign.center) - // ], - // )), - // Expanded( - // child: Column( - // children: [ - // AppText( - // model.dashboardItemsList - // .length > - // 0 - // ? isInpatient == 'in' - // ? model - // .dashboardItemsList[ - // 0] - // .summaryoptions[ - // 4] - // .value - // .toString() - // : model - // .dashboardItemsList[ - // 1] - // .summaryoptions[ - // 4] - // .value - // .toString() - // : "", - // fontWeight: FontWeight.bold, - // color: Colors.white, - // fontSize: 28), - // AppText( - // model.dashboardItemsList - // .length > - // 0 - // ? isInpatient == 'in' - // ? model - // .dashboardItemsList[ - // 0] - // .summaryoptions[ - // 4] - // .kPIParameter - // .toString() - // : model - // .dashboardItemsList[ - // 1] - // .summaryoptions[ - // 4] - // .kPIParameter - // .toString() - // : "", - // color: Colors.white, - // fontSize: 12, - // textAlign: TextAlign.center) - // ], - // ), - // ), - // Expanded( - // child: Container(), - // ) - // ], - // ) - // ], - // )), - // imageName: '5.png', - // color: HexColor('#B8382C'), - // hasBorder: false, - // width: MediaQuery.of(context).size.width * 0.9, - // height: MediaQuery.of(context).orientation == - // Orientation.portrait - // ? MediaQuery.of(context).size.height * 0.22 - // : MediaQuery.of(context).size.height * 0.25, - // ), - // ], - // ), - // ), - // collapsedChild: Container( - // margin: EdgeInsets.only(left: 10, right: 10), - // height: MediaQuery.of(context).orientation == - // Orientation.portrait - // ? MediaQuery.of(context).size.height * 0.15 - // : MediaQuery.of(context).size.height * 0.25, - // width: double.infinity, - // child: Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // DashboardItem( - // onTap: () { - // setState(() { - // this.isExpanded = true; - // this.isInpatient = 'in'; - // }); - // }, - // child: Padding( - // padding: const EdgeInsets.all(8.0), - // child: Row( - // mainAxisAlignment: - // MainAxisAlignment.spaceBetween, - // children: [ - // Column( - // mainAxisAlignment: - // MainAxisAlignment.start, - // children: [ - // AppText( - // model.dashboardItemsList.length > 0 - // ? getPatientCount( - // model.dashboardItemsList[0]) - // : "", - // fontSize: - // SizeConfig.textMultiplier * 6, - // color: Colors.white, - // ), - // Flexible( - // child: AppText( - // TranslationBase.of(context).inPatient, - // color: Colors.white, - // textOverflow: TextOverflow.ellipsis, - // )), - // ], - // ), - // Padding( - // padding: EdgeInsets.all(5), - // child: Column( - // mainAxisAlignment: - // MainAxisAlignment.end, - // children: [ - // Icon( - // DoctorApp.in_patient_white, - // size: 35, - // color: Colors.white, - // ) - // ], - // )) - // ], - // ), - // ), - // imageName: '4.png', - // color: HexColor('#B8382C'), - // hasBorder: false, - // width: MediaQuery.of(context).size.width * 0.44, - // height: MediaQuery.of(context).orientation == - // Orientation.portrait - // ? MediaQuery.of(context).size.height * 0.15 - // : MediaQuery.of(context).size.height * 0.25, - // ), - // DashboardItem( - // onTap: () { - // setState(() { - // isExpanded = true; - // this.isInpatient = 'out'; - // }); - // }, - // child: Padding( - // padding: const EdgeInsets.all(8.0), - // child: Row( - // mainAxisAlignment: - // MainAxisAlignment.spaceBetween, - // children: [ - // Column( - // mainAxisAlignment: - // MainAxisAlignment.start, - // children: [ - // AppText( - // model.dashboardItemsList.length > 0 - // ? getPatientCount( - // model.dashboardItemsList[1]) - // : "", - // fontSize: - // SizeConfig.textMultiplier * 6, - // color: Colors.white, - // ), - // Flexible( - // child: AppText( - // TranslationBase.of(context) - // .outPatients, - // color: Colors.white, - // textOverflow: TextOverflow.ellipsis, - // )), - // ], - // ), - // Padding( - // padding: EdgeInsets.all(5), - // child: Column( - // mainAxisAlignment: - // MainAxisAlignment.end, - // children: [ - // Icon( - // DoctorApp.out_patient, - // size: 35, - // color: Colors.white, - // ) - // ], - // )) - // ], - // ), - // ), - // imageName: '5.png', - // color: HexColor('#B8382C'), - // hasBorder: false, - // width: MediaQuery.of(context).size.width * 0.44, - // height: MediaQuery.of(context).orientation == - // Orientation.portrait - // ? MediaQuery.of(context).size.height * 0.15 - // : MediaQuery.of(context).size.height * 0.25, - // ), - // ], - // ), - // ), - // isExpanded: isExpanded, - // )) - ) + pagination: new SwiperCustomPagination(builder: + (BuildContext context, + SwiperPluginConfig config) { + return new Stack( + alignment: Alignment.bottomCenter, + children: [ + Positioned( + bottom: -5, + child: Center( + child: InkWell( + onTap: () {}, + child: Container( + child: Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + Container( + height: 10, + width: 50, + margin: + EdgeInsets.all(2), + color: + config.activeIndex == + 0 + ? Colors.black + : Colors + .grey), + Container( + height: 10, + width: 50, + margin: + EdgeInsets.all(2), + color: + config.activeIndex == + 1 + ? Colors.black + : Colors + .grey), + Container( + height: 10, + width: 50, + margin: + EdgeInsets.all(2), + color: + config.activeIndex == + 2 + ? Colors.black + : Colors + .grey), + ], + ))))) + ]); + }), + viewportFraction: 0.9, + // scale: 0.9, + // control: new SwiperControl(), + ) + : SizedBox()), + + //ExpandableCardContainer( + // expandedChild: Container( + // margin: EdgeInsets.only(left: 10, right: 10), + // height: MediaQuery.of(context).orientation == + // Orientation.portrait + // ? MediaQuery.of(context).size.height * 0.22 + // : MediaQuery.of(context).size.height * 0.25, + // width: double.infinity, + // child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // DashboardItem( + // onTap: () { + // setState(() { + // this.isExpanded = false; + // }); + // }, + // child: Padding( + // padding: const EdgeInsets.all(8.0), + // child: Column( + // children: [ + // Row( + // children: [ + // Expanded( + // child: Column( + // children: [ + // AppText( + // model.dashboardItemsList + // .length > + // 0 + // ? isInpatient == 'in' + // ? model + // .dashboardItemsList[ + // 0] + // .summaryoptions[0] + // .value + // .toString() + // : model + // .dashboardItemsList[ + // 1] + // .summaryoptions[0] + // .value + // .toString() + // : "", + // fontWeight: FontWeight.bold, + // color: Colors.white, + // fontSize: 24, + // ), + // AppText( + // model.dashboardItemsList + // .length > + // 0 + // ? isInpatient == 'in' + // ? model + // .dashboardItemsList[ + // 0] + // .summaryoptions[0] + // .kPIParameter + // : model + // .dashboardItemsList[ + // 1] + // .summaryoptions[0] + // .kPIParameter + // : "", + // //'My Admitted Patient', + // color: Colors.white, + // textAlign: TextAlign.center, + // fontSize: 12, + // ) + // ], + // )), + // Expanded( + // child: Column( + // children: [ + // AppText( + // model.dashboardItemsList + // .length > + // 0 + // ? isInpatient == 'in' + // ? model + // .dashboardItemsList[ + // 0] + // .summaryoptions[1] + // .value + // .toString() + // : model + // .dashboardItemsList[ + // 1] + // .summaryoptions[1] + // .value + // .toString() + // : "", + // fontWeight: FontWeight.bold, + // color: Colors.white, + // fontSize: 28, + // ), + // AppText( + // model.dashboardItemsList + // .length > + // 0 + // ? isInpatient == 'in' + // ? model + // .dashboardItemsList[ + // 0] + // .summaryoptions[1] + // .kPIParameter + // : model + // .dashboardItemsList[ + // 1] + // .summaryoptions[1] + // .kPIParameter + // : "", + // color: Colors.white, + // textAlign: TextAlign.center, + // fontSize: 12, + // ) + // ], + // )), + // Expanded( + // child: Column( + // children: [ + // AppText( + // model.dashboardItemsList + // .length > + // 0 + // ? isInpatient == 'in' + // ? model + // .dashboardItemsList[ + // 0] + // .summaryoptions[2] + // .value + // .toString() + // : model + // .dashboardItemsList[ + // 1] + // .summaryoptions[2] + // .value + // .toString() + // : "", + // fontWeight: FontWeight.bold, + // color: Colors.white, + // fontSize: 28), + // AppText( + // model.dashboardItemsList + // .length > + // 0 + // ? isInpatient == 'in' + // ? model + // .dashboardItemsList[ + // 0] + // .summaryoptions[2] + // .kPIParameter + // .toString() + // : model + // .dashboardItemsList[ + // 1] + // .summaryoptions[2] + // .kPIParameter + // .toString() + // : "", + // color: Colors.white, + // fontSize: 12, + // textAlign: TextAlign.center) + // ], + // )) + // ], + // ), + // Row( + // children: [ + // Expanded( + // child: Column( + // children: [ + // AppText( + // model.dashboardItemsList + // .length > + // 0 + // ? isInpatient == 'in' + // ? model + // .dashboardItemsList[ + // 0] + // .summaryoptions[3] + // .value + // .toString() + // : model + // .dashboardItemsList[ + // 1] + // .summaryoptions[3] + // .value + // .toString() + // : "", + // fontWeight: FontWeight.bold, + // color: Colors.white, + // fontSize: 28), + // AppText( + // model.dashboardItemsList + // .length > + // 0 + // ? isInpatient == 'in' + // ? model + // .dashboardItemsList[ + // 0] + // .summaryoptions[3] + // .kPIParameter + // .toString() + // : model + // .dashboardItemsList[ + // 1] + // .summaryoptions[3] + // .kPIParameter + // .toString() + // : "", + // color: Colors.white, + // fontSize: 12, + // textAlign: TextAlign.center) + // ], + // )), + // Expanded( + // child: Column( + // children: [ + // AppText( + // model.dashboardItemsList + // .length > + // 0 + // ? isInpatient == 'in' + // ? model + // .dashboardItemsList[ + // 0] + // .summaryoptions[ + // 4] + // .value + // .toString() + // : model + // .dashboardItemsList[ + // 1] + // .summaryoptions[ + // 4] + // .value + // .toString() + // : "", + // fontWeight: FontWeight.bold, + // color: Colors.white, + // fontSize: 28), + // AppText( + // model.dashboardItemsList + // .length > + // 0 + // ? isInpatient == 'in' + // ? model + // .dashboardItemsList[ + // 0] + // .summaryoptions[ + // 4] + // .kPIParameter + // .toString() + // : model + // .dashboardItemsList[ + // 1] + // .summaryoptions[ + // 4] + // .kPIParameter + // .toString() + // : "", + // color: Colors.white, + // fontSize: 12, + // textAlign: TextAlign.center) + // ], + // ), + // ), + // Expanded( + // child: Container(), + // ) + // ], + // ) + // ], + // )), + // imageName: '5.png', + // color: HexColor('#B8382C'), + // hasBorder: false, + // width: MediaQuery.of(context).size.width * 0.9, + // height: MediaQuery.of(context).orientation == + // Orientation.portrait + // ? MediaQuery.of(context).size.height * 0.22 + // : MediaQuery.of(context).size.height * 0.25, + // ), + // ], + // ), + // ), + // collapsedChild: Container( + // margin: EdgeInsets.only(left: 10, right: 10), + // height: MediaQuery.of(context).orientation == + // Orientation.portrait + // ? MediaQuery.of(context).size.height * 0.15 + // : MediaQuery.of(context).size.height * 0.25, + // width: double.infinity, + // child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // DashboardItem( + // onTap: () { + // setState(() { + // this.isExpanded = true; + // this.isInpatient = 'in'; + // }); + // }, + // child: Padding( + // padding: const EdgeInsets.all(8.0), + // child: Row( + // mainAxisAlignment: + // MainAxisAlignment.spaceBetween, + // children: [ + // Column( + // mainAxisAlignment: + // MainAxisAlignment.start, + // children: [ + // AppText( + // model.dashboardItemsList.length > 0 + // ? getPatientCount( + // model.dashboardItemsList[0]) + // : "", + // fontSize: + // SizeConfig.textMultiplier * 6, + // color: Colors.white, + // ), + // Flexible( + // child: AppText( + // TranslationBase.of(context).inPatient, + // color: Colors.white, + // textOverflow: TextOverflow.ellipsis, + // )), + // ], + // ), + // Padding( + // padding: EdgeInsets.all(5), + // child: Column( + // mainAxisAlignment: + // MainAxisAlignment.end, + // children: [ + // Icon( + // DoctorApp.in_patient_white, + // size: 35, + // color: Colors.white, + // ) + // ], + // )) + // ], + // ), + // ), + // imageName: '4.png', + // color: HexColor('#B8382C'), + // hasBorder: false, + // width: MediaQuery.of(context).size.width * 0.44, + // height: MediaQuery.of(context).orientation == + // Orientation.portrait + // ? MediaQuery.of(context).size.height * 0.15 + // : MediaQuery.of(context).size.height * 0.25, + // ), + // DashboardItem( + // onTap: () { + // setState(() { + // isExpanded = true; + // this.isInpatient = 'out'; + // }); + // }, + // child: Padding( + // padding: const EdgeInsets.all(8.0), + // child: Row( + // mainAxisAlignment: + // MainAxisAlignment.spaceBetween, + // children: [ + // Column( + // mainAxisAlignment: + // MainAxisAlignment.start, + // children: [ + // AppText( + // model.dashboardItemsList.length > 0 + // ? getPatientCount( + // model.dashboardItemsList[1]) + // : "", + // fontSize: + // SizeConfig.textMultiplier * 6, + // color: Colors.white, + // ), + // Flexible( + // child: AppText( + // TranslationBase.of(context) + // .outPatients, + // color: Colors.white, + // textOverflow: TextOverflow.ellipsis, + // )), + // ], + // ), + // Padding( + // padding: EdgeInsets.all(5), + // child: Column( + // mainAxisAlignment: + // MainAxisAlignment.end, + // children: [ + // Icon( + // DoctorApp.out_patient, + // size: 35, + // color: Colors.white, + // ) + // ], + // )) + // ], + // ), + // ), + // imageName: '5.png', + // color: HexColor('#B8382C'), + // hasBorder: false, + // width: MediaQuery.of(context).size.width * 0.44, + // height: MediaQuery.of(context).orientation == + // Orientation.portrait + // ? MediaQuery.of(context).size.height * 0.15 + // : MediaQuery.of(context).size.height * 0.25, + // ), + // ], + // ), + // ), + // isExpanded: isExpanded, + // )) + ) ]), + model.dashboardItemsList.length > 0 + ? FractionallySizedBox( + widthFactor: 0.90, + child: Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + height: 15, + ), + sliderActiveIndex == 0 + ? Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + model.dashboardItemsList[3].kPIName, + fontSize: + SizeConfig.textMultiplier * 2.2, + fontWeight: FontWeight.bold, + ), + ], + ), + new Container( + height: MediaQuery.of(context) + .orientation == + Orientation.portrait + ? MediaQuery.of(context) + .size + .height * + 0.15 + : MediaQuery.of(context) + .size + .height * + 0.20, + child: new ListView( + scrollDirection: Axis.horizontal, + children: new List.generate( + model + .dashboardItemsList[3] + .summaryoptions + .length, (int index) { + return getActivityButton(model + .dashboardItemsList[3] + .summaryoptions[index]); + }))) + ], + ) + : sliderActiveIndex == 1 + ? Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + model.dashboardItemsList[4] + .kPIName, + fontSize: + SizeConfig.textMultiplier * + 2.2, + fontWeight: FontWeight.bold, + ), + ], + ), + new Container( + height: MediaQuery.of(context) + .orientation == + Orientation.portrait + ? MediaQuery.of(context) + .size + .height * + 0.15 + : MediaQuery.of(context) + .size + .height * + 0.20, + child: new ListView( + scrollDirection: + Axis.horizontal, + children: new List.generate( + model + .dashboardItemsList[4] + .summaryoptions + .length, (int index) { + return getActivityButton(model + .dashboardItemsList[4] + .summaryoptions[index]); + }))) + ], + ) + : Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + model.dashboardItemsList[5] + .kPIName, + fontSize: + SizeConfig.textMultiplier * + 2.2, + fontWeight: FontWeight.bold, + ), + ], + ), + new Container( + height: MediaQuery.of(context) + .orientation == + Orientation.portrait + ? MediaQuery.of(context) + .size + .height * + 0.15 + : MediaQuery.of(context) + .size + .height * + 0.20, + child: new ListView( + scrollDirection: + Axis.horizontal, + children: new List.generate( + model + .dashboardItemsList[5] + .summaryoptions + .length, (int index) { + return getActivityButton(model + .dashboardItemsList[5] + .summaryoptions[index]); + }))) + ], + ), + ]))) + : SizedBox(), FractionallySizedBox( - widthFactor: 0.90, + // widthFactor: 0.90, child: Container( - color: Colors.white, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topRight: Radius.circular(50), + )), + padding: EdgeInsets.all(15), + margin: EdgeInsets.only(top: 15), child: Column( mainAxisAlignment: MainAxisAlignment.start, children: [ @@ -831,10 +874,23 @@ class _DashboardScreenState extends State { ), Row( children: [ - AppText( - TranslationBase.of(context).patientServices, - fontSize: SizeConfig.textMultiplier * 3, - ), + Container( + width: 150, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).patient, + fontSize: SizeConfig.textMultiplier * 1.5, + fontWeight: FontWeight.bold, + ), + AppText( + TranslationBase.of(context).services, + fontSize: SizeConfig.textMultiplier * 3, + fontWeight: FontWeight.bold, + ) + ], + )), ], ), SizedBox( @@ -845,81 +901,112 @@ class _DashboardScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ DashboardItem( + color: Colors.red[800], child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Icon( - DoctorApp.referred, - size: 50, - color: Colors.black, - ), - AppText( - TranslationBase.of(context).myReferredPatient, - color: Colors.black, - textAlign: TextAlign.center, - ) + Padding( + padding: EdgeInsets.only( + top: 10, left: 10, right: 0), + child: Icon( + DoctorApp.referral_1, + size: 35, + color: Colors.white, + )), + Container( + padding: EdgeInsets.all(10), + child: AppText( + TranslationBase.of(context) + .patientsreferral, + color: Colors.white, + textAlign: TextAlign.start, + )) ], ), - hasBorder: true, + hasBorder: false, onTap: () { Navigator.push( context, MaterialPageRoute( - builder: (context) => ReferredPatientScreen(), + builder: (context) => PatientReferralScreen(), // MyReferredPatient(), ), ); }, ), DashboardItem( + color: Colors.grey[300], child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Icon( - DoctorApp.referral, - size: 50, - color: Colors.black, - ), - AppText( - TranslationBase.of(context).myReferralPatient, - textAlign: TextAlign.center, - color: Colors.black, - ) + Padding( + padding: EdgeInsets.only( + top: 10, left: 10, right: 0), + child: Icon( + DoctorApp.arrival_patients, + size: 35, + color: Colors.black, + )), + Container( + padding: EdgeInsets.all(10), + child: AppText( + TranslationBase.of(context) + .arrivalpatient, + color: Colors.black, + textAlign: TextAlign.start, + )) ], ), - hasBorder: true, + hasBorder: false, onTap: () { Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - MyReferralPatientScreen(), - ), - ); + context, + MaterialPageRoute( + builder: (context) => + PatientArrivalScreen(), + )); }, ), DashboardItem( + color: Colors.black, child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Icon( - DoctorApp.patient, - size: 50, - ), - AppText( - TranslationBase.of(context).arrived, - color: Colors.black, - textAlign: TextAlign.center, - ) + Padding( + padding: EdgeInsets.only( + top: 10, left: 10, right: 0), + child: Icon( + DoctorApp.search, + size: 35, + color: Colors.white, + )), + Container( + padding: EdgeInsets.all(10), + child: AppText( + TranslationBase.of(context) + .searchmedicinepatient, + color: Colors.white, + textAlign: TextAlign.start, + )) ], ), - hasBorder: true, + hasBorder: false, onTap: () { - Navigator.of(context) - .pushNamed(PATIENTS, arguments: { - "patientSearchForm": _patientSearchFormValues, - "selectedType": "7" - }); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + SearchMedicinePatientScreen(), + )); + + // Navigator.of(context) + // .pushNamed(PATIENTS, arguments: { + // "patientSearchForm": _patientSearchFormValues, + // "selectedType": "7" + // }); }, ) ], @@ -927,95 +1014,95 @@ class _DashboardScreenState extends State { SizedBox( height: 10, ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - DashboardItem( - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Center( - child: Icon( - DoctorApp.search_patient_1, - size: 50, - color: Colors.black, - ), - ), - Column( - children: [ - AppText( - TranslationBase.of(context).searchAbout, - color: Colors.black, - textAlign: TextAlign.center, - ), - AppText( - TranslationBase.of(context).patient, - color: Colors.black, - textAlign: TextAlign.center, - ) - ], - ) - ], - ), - hasBorder: true, - onTap: () { - Navigator.of(context).pushNamed(PATIENT_SEARCH); - }, - ), - DashboardItem( - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Icon( - DoctorApp.medicine_search, - size: 50, - color: Colors.black, - ), - AppText( - TranslationBase.of(context).searchMedicine, - color: Colors.black, - textAlign: TextAlign.center, - ) - ], - ), - hasBorder: true, - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => MedicineSearchScreen(), - ), - ); - }, - ), - DashboardItem( - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Icon( - DoctorApp.leaves, - size: 50, - ), - AppText( - TranslationBase.of(context).rescheduleLeaves, - color: Colors.black, - textAlign: TextAlign.center, - ) - ], - ), - hasBorder: true, - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - AddRescheduleLeavScreen(), - // MyReferredPatient(), - ), - ); - }, - ), + // Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // DashboardItem( + // child: Column( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + // children: [ + // Center( + // child: Icon( + // DoctorApp.search_patient_1, + // size: 50, + // color: Colors.black, + // ), + // ), + // Column( + // children: [ + // AppText( + // TranslationBase.of(context).searchAbout, + // color: Colors.black, + // textAlign: TextAlign.center, + // ), + // AppText( + // TranslationBase.of(context).patient, + // color: Colors.black, + // textAlign: TextAlign.center, + // ) + // ], + // ) + // ], + // ), + // hasBorder: true, + // onTap: () { + // Navigator.of(context).pushNamed(PATIENT_SEARCH); + // }, + // ), + // DashboardItem( + // child: Column( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + // children: [ + // Icon( + // DoctorApp.medicine_search, + // size: 50, + // color: Colors.black, + // ), + // AppText( + // TranslationBase.of(context).searchMedicine, + // color: Colors.black, + // textAlign: TextAlign.center, + // ) + // ], + // ), + // hasBorder: true, + // onTap: () { + // // Navigator.push( + // // context, + // // MaterialPageRoute( + // // builder: (context) => MedicineSearchScreen(), + // // ), + // // ); + // }, + // ), + // DashboardItem( + // child: Column( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + // children: [ + // Icon( + // DoctorApp.leaves, + // size: 50, + // ), + // AppText( + // TranslationBase.of(context).rescheduleLeaves, + // color: Colors.black, + // textAlign: TextAlign.center, + // ) + // ], + // ), + // hasBorder: true, + // onTap: () { + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => + // AddRescheduleLeavScreen(), + // // MyReferredPatient(), + // ), + // ); + // }, + // ), // DashboardItem( // child: Column( // mainAxisAlignment: MainAxisAlignment.spaceAround, @@ -1051,8 +1138,8 @@ class _DashboardScreenState extends State { // Navigator.of(context).pushNamed(QR_READER); // }, // ), - ], - ), + //], + //), SizedBox( height: 20, ), @@ -1114,68 +1201,55 @@ class _DashboardScreenState extends State { ); } - static List> _createInpatientData(model) { - final data = [ - new GaugeSegment( - model.dashboardItemsList[0].summaryoptions[0].kPIParameter, - getValue(model.dashboardItemsList[0].summaryoptions[0].value), - charts.MaterialPalette.blue.shadeDefault), - new GaugeSegment( - model.dashboardItemsList[0].summaryoptions[1].kPIParameter, - getValue(model.dashboardItemsList[0].summaryoptions[1].value), - charts.MaterialPalette.cyan.shadeDefault), - new GaugeSegment( - model.dashboardItemsList[0].summaryoptions[2].kPIParameter, - getValue(model.dashboardItemsList[0].summaryoptions[2].value), - charts.MaterialPalette.red.shadeDefault), - new GaugeSegment( - model.dashboardItemsList[0].summaryoptions[3].kPIParameter, - getValue(model.dashboardItemsList[0].summaryoptions[3].value), - charts.MaterialPalette.deepOrange.shadeDefault.lighter), - new GaugeSegment( - model.dashboardItemsList[0].summaryoptions[4].kPIParameter, - getValue(model.dashboardItemsList[0].summaryoptions[4].value), - charts.MaterialPalette.green.shadeDefault), - ]; + // static List> _createInpatientData(model) { + // final data = [ + // new GaugeSegment( + // model.dashboardItemsList[0].summaryoptions[0].kPIParameter, + // getValue(model.dashboardItemsList[0].summaryoptions[0].value), + // charts.MaterialPalette.blue.shadeDefault), + // new GaugeSegment( + // model.dashboardItemsList[0].summaryoptions[1].kPIParameter, + // getValue(model.dashboardItemsList[0].summaryoptions[1].value), + // charts.MaterialPalette.cyan.shadeDefault), + // new GaugeSegment( + // model.dashboardItemsList[0].summaryoptions[2].kPIParameter, + // getValue(model.dashboardItemsList[0].summaryoptions[2].value), + // charts.MaterialPalette.red.shadeDefault), + // new GaugeSegment( + // model.dashboardItemsList[0].summaryoptions[3].kPIParameter, + // getValue(model.dashboardItemsList[0].summaryoptions[3].value), + // charts.MaterialPalette.deepOrange.shadeDefault.lighter), + // new GaugeSegment( + // model.dashboardItemsList[0].summaryoptions[4].kPIParameter, + // getValue(model.dashboardItemsList[0].summaryoptions[4].value), + // charts.MaterialPalette.green.shadeDefault), + // ]; - return [ - new charts.Series( - id: 'Segments', - domainFn: (GaugeSegment segment, _) => segment.segment, - measureFn: (GaugeSegment segment, _) => segment.size, - data: data, - colorFn: (GaugeSegment segment, _) => segment.color, - ) - ]; - } + // return [ + // new charts.Series( + // id: 'Segments', + // domainFn: (GaugeSegment segment, _) => segment.segment, + // measureFn: (GaugeSegment segment, _) => segment.size, + // data: data, + // colorFn: (GaugeSegment segment, _) => segment.color, + // ) + // ]; + // } - static List> _createOutPatientData( - model) { + static List> _createReferralData(model) { final data = [ new GaugeSegment( - model.dashboardItemsList[1].summaryoptions[0].kPIParameter, + model.dashboardItemsList[2].summaryoptions[0].kPIParameter, getValue(model.dashboardItemsList[1].summaryoptions[0].value), - charts.MaterialPalette.blue.shadeDefault), + charts.MaterialPalette.black), new GaugeSegment( - model.dashboardItemsList[1].summaryoptions[1].kPIParameter, + model.dashboardItemsList[2].summaryoptions[1].kPIParameter, getValue(model.dashboardItemsList[1].summaryoptions[1].value), - charts.MaterialPalette.cyan.shadeDefault), + charts.MaterialPalette.gray.shadeDefault), new GaugeSegment( - model.dashboardItemsList[1].summaryoptions[2].kPIParameter, + model.dashboardItemsList[2].summaryoptions[2].kPIParameter, getValue(model.dashboardItemsList[1].summaryoptions[2].value), charts.MaterialPalette.red.shadeDefault), - new GaugeSegment( - model.dashboardItemsList[1].summaryoptions[3].kPIParameter, - getValue(model.dashboardItemsList[1].summaryoptions[3].value), - charts.MaterialPalette.deepOrange.shadeDefault), - new GaugeSegment( - model.dashboardItemsList[1].summaryoptions[4].kPIParameter, - getValue(model.dashboardItemsList[1].summaryoptions[4].value), - charts.MaterialPalette.green.shadeDefault.lighter), - new GaugeSegment( - model.dashboardItemsList[1].summaryoptions[5].kPIParameter, - getValue(model.dashboardItemsList[1].summaryoptions[5].value), - charts.MaterialPalette.purple.shadeDefault.lighter) ]; return [ @@ -1295,6 +1369,39 @@ class _DashboardScreenState extends State { return value.toString(); } + Widget getActivityButton(value) { + return Container( + width: MediaQuery.of(context).size.width * 0.24, + padding: EdgeInsets.all(5), + margin: EdgeInsets.all(5), + height: MediaQuery.of(context).orientation == Orientation.portrait + ? MediaQuery.of(context).size.height * 0.15 + : MediaQuery.of(context).size.height * 0.20, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(10), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: EdgeInsets.all(10), + child: AppText(value.value.toString(), + fontSize: 28, fontWeight: FontWeight.bold)), + Expanded( + child: AppText( + value.kPIParameter, + textOverflow: TextOverflow.clip, + fontSize: 12, + textAlign: TextAlign.center, + ), + ), + ], + ), + ); + } + Widget dot(Color c) { return Container( padding: EdgeInsets.all(5.0), @@ -1306,111 +1413,177 @@ class _DashboardScreenState extends State { return Row( children: [ dot(c), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - name, - color: Colors.black, - textAlign: TextAlign.center, - fontSize: 10, - textOverflow: TextOverflow.ellipsis, - ), - AppText( - ' (' + count.toString() + ')', - color: Colors.black, - textAlign: TextAlign.center, - fontSize: 14, - fontWeight: FontWeight.bold, - ) - ], + Padding( + padding: EdgeInsets.only(top: 5, bottom: 5), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + name, + color: Colors.black, + textAlign: TextAlign.center, + fontSize: 12, + textOverflow: TextOverflow.ellipsis, + ), + AppText( + ' (' + count.toString() + ')', + color: Colors.black, + textAlign: TextAlign.center, + fontSize: 14, + fontWeight: FontWeight.bold, + ) + ], + )), + ], + ); + } + + Widget getOutPatientStack(value) { + value.summaryoptions + .sort((Summaryoptions a, Summaryoptions b) => b.value - a.value); + + var list = new List(); + value.summaryoptions.forEach((result) => + {list.add(getStack(result, value.summaryoptions.first.value))}); + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Texts( + value.kPIName, + medium: true, ), + Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: list) ], ); } + getStack(Summaryoptions value, max) { + return Stack(children: [ + Container( + height: 150, + margin: EdgeInsets.all(5), + width: ((SizeConfig.screenWidth * .55) / 5), + child: SizedBox(), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), color: Colors.red[50]), + ), + Positioned( + bottom: 0, + child: Container( + child: SizedBox(), + margin: EdgeInsets.all(5), + padding: EdgeInsets.all(10), + height: max != 0 ? (150 * value.value) / max : 0, + width: ((SizeConfig.screenWidth * .55) / 5), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.red[300]))), + Container( + height: 150, + margin: EdgeInsets.only(left: 10, top: 5), + padding: EdgeInsets.all(8), + child: RotatedBox( + quarterTurns: 1, + child: Center( + child: Align( + child: AppText( + value.kPIParameter + ' (' + value.value.toString() + ') ', + fontSize: 11, + textAlign: TextAlign.center, + fontWeight: FontWeight.bold, + )), + ), + )) + ]); + } + List getSwiperWidget(model) { return [ RoundedContainer( - height: MediaQuery.of(context).size.height * 0.30, + height: MediaQuery.of(context).size.height * 0.32, margin: 5, - child: Column(children: [ - Expanded( - flex: 5, - child: Row( - children: [ - Expanded( - flex: 4, - child: Padding( - padding: const EdgeInsets.all(5.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - rowCount( - model.dashboardItemsList[0] - .summaryoptions[0].kPIParameter, - model.dashboardItemsList[0] - .summaryoptions[0].value, - Colors.blue), - rowCount( - model.dashboardItemsList[0] - .summaryoptions[1].kPIParameter, - model.dashboardItemsList[0] - .summaryoptions[1].value, - Colors.cyan), - rowCount( - model.dashboardItemsList[0] - .summaryoptions[2].kPIParameter, - model.dashboardItemsList[0] - .summaryoptions[2].value, - Colors.red), - rowCount( - model.dashboardItemsList[0] - .summaryoptions[3].kPIParameter, - model.dashboardItemsList[0] - .summaryoptions[3].value, - Colors.orange), - rowCount( - model.dashboardItemsList[0] - .summaryoptions[4].kPIParameter, - model.dashboardItemsList[0] - .summaryoptions[4].value, - Colors.green), - ], - ))), - Expanded( - flex: 3, - child: Stack(children: [ - Container( - child: GaugeChart(_createInpatientData(model))), - Positioned( - child: Center( - child: Column( - children: [ - AppText( - TranslationBase.of(context).inPatient, - fontSize: 11, - fontWeight: FontWeight.bold, - ), - AppText( - getPatientCount(model.dashboardItemsList[0]) - .toString(), - fontSize: 18, - fontWeight: FontWeight.bold, - ) - ], - )), - top: MediaQuery.of(context).size.height * 0.12, - left: MediaQuery.of(context).size.width * 0.11) - ])), - ], - )), - ])), + child: Padding( + padding: const EdgeInsets.all(5.0), + child: getOutPatientStack(model.dashboardItemsList[0]))), + RoundedContainer( + height: MediaQuery.of(context).size.height * 0.32, + margin: 5, + child: Padding( + padding: const EdgeInsets.all(5.0), + child: getOutPatientStack(model.dashboardItemsList[1]))), + // Column( + // mainAxisAlignment: MainAxisAlignment.spaceEvenly, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // rowCount( + // model.dashboardItemsList[0] + // .summaryoptions[0].kPIParameter, + // model.dashboardItemsList[0] + // .summaryoptions[0].value, + // Colors.blue), + // rowCount( + // model.dashboardItemsList[0] + // .summaryoptions[1].kPIParameter, + // model.dashboardItemsList[0] + // .summaryoptions[1].value, + // Colors.cyan), + // rowCount( + // model.dashboardItemsList[0] + // .summaryoptions[2].kPIParameter, + // model.dashboardItemsList[0] + // .summaryoptions[2].value, + // Colors.red), + // rowCount( + // model.dashboardItemsList[0] + // .summaryoptions[3].kPIParameter, + // model.dashboardItemsList[0] + // .summaryoptions[3].value, + // Colors.orange), + // rowCount( + // model.dashboardItemsList[0] + // .summaryoptions[4].kPIParameter, + // model.dashboardItemsList[0] + // .summaryoptions[4].value, + // Colors.green), + // ], + // ))), + // Expanded( + // flex: 3, + // child: Stack(children: [ + // Container( + // child: GaugeChart(_createInpatientData(model))), + // Positioned( + // child: Center( + // child: Column( + // children: [ + // AppText( + // TranslationBase.of(context).inPatient, + // fontSize: 11, + // fontWeight: FontWeight.bold, + // ), + // AppText( + // getPatientCount(model.dashboardItemsList[0]) + // .toString(), + // fontSize: 18, + // fontWeight: FontWeight.bold, + // ) + // ], + // )), + // top: MediaQuery.of(context).size.height * 0.12, + // left: MediaQuery.of(context).size.width * 0.11) + // ])), + // ], + // ) + + // ), + //]) + //), RoundedContainer( height: MediaQuery.of(context).size.height * 0.24, margin: 5, - child: Column(children: [ + child: + Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( flex: 1, child: Row( @@ -1420,224 +1593,239 @@ class _DashboardScreenState extends State { child: Padding( padding: const EdgeInsets.all(5.0), child: Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, + mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - rowCount( - model.dashboardItemsList[1] - .summaryoptions[0].kPIParameter, - model.dashboardItemsList[1] - .summaryoptions[0].value, - Colors.blue), - rowCount( - model.dashboardItemsList[1] - .summaryoptions[1].kPIParameter, - model.dashboardItemsList[1] - .summaryoptions[1].value, - Colors.cyan), - rowCount( - model.dashboardItemsList[1] - .summaryoptions[2].kPIParameter, - model.dashboardItemsList[1] - .summaryoptions[2].value, - Colors.red), - rowCount( - model.dashboardItemsList[1] - .summaryoptions[3].kPIParameter, - model.dashboardItemsList[1] - .summaryoptions[3].value, - Colors.orange), - rowCount( - model.dashboardItemsList[1] - .summaryoptions[4].kPIParameter, - model.dashboardItemsList[1] - .summaryoptions[4].value, - Colors.green), - rowCount( - model.dashboardItemsList[1] - .summaryoptions[5].kPIParameter, - model.dashboardItemsList[1] - .summaryoptions[5].value, - Colors.purple) + Expanded( + flex: 1, + child: Padding( + child: AppText( + TranslationBase.of(context).referral, + fontSize: 20, + fontWeight: FontWeight.bold, + ), + padding: EdgeInsets.all(10))), + Expanded( + flex: 2, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + rowCount( + model.dashboardItemsList[2] + .summaryoptions[0].kPIParameter, + model.dashboardItemsList[2] + .summaryoptions[0].value, + Colors.black), + rowCount( + model.dashboardItemsList[2] + .summaryoptions[1].kPIParameter, + model.dashboardItemsList[2] + .summaryoptions[1].value, + Colors.grey), + rowCount( + model.dashboardItemsList[2] + .summaryoptions[2].kPIParameter, + model.dashboardItemsList[2] + .summaryoptions[2].value, + Colors.red), + // rowCount( + // model.dashboardItemsList[2] + // .summaryoptions[3].kPIParameter, + // model.dashboardItemsList[2] + // .summaryoptions[3].value, + // Colors.orange), + // rowCount( + // model.dashboardItemsList[2] + // .summaryoptions[4].kPIParameter, + // model.dashboardItemsList[2] + // .summaryoptions[4].value, + // Colors.green), + ], + ), + ) ], ))), Expanded( flex: 3, child: Stack(children: [ Container( - child: GaugeChart(_createOutPatientData(model))), + child: GaugeChart(_createReferralData(model))), Positioned( child: Column( + crossAxisAlignment: CrossAxisAlignment.center, children: [ + // AppText( + // TranslationBase.of(context)., + // fontSize: 11, + // fontWeight: FontWeight.bold, + // textOverflow: TextOverflow.ellipsis, + // ), AppText( - TranslationBase.of(context).outPatient, - fontSize: 11, - fontWeight: FontWeight.bold, - textOverflow: TextOverflow.ellipsis, - ), - AppText( - getPatientCount(model.dashboardItemsList[1]) + getPatientCount(model.dashboardItemsList[2]) .toString(), - fontSize: 18, + fontSize: 30, fontWeight: FontWeight.bold, ) ], ), top: MediaQuery.of(context).size.height * 0.12, - left: MediaQuery.of(context).size.width * 0.10) + left: 0, + right: 0) ]), ), ], )), ])), - RoundedContainer( - height: MediaQuery.of(context).size.height * 0.24, - margin: 5, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.all(10), - child: AppText(TranslationBase.of(context).otherStatistic)), - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - DashboardItem( - width: MediaQuery.of(context).size.width * 0.25, - height: MediaQuery.of(context).orientation == - Orientation.portrait - ? MediaQuery.of(context).size.height * 0.18 - : MediaQuery.of(context).size.height * 0.36, - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Container( - margin: EdgeInsets.only(top: 5), - child: Icon( - DoctorApp.lab_results, - size: 40, - color: Colors.black, - ), - ), - Container( - // margin: EdgeInsets.only(bottom: 10), - child: Column( - children: [ - AppText( - model.dashboardItemsList.length > 0 - ? getPatientCount( - model.dashboardItemsList[5]) - : "", - fontSize: SizeConfig.textMultiplier * 6, - color: Colors.black, - ), - AppText( - TranslationBase.of(context).targetPatient, - textAlign: TextAlign.center, - color: Colors.black, - ) - ], - ), - ), - ], - ), - //imageName: '1.png', - opacity: 0, - ), - Container( - color: Colors.black12, - height: MediaQuery.of(context).size.height * 0.18, - width: 1, - ), - DashboardItem( - width: MediaQuery.of(context).size.width * 0.25, - height: MediaQuery.of(context).orientation == - Orientation.portrait - ? MediaQuery.of(context).size.height * 0.18 - : MediaQuery.of(context).size.height * 0.36, - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Container( - margin: EdgeInsets.only(top: 5), - child: Icon( - DoctorApp.radiology, - size: 40, - color: Colors.black, - ), - ), - Container( - margin: EdgeInsets.only(bottom: 5), - child: Column( - children: [ - AppText( - clinicName.length.toString(), - fontSize: SizeConfig.textMultiplier * 6, - color: Colors.black, - ), - AppText( - TranslationBase.of(context).clinic, - color: Colors.black, - ) - ], - ), - ), - ], - ), - //imageName: '2.png', - opacity: 0, - ), - Container( - color: Colors.black12, - height: MediaQuery.of(context).size.height * 0.18, - width: 1, - ), - DashboardItem( - width: MediaQuery.of(context).size.width * 0.25, - height: MediaQuery.of(context).orientation == - Orientation.portrait - ? MediaQuery.of(context).size.height * 0.18 - : MediaQuery.of(context).size.height * 0.36, - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Container( - margin: EdgeInsets.only(top: 5), - child: Icon( - DoctorApp.referral, - size: 40, - color: Colors.black, - ), - ), - Container( - margin: EdgeInsets.only(bottom: 5), - child: Column( - children: [ - AppText( - model.dashboardItemsList.length > 0 - ? getPatientCount( - model.dashboardItemsList[2]) - : "", - fontSize: SizeConfig.textMultiplier * 6, - color: Colors.black, - ), - AppText( - TranslationBase.of(context).referral, - color: Colors.black, - ) - ], - ), - ), - ], - ), - //imageName: '3.png', - opacity: 0, - ), - ], - ) - ], - )) + // RoundedContainer( + // height: MediaQuery.of(context).size.height * 0.24, + // margin: 5, + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Padding( + // padding: EdgeInsets.all(10), + // child: AppText(TranslationBase.of(context).otherStatistic)), + // Row( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // DashboardItem( + // width: MediaQuery.of(context).size.width * 0.25, + // height: MediaQuery.of(context).orientation == + // Orientation.portrait + // ? MediaQuery.of(context).size.height * 0.18 + // : MediaQuery.of(context).size.height * 0.36, + // child: Column( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + // children: [ + // Container( + // margin: EdgeInsets.only(top: 5), + // child: Icon( + // DoctorApp.lab_results, + // size: 40, + // color: Colors.black, + // ), + // ), + // Container( + // // margin: EdgeInsets.only(bottom: 10), + // child: Column( + // children: [ + // AppText( + // model.dashboardItemsList.length > 0 + // ? getPatientCount( + // model.dashboardItemsList[5]) + // : "", + // fontSize: SizeConfig.textMultiplier * 6, + // color: Colors.black, + // ), + // AppText( + // TranslationBase.of(context).targetPatient, + // textAlign: TextAlign.center, + // color: Colors.black, + // ) + // ], + // ), + // ), + // ], + // ), + // //imageName: '1.png', + // opacity: 0, + // ), + // Container( + // color: Colors.black12, + // height: MediaQuery.of(context).size.height * 0.18, + // width: 1, + // ), + // DashboardItem( + // width: MediaQuery.of(context).size.width * 0.25, + // height: MediaQuery.of(context).orientation == + // Orientation.portrait + // ? MediaQuery.of(context).size.height * 0.18 + // : MediaQuery.of(context).size.height * 0.36, + // child: Column( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + // children: [ + // Container( + // margin: EdgeInsets.only(top: 5), + // child: Icon( + // DoctorApp.radiology, + // size: 40, + // color: Colors.black, + // ), + // ), + // Container( + // margin: EdgeInsets.only(bottom: 5), + // child: Column( + // children: [ + // AppText( + // clinicName.length.toString(), + // fontSize: SizeConfig.textMultiplier * 6, + // color: Colors.black, + // ), + // AppText( + // TranslationBase.of(context).clinic, + // color: Colors.black, + // ) + // ], + // ), + // ), + // ], + // ), + // //imageName: '2.png', + // opacity: 0, + // ), + // Container( + // color: Colors.black12, + // height: MediaQuery.of(context).size.height * 0.18, + // width: 1, + // ), + // DashboardItem( + // width: MediaQuery.of(context).size.width * 0.25, + // height: MediaQuery.of(context).orientation == + // Orientation.portrait + // ? MediaQuery.of(context).size.height * 0.18 + // : MediaQuery.of(context).size.height * 0.36, + // child: Column( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + // children: [ + // Container( + // margin: EdgeInsets.only(top: 5), + // child: Icon( + // DoctorApp.referral, + // size: 40, + // color: Colors.black, + // ), + // ), + // Container( + // margin: EdgeInsets.only(bottom: 5), + // child: Column( + // children: [ + // AppText( + // model.dashboardItemsList.length > 0 + // ? getPatientCount( + // model.dashboardItemsList[2]) + // : "", + // fontSize: SizeConfig.textMultiplier * 6, + // color: Colors.black, + // ), + // AppText( + // TranslationBase.of(context).referral, + // color: Colors.black, + // ) + // ], + // ), + // ), + // ], + // ), + // //imageName: '3.png', + // opacity: 0, + // ), + // ], + // ) + // ], + // )) ]; } } @@ -1673,7 +1861,7 @@ class DashboardItem extends StatelessWidget { height: height != null ? height : MediaQuery.of(context).orientation == Orientation.portrait - ? MediaQuery.of(context).size.height * 0.20 + ? MediaQuery.of(context).size.height * 0.16 : MediaQuery.of(context).size.height * 0.36, decoration: BoxDecoration( color: !hasBorder @@ -1681,7 +1869,7 @@ class DashboardItem extends StatelessWidget { ? color : HexColor('#050705').withOpacity(opacity) : Colors.white, - borderRadius: BorderRadius.circular(6.0), + borderRadius: BorderRadius.circular(15.0), border: hasBorder ? Border.all(width: 1.0, color: const Color(0xffcccccc)) : Border.all(width: 0.0, color: Colors.transparent), diff --git a/lib/screens/doctor/my_referred_patient_screen.dart b/lib/screens/doctor/my_referred_patient_screen.dart index cd9112e2..86e5de53 100644 --- a/lib/screens/doctor/my_referred_patient_screen.dart +++ b/lib/screens/doctor/my_referred_patient_screen.dart @@ -8,41 +8,39 @@ import 'package:flutter/material.dart'; import '../../widgets/shared/app_scaffold_widget.dart'; class MyReferredPatient extends StatelessWidget { - @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.getMyReferredPatient(), builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).myReferredPatient, - body: model.listMyReferredPatientModel.length == 0 - ? Center( - child: AppText( - TranslationBase.of(context).errorNoSchedule, - color: Theme.of(context).errorColor, - ), - ) - : Container( - padding: EdgeInsetsDirectional.fromSTEB(20, 0, 20, 0), - child: ListView( - children: [ - Column( + isShowAppBar: false, + appBarTitle: TranslationBase.of(context).myReferredPatient, + body: model.listMyReferredPatientModel.length == 0 + ? Center( + child: AppText( + TranslationBase.of(context).errorNoSchedule, + color: Theme.of(context).errorColor, + ), + ) + : Container( + padding: EdgeInsetsDirectional.fromSTEB(20, 0, 20, 0), + child: ListView( + children: [ + Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - height: 10, + height: 100, ), Container( child: Column( //children: referredPatientProvider.listMyReferralPatientModel.map((item) { - children: model - .listMyReferredPatientModel + children: model.listMyReferredPatientModel .map((item) { return MyReferredPatientWidget( - myReferredPatientModel: item, - model:model - ); + myReferredPatientModel: item, + model: model); }).toList(), ), ), @@ -51,6 +49,6 @@ class MyReferredPatient extends StatelessWidget { ], ), ), - )); + )); } } diff --git a/lib/screens/doctor/patient_arrival_screen.dart b/lib/screens/doctor/patient_arrival_screen.dart new file mode 100644 index 00000000..367f1728 --- /dev/null +++ b/lib/screens/doctor/patient_arrival_screen.dart @@ -0,0 +1,130 @@ +import 'dart:ui'; +import 'package:doctor_app_flutter/models/patient/patient_model.dart'; +import 'package:doctor_app_flutter/screens/doctor/my_referral_patient_screen.dart'; +import 'package:doctor_app_flutter/screens/doctor/my_referred_patient_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/patients_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/referral/my-referral-patient-screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/referral/referred-patient-screen.dart'; +import 'package:doctor_app_flutter/screens/reschedule-leaves/add-rescheduleleave.dart'; +import 'package:doctor_app_flutter/screens/reschedule-leaves/reschedule_leave.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class PatientArrivalScreen extends StatefulWidget { + @override + _PatientArrivalScreen createState() => _PatientArrivalScreen(); +} + +class _PatientArrivalScreen extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + var _patientSearchFormValues = PatientModel( + FirstName: "0", + MiddleName: "0", + LastName: "0", + PatientMobileNumber: "0", + PatientIdentificationID: "0", + PatientID: 0, + From: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') + .toString(), + To: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') + .toString(), + LanguageID: 2, + stamp: "2020-03-02T13:56:39.170Z", + IPAdress: "11.11.11.11", + VersionID: 1.2, + Channel: 9, + TokenID: "2Fi7HoIHB0eDyekVa6tCJg==", + SessionID: "5G0yXn0Jnq", + IsLoginForDoctorApp: true, + PatientOutSA: false); + @override + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + @override + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).arrivalpatient, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(65.0), + child: Center( + child: Container( + height: 60.0, + margin: EdgeInsets.only(top: 10.0), + width: MediaQuery.of(context).size.width * 0.92, // 0.9, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 0.9), //width: 0.7 + ), + color: Colors.white), + child: Center( + child: TabBar( + isScrollable: true, + controller: _tabController, + indicatorWeight: 5.0, + indicatorSize: TabBarIndicatorSize.tab, + labelColor: Theme.of(context).primaryColor, + labelPadding: + EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.30, + child: Center( + child: AppText( + TranslationBase.of(context).arrivalpatient), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.30, + child: Center( + child: AppText( + TranslationBase.of(context).rescheduleLeaves), + ), + ), + ], + ), + ), + ), + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + PatientsScreen( + patientSearchForm: _patientSearchFormValues, + selectedType: "7", + isAppbar: false, + ), + AddRescheduleLeavScreen(), + ], + ), + ) + ], + ), + )); + } +} diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index f08f52cb..187d1b9a 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -88,8 +88,8 @@ class _MedicineSearchState extends State { }); } - InputDecoration textFieldSelectorDecoration(String hintText, - String selectedText, bool isDropDown, + InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown, {IconData icon}) { return InputDecoration( focusedBorder: OutlineInputBorder( @@ -117,159 +117,154 @@ class _MedicineSearchState extends State { Widget build(BuildContext context) { return BaseView( onModelReady: (model) async { - if(model.allMedicationList.length == 0) - await model.getMedicationList(); + if (model.allMedicationList.length == 0) + await model.getMedicationList(); }, - builder: (_, model, w) => - AppScaffold( - baseViewModel: model, - appBarTitle: TranslationBase - .of(context) - .searchMedicine, - body: SingleChildScrollView( - child: FractionallySizedBox( - widthFactor: 0.97, - child: SingleChildScrollView( - child: Column( + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: false, + appBarTitle: TranslationBase.of(context).searchMedicine, + body: SingleChildScrollView( + child: FractionallySizedBox( + widthFactor: 0.97, + child: SingleChildScrollView( + child: Column( + children: [ + SizedBox( + height: 50, + ), + Column( children: [ - Column( - children: [ - Container( - child: Icon( - DoctorApp.medicine_search, - size: 100, - color: Colors.black, - ), - margin: EdgeInsets.only(top: 50), - ), - Padding( - padding: const EdgeInsets.only(top: 12.0), - child: AppText( - TranslationBase.of(context).type.toUpperCase(), - fontWeight: FontWeight.bold, - fontSize: SizeConfig.heightMultiplier * 2.5, - ), - ), - Padding( - padding: const EdgeInsets.only(top: 5.0), - child: AppText( - TranslationBase.of(context).searchMedicineImageCaption, - fontSize: SizeConfig.heightMultiplier * 2, - ), - ) - ], + Container( + child: Icon( + DoctorApp.medicine_search, + size: 100, + color: Colors.black, + ), + margin: EdgeInsets.only(top: 50), ), - SizedBox( - height: 15, + Padding( + padding: const EdgeInsets.only(top: 12.0), + child: AppText( + TranslationBase.of(context).type.toUpperCase(), + fontWeight: FontWeight.bold, + fontSize: SizeConfig.heightMultiplier * 2.5, + ), ), - FractionallySizedBox( - widthFactor: 0.9, - child: Column( - children: [ - Container( - height: MediaQuery - .of(context) - .size - .height * 0.070, - child: InkWell( - onTap: model.allMedicationList != null - ? () { - setState(() { - _selectedMedication = null; - }); - } - : null, - child: _selectedMedication == null - ? AutoCompleteTextField< + Padding( + padding: const EdgeInsets.only(top: 5.0), + child: AppText( + TranslationBase.of(context) + .searchMedicineImageCaption, + fontSize: SizeConfig.heightMultiplier * 2, + ), + ) + ], + ), + SizedBox( + height: 15, + ), + FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + Container( + height: MediaQuery.of(context).size.height * 0.070, + child: InkWell( + onTap: model.allMedicationList != null + ? () { + setState(() { + _selectedMedication = null; + }); + } + : null, + child: _selectedMedication == null + ? AutoCompleteTextField< GetMedicationResponseModel>( - decoration: textFieldSelectorDecoration( - TranslationBase - .of(context) - .searchMedicineNameHere, - _selectedMedication != null - ? _selectedMedication.genericName - : null, - true, - icon: EvaIcons.search), - itemSubmitted: (item) => - setState( - () => _selectedMedication = item), - key: key, - suggestions: model.allMedicationList, - itemBuilder: (context, suggestion) => - new Padding( - child: Texts(suggestion.description + '/' + - suggestion.genericName), - padding: EdgeInsets.all(8.0)), - itemSorter: (a, b) => 1, - itemFilter: (suggestion, input) => - suggestion.genericName - .toLowerCase() - .startsWith(input.toLowerCase()) || - suggestion.description - .toLowerCase() - .startsWith(input.toLowerCase()) || - suggestion.keywords - .toLowerCase() - .startsWith(input.toLowerCase()), - ) - : TextField( - minLines: 2, - maxLines: 2, - decoration: textFieldSelectorDecoration( - TranslationBase - .of(context) - .searchMedicineNameHere, - _selectedMedication != null - ? _selectedMedication.description + - (' (${_selectedMedication.genericName} )') - : null, - true, - icon: EvaIcons.search), - enabled: false, - ), - ), - ), - SizedBox( - height: 15, - ), - Container( - child: Wrap( - alignment: WrapAlignment.center, - children: [ - // TODO change it secondary button and add loading - AppButton( - title: TranslationBase.of(context).search, - onPressed: () async { - await searchMedicine(context, model); - }, + decoration: textFieldSelectorDecoration( + TranslationBase.of(context) + .searchMedicineNameHere, + _selectedMedication != null + ? _selectedMedication.genericName + : null, + true, + icon: EvaIcons.search), + itemSubmitted: (item) => setState( + () => _selectedMedication = item), + key: key, + suggestions: model.allMedicationList, + itemBuilder: (context, suggestion) => + new Padding( + child: Texts( + suggestion.description + + '/' + + suggestion.genericName), + padding: EdgeInsets.all(8.0)), + itemSorter: (a, b) => 1, + itemFilter: (suggestion, input) => + suggestion.genericName + .toLowerCase() + .startsWith(input.toLowerCase()) || + suggestion.description + .toLowerCase() + .startsWith(input.toLowerCase()) || + suggestion.keywords + .toLowerCase() + .startsWith(input.toLowerCase()), + ) + : TextField( + minLines: 2, + maxLines: 2, + decoration: textFieldSelectorDecoration( + TranslationBase.of(context) + .searchMedicineNameHere, + _selectedMedication != null + ? _selectedMedication.description + + (' (${_selectedMedication.genericName} )') + : null, + true, + icon: EvaIcons.search), + enabled: false, ), - ], + ), + ), + SizedBox( + height: 15, + ), + Container( + child: Wrap( + alignment: WrapAlignment.center, + children: [ + // TODO change it secondary button and add loading + AppButton( + title: TranslationBase.of(context).search, + onPressed: () async { + await searchMedicine(context, model); + }, ), - ), - ], + ], + ), ), - ), - ], + ], + ), ), - ), + ], ), - ),),); + ), + ), + ), + ), + ); } searchMedicine(context, MedicineViewModel model) async { FocusScope.of(context).unfocus(); if (_selectedMedication.isNullOrEmpty()) { - helpers.showErrorToast(TranslationBase - .of(context) - .typeMedicineName); + helpers.showErrorToast(TranslationBase.of(context).typeMedicineName); //"Type Medicine Name") return; - } else - if (_selectedMedication.description.length < 3) { - helpers.showErrorToast(TranslationBase - .of(context) - .moreThan3Letter); + } else if (_selectedMedication.description.length < 3) { + helpers.showErrorToast(TranslationBase.of(context).moreThan3Letter); return; } @@ -277,16 +272,14 @@ class _MedicineSearchState extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => - PharmaciesListScreen( - itemID:_selectedMedication.itemId, - selectedMedication: _selectedMedication, - ), + builder: (context) => PharmaciesListScreen( + itemID: _selectedMedication.itemId, + selectedMedication: _selectedMedication, + ), ), ); // await model.getMedicineItem(_selectedMedication.description); // GifLoaderDialogUtils.hideDialog(context); - } startVoiceSearch() { diff --git a/lib/screens/medicine/search_medicine_patient_screen.dart b/lib/screens/medicine/search_medicine_patient_screen.dart new file mode 100644 index 00000000..39c0deae --- /dev/null +++ b/lib/screens/medicine/search_medicine_patient_screen.dart @@ -0,0 +1,109 @@ +import 'dart:ui'; +import 'package:doctor_app_flutter/models/patient/patient_model.dart'; +import 'package:doctor_app_flutter/screens/doctor/my_referral_patient_screen.dart'; +import 'package:doctor_app_flutter/screens/doctor/my_referred_patient_screen.dart'; +import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/patient_search_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/patients_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/referral/my-referral-patient-screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/referral/referred-patient-screen.dart'; +import 'package:doctor_app_flutter/screens/reschedule-leaves/add-rescheduleleave.dart'; +import 'package:doctor_app_flutter/screens/reschedule-leaves/reschedule_leave.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class SearchMedicinePatientScreen extends StatefulWidget { + @override + _SearchMedicinePatientScreen createState() => _SearchMedicinePatientScreen(); +} + +class _SearchMedicinePatientScreen extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + @override + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).searchmedicinepatient, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(65.0), + child: Center( + child: Container( + height: 60.0, + margin: EdgeInsets.only(top: 10.0), + width: MediaQuery.of(context).size.width * 0.92, // 0.9, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 0.9), //width: 0.7 + ), + color: Colors.white), + child: Center( + child: TabBar( + isScrollable: true, + controller: _tabController, + indicatorWeight: 5.0, + indicatorSize: TabBarIndicatorSize.tab, + labelColor: Theme.of(context).primaryColor, + labelPadding: + EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.30, + child: Center( + child: AppText( + TranslationBase.of(context).searchPatient), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.30, + child: Center( + child: AppText( + TranslationBase.of(context).searchMedicine), + ), + ), + ], + ), + ), + ), + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + PatientSearchScreen(), + MedicineSearchScreen() + ], + ), + ) + ], + ), + )); + } +} diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 34e68779..6e43657b 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -44,7 +44,7 @@ class _PatientSearchScreenState extends State { bool _autoValidate = false; bool onlyArrived = true; - bool isFormSubmitted = false; + bool isFormSubmitted = false; FocusNode _nodeText1 = FocusNode(); FocusNode _nodeText2 = FocusNode(); @@ -70,23 +70,24 @@ class _PatientSearchScreenState extends State { PatientOutSA: false); void _validateInputs() async { - setState(() { - isFormSubmitted = true; - }); + setState(() { + isFormSubmitted = true; + }); try { if (_formKey.currentState.validate()) { _formKey.currentState.save(); if ((_patientSearchFormValues.From == "0" || - _patientSearchFormValues.To == "0") && - _selectedType == "7" || ((_patientSearchFormValues.From == "0" || - _patientSearchFormValues.To == "0") && - _selectedType == "6") ) { + _patientSearchFormValues.To == "0") && + _selectedType == "7" || + ((_patientSearchFormValues.From == "0" || + _patientSearchFormValues.To == "0") && + _selectedType == "6")) { // helpers.showErrorToast("Please Choose The Dates"); } else { setState(() { - isFormSubmitted = false; + isFormSubmitted = false; }); Navigator.of(context).pushNamed(PATIENTS, arguments: { "patientSearchForm": _patientSearchFormValues, @@ -115,11 +116,12 @@ class _PatientSearchScreenState extends State { Widget build(BuildContext context) { projectsProvider = Provider.of(context); return GestureDetector( - onTap: (){ + onTap: () { FocusScope.of(context).requestFocus(new FocusNode()); }, child: AppScaffold( appBarTitle: TranslationBase.of(context).searchPatient, + isShowAppBar: false, body: ListView( children: [ RoundedContainer( @@ -261,14 +263,15 @@ class _PatientSearchScreenState extends State { borderColor: Colors.white, onSaved: (value) { value == null || value == '' - ? _patientSearchFormValues.setFirstName = - "0" - : _patientSearchFormValues.setFirstName = - value; + ? _patientSearchFormValues + .setFirstName = "0" + : _patientSearchFormValues + .setFirstName = value; if (value != null && value.toString().trim().isEmpty) { - _patientSearchFormValues.setFirstName = "0"; + _patientSearchFormValues.setFirstName = + "0"; } }, // validator: (value) { @@ -292,16 +295,14 @@ class _PatientSearchScreenState extends State { borderColor: Colors.white, onSaved: (value) { value == null || value == '' - ? _patientSearchFormValues.setMiddleName = - "0" - : _patientSearchFormValues.setMiddleName = - value; - if (value != null && value - .toString() - .trim() - .isEmpty) { + ? _patientSearchFormValues + .setMiddleName = "0" + : _patientSearchFormValues + .setMiddleName = value; + if (value != null && + value.toString().trim().isEmpty) { _patientSearchFormValues.setMiddleName = - "0"; + "0"; } }, // validator: (value) { @@ -320,7 +321,8 @@ class _PatientSearchScreenState extends State { width: 1.0, color: HexColor("#CCCCCC"))), padding: EdgeInsets.only(top: 5), child: AppTextFormField( - labelText: TranslationBase.of(context).lastName, + labelText: + TranslationBase.of(context).lastName, borderColor: Colors.white, onSaved: (value) { value == null || value == '' @@ -328,11 +330,10 @@ class _PatientSearchScreenState extends State { "0" : _patientSearchFormValues.setLastName = value; - if (value != null && value - .toString() - .trim() - .isEmpty) { - _patientSearchFormValues.setLastName = "0"; + if (value != null && + value.toString().trim().isEmpty) { + _patientSearchFormValues.setLastName = + "0"; } }, inputFormatter: ONLY_LETTERS), @@ -340,39 +341,38 @@ class _PatientSearchScreenState extends State { SizedBox( height: 10, ), - if(_selectedType!='7') - Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.only(top: 5), - child: AppTextFormField( - labelText: - TranslationBase.of(context).phoneNumber, - borderColor: Colors.white, - textInputType: TextInputType.number, - textInputAction: TextInputAction.done, - inputFormatter: ONLY_NUMBERS, - focusNode: _nodeText1, - onSaved: (value) { - value == null || value == '' - ? _patientSearchFormValues - .setPatientMobileNumber = "0" - : _patientSearchFormValues - .setPatientMobileNumber = value; + if (_selectedType != '7') + Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + padding: EdgeInsets.only(top: 5), + child: AppTextFormField( + labelText: + TranslationBase.of(context).phoneNumber, + borderColor: Colors.white, + textInputType: TextInputType.number, + textInputAction: TextInputAction.done, + inputFormatter: ONLY_NUMBERS, + focusNode: _nodeText1, + onSaved: (value) { + value == null || value == '' + ? _patientSearchFormValues + .setPatientMobileNumber = "0" + : _patientSearchFormValues + .setPatientMobileNumber = value; - if (value != null && value - .toString() - .trim() - .isEmpty) { - _patientSearchFormValues - .setPatientMobileNumber = "0"; - } - }, + if (value != null && + value.toString().trim().isEmpty) { + _patientSearchFormValues + .setPatientMobileNumber = "0"; + } + }, + ), ), - ), SizedBox( height: 10, ), @@ -391,15 +391,13 @@ class _PatientSearchScreenState extends State { inputFormatter: ONLY_NUMBERS, focusNode: _nodeText2, onSaved: (value) { - value == null || value=='' - ? _patientSearchFormValues.setPatientID = - 0 - : _patientSearchFormValues.setPatientID = - int.parse(value); - if (value != null && value - .trim() - .toString() - .isEmpty) { + value == null || value == '' + ? _patientSearchFormValues + .setPatientID = 0 + : _patientSearchFormValues + .setPatientID = int.parse(value); + if (value != null && + value.trim().toString().isEmpty) { _patientSearchFormValues.setPatientID = 0; } }), @@ -425,7 +423,8 @@ class _PatientSearchScreenState extends State { ), ), (!(_selectedType == '2' || _selectedType == '4')) - ? DynamicElements(_patientSearchFormValues, isFormSubmitted) + ? DynamicElements( + _patientSearchFormValues, isFormSubmitted) : SizedBox( height: 0, ), diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 733a1b9c..8244cea2 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -22,6 +22,11 @@ import '../../config/size_config.dart'; import '../../widgets/shared/app_scaffold_widget.dart'; class PatientsScreen extends StatefulWidget { + final patientSearchForm; + final selectedType; + final isAppbar; + PatientsScreen( + {this.patientSearchForm, this.selectedType, this.isAppbar = true}); @override _PatientsScreenState createState() => _PatientsScreenState(); } @@ -59,7 +64,6 @@ class _PatientsScreenState extends State { PatientModel patient; - searchData(String str) { this.responseModelList = this.responseModelList2; var strExist = str.length > 0 ? true : false; @@ -132,7 +136,6 @@ class _PatientsScreenState extends State { return newDate.toString(); } - filterBooking(String str) { this.responseModelList = this.responseModelList2; @@ -197,9 +200,13 @@ class _PatientsScreenState extends State { projectsProvider = Provider.of(context); final routeArgs = ModalRoute.of(context).settings.arguments as Map; - patient = routeArgs['patientSearchForm']; + patient = widget.patientSearchForm != null + ? widget.patientSearchForm + : routeArgs['patientSearchForm']; - patientType = routeArgs['selectedType']; + patientType = widget.selectedType != null + ? widget.selectedType + : routeArgs['selectedType']; if (!projectsProvider.isArabic) patientTypeTitle = SERVICES_PATIANT_HEADER[int.parse(patientType)]; @@ -213,7 +220,11 @@ class _PatientsScreenState extends State { GetPatientArrivalListRequestModel getPatientArrivalListRequestModel; if (val2 == 7) { getPatientArrivalListRequestModel = GetPatientArrivalListRequestModel( - from: patient.From, to: patient.To, pageIndex: 0, pageSize: 0,patientMRN: patient.getPatientID); + from: patient.From, + to: patient.To, + pageIndex: 0, + pageSize: 0, + patientMRN: patient.getPatientID); } model @@ -224,8 +235,6 @@ class _PatientsScreenState extends State { patientType) .then((res) { setState(() { - - if (res != null && res['MessageStatus'] == 1) { if (val2 == 7) { if (res[SERVICES_PATIANT2[val2]] == null) { @@ -234,7 +243,7 @@ class _PatientsScreenState extends State { this.error = error.toString(); } else { var localList = []; - if(res["patientArrivalList"]["entityList"] == null){ + if (res["patientArrivalList"]["entityList"] == null) { res["patientArrivalList"]["entityList"] = []; } res["patientArrivalList"]["entityList"].forEach((v) { @@ -253,10 +262,11 @@ class _PatientsScreenState extends State { responseModelList = new ModelResponse.fromJson(parsed).list; responseModelList2 = responseModelList; _isError = false; - } else { _isError = true; - error = model.error??res['ErrorEndUserMessage'] ?? res['ErrorMessage']; + error = model.error ?? + res['ErrorEndUserMessage'] ?? + res['ErrorMessage']; } _isLoading = false; @@ -271,6 +281,7 @@ class _PatientsScreenState extends State { }, builder: (_, model, w) => AppScaffold( appBarTitle: patientTypeTitle, + isShowAppBar: widget.isAppbar, isLoading: _isLoading, body: _isLoading ? Container() @@ -351,19 +362,24 @@ class _PatientsScreenState extends State { children: responseModelList .map((PatiantInformtion item) { - return PatientCard(patientInfo: item, + return PatientCard( + patientInfo: item, patientType: patientType, onTap: () { - Navigator.of(context) - .pushNamed( - PATIENTS_PROFILE, - arguments: { - "patient": item, - "patientType":patientType, - "from" : patient.getFrom, - "to" : patient.getTo, - }); - },); + Navigator.of(context) + .pushNamed( + PATIENTS_PROFILE, + arguments: { + "patient": item, + "patientType": + patientType, + "from": patient + .getFrom, + "to": + patient.getTo, + }); + }, + ); }).toList(), ) : Center( @@ -429,8 +445,7 @@ class _PatientsScreenState extends State { topRight: Radius.circular(12.5), topLeft: Radius.circular(9.5), bottomLeft: Radius.circular(9.5)), - color: - _isActive ? HexColor("#B8382B") : Colors.white, + color: _isActive ? HexColor("#B8382B") : Colors.white, ), child: Center( child: Text( @@ -470,9 +485,4 @@ class _PatientsScreenState extends State { ), ); } - - } - - - diff --git a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart index 5e749011..87a2aec4 100644 --- a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart @@ -22,6 +22,7 @@ class MyReferralPatientScreen extends StatelessWidget { onModelReady: (model) => model.getPendingReferralPatients(), builder: (_, model, w) => AppScaffold( baseViewModel: model, + isShowAppBar: false, appBarTitle: TranslationBase.of(context).referPatient, body: model.pendingReferral == null || model.pendingReferral.length == 0 ? Center( @@ -35,6 +36,7 @@ class MyReferralPatientScreen extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + SizedBox(height: 100), ProfileWelcomeWidget( AppText( authProvider.selectedClinicName != null diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart new file mode 100644 index 00000000..f4b04d02 --- /dev/null +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -0,0 +1,101 @@ +import 'dart:ui'; +import 'package:doctor_app_flutter/screens/doctor/my_referral_patient_screen.dart'; +import 'package:doctor_app_flutter/screens/doctor/my_referred_patient_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/referral/my-referral-patient-screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/referral/referred-patient-screen.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class PatientReferralScreen extends StatefulWidget { + @override + _PatientReferralScreen createState() => _PatientReferralScreen(); +} + +class _PatientReferralScreen extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + @override + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + @override + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).patientsreferral, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(65.0), + child: Center( + child: Container( + height: 60.0, + margin: EdgeInsets.only(top: 10.0), + width: MediaQuery.of(context).size.width * 0.92, // 0.9, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 0.9), //width: 0.7 + ), + color: Colors.white), + child: Center( + child: TabBar( + isScrollable: true, + controller: _tabController, + indicatorWeight: 5.0, + indicatorSize: TabBarIndicatorSize.tab, + labelColor: Theme.of(context).primaryColor, + labelPadding: + EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.30, + child: Center( + child: + AppText(TranslationBase.of(context).myReferral), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.30, + child: Center( + child: AppText( + TranslationBase.of(context).myReferredPatient), + ), + ), + ], + ), + ), + ), + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + MyReferralPatientScreen(), + MyReferredPatient(), + ], + ), + ) + ], + ), + )); + } +} diff --git a/lib/screens/reschedule-leaves/add-rescheduleleave.dart b/lib/screens/reschedule-leaves/add-rescheduleleave.dart index c3cbe19c..bb4e23ae 100644 --- a/lib/screens/reschedule-leaves/add-rescheduleleave.dart +++ b/lib/screens/reschedule-leaves/add-rescheduleleave.dart @@ -28,11 +28,13 @@ class AddRescheduleLeavScreen extends StatelessWidget { {model.getRescheduleLeave(), model.getCoveringDoctors()}, builder: (_, model, w) => AppScaffold( baseViewModel: model, + isShowAppBar: false, appBarTitle: TranslationBase.of(context).rescheduleLeaves, body: model.getReschduleLeave.length > 0 ? SingleChildScrollView( child: Column( children: [ + SizedBox(height: 50), Container( margin: EdgeInsets.only(left: 15, right: 15, top: 20), diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 789d2d0a..43fae7a6 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1126,6 +1126,13 @@ class TranslationBase { String get otherStatistic => localizedValues['otherStatistic'][locale.languageCode]; + + String get patientsreferral => + localizedValues['ptientsreferral'][locale.languageCode]; + String get arrivalpatient => + localizedValues['arrivalpatient'][locale.languageCode]; + String get searchmedicinepatient => + localizedValues['searchmedicinepatient'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/profile-welcome-widget.dart b/lib/widgets/patients/profile/profile-welcome-widget.dart index fe5a9c9b..f2baac67 100644 --- a/lib/widgets/patients/profile/profile-welcome-widget.dart +++ b/lib/widgets/patients/profile/profile-welcome-widget.dart @@ -18,65 +18,70 @@ class ProfileWelcomeWidget extends StatelessWidget { return Container( height: height, - color: HexColor('#515B5D'), + // color: HexColor('#515B5D'), width: double.infinity, child: FractionallySizedBox( widthFactor: 0.9, child: Row( + mainAxisAlignment: MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Row( - children: [ - AppText( - TranslationBase.of(context).welcome, - fontSize: SizeConfig.textMultiplier * 1.7, - color: Colors.white, - ) - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).dr + - ' ${authProvider.doctorProfile.doctorName}', - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.5, - color: Colors.white, - ) - ], - ), - SizedBox( - height: 4, - ), - clinicWidget, - ], + // Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // mainAxisAlignment: MainAxisAlignment.start, + // children: [ + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).welcome, + // fontSize: SizeConfig.textMultiplier * 1.7, + // color: Colors.black, + // ) + // ], + // ), + // Row( + // mainAxisAlignment: MainAxisAlignment.end, + // children: [ + AppText( + // TranslationBase.of(context).dr + + ' ${authProvider.doctorProfile.doctorName}', + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.5, + color: Colors.black, ), - Expanded( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - CircleAvatar( - // radius: (52) - child: ClipRRect( - borderRadius: BorderRadius.circular(10), - child: Image.network( - authProvider.doctorProfile.doctorImageURL, - fit: BoxFit.fill, - width: 70, - height: 60, - ), - ), - backgroundColor: Colors.transparent, - ) - ], - ), + SizedBox( + width: 20, ), + CircleAvatar( + // radius: (52) + child: ClipRRect( + borderRadius: BorderRadius.circular(10), + child: Image.network( + authProvider.doctorProfile.doctorImageURL, + fit: BoxFit.fill, + width: 75, + height: 75, + ), + ), + backgroundColor: Colors.transparent, + ) + // ], + // ), + // SizedBox( + // height: 4, + // ), + // clinicWidget, + /// ], + // ), + // Expanded( + // child: Column( + // mainAxisAlignment: MainAxisAlignment.start, + // crossAxisAlignment: CrossAxisAlignment.end, + // children: [ + + // ], + // ), + // ), ], ), ), diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index e337b72d..378094c7 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -14,7 +14,7 @@ import 'network_base_view.dart'; class AppScaffold extends StatelessWidget { final String appBarTitle; final Widget body; - final bool isLoading; + final bool isLoading; final bool isShowAppBar; final BaseViewModel baseViewModel; @@ -30,45 +30,45 @@ class AppScaffold extends StatelessWidget { AppGlobal.CONTEX = context; ProjectViewModel projectProvider = Provider.of(context); return GestureDetector( - onTap: (){ + onTap: () { FocusScope.of(context).requestFocus(new FocusNode()); }, child: Scaffold( - backgroundColor: Colors.white, - appBar: isShowAppBar - ? AppBar( - elevation: 0, - backgroundColor: HexColor('#515B5D'), - textTheme: TextTheme(headline6: TextStyle(color: Colors.white)), - title: Text(appBarTitle.toUpperCase()), - leading: Builder(builder: (BuildContext context) { - return IconButton( - icon: Icon(Icons.arrow_back_ios), - color: Colors.white, //Colors.black, - onPressed: () => Navigator.pop(context), - ); - }), - centerTitle: true, - actions: [ - IconButton( - icon: Icon(DoctorApp.home_icon_active), - color: Colors.white, //Colors.black, - onPressed: () => Navigator.pushNamedAndRemoveUntil( - context, HOME, (r) => false), - ), - ], - ) - : null, - body: projectProvider.isInternetConnection - ? baseViewModel != null - ? NetworkBaseView( - baseViewModel: baseViewModel, - child: body, - ) - : Stack( - children: [body, buildAppLoaderWidget(isLoading)]) - : Center( - child: Column( + backgroundColor: Colors.white, + appBar: isShowAppBar + ? AppBar( + elevation: 0, + backgroundColor: HexColor('#515B5D'), + textTheme: TextTheme(headline6: TextStyle(color: Colors.white)), + title: Text(appBarTitle.toUpperCase()), + leading: Builder(builder: (BuildContext context) { + return IconButton( + icon: Icon(Icons.arrow_back_ios), + color: Colors.white, //Colors.black, + onPressed: () => Navigator.pop(context), + ); + }), + centerTitle: true, + actions: [ + IconButton( + icon: Icon(DoctorApp.home_icon_active), + color: Colors.white, //Colors.black, + onPressed: () => Navigator.pushNamedAndRemoveUntil( + context, HOME, (r) => false), + ), + ], + ) + : null, + body: projectProvider.isInternetConnection + ? baseViewModel != null + ? NetworkBaseView( + baseViewModel: baseViewModel, + child: body, + ) + : Stack( + children: [body, buildAppLoaderWidget(isLoading)]) + : Center( + child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ diff --git a/lib/widgets/shared/bottom_nav_bar.dart b/lib/widgets/shared/bottom_nav_bar.dart index c30b1540..026f46b2 100644 --- a/lib/widgets/shared/bottom_nav_bar.dart +++ b/lib/widgets/shared/bottom_nav_bar.dart @@ -45,29 +45,29 @@ class _BottomNavBarState extends State { name: TranslationBase.of(context).home, ), BottomNavigationItem( - icon: DoctorApp.message_icon, - activeIcon: DoctorApp.message_icon_active, + icon: DoctorApp.schedule_icon, + activeIcon: DoctorApp.scdedule_icon_active, changeIndex: _changeIndex, index: _index, currentIndex: 1, - name: TranslationBase.of(context).replay2, + name: TranslationBase.of(context).mySchedule, ), BottomNavigationItem( - icon: DoctorApp.schedule_icon, - activeIcon: DoctorApp.scdedule_icon_active, + icon: DoctorApp.qr_code, + activeIcon: DoctorApp.qr_code, changeIndex: _changeIndex, index: _index, currentIndex: 2, - name: TranslationBase.of(context).mySchedule, + name: TranslationBase.of(context).qr, ), BottomNavigationItem( - icon: DoctorApp.qr_code, - activeIcon: DoctorApp.qr_code, + icon: DoctorApp.message_icon, + activeIcon: DoctorApp.message_icon_active, changeIndex: _changeIndex, index: _index, currentIndex: 3, - name: TranslationBase.of(context).qr, - ) + name: TranslationBase.of(context).replay2, + ), ], ), ), diff --git a/lib/widgets/shared/network_base_view.dart b/lib/widgets/shared/network_base_view.dart index b8db1546..139b85e8 100644 --- a/lib/widgets/shared/network_base_view.dart +++ b/lib/widgets/shared/network_base_view.dart @@ -15,6 +15,7 @@ class NetworkBaseView extends StatelessWidget { @override Widget build(BuildContext context) { return Container( + color: Colors.grey[100], child: buildBaseViewWidget(), ); }