diff --git a/assets/app_icons/config.json b/assets/app_icons/config.json new file mode 100644 index 00000000..b2f57098 --- /dev/null +++ b/assets/app_icons/config.json @@ -0,0 +1,122 @@ +{ + "name": "DQIcons", + "css_prefix_text": "", + "css_use_suffix": false, + "hinting": true, + "units_per_em": 1000, + "ascent": 850, + "glyphs": [ + { + "uid": "ff411ee29329279e60e33c8fe13b69cf", + "css": "blood-pressure", + "code": 59392, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M479.2 354.2V423.1A41.1 41.1 0 0 0 458.3 458.4 41.8 41.8 0 0 0 541.7 458.4 41.1 41.1 0 0 0 520.9 423.1V354.2A20.8 20.8 0 1 0 479.1 354.2ZM854.2 0C772.4 0 708.3 73.2 708.3 166.7 708.3 233.8 758.9 352.6 833.3 372V770.9A187.1 187.1 0 0 1 459.5 782.2C524.8 773.9 583.4 758.4 583.4 729.2V649A207.9 207.9 0 0 0 583.4 267.6V145.8C583.4 86.3 340.4 83.3 291.7 83.3S0 86.3 0 145.8V729.3C0 788.8 243 791.8 291.7 791.8 311.4 791.8 363.1 791.2 417.4 786.7A229 229 0 0 0 875 771V372C949.4 352.7 1000 233.8 1000 166.7 1000 73.2 935.9 0 854.2 0ZM666.7 458.3A166.7 166.7 0 1 1 500 291.7 166.8 166.8 0 0 1 666.7 458.3ZM291.7 125A1092.4 1092.4 0 0 1 519.3 145.8 1092.6 1092.6 0 0 1 291.7 166.7 1092.4 1092.4 0 0 1 64 145.8 1092.7 1092.7 0 0 1 291.7 125ZM125 739.8A343.8 343.8 0 0 1 41.8 721.9V181.6A427 427 0 0 0 125 199.2ZM291.7 750C246.4 750 203.7 747.8 166.7 744.4V203.3C220.8 207.8 272.1 208.4 291.7 208.4 327.7 208.4 470.1 206.7 541.7 181.6V254.2A208.3 208.3 0 1 0 541.7 662.5V721.9A850.6 850.6 0 0 1 291.7 750ZM854.2 333.3C801.5 333.3 750 227.9 750 166.7 750 96.5 795.8 41.6 854.2 41.6S958.3 96.5 958.3 166.7C958.4 227.9 906.9 333.3 854.2 333.3Z", + "width": 1000 + }, + "search": [ + "blood-pressure" + ] + }, + { + "uid": "f06e0a60c298fe46fcd558db3c9103e6", + "css": "blood", + "code": 59393, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M902.3 687.5A19.5 19.5 0 1 0 921.9 707 19.6 19.6 0 0 0 902.3 687.5ZM902.3 687.5M332 429.6A19.5 19.5 0 1 0 312.5 410.1 19.6 19.6 0 0 0 332 429.6ZM332 429.6M214.9 625A214.7 214.7 0 0 0 401.1 303.2L231.8 9.8A19.5 19.5 0 0 0 197.9 9.8L28.6 303.1A214.7 214.7 0 0 0 214.9 625ZM62.4 322.7L214.9 58.6 367.3 322.7A175.8 175.8 0 1 1 62.4 322.7ZM62.4 322.7M214.8 546.9A136.2 136.2 0 0 0 321.1 496.1 19.5 19.5 0 0 0 290.7 471.5 97.4 97.4 0 0 1 214.8 507.8 19.5 19.5 0 1 0 214.8 546.9ZM214.8 546.9M1000 726.4A272.4 272.4 0 0 0 954.8 575.6L723.8 189A19.6 19.6 0 0 0 689.6 190.3L487.1 594.3A273.5 273.5 0 1 0 999.9 726.4ZM726.6 960.7A234.4 234.4 0 0 1 521.5 612.9L521.8 612.1 708.6 239.5 921.5 596 921.9 596.7A234.4 234.4 0 0 1 726.4 960.6ZM726.6 960.7M898.9 766.2A19.5 19.5 0 0 0 874 778.2 156.5 156.5 0 0 1 726.4 882.9 19.5 19.5 0 0 0 726.4 922 195.5 195.5 0 0 0 910.9 791.1 19.5 19.5 0 0 0 898.9 766.2ZM898.9 766.2", + "width": 1000 + }, + "search": [ + "blood" + ] + }, + { + "uid": "8bc572f19109474e3c88db0439fd2dcc", + "css": "bmi", + "code": 59394, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M937.8 231.3H846.3V80.5A80.6 80.6 0 0 0 765.8 0H80.3A80.5 80.5 0 0 0 0 80.5V686.2A80.5 80.5 0 0 0 80.3 766.6H456V948.3A51.7 51.7 0 0 0 507.7 1000H937.8A51.7 51.7 0 0 0 989.3 948.3V283A51.7 51.7 0 0 0 937.8 231.3ZM80.3 733.3A47.1 47.1 0 0 1 33.3 686.2V80.5A47.1 47.1 0 0 1 80.3 33.3H765.8A47.2 47.2 0 0 1 813 80.5V231.3H634A216.5 216.5 0 0 0 210.3 240 40.5 40.5 0 0 0 249.9 288.3H455.9V733.3ZM464.2 255H457.9L451.6 229.5A76.5 76.5 0 0 1 472.2 245.5 51.4 51.4 0 0 0 464.2 255ZM415.1 220.1L423.8 255H348.6A78.3 78.3 0 0 1 414.2 220L414.9 220ZM507.7 231.3C506.5 231.3 505.3 231.6 504.1 231.7A109.7 109.7 0 0 0 442 190.3L431.2 146.7 444.5 153.1A16.7 16.7 0 0 0 458.8 122.9L413.7 101.6H413.4A16.2 16.2 0 0 0 409 100.2C408.6 100.2 408.3 100.2 407.9 100.2A17.5 17.5 0 0 0 406 100.2 16.2 16.2 0 0 0 402.1 100.9 13.6 13.6 0 0 0 400.5 101.3 17.6 17.6 0 0 0 395.7 104.2L395.7 104.2A16.7 16.7 0 0 0 392.5 108.1L365.6 152.8A16.7 16.7 0 0 0 394.2 170L400.3 159.8 407.2 187.5A112.5 112.5 0 0 0 311.3 255H250A6.8 6.8 0 0 1 244.5 252.5 7.4 7.4 0 0 1 243 246.3 183.3 183.3 0 0 1 599.8 231.3ZM956 948.3A18.4 18.4 0 0 1 937.7 966.6H507.7A18.4 18.4 0 0 1 489.3 948.3V283A18.4 18.4 0 0 1 507.7 264.7H937.8A18.4 18.4 0 0 1 956.2 283ZM878.7 300H566.6A44 44 0 0 0 522.7 344V506.2A44 44 0 0 0 566.6 550.2H878.7A44 44 0 0 0 922.6 506.2V344A44 44 0 0 0 878.7 300ZM889.3 506A10.7 10.7 0 0 1 878.7 516.6H566.6A10.7 10.7 0 0 1 556 506V343.8A10.7 10.7 0 0 1 566.6 333.1H878.7A10.7 10.7 0 0 1 889.3 343.8V506ZM631 566.7H547.7A16.7 16.7 0 0 0 531 583.3V666.7A16.7 16.7 0 0 0 547.7 683.3H631A16.7 16.7 0 0 0 647.7 666.7V583.3A16.7 16.7 0 0 0 631 566.7ZM614.3 650H564.2V600H614.3ZM764.3 566.7H681A16.7 16.7 0 0 0 664.3 583.3V666.7A16.7 16.7 0 0 0 681 683.3H764.3A16.7 16.7 0 0 0 781 666.7V583.3A16.7 16.7 0 0 0 764.3 566.7ZM747.7 650H697.6V600H747.6ZM897.7 566.7H814.3A16.7 16.7 0 0 0 797.7 583.3V666.7A16.7 16.7 0 0 0 814.3 683.3H897.7A16.7 16.7 0 0 0 914.3 666.7V583.3A16.7 16.7 0 0 0 897.7 566.7ZM881 650H830.9V600H880.9ZM631 700H547.7A16.7 16.7 0 0 0 531 716.7V800A16.7 16.7 0 0 0 547.7 816.7H631A16.7 16.7 0 0 0 647.7 800V716.7A16.7 16.7 0 0 0 631 700ZM614.3 783.3H564.2V733.3H614.3ZM764.3 700H681A16.7 16.7 0 0 0 664.3 716.7V800A16.7 16.7 0 0 0 681 816.7H764.3A16.7 16.7 0 0 0 781 800V716.7A16.7 16.7 0 0 0 764.3 700ZM747.7 783.3H697.6V733.3H747.6ZM897.7 700H814.3A16.7 16.7 0 0 0 797.7 716.7V800A16.7 16.7 0 0 0 814.3 816.7H897.7A16.7 16.7 0 0 0 914.3 800V716.7A16.7 16.7 0 0 0 897.7 700ZM881 783.3H830.9V733.3H880.9ZM631 833.3H547.7A16.7 16.7 0 0 0 531 850V933.3A16.7 16.7 0 0 0 547.7 950H631A16.7 16.7 0 0 0 647.7 933.3V850A16.7 16.7 0 0 0 631 833.3ZM614.3 916.7H564.2V866.6H614.3ZM764.3 833.3H681A16.7 16.7 0 0 0 664.3 850V933.3A16.7 16.7 0 0 0 681 950H764.3A16.7 16.7 0 0 0 781 933.3V850A16.7 16.7 0 0 0 764.3 833.3ZM747.7 916.7H697.6V866.6H747.6ZM897.7 833.3H814.3A16.7 16.7 0 0 0 797.7 850V933.3A16.7 16.7 0 0 0 814.3 950H897.7A16.7 16.7 0 0 0 914.3 933.3V850A16.7 16.7 0 0 0 897.7 833.3ZM881 916.7H830.9V866.6H880.9ZM626.8 350H593.5A16.7 16.7 0 0 0 576.9 366.7V483.3A16.7 16.7 0 0 0 593.5 500H626.8A41.7 41.7 0 0 0 668.5 458.3V450A41.2 41.2 0 0 0 660 425 41.3 41.3 0 0 0 668.5 399.9V391.6A41.7 41.7 0 0 0 626.8 350ZM610.2 383.3H626.8A8.3 8.3 0 0 1 635.2 391.7V400A8.3 8.3 0 0 1 626.8 408.4H610.2ZM635.2 458.5A8.3 8.3 0 0 1 626.8 466.9H610.2V441.9H626.8A8.3 8.3 0 0 1 635.2 450.2ZM802.9 350.8A16.7 16.7 0 0 0 784.3 356.7L747.7 405.4 711 356.5A16.7 16.7 0 0 0 681 366.5V499.8H714.2V416.7L734.2 443.4A17.3 17.3 0 0 0 760.9 443.4L780.9 416.7V500H814.2V366.7A16.7 16.7 0 0 0 802.9 350.8ZM831 350H864.2V500H831Z", + "width": 989 + }, + "search": [ + "bmi" + ] + }, + { + "uid": "66a5ea0b6227f324a7bcce70c85374a9", + "css": "heart", + "code": 59395, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M1308.4 475H1204.8A726.6 726.6 0 0 0 1225.9 394C1251.4 266.6 1234.4 162.5 1177.2 92.3A269.9 269.9 0 0 0 962.4 0.3 417.3 417.3 0 0 0 651.3 143.5 417.3 417.3 0 0 0 340.2 0.3 269.9 269.9 0 0 0 124.3 92.3C67 163 50.1 266.6 75.5 394A725.7 725.7 0 0 0 98.3 476.7H23.6A23.6 23.6 0 1 0 23.6 523.8H115.9C259.5 877 640.3 997.8 644.4 999A23.6 23.6 0 0 0 658.1 999C662.3 997.8 1044.3 877 1187.5 522.1H1308.3A23.6 23.6 0 0 0 1308.3 475.1ZM651.4 951.7H651.4C601.4 934.5 296 818.6 166.7 523.8H423.2L501.2 715.2A23.6 23.6 0 0 0 522.9 729.8H524.8A23.6 23.6 0 0 0 546 711.9L626 384.4 691.8 605.9A24.1 24.1 0 0 0 737.3 607L803.9 422.9 874.5 513.1A23.6 23.6 0 0 0 892.9 522H1136.9C1007.7 817.7 701 934.5 651.4 951.7ZM1179.8 384.8A673.4 673.4 0 0 1 1154.7 475.3H904.5L814.3 360.7A23.6 23.6 0 0 0 773.6 367.3L716.8 523.6 646.2 288.3A23.9 23.9 0 0 0 600.2 289.5L517.6 630.2 460.6 491.3A23.6 23.6 0 0 0 438.7 476.7H147.9A676.1 676.1 0 0 1 122.8 384.8H122.8C99.3 271.8 113.6 181.2 161.9 122.3A223.9 223.9 0 0 1 340.1 47.3 362.4 362.4 0 0 1 631.7 195.7 23.6 23.6 0 0 0 670.8 195.7 362.4 362.4 0 0 1 962.4 47.3 223.9 223.9 0 0 1 1140.7 122.2C1187.8 181.2 1202.4 271.8 1179.8 384.8Z", + "width": 1332 + }, + "search": [ + "heart" + ] + }, + { + "uid": "4131eb4c890febf6ff3d52e759eed4d4", + "css": "height", + "code": 59396, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M518 285.7H508.4A107.1 107.1 0 1 0 349.1 285.7H339.4A89.4 89.4 0 0 0 250.3 374.9V624.9A17.9 17.9 0 0 0 268.1 642.7H321.7V982.2A17.9 17.9 0 0 0 339.6 1000H446.7A89.4 89.4 0 0 0 535.9 910.9V643H589.5A17.9 17.9 0 0 0 607.4 625.1V375A89.4 89.4 0 0 0 518 285.7ZM428.8 142.9A71.4 71.4 0 1 1 357.4 214.3 71.5 71.5 0 0 1 428.6 142.9ZM439.8 321.4L428.8 354.2 417.9 321.4ZM571.7 607.1H536V375H500.3V910.8A53.6 53.6 0 0 1 446.7 964.3V642.9H411V964.3H357.1V375H321.4V607.1H285.7V375A53.6 53.6 0 0 1 339.3 321.4H380L411.7 416.3A17.8 17.8 0 0 0 445.5 416.3L477.2 321.4H518A53.6 53.6 0 0 1 571.6 375V607.1ZM196.4 0H17.9A17.9 17.9 0 0 0 0 17.9V982.2A17.9 17.9 0 0 0 17.9 1000H196.5A17.9 17.9 0 0 0 214.3 982.2V17.9A17.9 17.9 0 0 0 196.4 0ZM178.6 107.1H142.9V142.9H178.6V214.3H107.1V250H178.6V321.4H142.9V357.1H178.6V428.7H107.1V464.4H178.6V535.9H142.9V571.6H178.6V643H107.1V678.7H178.6V750.2H142.9V785.9H178.6V857.3H107.1V893H178.6V964.5H35.7V35.7H178.6Z", + "width": 804 + }, + "search": [ + "height" + ] + }, + { + "uid": "7da96eaf449227b65b25e28f024492a7", + "css": "outline", + "code": 59397, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M295.8 216.2L303.6 183.8C300.3 183 222.5 165.2 167.6 293.5L198.2 306.8C241.3 206 293.6 215.8 295.8 216.2ZM147.9 1000C279.8 1000 416.2 671.4 416.2 583.3A102.5 102.5 0 0 0 399.1 524L499.6 423.6 600 524A102.5 102.5 0 0 0 582.9 583.3C582.9 671.4 719.4 1000 851.2 1000A94.7 94.7 0 0 0 928.2 950.1C1001.6 841.4 1023 563 968.4 427.4A1298.8 1298.8 0 0 0 893.8 267C832.1 156.3 772.7 100.2 717.3 100.2 692.2 100.2 667.5 118.5 646.3 153.3A349.4 349.4 0 0 0 604 380.8L566.2 343.1V16.6A16.6 16.6 0 0 0 549.6 0H449.6A16.6 16.6 0 0 0 432.9 16.6V343L395.2 380.8A349.4 349.4 0 0 0 352.9 153.1C331.6 118.3 307 99.9 281.9 99.9 156.3 99.9 43.6 392.7 30.7 427.2-23.9 562.8-2.5 841.2 70.9 949.9A94.7 94.7 0 0 0 147.9 1000ZM674.5 170.6C688.9 147.3 704.9 133.3 717.3 133.3 804.4 133.3 905.6 354.1 937.3 439.1L937.3 439.5C987.9 564.8 968 831.4 900.5 931.4 884.7 954.6 868.1 966.6 851.1 966.6 749.5 966.6 616.1 669.5 616.1 583.3A77.3 77.3 0 0 1 640.4 526 140.2 140.2 0 0 0 657 503 213.7 213.7 0 0 0 688.8 530.9 126.6 126.6 0 0 0 649.4 633.3H682.6A97.1 97.1 0 0 1 709.2 557.1 373 373 0 0 1 732.6 700C732.6 746.1 753.5 833.3 832.6 833.3V800.1C767 800.1 765.9 704.1 765.9 700.1A433 433 0 0 0 745.5 559 185.9 185.9 0 0 0 783.7 565.9 302.4 302.4 0 0 0 870.8 745.2L894.4 721.6A272.8 272.8 0 0 1 817.6 568 93.1 93.1 0 0 1 899.7 636.6L932.4 629.9A128.5 128.5 0 0 0 799.5 533.2 153.6 153.6 0 0 1 722.1 512.6 152.4 152.4 0 0 0 731.5 493.5 117.5 117.5 0 0 0 773.1 501.2 122.7 122.7 0 0 0 861.2 461.7L837.7 438.1A84.3 84.3 0 0 1 740.6 461 100.7 100.7 0 0 0 711.3 371.5L687.7 395A78.9 78.9 0 0 1 694.7 493.1 172.2 172.2 0 0 1 665.3 460.3 155.7 155.7 0 0 0 648 409.1C616.1 345.9 636.4 232.6 674.5 170.6ZM630.5 454.6A42.4 42.4 0 0 1 620.8 497.8L573.1 450 599.7 423.4ZM576 400L549.4 426.6 516.2 393.4V366.8H542.7ZM466.2 33.2H532.9V66.5H466.2ZM466.2 99.9H532.9V133.1H466.2ZM466.2 166.6H532.9V199.8H466.2ZM466.2 233.2H532.9V266.5H466.2ZM466.2 299.9H532.9V333.1H466.2ZM456.5 366.6H483.1V393.2L449.8 426.4 423.2 399.8ZM399.6 423.6L426.2 450.1 378.3 497.7A42.4 42.4 0 0 1 368.5 454.5ZM61.7 439.6L61.7 439.1C93.4 354.1 194.6 133.4 281.7 133.4 294.1 133.4 310 147.3 324.4 170.7 362.6 232.7 382.8 345.9 351 409.2A155.7 155.7 0 0 0 333.7 460.5 172.4 172.4 0 0 1 304.2 493.3 78.7 78.7 0 0 1 311.3 395.2L287.7 371.6A100.7 100.7 0 0 0 258.4 461.3 84.3 84.3 0 0 1 161.3 438.5L137.8 462A122.8 122.8 0 0 0 225.9 501.6 117.5 117.5 0 0 0 267.6 493.8 152.3 152.3 0 0 0 277 512.9 153.6 153.6 0 0 1 199.6 533.5 128.6 128.6 0 0 0 66.6 630.2L99.3 636.9A91.8 91.8 0 0 1 181.2 567.9 273 273 0 0 1 104.4 721.5L128 745.1A302.4 302.4 0 0 0 215.1 565.9 185.9 185.9 0 0 0 253.3 558.9 432.9 432.9 0 0 0 232.9 700C232.9 704.1 231.8 800 166.2 800V833.2C245.3 833.2 266.2 746 266.2 699.9A373.6 373.6 0 0 1 289.5 557 97.4 97.4 0 0 1 316.1 633.1H349.3A126.7 126.7 0 0 0 309.9 530.8 213.8 213.8 0 0 0 341.6 502.9 140.2 140.2 0 0 0 358.3 525.8 77.3 77.3 0 0 1 382.6 583.1C382.6 669.3 249.1 966.4 147.6 966.4 130.6 966.4 114 954.6 98.2 931.2 31 831.5 11.1 565 61.7 439.6ZM800.9 306.6L831.5 293.3C776.5 165 698.8 182.9 695.5 183.6L703.3 216C705.5 215.8 757.9 206.1 800.9 306.6Z", + "width": 999 + }, + "search": [ + "outline" + ] + }, + { + "uid": "9ad94ca188c9245ce61a2023913176f8", + "css": "thermometer", + "code": 59398, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M183.4 0A116.7 116.7 0 0 0 66.7 116.6V675.1A183.3 183.3 0 1 0 366.6 816.3 181.6 181.6 0 0 0 300 675.1V116.6A116.7 116.7 0 0 0 183.4 0ZM333.3 816.3A150 150 0 1 1 93.4 696.6 16.7 16.7 0 0 0 100.1 683.2V633.1H133.3V599.9H100.1V549.8H133.3V516.6H100.1V466.5H133.3V433.3H100.1V383.2H133.3V350H100.1V299.9H133.3V266.6H100.1V216.6H133.3V183.3H100.1V116.6A83.3 83.3 0 0 1 266.7 116.6V683.3A16.6 16.6 0 0 0 273.3 696.6 148.8 148.8 0 0 1 333.3 816.3ZM333.3 816.3M200.1 734.7V150H166.9V734.7A83.3 83.3 0 1 0 200.1 734.7ZM183.4 866.3A50 50 0 1 1 233.4 816.3 50 50 0 0 1 183.4 866.3ZM183.4 866.3", + "width": 367 + }, + "search": [ + "thermometer" + ] + }, + { + "uid": "dc83d16b71561f6b582663f6b4d604ec", + "css": "weight-scale", + "code": 59399, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M912.1 0H87.9A88 88 0 0 0 0 87.9V912.1A88 88 0 0 0 87.9 1000H912.1A88 88 0 0 0 1000 912.1V87.9A88 88 0 0 0 912.1 0ZM941.4 912.1A29.3 29.3 0 0 1 912.1 941.4H87.9A29.3 29.3 0 0 1 58.6 912.1V87.9A29.3 29.3 0 0 1 87.9 58.6H912.1A29.3 29.3 0 0 1 941.4 87.9ZM941.4 912.1M837.9 233.7A563.3 563.3 0 0 0 162.2 233.7 29.3 29.3 0 0 0 156.4 274.9L311.1 480.7A29.3 29.3 0 0 0 352.2 486.5 246.9 246.9 0 0 1 648.4 486.5 29.3 29.3 0 0 0 689.5 480.7L844.2 274.9A29.3 29.3 0 0 0 838.4 233.7ZM659 422.9A302 302 0 0 0 529.3 379.8V290.6A29.3 29.3 0 0 0 470.7 290.6V379.8A302 302 0 0 0 341 422.9L221.2 263.6A504.8 504.8 0 0 1 778.8 263.6ZM659 422.9", + "width": 1000 + }, + "search": [ + "weight-scale" + ] + } + ] +} \ No newline at end of file diff --git a/assets/app_icons/fonts/DQIcons.ttf b/assets/app_icons/fonts/DQIcons.ttf new file mode 100644 index 00000000..ddb147b0 Binary files /dev/null and b/assets/app_icons/fonts/DQIcons.ttf differ diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 7a99333e..cc9da16f 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -214,6 +214,13 @@ const Map> localizedValues = { "sent-requests": {"en": "Sent Requests", "ar": "الطلبات المرسلة"}, "recieved-requests": {"en": "Recieved Requests", "ar": "الطلبات المستلمة"}, "manage-files": {"en": "Manage Family Files", "ar": "إدارة ملفات العائلة"}, + "request": {"en": "Request", "ar": "طلبات الاضافة"}, + "member-name": {"en": "Member Name", "ar": "اسم العضو"}, + "switch-login": {"en": "Switch User", "ar": "تغير المستخدم"}, + "remove-member": {"en": "Remove", "ar": "حذف"}, + "allow-view": {"en": "Allow", "ar": "قبول"}, + "reject-view": {"en": "Reject", "ar": "رفض"}, + "delete-view": {"en": "Delete", "ar": "حذف"}, // "my-family": {"en": "MY FAMILY", "ar": "عائلتي"}, "approvals": {"en": "Approvals", "ar": "موفقات التأمين"}, "approvalNo": {"en": "Approval No.: ", "ar": "رقم الموافقة: "}, diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 9586b862..05cb0f8b 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -1,6 +1,7 @@ import 'dart:convert'; import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:http/http.dart' as http; @@ -22,22 +23,26 @@ class BaseAppClient { String url = BASE_URL + endPoint; try { //Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - // String token = await sharedPref.getString(TOKEN); - -// body['SetupID'] = SETUP_ID; -// body['VersionID'] = VERSION_ID; -// body['Channel'] = CHANNEL; -// body['LanguageID'] = LANGUAGE; -// body['IPAdress'] = IP_ADDRESS; -// body['generalid'] = GENERAL_ID; -// body['PatientOutSA'] = PATIENT_OUT_SA; -// body['SessionID'] = SESSION_ID; -// body['isDentalAllowedBackend'] = IS_DENTAL_ALLOWED_BACKEND; -// body['DeviceTypeID'] = DeviceTypeID; -// body['PatientType'] = PATIENT_TYPE; -// body['PatientTypeID'] = PATIENT_TYPE_ID; - body['TokenID'] = '@dm!n'; - body['PatientID'] = 1231755; + String token = await sharedPref.getString(TOKEN); + var user = await sharedPref.getObject(USER_PROFILE); + body['SetupID'] = SETUP_ID; + body['VersionID'] = VERSION_ID; + body['Channel'] = CHANNEL; + body['LanguageID'] = LANGUAGE; + body['IPAdress'] = IP_ADDRESS; + body['generalid'] = GENERAL_ID; + // body['PatientOutSA'] = PATIENT_OUT_SA; + body['SessionID'] = null; //SESSION_ID; + body['isDentalAllowedBackend'] = IS_DENTAL_ALLOWED_BACKEND; + body['DeviceTypeID'] = DeviceTypeID; + body['PatientType'] = PATIENT_TYPE; + body['PatientTypeID'] = PATIENT_TYPE_ID; + if (user != null) { + body['TokenID'] = token; //user['TokenID']; + body['PatientID'] = user['PatientID']; + body['PatientOutSA'] = user['OutSA']; + body['SessionID'] = getSessionId(token); + } print("URL : $url"); print("Body : ${json.encode(body)}"); @@ -54,29 +59,24 @@ class BaseAppClient { onFailure('Error While Fetching data', statusCode); } else { var parsed = json.decode(response.body.toString()); - if (parsed['Response_Message'] != null) { + if (isAllowAny) { onSuccess(parsed, statusCode); - } else { - if (!parsed['IsAuthenticated']) { - if (parsed['isSMSSent'] == true) { - onSuccess(parsed, statusCode); - } - // await helpers.logout(); - //helpers.showErrorToast('Your session expired Please login agian'); - var asd = ""; - // TODO create logout fun - } else if (parsed['MessageStatus'] == 1 || - parsed['SMSLoginRequired'] == true) { + } else if (!parsed['IsAuthenticated']) { + if (parsed['isSMSSent'] == true) { + onSuccess(parsed, statusCode); + } else if (parsed['MessageStatus'] == 1) { onSuccess(parsed, statusCode); } else { - if (parsed['SameClinicApptList'] != null) { - onSuccess(parsed, statusCode); - } else { - onFailure( - parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], - statusCode); - } + onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); + logout(); } + } else if (parsed['MessageStatus'] == 1 || + parsed['SMSLoginRequired'] == true) { + onSuccess(parsed, statusCode); + } else { + onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); } } } else { @@ -87,4 +87,12 @@ class BaseAppClient { onFailure(e.toString(), -1); } } + + logout() async { + await sharedPref.remove(LOGIN_TOKEN_ID); + } + + String getSessionId(String id) { + return id.replaceAll('/[^a-zA-Z ]', ''); + } } diff --git a/lib/d_q_icons_icons.dart b/lib/d_q_icons_icons.dart new file mode 100644 index 00000000..570861bf --- /dev/null +++ b/lib/d_q_icons_icons.dart @@ -0,0 +1,32 @@ +/// Flutter icons DQIcons +/// Copyright (C) 2020 by original authors @ fluttericon.com, fontello.com +/// This font was generated by FlutterIcon.com, which is derived from Fontello. +/// +/// To use this font, place it in your fonts/ directory and include the +/// following in your pubspec.yaml +/// +/// flutter: +/// fonts: +/// - family: DQIcons +/// fonts: +/// - asset: fonts/DQIcons.ttf +/// +/// +/// +import 'package:flutter/widgets.dart'; + +class DQIcons { + DQIcons._(); + + static const _kFontFam = 'DQIcons'; + static const _kFontPkg = null; + + static const IconData blood_pressure = IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData blood = IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData bmi = IconData(0xe802, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData heart = IconData(0xe803, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData height = IconData(0xe804, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData outline = IconData(0xe805, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData thermometer = IconData(0xe806, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData weight_scale = IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg); +} diff --git a/lib/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart b/lib/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart new file mode 100644 index 00000000..da848b65 --- /dev/null +++ b/lib/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart @@ -0,0 +1,347 @@ +class GetAllSharedRecordsByStatusResponse { + Null date; + int languageID; + int serviceName; + Null time; + Null androidLink; + Null authenticationTokenID; + Null data; + bool dataw; + int dietType; + Null errorCode; + Null errorEndUserMessage; + Null errorEndUserMessageN; + Null errorMessage; + int errorType; + int foodCategory; + Null iOSLink; + bool isAuthenticated; + int mealOrderStatus; + int mealType; + int messageStatus; + int numberOfResultRecords; + Null patientBlodType; + Null successMsg; + Null successMsgN; + Null doctorInformationList; + Null getAllPendingRecordsList; + List getAllSharedRecordsByStatusList; + Null getResponseFileList; + bool isHMGPatient; + bool isLoginSuccessfully; + bool isNeedUpdateIdintificationNo; + bool kioskSendSMS; + Null list; + Null listAskHabibMobileLoginInfo; + Null listAskHabibPatientFile; + Null listMergeFiles; + Null listMobileLoginInfo; + Null listPatientCount; + Null logInTokenID; + Null mohemmPrivilegeList; + int pateintID; + Null patientBloodType; + Null patientERDriverFile; + Null patientERDriverFileList; + bool patientHasFile; + Null patientMergedIDs; + bool patientOutSA; + int patientShareRequestID; + int patientType; + int projectIDOut; + Null returnMessage; + bool sMSLoginRequired; + Null servicePrivilegeList; + Null sharePatientName; + Null verificationCode; + Null email; + Null errorList; + bool hasFile; + bool isActiveCode; + bool isMerged; + bool isNeedUserAgreement; + bool isSMSSent; + Null memberList; + Null message; + int statusCode; + + GetAllSharedRecordsByStatusResponse( + {this.date, + this.languageID, + this.serviceName, + this.time, + this.androidLink, + this.authenticationTokenID, + this.data, + this.dataw, + this.dietType, + this.errorCode, + this.errorEndUserMessage, + this.errorEndUserMessageN, + this.errorMessage, + this.errorType, + this.foodCategory, + this.iOSLink, + this.isAuthenticated, + this.mealOrderStatus, + this.mealType, + this.messageStatus, + this.numberOfResultRecords, + this.patientBlodType, + this.successMsg, + this.successMsgN, + this.doctorInformationList, + this.getAllPendingRecordsList, + this.getAllSharedRecordsByStatusList, + this.getResponseFileList, + this.isHMGPatient, + this.isLoginSuccessfully, + this.isNeedUpdateIdintificationNo, + this.kioskSendSMS, + this.list, + this.listAskHabibMobileLoginInfo, + this.listAskHabibPatientFile, + this.listMergeFiles, + this.listMobileLoginInfo, + this.listPatientCount, + this.logInTokenID, + this.mohemmPrivilegeList, + this.pateintID, + this.patientBloodType, + this.patientERDriverFile, + this.patientERDriverFileList, + this.patientHasFile, + this.patientMergedIDs, + this.patientOutSA, + this.patientShareRequestID, + this.patientType, + this.projectIDOut, + this.returnMessage, + this.sMSLoginRequired, + this.servicePrivilegeList, + this.sharePatientName, + this.verificationCode, + this.email, + this.errorList, + this.hasFile, + this.isActiveCode, + this.isMerged, + this.isNeedUserAgreement, + this.isSMSSent, + this.memberList, + this.message, + this.statusCode}); + + GetAllSharedRecordsByStatusResponse.fromJson(Map json) { + date = json['Date']; + languageID = json['LanguageID']; + serviceName = json['ServiceName']; + time = json['Time']; + androidLink = json['AndroidLink']; + authenticationTokenID = json['AuthenticationTokenID']; + data = json['Data']; + dataw = json['Dataw']; + dietType = json['DietType']; + errorCode = json['ErrorCode']; + errorEndUserMessage = json['ErrorEndUserMessage']; + errorEndUserMessageN = json['ErrorEndUserMessageN']; + errorMessage = json['ErrorMessage']; + errorType = json['ErrorType']; + foodCategory = json['FoodCategory']; + iOSLink = json['IOSLink']; + isAuthenticated = json['IsAuthenticated']; + mealOrderStatus = json['MealOrderStatus']; + mealType = json['MealType']; + messageStatus = json['MessageStatus']; + numberOfResultRecords = json['NumberOfResultRecords']; + patientBlodType = json['PatientBlodType']; + successMsg = json['SuccessMsg']; + successMsgN = json['SuccessMsgN']; + doctorInformationList = json['DoctorInformation_List']; + getAllPendingRecordsList = json['GetAllPendingRecordsList']; + if (json['GetAllSharedRecordsByStatusList'] != null) { + getAllSharedRecordsByStatusList = + new List(); + json['GetAllSharedRecordsByStatusList'].forEach((v) { + getAllSharedRecordsByStatusList + .add(new GetAllSharedRecordsByStatusList.fromJson(v)); + }); + } + getResponseFileList = json['GetResponseFileList']; + isHMGPatient = json['IsHMGPatient']; + isLoginSuccessfully = json['IsLoginSuccessfully']; + isNeedUpdateIdintificationNo = json['IsNeedUpdateIdintificationNo']; + kioskSendSMS = json['KioskSendSMS']; + list = json['List']; + listAskHabibMobileLoginInfo = json['List_AskHabibMobileLoginInfo']; + listAskHabibPatientFile = json['List_AskHabibPatientFile']; + listMergeFiles = json['List_MergeFiles']; + listMobileLoginInfo = json['List_MobileLoginInfo']; + listPatientCount = json['List_PatientCount']; + logInTokenID = json['LogInTokenID']; + mohemmPrivilegeList = json['MohemmPrivilege_List']; + pateintID = json['PateintID']; + patientBloodType = json['PatientBloodType']; + patientERDriverFile = json['PatientER_DriverFile']; + patientERDriverFileList = json['PatientER_DriverFileList']; + patientHasFile = json['PatientHasFile']; + patientMergedIDs = json['PatientMergedIDs']; + patientOutSA = json['PatientOutSA']; + patientShareRequestID = json['PatientShareRequestID']; + patientType = json['PatientType']; + projectIDOut = json['ProjectIDOut']; + returnMessage = json['ReturnMessage']; + sMSLoginRequired = json['SMSLoginRequired']; + servicePrivilegeList = json['ServicePrivilege_List']; + sharePatientName = json['SharePatientName']; + verificationCode = json['VerificationCode']; + email = json['email']; + errorList = json['errorList']; + hasFile = json['hasFile']; + isActiveCode = json['isActiveCode']; + isMerged = json['isMerged']; + isNeedUserAgreement = json['isNeedUserAgreement']; + isSMSSent = json['isSMSSent']; + memberList = json['memberList']; + message = json['message']; + statusCode = json['statusCode']; + } + + Map toJson() { + final Map data = new Map(); + data['Date'] = this.date; + data['LanguageID'] = this.languageID; + data['ServiceName'] = this.serviceName; + data['Time'] = this.time; + data['AndroidLink'] = this.androidLink; + data['AuthenticationTokenID'] = this.authenticationTokenID; + data['Data'] = this.data; + data['Dataw'] = this.dataw; + data['DietType'] = this.dietType; + data['ErrorCode'] = this.errorCode; + data['ErrorEndUserMessage'] = this.errorEndUserMessage; + data['ErrorEndUserMessageN'] = this.errorEndUserMessageN; + data['ErrorMessage'] = this.errorMessage; + data['ErrorType'] = this.errorType; + data['FoodCategory'] = this.foodCategory; + data['IOSLink'] = this.iOSLink; + data['IsAuthenticated'] = this.isAuthenticated; + data['MealOrderStatus'] = this.mealOrderStatus; + data['MealType'] = this.mealType; + data['MessageStatus'] = this.messageStatus; + data['NumberOfResultRecords'] = this.numberOfResultRecords; + data['PatientBlodType'] = this.patientBlodType; + data['SuccessMsg'] = this.successMsg; + data['SuccessMsgN'] = this.successMsgN; + data['DoctorInformation_List'] = this.doctorInformationList; + data['GetAllPendingRecordsList'] = this.getAllPendingRecordsList; + if (this.getAllSharedRecordsByStatusList != null) { + data['GetAllSharedRecordsByStatusList'] = + this.getAllSharedRecordsByStatusList.map((v) => v.toJson()).toList(); + } + data['GetResponseFileList'] = this.getResponseFileList; + data['IsHMGPatient'] = this.isHMGPatient; + data['IsLoginSuccessfully'] = this.isLoginSuccessfully; + data['IsNeedUpdateIdintificationNo'] = this.isNeedUpdateIdintificationNo; + data['KioskSendSMS'] = this.kioskSendSMS; + data['List'] = this.list; + data['List_AskHabibMobileLoginInfo'] = this.listAskHabibMobileLoginInfo; + data['List_AskHabibPatientFile'] = this.listAskHabibPatientFile; + data['List_MergeFiles'] = this.listMergeFiles; + data['List_MobileLoginInfo'] = this.listMobileLoginInfo; + data['List_PatientCount'] = this.listPatientCount; + data['LogInTokenID'] = this.logInTokenID; + data['MohemmPrivilege_List'] = this.mohemmPrivilegeList; + data['PateintID'] = this.pateintID; + data['PatientBloodType'] = this.patientBloodType; + data['PatientER_DriverFile'] = this.patientERDriverFile; + data['PatientER_DriverFileList'] = this.patientERDriverFileList; + data['PatientHasFile'] = this.patientHasFile; + data['PatientMergedIDs'] = this.patientMergedIDs; + data['PatientOutSA'] = this.patientOutSA; + data['PatientShareRequestID'] = this.patientShareRequestID; + data['PatientType'] = this.patientType; + data['ProjectIDOut'] = this.projectIDOut; + data['ReturnMessage'] = this.returnMessage; + data['SMSLoginRequired'] = this.sMSLoginRequired; + data['ServicePrivilege_List'] = this.servicePrivilegeList; + data['SharePatientName'] = this.sharePatientName; + data['VerificationCode'] = this.verificationCode; + data['email'] = this.email; + data['errorList'] = this.errorList; + data['hasFile'] = this.hasFile; + data['isActiveCode'] = this.isActiveCode; + data['isMerged'] = this.isMerged; + data['isNeedUserAgreement'] = this.isNeedUserAgreement; + data['isSMSSent'] = this.isSMSSent; + data['memberList'] = this.memberList; + data['message'] = this.message; + data['statusCode'] = this.statusCode; + return data; + } +} + +class GetAllSharedRecordsByStatusList { + int iD; + int patientID; + int responseID; + int regionID; + int status; + Null isActive; + String editedOn; + String createdOn; + String emaiLAddress; + String mobileNumber; + String patientIdenficationNumber; + String patientName; + String statusDescription; + + GetAllSharedRecordsByStatusList( + {this.iD, + this.patientID, + this.responseID, + this.regionID, + this.status, + this.isActive, + this.editedOn, + this.createdOn, + this.emaiLAddress, + this.mobileNumber, + this.patientIdenficationNumber, + this.patientName, + this.statusDescription}); + + GetAllSharedRecordsByStatusList.fromJson(Map json) { + iD = json['ID']; + patientID = json['PatientID']; + responseID = json['ResponseID']; + regionID = json['RegionID']; + status = json['Status']; + isActive = json['IsActive']; + editedOn = json['EditedOn']; + createdOn = json['CreatedOn']; + emaiLAddress = json['EmaiLAddress']; + mobileNumber = json['MobileNumber']; + patientIdenficationNumber = json['PatientIdenficationNumber']; + patientName = json['PatientName']; + statusDescription = json['StatusDescription']; + } + + Map toJson() { + final Map data = new Map(); + data['ID'] = this.iD; + data['PatientID'] = this.patientID; + data['ResponseID'] = this.responseID; + data['RegionID'] = this.regionID; + data['Status'] = this.status; + data['IsActive'] = this.isActive; + data['EditedOn'] = this.editedOn; + data['CreatedOn'] = this.createdOn; + data['EmaiLAddress'] = this.emaiLAddress; + data['MobileNumber'] = this.mobileNumber; + data['PatientIdenficationNumber'] = this.patientIdenficationNumber; + data['PatientName'] = this.patientName; + data['StatusDescription'] = this.statusDescription; + return data; + } +} diff --git a/lib/models/FamilyFiles/GetAllSharedRecordsByStatusReq.dart b/lib/models/FamilyFiles/GetAllSharedRecordsByStatusReq.dart new file mode 100644 index 00000000..ac0adc34 --- /dev/null +++ b/lib/models/FamilyFiles/GetAllSharedRecordsByStatusReq.dart @@ -0,0 +1,68 @@ +class GetAllSharedRecordsByStatusReq { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + int status; + + GetAllSharedRecordsByStatusReq( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.status}); + + GetAllSharedRecordsByStatusReq.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + status = json['Status']; + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + data['Status'] = this.status; + return data; + } +} diff --git a/lib/pages/family/my-family.dart b/lib/pages/family/my-family.dart index 9d1a39e9..93638e52 100644 --- a/lib/pages/family/my-family.dart +++ b/lib/pages/family/my-family.dart @@ -1,15 +1,10 @@ -import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; -import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; -import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; +import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:diplomaticquarterapp/routes.dart'; class MyFamily extends StatefulWidget { @override @@ -18,6 +13,7 @@ class MyFamily extends StatefulWidget { class _MyFamily extends State { bool isLoading = true; + var familyFileProvider = FamilyFilesProvider(); @override void initState() { isLoading = true; @@ -29,23 +25,101 @@ class _MyFamily extends State { return AppScaffold( appBarTitle: TranslationBase.of(context).myFamilyFiles, isShowAppBar: true, - body: SingleChildScrollView( - padding: EdgeInsets.all(20), - child: Stack( + body: DefaultTabController( + length: 2, + child: SingleChildScrollView( + padding: EdgeInsets.all(20), + child: Container( + height: SizeConfig.realScreenHeight * .9, + width: SizeConfig.realScreenWidth, + child: Stack( + children: [ + TabBar( + indicatorColor: Colors.red, + tabs: [ + Padding( + padding: EdgeInsets.all(6), + child: + Text(TranslationBase.of(context).family)), + Padding( + padding: EdgeInsets.all(6), + child: + Text(TranslationBase.of(context).request)), + ], + ), + TabBarView( + children: [myFamilyDetails(), myFamilyRequest()], + ) + ], + ))))); + } + + Widget myFamilyDetails() { + return Padding( + padding: EdgeInsets.only(top: 40), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - TabBar( - tabs: [ - Tab(icon: Icon(Icons.directions_car)), - Tab(icon: Icon(Icons.directions_transit)), - ], - ), - TabBarView( - children: [ - Icon(Icons.directions_car), - Icon(Icons.directions_transit), - ], - ) + Expanded( + flex: 3, child: Text(TranslationBase.of(context).request)), + Expanded( + flex: 2, + child: Text( + TranslationBase.of(context).switchUser, + )), + Expanded( + flex: 1, + child: Text( + TranslationBase.of(context).deleteView, + )), ], - ))); + ), + FutureBuilder( + future: getFamilyFiles(), // async work + builder: (BuildContext context, + AsyncSnapshot snapshot) { + switch (snapshot.connectionState) { + case ConnectionState.waiting: + return Padding( + padding: EdgeInsets.all(10), + child: Text('Loading....')); + default: + if (snapshot.hasError) + return Padding( + padding: EdgeInsets.all(10), + child: Text(snapshot.error)); + else + return Column( + children: snapshot + .data.getAllSharedRecordsByStatusList + .map((result) { + return Padding( + padding: EdgeInsets.all(10), + child: Row( + children: [ + Expanded( + flex: 3, child: Text(result.patientName)), + Expanded(flex: 2, child: Icon(Icons.group)), + Expanded(flex: 1, child: Icon(Icons.delete)), + ], + )); + }).toList()); + } + }, + ) + ], + )); + } + + Widget myFamilyRequest() { + return Column( + children: [], + ); + } + + Future getFamilyFiles() { + return familyFileProvider.getSharedRecordByStatus(); } } diff --git a/lib/services/family_files/family_files_provider.dart b/lib/services/family_files/family_files_provider.dart new file mode 100644 index 00000000..25539040 --- /dev/null +++ b/lib/services/family_files/family_files_provider.dart @@ -0,0 +1,39 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordsByStatusReq.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:flutter/cupertino.dart'; + +// SharedPreferences sharedPref = new SharedPreferences(); +enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED } +AppSharedPreferences sharedPref = new AppSharedPreferences(); + +const String GET_SHARED_RECORD_BY_STATUS = + '/Authentication.svc/REST/GetAllSharedRecordsByStatus'; + +class FamilyFilesProvider with ChangeNotifier { + bool isLogin = false; + bool isLoading = true; + dynamic authenticatedUser; + + Future getSharedRecordByStatus() async { + try { + dynamic localRes; + var request = GetAllSharedRecordsByStatusReq(); + request.status = 0; + await new BaseAppClient().post(GET_SHARED_RECORD_BY_STATUS, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request.toJson()); + return Future.value( + GetAllSharedRecordsByStatusResponse.fromJson(localRes)); + } catch (error) { + print(error); + throw error; + } + } +} diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 21e74ce2..42156864 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -310,6 +310,14 @@ class TranslationBase { String get family => localizedValues['family'][locale.languageCode]; String get myFamilyFiles => localizedValues['family-title'][locale.languageCode]; + String get request => localizedValues['request'][locale.languageCode]; + String get memberName => localizedValues['member-name'][locale.languageCode]; + String get switchUser => localizedValues['switch-login'][locale.languageCode]; + String get removeMember => + localizedValues['remove-membe'][locale.languageCode]; + String get allowView => localizedValues['allow-view'][locale.languageCode]; + String get rejectView => localizedValues['reject-view'][locale.languageCode]; + String get deleteView => localizedValues['delete-view'][locale.languageCode]; String get approvals => localizedValues['approvals'][locale.languageCode]; String get approvalNo => localizedValues['approvalNo'][locale.languageCode]; String get companyName => localizedValues['companyName'][locale.languageCode]; diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index c9d281ce..3a76e924 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -1,7 +1,9 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import 'package:diplomaticquarterapp/routes.dart'; +import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/list/flexible_container.dart'; @@ -25,6 +27,7 @@ class _AppDrawerState extends State { } var sharedPref = new AppSharedPreferences(); + var familyFileProvider = FamilyFilesProvider(); AuthenticatedUser user; @override Widget build(BuildContext context) { @@ -54,52 +57,55 @@ class _AppDrawerState extends State { user != null ? Padding( padding: EdgeInsets.all(15), - child: Column(children: [ - Row( + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, children: [ - Padding( - padding: - EdgeInsets.only(right: 5), - child: Icon( - Icons.account_circle, + Row( + children: [ + Padding( + padding: EdgeInsets.only( + right: 5), + child: Icon( + Icons.account_circle, + color: Colors.red, + )), + AppText( + user.firstName + + ' ' + + user.lastName, color: Colors.red, - )), - AppText( - user.firstName + - ' ' + - user.lastName, - color: Colors.red, - ) - ], - ), - Row(children: [ - Padding( - padding: EdgeInsets.only( - left: 30, top: 5), - child: Column( - children: [ - AppText( - 'File No:' + - user.patientID - .toString(), - color: Colors.red, - fontSize: SizeConfig - .textMultiplier * - 1.5, - ), - AppText( - user.bloodGroup != null - ? 'Blood Group: ' + - user.bloodGroup - : '', - fontSize: SizeConfig - .textMultiplier * - 1.5, - ), - ], - )) - ]) - ])) + ) + ], + ), + Row(children: [ + Padding( + padding: EdgeInsets.only( + left: 30, top: 5), + child: Column( + children: [ + AppText( + 'File No:' + + user.patientID + .toString(), + color: Colors.red, + fontSize: SizeConfig + .textMultiplier * + 1.5, + ), + AppText( + user.bloodGroup != null + ? 'Blood Group: ' + + user.bloodGroup + : '', + fontSize: SizeConfig + .textMultiplier * + 1.5, + ), + ], + )) + ]) + ])) : SizedBox(), ], ), @@ -107,7 +113,7 @@ class _AppDrawerState extends State { ), ), Column( - mainAxisAlignment: MainAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, children: [ InkWell( child: DrawerItem( @@ -121,26 +127,16 @@ class _AppDrawerState extends State { ), user != null ? Column( + mainAxisAlignment: MainAxisAlignment.start, children: [ InkWell( - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - DrawerItem( - TranslationBase.of(context).family, - Icons.group, - textColor: Colors.red, - iconColor: Colors.red, - ), - Padding( - padding: EdgeInsets.only( - bottom: 10, right: 30), - child: Icon( - Icons.chevron_right, - color: Colors.red, - )) - ], + child: DrawerItem( + TranslationBase.of(context).family, + Icons.group, + textColor: Colors.red, + iconColor: Colors.red, + bottomLine: false, + sideArrow: true, ), onTap: () { Navigator.of(context).pushNamed( @@ -148,6 +144,75 @@ class _AppDrawerState extends State { ); }, ), + FutureBuilder( + future: getFamilyFiles(), // async work + builder: (BuildContext context, + AsyncSnapshot< + GetAllSharedRecordsByStatusResponse> + snapshot) { + switch (snapshot.connectionState) { + case ConnectionState.waiting: + return Padding( + padding: EdgeInsets.all(10), + child: Text('Loading....')); + default: + if (snapshot.hasError) + return Padding( + padding: EdgeInsets.all(10), + child: Text(snapshot.error)); + else + return Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + // <--- left side + color: Colors.grey[200], + width: 1.0, + ), + )), + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + mainAxisSize: + MainAxisSize.min, + children: snapshot.data + .getAllSharedRecordsByStatusList + .map((result) { + return result.status == 3 + ? Padding( + padding: EdgeInsets + .only( + bottom: + 5), + child: Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: < + Widget>[ + Expanded( + child: Icon( + Icons + .person), + ), + Expanded( + flex: 7, + child: Column( + crossAxisAlignment: CrossAxisAlignment + .start, + children: < + Widget>[ + Text(result.patientName), + Text('File No:' + + result.iD.toString()), + ])), + ], + )) + : SizedBox(); + }).toList())); + } + }, + ), InkWell( child: DrawerItem( TranslationBase.of(context) @@ -270,4 +335,8 @@ class _AppDrawerState extends State { ); } } + + Future getFamilyFiles() { + return familyFileProvider.getSharedRecordByStatus(); + } } diff --git a/lib/widgets/drawer/drawer_item_widget.dart b/lib/widgets/drawer/drawer_item_widget.dart index 0c913724..e5a1eb50 100644 --- a/lib/widgets/drawer/drawer_item_widget.dart +++ b/lib/widgets/drawer/drawer_item_widget.dart @@ -11,11 +11,14 @@ class DrawerItem extends StatefulWidget { final IconData icon; final Color textColor; final Color iconColor; - + final bool bottomLine; + final bool sideArrow; DrawerItem(this.title, this.icon, {this.textColor = Colors.black, this.iconColor = Colors.black87, - this.subTitle = ''}); + this.subTitle = '', + this.bottomLine = true, + this.sideArrow = false}); @override _DrawerItemState createState() => _DrawerItemState(); @@ -25,45 +28,54 @@ class _DrawerItemState extends State { @override Widget build(BuildContext context) { return Container( - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - // <--- left side - color: Colors.grey[200], - width: 1.0, - ), - )), - margin: EdgeInsets.only(left: 10, right: 10, top: 5), - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Padding( - padding: EdgeInsets.only(bottom: 30), - child: Icon( - widget.icon, - color: widget.iconColor, - size: SizeConfig.imageSizeMultiplier * 5, - )), - Padding( - padding: EdgeInsets.only(left: 5, right: 5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - widget.title, - color: widget.textColor, - fontSize: SizeConfig.textMultiplier * 2.3, - ), - Texts( - widget.subTitle, - color: widget.textColor, - fontSize: SizeConfig.textMultiplier * 2.5, + decoration: widget.bottomLine == true + ? BoxDecoration( + border: Border( + bottom: BorderSide( + // <--- left side + color: Colors.grey[200], + width: 1.0, ), - ], - ), - ) - ], - ), - ); + )) + : BoxDecoration(), + child: Padding( + padding: EdgeInsets.all(10), + child: Row( + children: [ + Expanded( + flex: 1, + child: Icon( + widget.icon, + color: widget.iconColor, + size: SizeConfig.imageSizeMultiplier * 5, + )), + Expanded( + flex: 7, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Texts( + widget.title, + color: widget.textColor, + fontSize: SizeConfig.textMultiplier * 2.3, + ), + widget.subTitle != '' + ? Texts( + widget.subTitle, + color: widget.textColor, + fontSize: SizeConfig.textMultiplier * 2.5, + ) + : SizedBox(), + ])), + widget.sideArrow == true + ? Expanded( + flex: 1, + child: + Icon(Icons.keyboard_arrow_right, color: Colors.red)) + : Expanded(flex: 1, child: SizedBox()) + ], + ), + )); } } diff --git a/pubspec.yaml b/pubspec.yaml index d9d89739..c711d722 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -113,6 +113,7 @@ flutter: - assets/images/login/ - assets/json/ + fonts: - family: WorkSans fonts: @@ -120,3 +121,7 @@ flutter: - asset: assets/fonts/Work_Sans/WorkSans-Bold.ttf - asset: assets/fonts/Work_Sans/WorkSans-Bold.ttf weight: 700 + + - family: DQIcons + fonts: + - asset: assets/app_icons/fonts/DQIcons.ttf