From bc92f9b9f54b1eedf67946789bd2c577db6de60f Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 15 Nov 2021 08:22:33 +0200 Subject: [PATCH 1/8] contries model --- lib/models/countriesModel.dart | 1087 ++++++++++++++++++++++++++++++++ 1 file changed, 1087 insertions(+) create mode 100644 lib/models/countriesModel.dart diff --git a/lib/models/countriesModel.dart b/lib/models/countriesModel.dart new file mode 100644 index 00000000..89797fab --- /dev/null +++ b/lib/models/countriesModel.dart @@ -0,0 +1,1087 @@ +// final List countries = [ +// new Countries( +// name: "Saudi Arabia", name_ar: "المملكة العربية السعودية", code: '966'), +// new Countries( +// name: "United Arab Emirates", +// name_ar: "الإمارات العربية المتحدة", +// code: '971'), +// ]; + +// class Countries { +// final String name; +// final String name_ar; +// final String code; + +// Countries({this.name, this.name_ar, this.code}); +// } + +class Countries { + String name; + String nameAr; + String code; + String countryCode; + + Countries({this.name, this.nameAr, this.code, this.countryCode}); + + Countries.fromJson(Map json) { + name = json['name']; + nameAr = json['name_ar']; + code = json['code']; + countryCode = json['countryCode']; + } + + Map toJson() { + final Map data = new Map(); + data['name'] = this.name; + data['name_ar'] = this.nameAr; + data['code'] = this.code; + data['countryCode'] = this.countryCode; + return data; + } +} + +List> countriesData = [ + { + "name": "Saudi Arabia", + "name_ar": "المملكة العربية السعودية", + "code": "+966", + "countryCode": "SA", + "pattern": "5xxxxxxxx", + "maxLength": 9 + }, + { + "name": "United Arab Emirates", + "name_ar": "الإمارات العربية المتحدة", + "code": "+971", + "countryCode": "AE", + "pattern": "5xxxxxxxx", + "maxLength": 9 + }, + { + "name": "Bahrain", + "name_ar": "البحرين", + "code": "+973", + "countryCode": "BH", + "maxLength": 8 + }, + {"name": "Kuwait", "name_ar": "الكويت", "code": "+965", "countryCode": "KW"}, + { + "name": "Afghanistan", + "name_ar": "أفغانستان", + "code": "+93", + "countryCode": "AF" + }, + { + "name": "Aland Islands", + "name_ar": "جزر آلاند", + "code": "+358", + "countryCode": "AX" + }, + { + "name": "Albania", + "name_ar": "ألبانيا", + "code": "+355", + "countryCode": "AL" + }, + { + "name": "Algeria", + "name_ar": "الجزائر", + "code": "+213", + "countryCode": "DZ" + }, + { + "name": "AmericanSamoa", + "name_ar": "ساموا الأمريكية", + "code": "+1 684", + "countryCode": "AS" + }, + {"name": "Andorra", "name_ar": "أندورا", "code": "+376", "countryCode": "AD"}, + {"name": "Angola", "name_ar": "أنغولا", "code": "+244", "countryCode": "AO"}, + { + "name": "Anguilla", + "name_ar": "أنغيلا", + "code": "+1 264", + "countryCode": "AI" + }, + { + "name": "Antarctica", + "name_ar": "القارة القطبية الجنوبية", + "code": "+672", + "countryCode": "AQ" + }, + { + "name": "Antigua and Barbuda", + "name_ar": "أنتيغوا وبربودا", + "code": "+1268", + "countryCode": "AG" + }, + { + "name": "Argentina", + "name_ar": "الأرجنتين", + "code": "+54", + "countryCode": "AR" + }, + { + "name": "Armenia", + "name_ar": "أرمينيا", + "code": "+374", + "countryCode": "AM" + }, + {"name": "Aruba", "name_ar": "أروبا", "code": "+297", "countryCode": "AW"}, + { + "name": "Australia", + "name_ar": "أستراليا", + "code": "+61", + "countryCode": "AU" + }, + {"name": "Austria", "name_ar": "النمسا", "code": "+43", "countryCode": "AT"}, + { + "name": "Azerbaijan", + "name_ar": "أذربيجان", + "code": "+994", + "countryCode": "AZ" + }, + { + "name": "Bahamas", + "name_ar": "الباهاما", + "code": "+1 242", + "countryCode": "BS" + }, + { + "name": "Bangladesh", + "name_ar": "بنغلاديش", + "code": "+880", + "countryCode": "BD" + }, + { + "name": "Barbados", + "name_ar": "بربادوس", + "code": "+1 246", + "countryCode": "BB" + }, + { + "name": "Belarus", + "name_ar": "روسيا البيضاء", + "code": "+375", + "countryCode": "BY" + }, + {"name": "Belgium", "name_ar": "بلجيكا", "code": "+32", "countryCode": "BE"}, + {"name": "Belize", "name_ar": "بليز", "code": "+501", "countryCode": "BZ"}, + {"name": "Benin", "name_ar": "بنين", "code": "+229", "countryCode": "BJ"}, + { + "name": "Bermuda", + "name_ar": "برمودا", + "code": "+1 441", + "countryCode": "BM" + }, + {"name": "Bhutan", "name_ar": "بوتان", "code": "+975", "countryCode": "BT"}, + { + "name": "Bolivia, Plurinational State of", + "name_ar": "دولة بوليفيا المتعددة القوميات", + "code": "+591", + "countryCode": "BO" + }, + { + "name": "Bosnia and Herzegovina", + "name_ar": "البوسنة والهرسك", + "code": "+387", + "countryCode": "BA" + }, + { + "name": "Botswana", + "name_ar": "بوتسوانا", + "code": "+267", + "countryCode": "BW" + }, + {"name": "Brazil", "name_ar": "البرازيل", "code": "+55", "countryCode": "BR"}, + { + "name": "British Indian Ocean Territory", + "name_ar": "إقليم المحيط البريطاني الهندي", + "code": "+246", + "countryCode": "IO" + }, + { + "name": "Brunei Darussalam", + "name_ar": "بروناي دار السلام", + "code": "+673", + "countryCode": "BN" + }, + { + "name": "Bulgaria", + "name_ar": "بلغاريا", + "code": "+359", + "countryCode": "BG" + }, + { + "name": "Burkina Faso", + "name_ar": "بوركينا فاسو", + "code": "+226", + "countryCode": "BF" + }, + { + "name": "Burundi", + "name_ar": "بوروندي", + "code": "+257", + "countryCode": "BI" + }, + { + "name": "Cambodia", + "name_ar": "كمبوديا", + "code": "+855", + "countryCode": "KH" + }, + { + "name": "Cameroon", + "name_ar": "الكاميرون", + "code": "+237", + "countryCode": "CM" + }, + {"name": "Canada", "name_ar": "كندا", "code": "+1", "countryCode": "CA"}, + { + "name": "Cape Verde", + "name_ar": "الرأس الأخضر", + "code": "+238", + "countryCode": "CV" + }, + { + "name": "Cayman Islands", + "name_ar": "جزر كايمان", + "code": "+345", + "countryCode": "KY" + }, + { + "name": "Central African Republic", + "name_ar": "جمهورية افريقيا الوسطى", + "code": "+236", + "countryCode": "CF" + }, + {"name": "Chad", "name_ar": "تشاد", "code": "+235", "countryCode": "TD"}, + {"name": "Chile", "name_ar": "تشيلي", "code": "+56", "countryCode": "CL"}, + {"name": "China", "name_ar": "الصين", "code": "+86", "countryCode": "CN"}, + { + "name": "Christmas Island", + "name_ar": "جزيرة الكريسماس", + "code": "+61", + "countryCode": "CX" + }, + { + "name": "Cocos (Keeling) Islands", + "name_ar": "جزر كوكوس كيلينغ", + "code": "+61", + "countryCode": "CC" + }, + { + "name": "Colombia", + "name_ar": "كولومبيا", + "code": "+57", + "countryCode": "CO" + }, + { + "name": "Comoros", + "name_ar": "جزر القمر", + "code": "+269", + "countryCode": "KM" + }, + {"name": "Congo", "name_ar": "الكونغو", "code": "+242", "countryCode": "CG"}, + { + "name": "Congo, The Democratic Republic of the Congo", + "name_ar": "الكونغو ، جمهورية الكونغو الديمقراطية", + "code": "+243", + "countryCode": "CD" + }, + { + "name": "Cook Islands", + "name_ar": "جزر كوك", + "code": "+682", + "countryCode": "CK" + }, + { + "name": "Costa Rica", + "name_ar": "كوستا ريكا", + "code": "+506", + "countryCode": "CR" + }, + { + "name": "Cote d'Ivoire", + "name_ar": "ساحل العاج", + "code": "+225", + "countryCode": "CI" + }, + { + "name": "Croatia", + "name_ar": "كرواتيا", + "code": "+385", + "countryCode": "HR" + }, + {"name": "Cuba", "name_ar": "كوبا", "code": "+53", "countryCode": "CU"}, + {"name": "Cyprus", "name_ar": "قبرص", "code": "+357", "countryCode": "CY"}, + { + "name": "Czech Republic", + "name_ar": "جمهورية التشيك", + "code": "+420", + "countryCode": "CZ" + }, + { + "name": "Denmark", + "name_ar": "الدنمارك", + "code": "+45", + "countryCode": "DK" + }, + { + "name": "Djibouti", + "name_ar": "جيبوتي", + "code": "+253", + "countryCode": "DJ" + }, + { + "name": "Dominica", + "name_ar": "دومينيكا", + "code": "+1 767", + "countryCode": "DM" + }, + { + "name": "Dominican Republic", + "name_ar": "جمهورية الدومنيكان", + "code": "+1 849", + "countryCode": "DO" + }, + { + "name": "Ecuador", + "name_ar": "الإكوادور", + "code": "+593", + "countryCode": "EC" + }, + {"name": "Egypt", "name_ar": "مصر", "code": "+20", "countryCode": "EG"}, + { + "name": "El Salvador", + "name_ar": "السلفادور", + "code": "+503", + "countryCode": "SV" + }, + { + "name": "Equatorial Guinea", + "name_ar": "غينيا الإستوائية", + "code": "+240", + "countryCode": "GQ" + }, + { + "name": "Eritrea", + "name_ar": "إريتريا", + "code": "+291", + "countryCode": "ER" + }, + { + "name": "Estonia", + "name_ar": "استونيا", + "code": "+372", + "countryCode": "EE" + }, + { + "name": "Ethiopia", + "name_ar": "أثيوبيا", + "code": "+251", + "countryCode": "ET" + }, + { + "name": "Falkland Islands (Malvinas)", + "name_ar": "جزر فوكلاند مالفيناس", + "code": "+500", + "countryCode": "FK" + }, + { + "name": "Faroe Islands", + "name_ar": "جزر صناعية", + "code": "+298", + "countryCode": "FO" + }, + {"name": "Fiji", "name_ar": "فيجي", "code": "+679", "countryCode": "FJ"}, + {"name": "Finland", "name_ar": "فنلندا", "code": "+358", "countryCode": "FI"}, + {"name": "France", "name_ar": "فرنسا", "code": "+33", "countryCode": "FR"}, + { + "name": "French Guiana", + "name_ar": "غيانا الفرنسية", + "code": "+594", + "countryCode": "GF" + }, + { + "name": "French Polynesia", + "name_ar": "بولينيزيا الفرنسية", + "code": "+689", + "countryCode": "PF" + }, + {"name": "Gabon", "name_ar": "الغابون", "code": "+241", "countryCode": "GA"}, + {"name": "Gambia", "name_ar": "غامبيا", "code": "+220", "countryCode": "GM"}, + {"name": "Georgia", "name_ar": "جورجيا", "code": "+995", "countryCode": "GE"}, + {"name": "Germany", "name_ar": "ألمانيا", "code": "+49", "countryCode": "DE"}, + {"name": "Ghana", "name_ar": "غانا", "code": "+233", "countryCode": "GH"}, + { + "name": "Gibraltar", + "name_ar": "جبل طارق", + "code": "+350", + "countryCode": "GI" + }, + {"name": "Greece", "name_ar": "اليونان", "code": "+30", "countryCode": "GR"}, + { + "name": "Greenland", + "name_ar": "الأرض الخضراء", + "code": "+299", + "countryCode": "GL" + }, + { + "name": "Grenada", + "name_ar": "غرينادا", + "code": "+1 473", + "countryCode": "GD" + }, + { + "name": "Guadeloupe", + "name_ar": "جوادلوب", + "code": "+590", + "countryCode": "GP" + }, + {"name": "Guam", "name_ar": "غوام", "code": "+1 671", "countryCode": "GU"}, + { + "name": "Guatemala", + "name_ar": "غواتيمالا", + "code": "+502", + "countryCode": "GT" + }, + {"name": "Guernsey", "name_ar": "غيرنسي", "code": "+44", "countryCode": "GG"}, + {"name": "Guinea", "name_ar": "غينيا", "code": "+224", "countryCode": "GN"}, + { + "name": "Guinea-Bissau", + "name_ar": "غينيا بيساو", + "code": "+245", + "countryCode": "GW" + }, + {"name": "Guyana", "name_ar": "غيانا", "code": "+595", "countryCode": "GY"}, + {"name": "Haiti", "name_ar": "هايتي", "code": "+509", "countryCode": "HT"}, + { + "name": "Holy See (Vatican City State)", + "name_ar": "الكرسي الرسولي دولة الفاتيكان", + "code": "+379", + "countryCode": "VA" + }, + { + "name": "Honduras", + "name_ar": "هندوراس", + "code": "+504", + "countryCode": "HN" + }, + { + "name": "Hong Kong", + "name_ar": "هونج كونج", + "code": "+852", + "countryCode": "HK" + }, + {"name": "Hungary", "name_ar": "اليونان", "code": "+36", "countryCode": "HU"}, + { + "name": "Iceland", + "name_ar": "أيسلندا", + "code": "+354", + "countryCode": "IS" + }, + {"name": "India", "name_ar": "الهند", "code": "+91", "countryCode": "IN"}, + { + "name": "Indonesia", + "name_ar": "أندونيسيا", + "code": "+62", + "countryCode": "ID" + }, + { + "name": "Iran, Islamic Republic of Persian Gulf", + "name_ar": "جمهورية إيران الإسلامية الخليج الفارسي", + "code": "+98", + "countryCode": "IR" + }, + {"name": "Iraq", "name_ar": "العراق", "code": "+964", "countryCode": "IQ"}, + { + "name": "Ireland", + "name_ar": "أيرلندا", + "code": "+353", + "countryCode": "IE" + }, + { + "name": "Isle of Man", + "name_ar": "جزيرة آيل أوف مان", + "code": "+44", + "countryCode": "IM" + }, + {"name": "Israel", "name_ar": "إسرائيل", "code": "+972", "countryCode": "IL"}, + {"name": "Italy", "name_ar": "إيطاليا", "code": "+39", "countryCode": "IT"}, + { + "name": "Jamaica", + "name_ar": "جامايكا", + "code": "+1 876", + "countryCode": "JM" + }, + {"name": "Japan", "name_ar": "اليابان", "code": "+81", "countryCode": "JP"}, + {"name": "Jersey", "name_ar": "جيرسي", "code": "+44", "countryCode": "JE"}, + {"name": "Jordan", "name_ar": "الأردن", "code": "+962", "countryCode": "JO"}, + { + "name": "Kazakhstan", + "name_ar": "كازاخستان", + "code": "+77", + "countryCode": "KZ" + }, + {"name": "Kenya", "name_ar": "كينيا", "code": "+254", "countryCode": "KE"}, + { + "name": "Kiribati", + "name_ar": "كيريباس", + "code": "+686", + "countryCode": "KI" + }, + { + "name": "Korea, Democratic People's Republic of Korea", + "name_ar": "جمهورية كوريا الديمقراطية الشعبية", + "code": "+850", + "countryCode": "KP" + }, + { + "name": "Korea, Republic of South Korea", + "name_ar": "جمهورية كوريا الديمقراطية الشعبية", + "code": "+82", + "countryCode": "KR" + }, + { + "name": "Kyrgyzstan", + "name_ar": "قرغيزستان", + "code": "+996", + "countryCode": "KG" + }, + {"name": "Laos", "name_ar": "لاوس", "code": "+856", "countryCode": "LA"}, + {"name": "Latvia", "name_ar": "لاتفيا", "code": "+371", "countryCode": "LV"}, + {"name": "Lebanon", "name_ar": "لبنان", "code": "+961", "countryCode": "LB"}, + {"name": "Lesotho", "name_ar": "ليسوتو", "code": "+266", "countryCode": "LS"}, + { + "name": "Liberia", + "name_ar": "ليبيريا", + "code": "+231", + "countryCode": "LR" + }, + { + "name": "Libyan Arab Jamahiriya", + "name_ar": "الجماهيرية العربية الليبية", + "code": "+218", + "countryCode": "LY" + }, + { + "name": "Liechtenstein", + "name_ar": "ليختنشتاين", + "code": "+423", + "countryCode": "LI" + }, + { + "name": "Lithuania", + "name_ar": "ليتوانيا", + "code": "+370", + "countryCode": "LT" + }, + { + "name": "Luxembourg", + "name_ar": "لوكسمبورغ", + "code": "+352", + "countryCode": "LU" + }, + {"name": "Macao", "name_ar": "ماكاو", "code": "+853", "countryCode": "MO"}, + { + "name": "Macedonia", + "name_ar": "مقدونيا", + "code": "+389", + "countryCode": "MK" + }, + { + "name": "Madagascar", + "name_ar": "مدغشقر", + "code": "+261", + "countryCode": "MG" + }, + {"name": "Malawi", "name_ar": "مالاوي", "code": "+265", "countryCode": "MW"}, + { + "name": "Malaysia", + "name_ar": "ماليزيا", + "code": "+60", + "countryCode": "MY" + }, + { + "name": "Maldives", + "name_ar": "جزر المالديف", + "code": "+960", + "countryCode": "MV" + }, + {"name": "Mali", "name_ar": "مالي", "code": "+223", "countryCode": "ML"}, + {"name": "Malta", "name_ar": "مالطا", "code": "+356", "countryCode": "MT"}, + { + "name": "Marshall Islands", + "name_ar": "جزر مارشال", + "code": "+692", + "countryCode": "MH" + }, + { + "name": "Martinique", + "name_ar": "مارتينيك", + "code": "+596", + "countryCode": "MQ" + }, + { + "name": "Mauritania", + "name_ar": "موريتانيا", + "code": "+222", + "countryCode": "MR" + }, + { + "name": "Mauritius", + "name_ar": "موريشيوس", + "code": "+230", + "countryCode": "MU" + }, + {"name": "Mayotte", "name_ar": "مايوت", "code": "+262", "countryCode": "YT"}, + {"name": "Mexico", "name_ar": "المكسيك", "code": "+52", "countryCode": "MX"}, + { + "name": "Micronesia, Federated States of Micronesia", + "name_ar": "ميكرونيزيا ، ولايات ميكرونيزيا الموحدة", + "code": "+691", + "countryCode": "FM" + }, + { + "name": "Moldova", + "name_ar": "مولدوفا", + "code": "+373", + "countryCode": "MD" + }, + {"name": "Monaco", "name_ar": "موناكو", "code": "+377", "countryCode": "MC"}, + { + "name": "Mongolia", + "name_ar": "منغوليا", + "code": "+976", + "countryCode": "MN" + }, + { + "name": "Montenegro", + "name_ar": "الجبل الأسود", + "code": "+382", + "countryCode": "ME" + }, + { + "name": "Montserrat", + "name_ar": "مونتسيرات", + "code": "+1664", + "countryCode": "MS" + }, + {"name": "Morocco", "name_ar": "المغرب", "code": "+212", "countryCode": "MA"}, + { + "name": "Mozambique", + "name_ar": "موزمبيق", + "code": "+258", + "countryCode": "MZ" + }, + {"name": "Myanmar", "name_ar": "ميانمار", "code": "+95", "countryCode": "MM"}, + { + "name": "Namibia", + "name_ar": "ناميبيا", + "code": "+264", + "countryCode": "NA" + }, + {"name": "Nauru", "name_ar": "ناورو", "code": "+674", "countryCode": "NR"}, + {"name": "Nepal", "name_ar": "نيبال", "code": "+977", "countryCode": "NP"}, + { + "name": "Netherlands", + "name_ar": "هولندا", + "code": "+31", + "countryCode": "NL" + }, + { + "name": "Netherlands Antilles", + "name_ar": "جزر الأنتيل الهولندية", + "code": "+599", + "countryCode": "AN" + }, + { + "name": "New Caledonia", + "name_ar": "كاليدونيا الجديدة", + "code": "+687", + "countryCode": "NC" + }, + { + "name": "New Zealand", + "name_ar": "نيوزيلندا", + "code": "+64", + "countryCode": "NZ" + }, + { + "name": "Nicaragua", + "name_ar": "نيكاراغوا", + "code": "+505", + "countryCode": "NI" + }, + {"name": "Niger", "name_ar": "النيجر", "code": "+227", "countryCode": "NE"}, + { + "name": "Nigeria", + "name_ar": "نيجيريا", + "code": "+234", + "countryCode": "NG" + }, + {"name": "Niue", "name_ar": "نيوي", "code": "+683", "countryCode": "NU"}, + { + "name": "Norfolk Island", + "name_ar": "جزيرة نورفولك", + "code": "+672", + "countryCode": "NF" + }, + { + "name": "Northern Mariana Islands", + "name_ar": "جزر مريانا الشمالية", + "code": "+1 670", + "countryCode": "MP" + }, + {"name": "Norway", "name_ar": "النرويج", "code": "+47", "countryCode": "NO"}, + { + "name": "Oman", + "name_ar": "سلطنة عمان", + "code": "+968", + "countryCode": "OM" + }, + { + "name": "Pakistan", + "name_ar": "باكستان", + "code": "+92", + "countryCode": "PK" + }, + {"name": "Palau", "name_ar": "بالاو", "code": "+680", "countryCode": "PW"}, + { + "name": "Palestinian Territory, Occupied", + "name_ar": "الأراضي الفلسطينية المحتلة", + "code": "+970", + "countryCode": "PS" + }, + {"name": "Panama", "name_ar": "بناما", "code": "+507", "countryCode": "PA"}, + { + "name": "Papua New Guinea", + "name_ar": "بابوا غينيا الجديدة", + "code": "+675", + "countryCode": "PG" + }, + { + "name": "Paraguay", + "name_ar": "باراغواي", + "code": "+595", + "countryCode": "PY" + }, + {"name": "Peru", "name_ar": "بيرو", "code": "+51", "countryCode": "PE"}, + { + "name": "Philippines", + "name_ar": "الفلبين", + "code": "+63", + "countryCode": "PH" + }, + { + "name": "Pitcairn", + "name_ar": "بيتكيرن", + "code": "+872", + "countryCode": "PN" + }, + {"name": "Poland", "name_ar": "بولندا", "code": "+48", "countryCode": "PL"}, + { + "name": "Portugal", + "name_ar": "البرتغال", + "code": "+351", + "countryCode": "PT" + }, + { + "name": "Puerto Rico", + "name_ar": "بورتوريكو", + "code": "+1 939", + "countryCode": "PR" + }, + {"name": "Qatar", "name_ar": "دولة قطر", "code": "+974", "countryCode": "QA"}, + {"name": "Romania", "name_ar": "رومانيا", "code": "+40", "countryCode": "RO"}, + {"name": "Russia", "name_ar": "روسيا", "code": "+7", "countryCode": "RU"}, + {"name": "Rwanda", "name_ar": "رواندا", "code": "+250", "countryCode": "RW"}, + { + "name": "Reunion", + "name_ar": "جمع شمل", + "code": "+262", + "countryCode": "RE" + }, + { + "name": "Saint Barthelemy", + "name_ar": "سانت بارتيليمي", + "code": "+590", + "countryCode": "BL" + }, + { + "name": "Saint Helena, Ascension and Tristan Da Cunha", + "name_ar": "سانت هيلانة ، أسنشن وتريستان دا كونها", + "code": "+290", + "countryCode": "SH" + }, + { + "name": "Saint Kitts and Nevis", + "name_ar": "سانت كيتس ونيفيس", + "code": "+1 869", + "countryCode": "KN" + }, + { + "name": "Saint Lucia", + "name_ar": "القديسة لوسيا", + "code": "+1 758", + "countryCode": "LC" + }, + { + "name": "Saint Martin", + "name_ar": "القديس مارتن", + "code": "+590", + "countryCode": "MF" + }, + { + "name": "Saint Pierre and Miquelon", + "name_ar": "سانت بيير وميكلون", + "code": "+508", + "countryCode": "PM" + }, + { + "name": "Saint Vincent and the Grenadines", + "name_ar": "سانت فنسنت وجزر غرينادين", + "code": "+1 784", + "countryCode": "VC" + }, + {"name": "Samoa", "name_ar": "ساموا", "code": "+685", "countryCode": "WS"}, + { + "name": "San Marino", + "name_ar": "سان مارينو", + "code": "+378", + "countryCode": "SM" + }, + { + "name": "Sao Tome and Principe", + "name_ar": "ساو تومي وبرينسيبي", + "code": "+239", + "countryCode": "ST" + }, + { + "name": "Senegal", + "name_ar": "السنغال", + "code": "+221", + "countryCode": "SN" + }, + {"name": "Serbia", "name_ar": "صربيا", "code": "+381", "countryCode": "RS"}, + { + "name": "Seychelles", + "name_ar": "سيشيل", + "code": "+248", + "countryCode": "SC" + }, + { + "name": "Sierra Leone", + "name_ar": "سيرا ليون", + "code": "+232", + "countryCode": "SL" + }, + { + "name": "Singapore", + "name_ar": "سنغافورة", + "code": "+65", + "countryCode": "SG" + }, + { + "name": "Slovakia", + "name_ar": "سلوفاكيا", + "code": "+421", + "countryCode": "SK" + }, + { + "name": "Slovenia", + "name_ar": "سلوفينيا", + "code": "+386", + "countryCode": "SI" + }, + { + "name": "Solomon Islands", + "name_ar": "جزر سليمان", + "code": "+677", + "countryCode": "SB" + }, + { + "name": "Somalia", + "name_ar": "الصومال", + "code": "+252", + "countryCode": "SO" + }, + { + "name": "South Africa", + "name_ar": "جنوب أفريقيا", + "code": "+27", + "countryCode": "ZA" + }, + { + "name": "South Georgia and the South Sandwich Islands", + "name_ar": "جورجيا الجنوبية وجزر ساندويتش الجنوبية", + "code": "+500", + "countryCode": "GS" + }, + {"name": "Spain", "name_ar": "إسبانيا", "code": "+34", "countryCode": "ES"}, + { + "name": "Sri Lanka", + "name_ar": "سيريلانكا", + "code": "+94", + "countryCode": "LK" + }, + {"name": "Sudan", "name_ar": "سودان", "code": "+249", "countryCode": "SD"}, + { + "name": "Suriname", + "name_ar": "سورينام", + "code": "+597", + "countryCode": "SR" + }, + { + "name": "Svalbard and Jan Mayen", + "name_ar": "سفالبارد وجان ماين", + "code": "+47", + "countryCode": "SJ" + }, + { + "name": "Swaziland", + "name_ar": "سوازيلاند", + "code": "+268", + "countryCode": "SZ" + }, + {"name": "Sweden", "name_ar": "السويد", "code": "+46", "countryCode": "SE"}, + { + "name": "Switzerland", + "name_ar": "سويسرا", + "code": "+41", + "countryCode": "CH" + }, + { + "name": "Syrian Arab Republic", + "name_ar": "الجمهورية العربية السورية", + "code": "+963", + "countryCode": "SY" + }, + {"name": "Taiwan", "name_ar": "تايوان", "code": "+886", "countryCode": "TW"}, + { + "name": "Tajikistan", + "name_ar": "طاجيكستان", + "code": "+992", + "countryCode": "TJ" + }, + { + "name": "Tanzania, United Republic of Tanzania", + "name_ar": "تنزانيا ، جمهورية تنزانيا المتحدة", + "code": "+255", + "countryCode": "TZ" + }, + { + "name": "Thailand", + "name_ar": "تايلاند", + "code": "+66", + "countryCode": "TH" + }, + { + "name": "Timor-Leste", + "name_ar": "تيمور الشرقية", + "code": "+670", + "countryCode": "TL" + }, + {"name": "Togo", "name_ar": "ليذهب", "code": "+228", "countryCode": "TG"}, + { + "name": "Tokelau", + "name_ar": "توكيلاو", + "code": "+690", + "countryCode": "TK" + }, + {"name": "Tonga", "name_ar": "تونغا", "code": "+676", "countryCode": "TO"}, + { + "name": "Trinidad and Tobago", + "name_ar": "ترينداد وتوباغو", + "code": "+1 868", + "countryCode": "TT" + }, + {"name": "Tunisia", "name_ar": "تونس", "code": "+216", "countryCode": "TN"}, + {"name": "Turkey", "name_ar": "ديك رومي", "code": "+90", "countryCode": "TR"}, + { + "name": "Turkmenistan", + "name_ar": "تركمانستان", + "code": "+993", + "countryCode": "TM" + }, + { + "name": "Turks and Caicos Islands", + "name_ar": "جزر تركس وكايكوس", + "code": "+1 649", + "countryCode": "TC" + }, + {"name": "Tuvalu", "name_ar": "توفالو", "code": "+688", "countryCode": "TV"}, + {"name": "Uganda", "name_ar": "أوغندا", "code": "+256", "countryCode": "UG"}, + { + "name": "Ukraine", + "name_ar": "أوكرانيا", + "code": "+380", + "countryCode": "UA" + }, + { + "name": "United Kingdom", + "name_ar": "المملكة المتحدة", + "code": "+44", + "countryCode": "GB" + }, + { + "name": "United States", + "name_ar": "الولايات المتحدة الامريكانية", + "code": "+1", + "countryCode": "US" + }, + { + "name": "Uruguay", + "name_ar": "أوروغواي", + "code": "+598", + "countryCode": "UY" + }, + { + "name": "Uzbekistan", + "name_ar": "أوزبكستان", + "code": "+998", + "countryCode": "UZ" + }, + { + "name": "Vanuatu", + "name_ar": "فانواتو", + "code": "+678", + "countryCode": "VU" + }, + { + "name": "Venezuela, Bolivarian Republic of Venezuela", + "name_ar": "فنزويلا ، جمهورية فنزويلا البوليفارية", + "code": "+58", + "countryCode": "VE" + }, + {"name": "Vietnam", "name_ar": "فيتنام", "code": "+84", "countryCode": "VN"}, + { + "name": "Virgin Islands, British", + "name_ar": "جزر العذراء البريطانية", + "code": "+1 284", + "countryCode": "VG" + }, + { + "name": "Virgin Islands, U.S.", + "name_ar": "جزر فيرجن ، الولايات المتحدة", + "code": "+1 340", + "countryCode": "VI" + }, + { + "name": "Wallis and Futuna", + "name_ar": "واليس وفوتونا", + "code": "+681", + "countryCode": "WF" + }, + {"name": "Yemen", "name_ar": "اليمن", "code": "+967", "countryCode": "YE"}, + {"name": "Zambia", "name_ar": "زامبيا", "code": "+260", "countryCode": "ZM"}, + { + "name": "Zimbabwe", + "name_ar": "زيمبابوي", + "code": "+263", + "countryCode": "ZW" + } +]; +// }); +// List countryList =[]; From 37d4dfffa2f1db6a176060b87c37508c075bb45b Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 15 Nov 2021 16:23:29 +0200 Subject: [PATCH 2/8] all discharge summary --- lib/config/config.dart | 12 +- .../profile/discharge_summary_servive.dart | 29 +- .../profile/discharge_summary_view_model.dart | 19 + .../GetDischargeSummaryResModel.dart | 112 +++--- .../all_discharge_summary.dart | 100 +++-- .../discharge_Summary_widget.dart | 374 ++++++++++++++---- .../discharge_summary/discharge_summary.dart | 18 +- .../pending_discharge_summary.dart | 5 +- .../pending_orders/pending_orders_screen.dart | 72 +++- 9 files changed, 532 insertions(+), 209 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 2afbe5ac..0511f1cd 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -346,7 +346,6 @@ const GET_MEDICATION_FOR_IN_PATIENT = const GET_EPISODE_FOR_INPATIENT = "/Services/DoctorApplication.svc/REST/DoctorApp_GetEpisodeForInpatient"; - ///Operation Details Services const GET_RESERVATIONS = @@ -377,12 +376,15 @@ const SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE_FOR_REGISTRATION = "Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationTypeForRegistration"; const CHECK_ACTIVATION_CODE_FOR_PATIENT = "Services/Authentication.svc/REST/CheckActivationCode"; -const PATIENT_REGISTRATION = "Services/Authentication.svc/REST/PatientRegistration"; -const GET_PATIENT_INFO= "Services/NHIC.svc/REST/GetPatientInfo"; - +const PATIENT_REGISTRATION = + "Services/Authentication.svc/REST/PatientRegistration"; +const GET_PATIENT_INFO = "Services/NHIC.svc/REST/GetPatientInfo"; /// Discharge Summary -const GET_PENDING_DISCHARGE_SUMMARY = "Services/DoctorApplication.svc/REST/DoctorApp_GetPendingDischargeSummary"; +const GET_PENDING_DISCHARGE_SUMMARY = + "Services/DoctorApplication.svc/REST/DoctorApp_GetPendingDischargeSummary"; +const GET_ALL_DISCHARGE_SUMMARY = + "Services/DoctorApplication.svc/REST/DoctorApp_GetDischargeSummary"; var selectedPatientType = 1; diff --git a/lib/core/service/patient/profile/discharge_summary_servive.dart b/lib/core/service/patient/profile/discharge_summary_servive.dart index daea1b42..12de09ac 100644 --- a/lib/core/service/patient/profile/discharge_summary_servive.dart +++ b/lib/core/service/patient/profile/discharge_summary_servive.dart @@ -10,18 +10,41 @@ import 'package:doctor_app_flutter/models/operation_report/get_reservations_requ class DischargeSummaryService extends BaseService { List _pendingDischargeSummaryList = []; - List get pendingDischargeSummaryList => _pendingDischargeSummaryList; + List get pendingDischargeSummaryList => + _pendingDischargeSummaryList; + + List _allDischargeSummaryList = []; + List get allDischargeSummaryList => + _allDischargeSummaryList; Future getPendingDischargeSummary( {GetDischargeSummaryReqModel getDischargeSummaryReqModel}) async { - hasError = false; await baseAppClient.post(GET_PENDING_DISCHARGE_SUMMARY, onSuccess: (dynamic response, int statusCode) { _pendingDischargeSummaryList.clear(); response['List_PendingDischargeSummary'].forEach( (v) { - _pendingDischargeSummaryList.add(GetDischargeSummaryResModel.fromJson(v)); + _pendingDischargeSummaryList + .add(GetDischargeSummaryResModel.fromJson(v)); + }, + ); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: getDischargeSummaryReqModel.toJson()); + } + + Future getAllDischargeSummary( + {GetDischargeSummaryReqModel getDischargeSummaryReqModel}) async { + hasError = false; + await baseAppClient.post(GET_ALL_DISCHARGE_SUMMARY, + onSuccess: (dynamic response, int statusCode) { + _pendingDischargeSummaryList.clear(); + response['List_DischargeSummary'].forEach( + (v) { + _pendingDischargeSummaryList + .add(GetDischargeSummaryResModel.fromJson(v)); }, ); }, onFailure: (String error, int statusCode) { diff --git a/lib/core/viewModel/profile/discharge_summary_view_model.dart b/lib/core/viewModel/profile/discharge_summary_view_model.dart index 29910570..9db5a6dd 100644 --- a/lib/core/viewModel/profile/discharge_summary_view_model.dart +++ b/lib/core/viewModel/profile/discharge_summary_view_model.dart @@ -15,6 +15,10 @@ class DischargeSummaryViewModel extends BaseViewModel { _dischargeSummaryService.pendingDischargeSummaryList; + List get allDisChargeSummaryList => + _dischargeSummaryService.allDischargeSummaryList; + + Future getPendingDischargeSummary({int patientId, int admissionNo, }) async { GetDischargeSummaryReqModel getDischargeSummaryReqModel = GetDischargeSummaryReqModel(admissionNo:admissionNo,patientID: patientId ); hasError = false; @@ -28,4 +32,19 @@ class DischargeSummaryViewModel extends BaseViewModel { } } + + + Future getAllDischargeSummary({int patientId, int admissionNo, }) async { + GetDischargeSummaryReqModel getDischargeSummaryReqModel = GetDischargeSummaryReqModel(admissionNo:admissionNo,patientID: patientId ); + hasError = false; + setState(ViewState.Busy); + await _dischargeSummaryService.getAllDischargeSummary(getDischargeSummaryReqModel: getDischargeSummaryReqModel); + if (_dischargeSummaryService.hasError) { + error = _dischargeSummaryService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + } diff --git a/lib/models/discharge_summary/GetDischargeSummaryResModel.dart b/lib/models/discharge_summary/GetDischargeSummaryResModel.dart index 006ac6a2..0be29e50 100644 --- a/lib/models/discharge_summary/GetDischargeSummaryResModel.dart +++ b/lib/models/discharge_summary/GetDischargeSummaryResModel.dart @@ -28,69 +28,69 @@ class GetDischargeSummaryResModel { int editedBy; String editedOn; bool isPatientDied; - Null isMedicineApproved; - Null isOpenBillDischarge; - Null activatedDate; - Null activatedBy; - Null lAMA; - Null patientCodition; - Null others; - Null reconciliationInstruction; + dynamic isMedicineApproved; + dynamic isOpenBillDischarge; + dynamic activatedDate; + dynamic activatedBy; + dynamic lAMA; + dynamic patientCodition; + dynamic others; + dynamic reconciliationInstruction; String dischargeInstructions; String reason; - Null dischargeDisposition; - Null hospitalID; + dynamic dischargeDisposition; + dynamic hospitalID; String createdByName; - Null createdByNameN; + dynamic createdByNameN; String editedByName; - Null editedByNameN; + dynamic editedByNameN; GetDischargeSummaryResModel( {this.setupID, - this.projectID, - this.dischargeNo, - this.dischargeDate, - this.admissionNo, - this.assessmentNo, - this.patientType, - this.patientID, - this.clinicID, - this.doctorID, - this.finalDiagnosis, - this.persentation, - this.pastHistory, - this.planOfCare, - this.investigations, - this.followupPlan, - this.conditionOnDischarge, - this.significantFindings, - this.planedProcedure, - this.daysStayed, - this.remarks, - this.eRCare, - this.status, - this.isActive, - this.createdBy, - this.createdOn, - this.editedBy, - this.editedOn, - this.isPatientDied, - this.isMedicineApproved, - this.isOpenBillDischarge, - this.activatedDate, - this.activatedBy, - this.lAMA, - this.patientCodition, - this.others, - this.reconciliationInstruction, - this.dischargeInstructions, - this.reason, - this.dischargeDisposition, - this.hospitalID, - this.createdByName, - this.createdByNameN, - this.editedByName, - this.editedByNameN}); + this.projectID, + this.dischargeNo, + this.dischargeDate, + this.admissionNo, + this.assessmentNo, + this.patientType, + this.patientID, + this.clinicID, + this.doctorID, + this.finalDiagnosis, + this.persentation, + this.pastHistory, + this.planOfCare, + this.investigations, + this.followupPlan, + this.conditionOnDischarge, + this.significantFindings, + this.planedProcedure, + this.daysStayed, + this.remarks, + this.eRCare, + this.status, + this.isActive, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn, + this.isPatientDied, + this.isMedicineApproved, + this.isOpenBillDischarge, + this.activatedDate, + this.activatedBy, + this.lAMA, + this.patientCodition, + this.others, + this.reconciliationInstruction, + this.dischargeInstructions, + this.reason, + this.dischargeDisposition, + this.hospitalID, + this.createdByName, + this.createdByNameN, + this.editedByName, + this.editedByNameN}); GetDischargeSummaryResModel.fromJson(Map json) { setupID = json['SetupID']; diff --git a/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart index 0ae7bf04..fcec04c4 100644 --- a/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart @@ -1,66 +1,94 @@ -import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/profile/discharge_summary_view_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/screens/doctor/doctor_replay/doctor_reply_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; -import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:flutter/material.dart'; import 'discharge_Summary_widget.dart'; - class AllDischargeSummary extends StatefulWidget { final Function changeCurrentTab; + final PatiantInformtion patient; - const AllDischargeSummary({Key key, this.changeCurrentTab}) : super(key: key); + const AllDischargeSummary({this.changeCurrentTab, this.patient}); @override _AllDischargeSummaryState createState() => _AllDischargeSummaryState(); } class _AllDischargeSummaryState extends State { - int pageIndex = 1; @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) { - model.getPendingDischargeSummary(); + model.getAllDischargeSummary( + patientId: widget.patient.patientId, + admissionNo: int.parse(widget.patient.admissionNo), + ); }, builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, - body: model.pendingDischargeSummaryList.isEmpty - ?ErrorMessage(error: TranslationBase.of(context).noItem)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem) - : Column( - children: [ - Expanded( - child: Container( - padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), - child: ListView.builder( - scrollDirection: Axis.vertical, - itemCount: model.pendingDischargeSummaryList.length, - shrinkWrap: true, - itemBuilder: (BuildContext ctxt, int index) { - return Column( - children: [ - InkWell( - child: DischargeSummaryWidget( - dischargeSummary: model - .pendingDischargeSummaryList[index]), - ), - - ], - ); - }), - ), - ), - ], - ), + body: // DrAppEmbeddedError(error: TranslationBase.of(context).noItem) + model.pendingDischargeSummaryList.isEmpty + ? ErrorMessage( + error: TranslationBase.of(context).noDataAvailable) + : Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( + children: [ + AppText( + TranslationBase.of(context).discharge, + fontSize: 15.0, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + ), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).summary, + fontSize: 25.0, + fontWeight: FontWeight.w700, + ), + ], + ), + ], + ), + ), + Expanded( + child: Container( + padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), + child: ListView.builder( + scrollDirection: Axis.vertical, + itemCount: + model.pendingDischargeSummaryList.length, + shrinkWrap: true, + itemBuilder: (BuildContext ctxt, int index) { + return Column( + children: [ + InkWell( + child: DischargeSummaryWidget( + dischargeSummary: + model.pendingDischargeSummaryList[ + index]), + ), + ], + ); + }), + ), + ), + ], + ), ), ); } diff --git a/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart b/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart index f4c67442..88f150e5 100644 --- a/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart +++ b/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart @@ -1,19 +1,17 @@ -import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryResModel.dart'; -import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'package:url_launcher/url_launcher.dart'; class DischargeSummaryWidget extends StatefulWidget { final GetDischargeSummaryResModel dischargeSummary; @@ -26,27 +24,54 @@ class DischargeSummaryWidget extends StatefulWidget { } class _DischargeSummaryWidgetState extends State { + bool isCardExpanded = true; @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - return Container( - child: CardWithBgWidget( - bgColor:Colors.transparent, - hasBorder: false, - widget: Container( - child: InkWell( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( + return Column( + children: [ + Container( + width: double.infinity, + margin: EdgeInsets.only(top: 8.0, left: 8.0, right: 8.0), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all(color: Colors.grey[200], width: 0.5), + ), + child: Padding( + padding: EdgeInsets.all(15.0), + child: HeaderBodyExpandableNotifier( + headerWidget: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Column( - crossAxisAlignment: CrossAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - AppText( - AppDateUtils.getDateTimeFromServerFormat( + CustomRow( + label: TranslationBase.of(context).doctorName + ": ", + value: widget.dischargeSummary.doctorID.toString() ?? + "".toString(), + isCopyable: false, + ), + CustomRow( + label: TranslationBase.of(context).branch + ": ", + value: widget.dischargeSummary.projectID.toString() ?? + "".toString(), + isCopyable: false, + ), + CustomRow( + label: TranslationBase.of(context).clinicName + ": ", + value: widget.dischargeSummary.clinicID.toString() ?? + "".toString(), + isCopyable: false, + ), + CustomRow( + label: TranslationBase.of(context).dischargeDate + ": ", + value: AppDateUtils.getDateTimeFromServerFormat( widget.dischargeSummary.createdOn) .day .toString() + @@ -62,61 +87,149 @@ class _DischargeSummaryWidgetState extends State { widget.dischargeSummary.createdOn) .year .toString(), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, + isCopyable: false, ), - AppText( - AppDateUtils.getDateTimeFromServerFormat( - widget.dischargeSummary.createdOn) - .hour - .toString() + - ":" + - AppDateUtils.getDateTimeFromServerFormat( - widget.dischargeSummary.createdOn) - .minute - .toString(), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - ) + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + InkWell( + onTap: () { + setState(() { + isCardExpanded = !isCardExpanded; + }); + }, + child: Icon(isCardExpanded + ? EvaIcons.arrowUp + : EvaIcons.arrowDown)) ], ), ], ), - SizedBox( - height: 20, - ), - - Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, + bodyWidget: Row( children: [ - SizedBox( - width: 20, - ), Column( - crossAxisAlignment: CrossAxisAlignment.start, children: [ - // SizedBox(height: 10,), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - CustomRow( - label: TranslationBase.of(context).fileNumber, - value: widget.dischargeSummary.patientID.toString(), - isCopyable:false, - ), - SizedBox( - height: 8, - ), + SizedBox( + height: 15.0, + ), + AppText("More Details"), + SizedBox( + height: 15.0, + ), + Container( + width: MediaQuery.of(context).size.width * 0.5, + child: RichText( + maxLines: 3, + overflow: TextOverflow.ellipsis, + text: new TextSpan( + style: new TextStyle( + fontSize: 1.3 * SizeConfig.textMultiplier, + color: Color(0xFF575757)), + children: [ + new TextSpan( + text: "Past History" + ": ", + style: TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 2.8, + color: Color(0xFF575757), + //TranslationBase.of(context).doctorResponse + " : ", + )), + new TextSpan( + text: Helpers.parseHtmlString( + widget.dischargeSummary.pastHistory), + style: TextStyle( + fontFamily: 'Poppins', + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700, + )), ], ), - ], + ), + ), + SizedBox( + height: 5.0, + ), + Container( + width: MediaQuery.of(context).size.width * 0.5, + child: RichText( + maxLines: 3, + overflow: TextOverflow.ellipsis, + text: new TextSpan( + style: new TextStyle( + fontSize: 1.3 * SizeConfig.textMultiplier, + color: Color(0xFF575757)), + children: [ + new TextSpan( + text: "Investigations" + ": ", + style: TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 2.8, + color: Color(0xFF575757), + //TranslationBase.of(context).doctorResponse + " : ", + )), + new TextSpan( + text: Helpers.parseHtmlString( + widget.dischargeSummary.investigations ?? + ""), + style: TextStyle( + fontFamily: 'Poppins', + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700, + )), + ], + ), + ), + ), + SizedBox( + height: 5.0, + ), + Container( + width: MediaQuery.of(context).size.width * 0.5, + child: RichText( + maxLines: 3, + overflow: TextOverflow.ellipsis, + text: new TextSpan( + style: new TextStyle( + fontSize: 1.3 * SizeConfig.textMultiplier, + color: Color(0xFF575757)), + children: [ + new TextSpan( + text: "Condition On Discharge" + ": ", + style: TextStyle( + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 2.8, + color: Color(0xFF575757), + //TranslationBase.of(context).doctorResponse + " : ", + )), + new TextSpan( + text: Helpers.parseHtmlString(widget + .dischargeSummary.conditionOnDischarge), + style: TextStyle( + fontFamily: 'Poppins', + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3, + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700, + )), + ], + ), + ), + ), + SizedBox( + height: 5.0, ), - Container( width: MediaQuery.of(context).size.width * 0.5, child: RichText( @@ -128,9 +241,7 @@ class _DischargeSummaryWidgetState extends State { color: Color(0xFF575757)), children: [ new TextSpan( - text: - TranslationBase.of(context).requestType + - ": ", + text: "Planed Procedure" + ": ", style: TextStyle( fontSize: SizeConfig .getTextMultiplierBasedOnWidth() * @@ -139,8 +250,8 @@ class _DischargeSummaryWidgetState extends State { //TranslationBase.of(context).doctorResponse + " : ", )), new TextSpan( - text: - "${widget.dischargeSummary.dischargeInstructions}", + text: Helpers.parseHtmlString( + widget.dischargeSummary.planedProcedure), style: TextStyle( fontFamily: 'Poppins', fontSize: SizeConfig @@ -157,15 +268,130 @@ class _DischargeSummaryWidgetState extends State { ) ], ), - // Container( - // alignment: projectViewModel.isArabic?Alignment.centerLeft:Alignment.centerRight, - // child: Icon(FontAwesomeIcons.arrowRight, - // size: 20, color: Colors.black),) - ], + isExpand: isCardExpanded, + // widget: Container( + // child: InkWell( + // child: Row( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [], + // ), + // SizedBox( + // height: 20, + // ), + // + // Row( + // crossAxisAlignment: CrossAxisAlignment.start, + // mainAxisAlignment: MainAxisAlignment.start, + // children: [ + // SizedBox( + // width: 20, + // ), + // Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // // SizedBox(height: 10,), + // Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // CustomRow( + // label: TranslationBase.of(context) + // .fileNumber, + // value: widget.dischargeSummary.patientID + // .toString(), + // isCopyable: false, + // ), + // SizedBox( + // height: 8, + // ), + // ], + // ), + // ], + // ), + // + // Container( + // width: MediaQuery.of(context).size.width * 0.5, + // child: RichText( + // maxLines: 3, + // overflow: TextOverflow.ellipsis, + // text: new TextSpan( + // style: new TextStyle( + // fontSize: 1.3 * SizeConfig.textMultiplier, + // color: Color(0xFF575757)), + // children: [ + // new TextSpan( + // text: TranslationBase.of(context) + // .requestType + + // ": ", + // style: TextStyle( + // fontSize: SizeConfig + // .getTextMultiplierBasedOnWidth() * + // 2.8, + // color: Color(0xFF575757), + // //TranslationBase.of(context).doctorResponse + " : ", + // )), + // new TextSpan( + // text: Helpers.parseHtmlString(widget + // .dischargeSummary.pastHistory), + // style: TextStyle( + // fontFamily: 'Poppins', + // fontSize: SizeConfig + // .getTextMultiplierBasedOnWidth() * + // 3, + // color: Color(0xFF2E303A), + // fontWeight: FontWeight.w700, + // )), + // ], + // ), + // ), + // ), + // ], + // ) + // ], + // ), + // Column( + // crossAxisAlignment: CrossAxisAlignment.end, + // children: [ + // AppText( + // AppDateUtils.getDateTimeFromServerFormat( + // widget.dischargeSummary.createdOn) + // .day + // .toString() + + // " " + + // AppDateUtils.getMonth( + // AppDateUtils.getDateTimeFromServerFormat( + // widget.dischargeSummary.createdOn) + // .month) + // .toString() + // .substring(0, 3) + + // ' ' + + // AppDateUtils.getDateTimeFromServerFormat( + // widget.dischargeSummary.createdOn) + // .year + // .toString(), + // fontFamily: 'Poppins', + // fontWeight: FontWeight.w600, + // ), + // ], + // ), + // // Container( + // // alignment: projectViewModel.isArabic?Alignment.centerLeft:Alignment.centerRight, + // // child: Icon(FontAwesomeIcons.arrowRight, + // // size: 20, color: Colors.black),) + // ], + // ), + // // onTap: onTap, + // )), + ), ), - // onTap: onTap, - )), - ), + ), + ], ); } } diff --git a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart index 1625d7bb..31935fcf 100644 --- a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart @@ -1,18 +1,9 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/doctor/doctor_replay/doctor_repaly_chat.dart'; -import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/screens/doctor/doctor_replay/doctor_reply_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.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:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; -import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; -import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -23,7 +14,8 @@ import 'pending_discharge_summary.dart'; class DischargeSummaryPage extends StatefulWidget { final Function changeCurrentTab; - const DischargeSummaryPage({Key key, this.changeCurrentTab}) : super(key: key); + const DischargeSummaryPage({Key key, this.changeCurrentTab}) + : super(key: key); @override _DoctorReplyScreenState createState() => _DoctorReplyScreenState(); @@ -125,8 +117,10 @@ class _DoctorReplyScreenState extends State physics: BouncingScrollPhysics(), controller: _tabController, children: [ - PendingDischargeSummary(patient:patient ,), - AllDischargeSummary(), + PendingDischargeSummary( + patient: patient, + ), + AllDischargeSummary(patient: patient), ], ), ), diff --git a/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart index 3981163e..ef70020a 100644 --- a/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart @@ -33,9 +33,8 @@ class _PendingDischargeSummaryState extends State { return BaseView( onModelReady: (model) { model.getPendingDischargeSummary( - patientId: widget.patient.patientId, - admissionNo: int.parse(widget.patient.admissionNo), - + patientId: widget.patient.patientId, + admissionNo: int.parse(widget.patient.admissionNo), ); }, builder: (_, model, w) => AppScaffold( diff --git a/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart b/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart index a03ca3c5..e9e4f8b2 100644 --- a/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart +++ b/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart @@ -36,28 +36,60 @@ class PendingOrdersScreen extends StatelessWidget { model.pendingOrdersList.length == 0 ? DrAppEmbeddedError( error: TranslationBase.of(context).noDataAvailable) - : Container( - child: ListView.builder( - itemCount: model.pendingOrdersList.length, - itemBuilder: (BuildContext ctxt, int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(10.0), + : Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( + children: [ + AppText( + TranslationBase.of(context).pending, + fontSize: 15.0, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', ), - border: Border.all( - color: Color(0xFF707070), width: 0.30), - ), - child: Padding( - padding: EdgeInsets.all(8.0), - child: - AppText(model.pendingOrdersList[index].notes), - ), + ], ), - ); - })), + Row( + children: [ + AppText( + TranslationBase.of(context).orders, + fontSize: 25.0, + fontWeight: FontWeight.w700, + ), + ], + ), + ], + ), + ), + Container( + child: ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.pendingOrdersList.length, + itemBuilder: (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: Color(0xFF707070), width: 0.30), + ), + child: Padding( + padding: EdgeInsets.all(8.0), + child: AppText( + model.pendingOrdersList[index].notes), + ), + ), + ); + })), + ], + ), ), ); } From dfce0d20e24f847d35fc83b430a9ba0b639c60a8 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 16 Nov 2021 14:02:12 +0200 Subject: [PATCH 3/8] discharge summary card --- .../profile/discharge_summary_servive.dart | 5 +- .../GetDischargeSummaryResModel.dart | 11 +- .../all_discharge_summary.dart | 10 +- .../discharge_Summary_widget.dart | 130 +----------------- .../pending_discharge_summary.dart | 35 ++++- 5 files changed, 50 insertions(+), 141 deletions(-) diff --git a/lib/core/service/patient/profile/discharge_summary_servive.dart b/lib/core/service/patient/profile/discharge_summary_servive.dart index 12de09ac..a92ef0eb 100644 --- a/lib/core/service/patient/profile/discharge_summary_servive.dart +++ b/lib/core/service/patient/profile/discharge_summary_servive.dart @@ -40,11 +40,10 @@ class DischargeSummaryService extends BaseService { hasError = false; await baseAppClient.post(GET_ALL_DISCHARGE_SUMMARY, onSuccess: (dynamic response, int statusCode) { - _pendingDischargeSummaryList.clear(); + _allDischargeSummaryList.clear(); response['List_DischargeSummary'].forEach( (v) { - _pendingDischargeSummaryList - .add(GetDischargeSummaryResModel.fromJson(v)); + _allDischargeSummaryList.add(GetDischargeSummaryResModel.fromJson(v)); }, ); }, onFailure: (String error, int statusCode) { diff --git a/lib/models/discharge_summary/GetDischargeSummaryResModel.dart b/lib/models/discharge_summary/GetDischargeSummaryResModel.dart index 0be29e50..10ddab00 100644 --- a/lib/models/discharge_summary/GetDischargeSummaryResModel.dart +++ b/lib/models/discharge_summary/GetDischargeSummaryResModel.dart @@ -44,6 +44,8 @@ class GetDischargeSummaryResModel { dynamic createdByNameN; String editedByName; dynamic editedByNameN; + String clinicName; + String projectName; GetDischargeSummaryResModel( {this.setupID, @@ -90,7 +92,9 @@ class GetDischargeSummaryResModel { this.createdByName, this.createdByNameN, this.editedByName, - this.editedByNameN}); + this.editedByNameN, + this.clinicName, + this.projectName}); GetDischargeSummaryResModel.fromJson(Map json) { setupID = json['SetupID']; @@ -138,6 +142,8 @@ class GetDischargeSummaryResModel { createdByNameN = json['CreatedByNameN']; editedByName = json['EditedByName']; editedByNameN = json['EditedByNameN']; + clinicName = json['ClinicDescription']; + projectName = json['ProjectName']; } Map toJson() { @@ -187,6 +193,9 @@ class GetDischargeSummaryResModel { data['CreatedByNameN'] = this.createdByNameN; data['EditedByName'] = this.editedByName; data['EditedByNameN'] = this.editedByNameN; + data['ClinicDescription'] = this.clinicName; + data['ProjectName'] = this.projectName; + return data; } } diff --git a/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart index fcec04c4..f29315ae 100644 --- a/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart @@ -34,7 +34,7 @@ class _AllDischargeSummaryState extends State { baseViewModel: model, isShowAppBar: false, body: // DrAppEmbeddedError(error: TranslationBase.of(context).noItem) - model.pendingDischargeSummaryList.isEmpty + model.allDisChargeSummaryList.isEmpty ? ErrorMessage( error: TranslationBase.of(context).noDataAvailable) : Column( @@ -70,17 +70,15 @@ class _AllDischargeSummaryState extends State { padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), child: ListView.builder( scrollDirection: Axis.vertical, - itemCount: - model.pendingDischargeSummaryList.length, + itemCount: model.allDisChargeSummaryList.length, shrinkWrap: true, itemBuilder: (BuildContext ctxt, int index) { return Column( children: [ InkWell( child: DischargeSummaryWidget( - dischargeSummary: - model.pendingDischargeSummaryList[ - index]), + dischargeSummary: model + .allDisChargeSummaryList[index]), ), ], ); diff --git a/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart b/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart index 88f150e5..c1e72f96 100644 --- a/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart +++ b/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart @@ -24,7 +24,7 @@ class DischargeSummaryWidget extends StatefulWidget { } class _DischargeSummaryWidgetState extends State { - bool isCardExpanded = true; + bool isCardExpanded = false; @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); @@ -53,19 +53,20 @@ class _DischargeSummaryWidgetState extends State { children: [ CustomRow( label: TranslationBase.of(context).doctorName + ": ", - value: widget.dischargeSummary.doctorID.toString() ?? - "".toString(), + value: + widget.dischargeSummary.createdByName.toString() ?? + "".toString(), isCopyable: false, ), CustomRow( label: TranslationBase.of(context).branch + ": ", - value: widget.dischargeSummary.projectID.toString() ?? + value: widget.dischargeSummary.projectName.toString() ?? "".toString(), isCopyable: false, ), CustomRow( label: TranslationBase.of(context).clinicName + ": ", - value: widget.dischargeSummary.clinicID.toString() ?? + value: widget.dischargeSummary.clinicName.toString() ?? "".toString(), isCopyable: false, ), @@ -269,125 +270,6 @@ class _DischargeSummaryWidgetState extends State { ], ), isExpand: isCardExpanded, - // widget: Container( - // child: InkWell( - // child: Row( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // children: [], - // ), - // SizedBox( - // height: 20, - // ), - // - // Row( - // crossAxisAlignment: CrossAxisAlignment.start, - // mainAxisAlignment: MainAxisAlignment.start, - // children: [ - // SizedBox( - // width: 20, - // ), - // Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // // SizedBox(height: 10,), - // Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // CustomRow( - // label: TranslationBase.of(context) - // .fileNumber, - // value: widget.dischargeSummary.patientID - // .toString(), - // isCopyable: false, - // ), - // SizedBox( - // height: 8, - // ), - // ], - // ), - // ], - // ), - // - // Container( - // width: MediaQuery.of(context).size.width * 0.5, - // child: RichText( - // maxLines: 3, - // overflow: TextOverflow.ellipsis, - // text: new TextSpan( - // style: new TextStyle( - // fontSize: 1.3 * SizeConfig.textMultiplier, - // color: Color(0xFF575757)), - // children: [ - // new TextSpan( - // text: TranslationBase.of(context) - // .requestType + - // ": ", - // style: TextStyle( - // fontSize: SizeConfig - // .getTextMultiplierBasedOnWidth() * - // 2.8, - // color: Color(0xFF575757), - // //TranslationBase.of(context).doctorResponse + " : ", - // )), - // new TextSpan( - // text: Helpers.parseHtmlString(widget - // .dischargeSummary.pastHistory), - // style: TextStyle( - // fontFamily: 'Poppins', - // fontSize: SizeConfig - // .getTextMultiplierBasedOnWidth() * - // 3, - // color: Color(0xFF2E303A), - // fontWeight: FontWeight.w700, - // )), - // ], - // ), - // ), - // ), - // ], - // ) - // ], - // ), - // Column( - // crossAxisAlignment: CrossAxisAlignment.end, - // children: [ - // AppText( - // AppDateUtils.getDateTimeFromServerFormat( - // widget.dischargeSummary.createdOn) - // .day - // .toString() + - // " " + - // AppDateUtils.getMonth( - // AppDateUtils.getDateTimeFromServerFormat( - // widget.dischargeSummary.createdOn) - // .month) - // .toString() - // .substring(0, 3) + - // ' ' + - // AppDateUtils.getDateTimeFromServerFormat( - // widget.dischargeSummary.createdOn) - // .year - // .toString(), - // fontFamily: 'Poppins', - // fontWeight: FontWeight.w600, - // ), - // ], - // ), - // // Container( - // // alignment: projectViewModel.isArabic?Alignment.centerLeft:Alignment.centerRight, - // // child: Icon(FontAwesomeIcons.arrowRight, - // // size: 20, color: Colors.black),) - // ], - // ), - // // onTap: onTap, - // )), ), ), ), diff --git a/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart index ef70020a..4984999f 100644 --- a/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart @@ -1,16 +1,11 @@ -import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/profile/discharge_summary_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/screens/doctor/doctor_replay/doctor_reply_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; -import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:flutter/material.dart'; - import 'discharge_Summary_widget.dart'; class PendingDischargeSummary extends StatefulWidget { @@ -43,9 +38,35 @@ class _PendingDischargeSummaryState extends State { body: model.pendingDischargeSummaryList.isEmpty ? ErrorMessage( error: TranslationBase.of(context) - .noItem) // DrAppEmbeddedError(error: TranslationBase.of(context).noItem) + .noDataAvailable) // DrAppEmbeddedError(error: TranslationBase.of(context).noItem) : Column( children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( + children: [ + AppText( + TranslationBase.of(context).discharge, + fontSize: 15.0, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + ), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).summary, + fontSize: 25.0, + fontWeight: FontWeight.w700, + ), + ], + ), + ], + ), + ), Expanded( child: Container( padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), From ced1c9b3927513bddf9950f5f5d36d028f745c6e Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 21 Nov 2021 16:16:41 +0200 Subject: [PATCH 4/8] first step from fix service --- lib/core/service/NavigationService.dart | 4 ++-- lib/core/service/PatientRegistrationService.dart | 12 ++++++------ lib/core/service/base/base_service.dart | 1 + .../service/patient/LiveCarePatientServices.dart | 12 ++++++------ .../profile/discharge_summary_servive.dart | 2 +- .../profile/operation_report_servive.dart | 6 +++--- .../lab_order/labs_service.dart | 4 ++-- .../PatientMedicalReportService.dart | 2 +- .../prescription/prescriptions_service.dart | 4 ++-- .../procedure/procedure_service.dart | 2 +- .../patient_medical_file/soap/SOAP_service.dart | 6 +++--- .../ucaf/patient-ucaf-service.dart | 16 ++++++++-------- lib/core/service/pending_order_service.dart | 12 ++++++------ 13 files changed, 42 insertions(+), 41 deletions(-) diff --git a/lib/core/service/NavigationService.dart b/lib/core/service/NavigationService.dart index f32c2c0d..182adb6c 100644 --- a/lib/core/service/NavigationService.dart +++ b/lib/core/service/NavigationService.dart @@ -17,10 +17,10 @@ class NavigationService { } Future pushAndRemoveUntil(Route newRoute) { - return navigatorKey.currentState.pushAndRemoveUntil(newRoute,(asd)=>false); + return navigatorKey.currentState!.pushAndRemoveUntil(newRoute,(asd)=>false); } pop() { - return navigatorKey.currentState.pop(); + return navigatorKey.currentState!.pop(); } } \ No newline at end of file diff --git a/lib/core/service/PatientRegistrationService.dart b/lib/core/service/PatientRegistrationService.dart index 236bcd42..14e2c3df 100644 --- a/lib/core/service/PatientRegistrationService.dart +++ b/lib/core/service/PatientRegistrationService.dart @@ -9,8 +9,8 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart'; class PatientRegistrationService extends BaseService { - GetPatientInfoResponseModel getPatientInfoResponseModel; - String logInTokenID; + late GetPatientInfoResponseModel getPatientInfoResponseModel; + late String logInTokenID; checkPatientForRegistration( CheckPatientForRegistrationModel registrationModel) async { @@ -39,11 +39,11 @@ class PatientRegistrationService extends BaseService { } sendActivationCodeByOTPNotificationType( - {SendActivationCodeByOTPNotificationTypeForRegistrationModel + {required SendActivationCodeByOTPNotificationTypeForRegistrationModel registrationModel, - int otpType, - PatientRegistrationViewModel model, - CheckPatientForRegistrationModel + required int otpType, + required PatientRegistrationViewModel model, + required CheckPatientForRegistrationModel checkPatientForRegistrationModel}) async { registrationModel = SendActivationCodeByOTPNotificationTypeForRegistrationModel( diff --git a/lib/core/service/base/base_service.dart b/lib/core/service/base/base_service.dart index a8a87c8f..05d1d1ab 100644 --- a/lib/core/service/base/base_service.dart +++ b/lib/core/service/base/base_service.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; diff --git a/lib/core/service/patient/LiveCarePatientServices.dart b/lib/core/service/patient/LiveCarePatientServices.dart index b0bf13e1..b390556d 100644 --- a/lib/core/service/patient/LiveCarePatientServices.dart +++ b/lib/core/service/patient/LiveCarePatientServices.dart @@ -47,7 +47,7 @@ class LiveCarePatientServices extends BaseService { /// add new items. localPatientList.forEach((element) { - if ((_patientList.singleWhere((it) => it.patientId == element.patientId, orElse: () => null)) == null) { + if ((_patientList.singleWhere((it) => it.patientId == element.patientId)) == null) { _patientList.add(element); } }); @@ -55,7 +55,7 @@ class LiveCarePatientServices extends BaseService { /// remove items. List removedPatientList = []; _patientList.forEach((element) { - if ((localPatientList.singleWhere((it) => it.patientId == element.patientId, orElse: () => null)) == null) { + if ((localPatientList.singleWhere((it) => it.patientId == element.patientId)) == null) { removedPatientList.add(element); } }); @@ -155,12 +155,12 @@ class LiveCarePatientServices extends BaseService { }, body: {"VC_ID": vcID, "generalid": GENERAL_ID}, isLiveCare: _isLive); } - Future addPatientToDoctorList({int vcID}) async { + Future addPatientToDoctorList({required int vcID}) async { hasError = false; await getDoctorProfile(); AddPatientToDoctorListRequestModel addPatientToDoctorListRequestModel = AddPatientToDoctorListRequestModel(); - addPatientToDoctorListRequestModel.doctorId = super.doctorProfile.doctorID; + addPatientToDoctorListRequestModel.doctorId = super.doctorProfile!.doctorID!; addPatientToDoctorListRequestModel.vCID = vcID; addPatientToDoctorListRequestModel.isOutKsa = false; addPatientToDoctorListRequestModel.generalid = GENERAL_ID; @@ -173,11 +173,11 @@ class LiveCarePatientServices extends BaseService { }, body: addPatientToDoctorListRequestModel.toJson(), isLiveCare: _isLive); } - Future removePatientFromDoctorList({int vcID}) async { + Future removePatientFromDoctorList({required int vcID}) async { hasError = false; AddPatientToDoctorListRequestModel addPatientToDoctorListRequestModel = AddPatientToDoctorListRequestModel(); await getDoctorProfile(); - addPatientToDoctorListRequestModel.doctorId = super.doctorProfile.doctorID; + addPatientToDoctorListRequestModel.doctorId = super.doctorProfile!.doctorID!; addPatientToDoctorListRequestModel.vCID = vcID; addPatientToDoctorListRequestModel.isOutKsa = false; addPatientToDoctorListRequestModel.generalid = GENERAL_ID; diff --git a/lib/core/service/patient/profile/discharge_summary_servive.dart b/lib/core/service/patient/profile/discharge_summary_servive.dart index daea1b42..52c15e79 100644 --- a/lib/core/service/patient/profile/discharge_summary_servive.dart +++ b/lib/core/service/patient/profile/discharge_summary_servive.dart @@ -13,7 +13,7 @@ class DischargeSummaryService extends BaseService { List get pendingDischargeSummaryList => _pendingDischargeSummaryList; Future getPendingDischargeSummary( - {GetDischargeSummaryReqModel getDischargeSummaryReqModel}) async { + {required GetDischargeSummaryReqModel getDischargeSummaryReqModel}) async { hasError = false; await baseAppClient.post(GET_PENDING_DISCHARGE_SUMMARY, diff --git a/lib/core/service/patient/profile/operation_report_servive.dart b/lib/core/service/patient/profile/operation_report_servive.dart index 7ac4ade7..b3a43717 100644 --- a/lib/core/service/patient/profile/operation_report_servive.dart +++ b/lib/core/service/patient/profile/operation_report_servive.dart @@ -14,8 +14,8 @@ class OperationReportService extends BaseService { List get operationDetailsList => _operationDetailsList; Future getReservations( - {GetReservationsRequestModel getReservationsRequestModel, - int patientId}) async { + {required GetReservationsRequestModel getReservationsRequestModel, + required int patientId}) async { getReservationsRequestModel = GetReservationsRequestModel(patientID: patientId, doctorID: ""); @@ -36,7 +36,7 @@ class OperationReportService extends BaseService { } Future getOperationReportDetails( - {GetOperationDetailsRequestModel getOperationReportRequestModel, + {required GetOperationDetailsRequestModel getOperationReportRequestModel, }) async { hasError = false; diff --git a/lib/core/service/patient_medical_file/lab_order/labs_service.dart b/lib/core/service/patient_medical_file/lab_order/labs_service.dart index 1fe088c0..84861d5b 100644 --- a/lib/core/service/patient_medical_file/lab_order/labs_service.dart +++ b/lib/core/service/patient_medical_file/lab_order/labs_service.dart @@ -179,7 +179,7 @@ class LabsService extends BaseService { } Future getPatientLabOrdersResultHistoryByDescription( - {PatientLabOrders patientLabOrder, String procedureDescription, PatiantInformtion patient}) async { + {required PatientLabOrders patientLabOrder, required String procedureDescription, required PatiantInformtion patient}) async { hasError = false; Map body = Map(); if (patientLabOrder != null) { @@ -201,7 +201,7 @@ class LabsService extends BaseService { }, body: body); } - Future getAllSpecialLabResult({int mrn}) async { + Future getAllSpecialLabResult({required int mrn}) async { _allSpecialLabResultRequestModel = AllSpecialLabResultRequestModel( patientID: mrn, patientType: 1, diff --git a/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart b/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart index 98536476..1af15e10 100644 --- a/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart +++ b/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart @@ -94,7 +94,7 @@ class PatientMedicalReportService extends BaseService { ? body['SetupID'] : SETUP_ID : SETUP_ID; - body['AdmissionNo'] = int.parse(patient.admissionNo); + body['AdmissionNo'] = int.parse(patient!.admissionNo!); body['MedicalReportHTML'] = htmlText; if (body['ProjectID'] == null) { body['ProjectID'] = doctorProfile?.projectID; diff --git a/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart b/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart index 55ab7a89..bf3100c5 100644 --- a/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart +++ b/lib/core/service/patient_medical_file/prescription/prescriptions_service.dart @@ -192,9 +192,9 @@ class PrescriptionsService extends BaseService { hasError = false; _getMedicationForInPatientRequestModel = GetMedicationForInPatientRequestModel( isDentalAllowedBackend: false, - admissionNo: int.parse(patient.admissionNo), + admissionNo: int.parse(patient!.admissionNo!), tokenID: "@dm!n", - projectID: patient.projectId, + projectID: patient!.projectId!, ); await baseAppClient.postPatient(GET_MEDICATION_FOR_IN_PATIENT, patient: patient, onSuccess: (dynamic response, int statusCode) { diff --git a/lib/core/service/patient_medical_file/procedure/procedure_service.dart b/lib/core/service/patient_medical_file/procedure/procedure_service.dart index 576c593d..5708b6b3 100644 --- a/lib/core/service/patient_medical_file/procedure/procedure_service.dart +++ b/lib/core/service/patient_medical_file/procedure/procedure_service.dart @@ -104,7 +104,7 @@ class ProcedureService extends BaseService { }, body: _procedureTempleteDetailsRequestModel.toJson()); } - Future getProcedure({int? mrn, int appointmentNo}) async { + Future getProcedure({int? mrn, required int appointmentNo}) async { _getOrderedProcedureRequestModel = GetOrderedProcedureRequestModel( patientMRN: mrn, ); diff --git a/lib/core/service/patient_medical_file/soap/SOAP_service.dart b/lib/core/service/patient_medical_file/soap/SOAP_service.dart index d206de77..dbdb3855 100644 --- a/lib/core/service/patient_medical_file/soap/SOAP_service.dart +++ b/lib/core/service/patient_medical_file/soap/SOAP_service.dart @@ -83,7 +83,7 @@ class SOAPService extends LookupService { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; - super.error = super.error+ "\n"+error; + super.error = super.error!+ "\n"+error; }, body: postAllergyRequestModel.toJson()); } @@ -93,7 +93,7 @@ class SOAPService extends LookupService { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; - super.error =super.error + "\n"+error; + super.error =super.error! + "\n"+error; }, body: postHistoriesRequestModel.toJson()); } @@ -155,7 +155,7 @@ class SOAPService extends LookupService { print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; - super.error = super.error +"\n"+error; + super.error = super.error! +"\n"+error; }, body: patchHistoriesRequestModel.toJson()); } diff --git a/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart b/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart index 535a5b49..2028ed6b 100644 --- a/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart +++ b/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart @@ -8,8 +8,8 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; class UcafService extends LookupService { - List patientChiefComplaintList; - List patientVitalSignsHistory; + late List patientChiefComplaintList; + late List patientVitalSignsHistory; List patientAssessmentList = []; List orderProcedureList = []; PrescriptionModel? prescriptionList; @@ -22,13 +22,13 @@ class UcafService extends LookupService { body['EpisodeID'] = patient.episodeNo; body['DoctorID'] = ""; - patientChiefComplaintList = null; + patientChiefComplaintList = []; await baseAppClient.post(GET_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) { print("Success"); if (patientChiefComplaintList != null) { patientChiefComplaintList.clear(); } else { - patientChiefComplaintList = new List(); + patientChiefComplaintList = []; } response['List_ChiefComplaint']['entityList'].forEach((v) { patientChiefComplaintList.add(GetChiefComplaintResModel.fromJson(v)); @@ -50,14 +50,14 @@ class UcafService extends LookupService { body['InOutPatientType'] = 2; } - patientVitalSignsHistory = null; + patientVitalSignsHistory = []; await baseAppClient.post( GET_PATIENT_VITAL_SIGN, onSuccess: (dynamic response, int statusCode) { if (patientVitalSignsHistory != null) { patientVitalSignsHistory.clear(); } else { - patientVitalSignsHistory = new List(); + patientVitalSignsHistory = []; } if (response['List_DoctorPatientVitalSign'] != null) { response['List_DoctorPatientVitalSign'].forEach((v) { @@ -86,14 +86,14 @@ class UcafService extends LookupService { body['From'] = fromDate; body['To'] = toDate; - patientVitalSignsHistory = null; + patientVitalSignsHistory = []; await baseAppClient.post( GET_PATIENT_VITAL_SIGN_DATA, onSuccess: (dynamic response, int statusCode) { if (patientVitalSignsHistory != null) { patientVitalSignsHistory.clear(); } else { - patientVitalSignsHistory = new List(); + patientVitalSignsHistory = []; } if (response['VitalSignsHistory'] != null) { response['VitalSignsHistory'].forEach((v) { diff --git a/lib/core/service/pending_order_service.dart b/lib/core/service/pending_order_service.dart index f0bcf5e9..09ca517e 100644 --- a/lib/core/service/pending_order_service.dart +++ b/lib/core/service/pending_order_service.dart @@ -13,9 +13,9 @@ class PendingOrderService extends BaseService { List get admissionOrderList => _admissionOrderList; Future getPendingOrders( - {PendingOrderRequestModel pendingOrderRequestModel, - int patientId, - int admissionNo}) async { + {required PendingOrderRequestModel pendingOrderRequestModel, + required int patientId, + required int admissionNo}) async { pendingOrderRequestModel = PendingOrderRequestModel( patientID: patientId, admissionNo: admissionNo, @@ -40,9 +40,9 @@ class PendingOrderService extends BaseService { } Future getAdmissionOrders( - {AdmissionOrdersRequestModel admissionOrdersRequestModel, - int patientId, - int admissionNo}) async { + {required AdmissionOrdersRequestModel admissionOrdersRequestModel, + required int patientId, + required int admissionNo}) async { admissionOrdersRequestModel = AdmissionOrdersRequestModel( patientID: patientId, admissionNo: admissionNo, From dc0f3e72352343969d46a2608d380299241fe8e9 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 21 Nov 2021 17:58:54 +0200 Subject: [PATCH 5/8] fix utils && widget --- lib/config/size_config.dart | 4 +- lib/core/service/AnalyticsService.dart | 2 +- .../service/PatientRegistrationService.dart | 5 +- .../profile/operation_report_servive.dart | 2 +- lib/core/service/pending_order_service.dart | 8 +- .../viewModel/LiveCarePatientViewModel.dart | 2 +- .../PatientRegistrationViewModel.dart | 8 +- .../viewModel/PatientSearchViewModel.dart | 24 +- lib/core/viewModel/SOAP_view_model.dart | 47 +- .../viewModel/authentication_view_model.dart | 30 +- .../viewModel/doctor_replay_view_model.dart | 4 +- lib/core/viewModel/labs_view_model.dart | 4 +- .../viewModel/patient-ucaf-viewmodel.dart | 8 +- lib/core/viewModel/patient_view_model.dart | 2 +- .../viewModel/pednding_orders_view_model.dart | 4 +- lib/core/viewModel/procedure_View_model.dart | 6 +- .../profile/discharge_summary_view_model.dart | 2 +- .../GetChiefComplaintReqModel.dart | 2 +- .../post_chief_complaint_request_model.dart | 2 +- lib/util/translations_delegate_base.dart | 54 +- .../patients/patient_card/PatientCard.dart | 26 +- .../profile/PatientProfileButton.dart | 8 +- .../profile/patient-profile-app-bar.dart | 67 +- ...ent-profile-header-new-design-app-bar.dart | 38 +- .../profile/profile_medical_info_widget.dart | 4 +- lib/widgets/shared/app_texts_widget.dart | 22 +- .../shared/bottom_navigation_item.dart | 4 +- .../shared/buttons/app_buttons_widget.dart | 1 - lib/widgets/shared/card_with_bg_widget.dart | 4 +- .../text_fields/app-textfield-custom.dart | 8 +- .../app_text_field_custom_serach.dart | 28 +- .../text_fields/country_textfield_custom.dart | 16 +- lib/widgets/shared/user-guid/CusomRow.dart | 16 +- lib/widgets/transitions/slide_up_page.dart | 4 +- pubspec.lock | 1340 ----------------- pubspec.yaml | 1 + 36 files changed, 241 insertions(+), 1566 deletions(-) delete mode 100644 pubspec.lock diff --git a/lib/config/size_config.dart b/lib/config/size_config.dart index 3e07990b..c6ec4fdd 100644 --- a/lib/config/size_config.dart +++ b/lib/config/size_config.dart @@ -76,7 +76,7 @@ class SizeConfig { } - static getTextMultiplierBasedOnWidth({double width}) { + static getTextMultiplierBasedOnWidth({double? width}) { // TODO handel LandScape case if (width != null) { return width / 100; @@ -84,7 +84,7 @@ class SizeConfig { return widthMultiplier; } - static getWidthMultiplier({double width}) { +static getWidthMultiplier({double? width}) { // TODO handel LandScape case if (width != null) { return width / 100; diff --git a/lib/core/service/AnalyticsService.dart b/lib/core/service/AnalyticsService.dart index 0ad669ab..b5ffb318 100644 --- a/lib/core/service/AnalyticsService.dart +++ b/lib/core/service/AnalyticsService.dart @@ -7,7 +7,7 @@ class AnalyticsService { FirebaseAnalyticsObserver getAnalyticsObserver() => FirebaseAnalyticsObserver(analytics: _analytics); - Future logEvent({@required String eventCategory, @required String eventAction}) async { + Future logEvent({required String eventCategory, required String eventAction}) async { await _analytics.logEvent(name: 'event', parameters: { "eventCategory": eventCategory, "eventAction": eventAction, diff --git a/lib/core/service/PatientRegistrationService.dart b/lib/core/service/PatientRegistrationService.dart index 14e2c3df..5f29325a 100644 --- a/lib/core/service/PatientRegistrationService.dart +++ b/lib/core/service/PatientRegistrationService.dart @@ -39,13 +39,12 @@ class PatientRegistrationService extends BaseService { } sendActivationCodeByOTPNotificationType( - {required SendActivationCodeByOTPNotificationTypeForRegistrationModel - registrationModel, + { required int otpType, required PatientRegistrationViewModel model, required CheckPatientForRegistrationModel checkPatientForRegistrationModel}) async { - registrationModel = + SendActivationCodeByOTPNotificationTypeForRegistrationModel registrationModel = SendActivationCodeByOTPNotificationTypeForRegistrationModel( oTPSendType: otpType, patientIdentificationID: checkPatientForRegistrationModel diff --git a/lib/core/service/patient/profile/operation_report_servive.dart b/lib/core/service/patient/profile/operation_report_servive.dart index b3a43717..937b4639 100644 --- a/lib/core/service/patient/profile/operation_report_servive.dart +++ b/lib/core/service/patient/profile/operation_report_servive.dart @@ -14,7 +14,7 @@ class OperationReportService extends BaseService { List get operationDetailsList => _operationDetailsList; Future getReservations( - {required GetReservationsRequestModel getReservationsRequestModel, + { required int patientId}) async { getReservationsRequestModel = GetReservationsRequestModel(patientID: patientId, doctorID: ""); diff --git a/lib/core/service/pending_order_service.dart b/lib/core/service/pending_order_service.dart index 09ca517e..527f3d20 100644 --- a/lib/core/service/pending_order_service.dart +++ b/lib/core/service/pending_order_service.dart @@ -13,10 +13,10 @@ class PendingOrderService extends BaseService { List get admissionOrderList => _admissionOrderList; Future getPendingOrders( - {required PendingOrderRequestModel pendingOrderRequestModel, + { required int patientId, required int admissionNo}) async { - pendingOrderRequestModel = PendingOrderRequestModel( + PendingOrderRequestModel pendingOrderRequestModel = PendingOrderRequestModel( patientID: patientId, admissionNo: admissionNo, patientTypeID: 1, @@ -40,10 +40,10 @@ class PendingOrderService extends BaseService { } Future getAdmissionOrders( - {required AdmissionOrdersRequestModel admissionOrdersRequestModel, + { required int patientId, required int admissionNo}) async { - admissionOrdersRequestModel = AdmissionOrdersRequestModel( + AdmissionOrdersRequestModel admissionOrdersRequestModel = AdmissionOrdersRequestModel( patientID: patientId, admissionNo: admissionNo, patientTypeID: 1, diff --git a/lib/core/viewModel/LiveCarePatientViewModel.dart b/lib/core/viewModel/LiveCarePatientViewModel.dart index e7dc0a92..54ae3ab8 100644 --- a/lib/core/viewModel/LiveCarePatientViewModel.dart +++ b/lib/core/viewModel/LiveCarePatientViewModel.dart @@ -235,7 +235,7 @@ class LiveCarePatientViewModel extends BaseViewModel { ); } - updateInCallPatient({PatiantInformtion patient, appointmentNo}) { + updateInCallPatient({required PatiantInformtion patient, appointmentNo}) { _liveCarePatientServices.patientList.forEach((e) { if (e.patientId == patient.patientId) { e.episodeNo = 0; diff --git a/lib/core/viewModel/PatientRegistrationViewModel.dart b/lib/core/viewModel/PatientRegistrationViewModel.dart index 64fdae18..31d84608 100644 --- a/lib/core/viewModel/PatientRegistrationViewModel.dart +++ b/lib/core/viewModel/PatientRegistrationViewModel.dart @@ -18,7 +18,7 @@ class PatientRegistrationViewModel extends BaseViewModel { GetPatientInfoResponseModel get getPatientInfoResponseModel => _patientRegistrationService.getPatientInfoResponseModel; - CheckPatientForRegistrationModel checkPatientForRegistrationModel; + late CheckPatientForRegistrationModel checkPatientForRegistrationModel; Future checkPatientForRegistration( CheckPatientForRegistrationModel registrationModel) async { @@ -142,10 +142,10 @@ class PatientRegistrationViewModel extends BaseViewModel { } Future sendActivationCodeByOTPNotificationType( - {SendActivationCodeByOTPNotificationTypeForRegistrationModel + {required SendActivationCodeByOTPNotificationTypeForRegistrationModel registrationModel, - int otpType, - PatientRegistrationViewModel user}) async { + required int otpType, + required PatientRegistrationViewModel user}) async { setState(ViewState.BusyLocal); print(checkPatientForRegistrationModel); print(checkPatientForRegistrationModel); diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index b9a9a323..04e6ff09 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -169,7 +169,7 @@ class PatientSearchViewModel extends BaseViewModel { } } - sortInPatient({bool isDes = false, bool isAllClinic, bool isMyInPatient}) { + sortInPatient({bool isDes = false, required bool isAllClinic, required bool isMyInPatient}) { if (isMyInPatient ? myIinPatientList.length > 0 : isAllClinic @@ -232,7 +232,7 @@ class PatientSearchViewModel extends BaseViewModel { InpatientClinicList.clear(); inPatientList.forEach((element) { if (!InpatientClinicList.contains(element.clinicDescription)) { - InpatientClinicList.add(element.clinicDescription); + InpatientClinicList.add(element!.clinicDescription!); } }); } @@ -260,7 +260,7 @@ class PatientSearchViewModel extends BaseViewModel { } } - filterByHospital({int hospitalId}) { + filterByHospital({required int hospitalId}) { filteredInPatientItems = []; for (var i = 0; i < inPatientList.length; i++) { if (inPatientList[i].projectId == hospitalId) { @@ -270,7 +270,7 @@ class PatientSearchViewModel extends BaseViewModel { notifyListeners(); } - filterByClinic({String clinicName}) { + filterByClinic({required String clinicName}) { filteredInPatientItems = []; for (var i = 0; i < inPatientList.length; i++) { if (inPatientList[i].clinicDescription == clinicName) { @@ -286,7 +286,7 @@ class PatientSearchViewModel extends BaseViewModel { } void filterSearchResults(String query, - {bool isAllClinic, bool isMyInPatient}) { + {required bool isAllClinic, required bool isMyInPatient}) { var strExist = query.length > 0 ? true : false; if (isMyInPatient) { @@ -298,13 +298,13 @@ class PatientSearchViewModel extends BaseViewModel { filteredMyInPatientItems.clear(); for (var i = 0; i < localFilteredMyInPatientItems.length; i++) { String firstName = - localFilteredMyInPatientItems[i].firstName.toUpperCase(); + localFilteredMyInPatientItems[i].firstName!.toUpperCase(); String lastName = - localFilteredMyInPatientItems[i].lastName.toUpperCase(); + localFilteredMyInPatientItems[i].lastName!.toUpperCase(); String mobile = - localFilteredMyInPatientItems[i].mobileNumber.toUpperCase(); + localFilteredMyInPatientItems[i].mobileNumber!.toUpperCase(); String patientID = - localFilteredMyInPatientItems[i].patientId.toString(); + localFilteredMyInPatientItems[i].patientId!.toString(); if (firstName.contains(query.toUpperCase()) || lastName.contains(query.toUpperCase()) || @@ -351,11 +351,11 @@ class PatientSearchViewModel extends BaseViewModel { filteredInPatientItems.clear(); for (var i = 0; i < localFilteredInPatientItems.length; i++) { String firstName = - localFilteredInPatientItems[i].firstName.toUpperCase(); + localFilteredInPatientItems[i].firstName!.toUpperCase(); String lastName = - localFilteredInPatientItems[i].lastName.toUpperCase(); + localFilteredInPatientItems[i].lastName!.toUpperCase(); String mobile = - localFilteredInPatientItems[i].mobileNumber.toUpperCase(); + localFilteredInPatientItems[i].mobileNumber!.toUpperCase(); String patientID = localFilteredInPatientItems[i].patientId.toString(); diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 09afc8be..0e45825e 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -100,7 +100,7 @@ class SOAPViewModel extends BaseViewModel { List get allMedicationList => _prescriptionService.allMedicationList; - SubjectiveCallBack subjectiveCallBack; + late SubjectiveCallBack subjectiveCallBack; setSubjectiveCallBack(SubjectiveCallBack callBack) { this.subjectiveCallBack = callBack; @@ -110,7 +110,7 @@ class SOAPViewModel extends BaseViewModel { subjectiveCallBack.nextFunction(model); } - ObjectiveCallBack objectiveCallBack; + late ObjectiveCallBack objectiveCallBack; setObjectiveCallBack(ObjectiveCallBack callBack) { this.objectiveCallBack = callBack; @@ -120,7 +120,7 @@ class SOAPViewModel extends BaseViewModel { objectiveCallBack.nextFunction(model); } - AssessmentCallBack assessmentCallBack; + late AssessmentCallBack assessmentCallBack; setAssessmentCallBack(AssessmentCallBack callBack) { this.assessmentCallBack = callBack; @@ -130,7 +130,7 @@ class SOAPViewModel extends BaseViewModel { assessmentCallBack.nextFunction(model); } - PlanCallBack planCallBack; + late PlanCallBack planCallBack; setPlanCallBack(PlanCallBack callBack) { this.planCallBack = callBack; @@ -299,8 +299,8 @@ class SOAPViewModel extends BaseViewModel { patientInfo.appointmentNo.toString(), ), ); - if (patientInfo.admissionNo != null && patientInfo.admissionNo.isNotEmpty) - getPhysicalExamReqModel.admissionNo = int.parse(patientInfo.admissionNo); + if (patientInfo.admissionNo != null && patientInfo.admissionNo!.isNotEmpty) + getPhysicalExamReqModel.admissionNo = int.parse(patientInfo!.admissionNo!); else getPhysicalExamReqModel.admissionNo = 0; setState(ViewState.Busy); @@ -350,7 +350,7 @@ class SOAPViewModel extends BaseViewModel { GetEpisodeForInpatientReqModel getEpisodeForInpatientReqModel = GetEpisodeForInpatientReqModel( patientID: patient.patientId, - admissionNo: int.parse(patient.admissionNo), + admissionNo: int.parse(patient!.admissionNo!), patientTypeID: 1); await _SOAPService.getEpisodeForInpatient(getEpisodeForInpatientReqModel); if (_SOAPService.hasError) { @@ -480,10 +480,9 @@ class SOAPViewModel extends BaseViewModel { GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel( admissionNo: - patientInfo - .admissionNo != + patientInfo!.admissionNo != null - ? int.parse(patientInfo.admissionNo) + ? int.parse(patientInfo!.admissionNo!) : null, patientMRN: patientInfo.patientMRN, appointmentNo: patientInfo.appointmentNo != null @@ -644,7 +643,7 @@ class SOAPViewModel extends BaseViewModel { final results = await Future.wait(services ?? []); if (_SOAPService.hasError || _prescriptionService.hasError) { - error = _SOAPService.error + _prescriptionService.error!; + error = _SOAPService.error! + _prescriptionService.error!; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); @@ -716,11 +715,11 @@ class SOAPViewModel extends BaseViewModel { postSubjectServices( {patientInfo, - String complaintsText, - String medicationText, - String illnessText, - List myHistoryList, - List myAllergiesList}) async { + required String complaintsText, + required String medicationText, + required String illnessText, + required List myHistoryList, + required List myAllergiesList}) async { var services; PostChiefComplaintRequestModel postChiefComplaintRequestModel = @@ -774,9 +773,9 @@ class SOAPViewModel extends BaseViewModel { PostChiefComplaintRequestModel createPostChiefComplaintRequestModel( {patientInfo, - String complaintsText, - String medicationText, - String illnessText}) { + required String complaintsText, + required String medicationText, + required String illnessText}) { return new PostChiefComplaintRequestModel( admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo) @@ -794,13 +793,13 @@ class SOAPViewModel extends BaseViewModel { } PostHistoriesRequestModel createPostHistoriesRequestModel( - {patientInfo, List myHistoryList}) { + {patientInfo, required List myHistoryList}) { PostHistoriesRequestModel postHistoriesRequestModel = new PostHistoriesRequestModel(doctorID: ''); myHistoryList.forEach((history) { if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = []; - postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM( + postHistoriesRequestModel.listMedicalHistoryVM!.add(ListMedicalHistoryVM( patientMRN: patientInfo.patientMRN, episodeId: patientInfo.episodeNo, appointmentNo: patientInfo.appointmentNo, @@ -822,7 +821,7 @@ class SOAPViewModel extends BaseViewModel { if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null) postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = []; - postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add( + postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM!.add( ListHisProgNotePatientAllergyDiseaseVM( allergyDiseaseId: allergy.selectedAllergy.id, allergyDiseaseType: allergy.selectedAllergy.typeId, @@ -831,9 +830,9 @@ class SOAPViewModel extends BaseViewModel { appointmentNo: patientInfo.appointmentNo, severity: allergy.selectedAllergySeverity.id, remarks: allergy.remark, - createdBy: allergy.createdBy ?? doctorProfile.doctorID, + createdBy: allergy.createdBy ?? doctorProfile!.doctorID, createdOn: DateTime.now().toIso8601String(), - editedBy: doctorProfile.doctorID, + editedBy: doctorProfile!.doctorID, editedOn: DateTime.now().toIso8601String(), isChecked: allergy.isChecked, isUpdatedByNurse: false)); diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index 697f5654..059cb4fa 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -86,7 +86,7 @@ class AuthenticationViewModel extends BaseViewModel { profileInfo['IMEI'] = token; profileInfo['LogInTypeID'] = await sharedPref.getInt(OTP_TYPE); profileInfo['BioMetricEnabled'] = true; - profileInfo['MobileNo'] = loggedIn != null ? loggedIn['MobileNumber'] : user.mobile; + profileInfo['MobileNo'] = loggedIn != null ? loggedIn['MobileNumber'] : user!.mobile; InsertIMEIDetailsModel insertIMEIDetailsModel = InsertIMEIDetailsModel.fromJson(profileInfo); insertIMEIDetailsModel.genderDescription = profileInfo['Gender_Description']; insertIMEIDetailsModel.genderDescriptionN = profileInfo['Gender_DescriptionN']; @@ -95,8 +95,8 @@ class AuthenticationViewModel extends BaseViewModel { insertIMEIDetailsModel.titleDescriptionN = profileInfo['Title_DescriptionN']; insertIMEIDetailsModel.projectID = await sharedPref.getInt(PROJECT_ID); insertIMEIDetailsModel.doctorID = - loggedIn != null ? loggedIn['List_MemberInformation'][0]['MemberID'] : user.doctorID; - insertIMEIDetailsModel.outSA = loggedIn != null ? loggedIn['PatientOutSA'] : user.outSA; + loggedIn != null ? loggedIn['List_MemberInformation'][0]['MemberID'] : user!.doctorID; + insertIMEIDetailsModel.outSA = loggedIn != null ? loggedIn['PatientOutSA'] : user!.outSA; insertIMEIDetailsModel.vidaAuthTokenID = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); insertIMEIDetailsModel.vidaRefreshTokenID = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); insertIMEIDetailsModel.password = userInfo.password; @@ -133,7 +133,7 @@ class AuthenticationViewModel extends BaseViewModel { iMEI: user!.iMEI, facilityId: user!.projectID, memberID: user!.doctorID, - loginDoctorID: int.parse(user.editedBy.toString()), + loginDoctorID: int.parse(user!.editedBy.toString()), zipCode: user!.outSA == true ? '971' : '966', mobileNumber: user!.mobile, oTPSendType: authMethodType.getTypeIdService(), @@ -154,8 +154,8 @@ class AuthenticationViewModel extends BaseViewModel { int projectID = await sharedPref.getInt(PROJECT_ID); ActivationCodeModel activationCodeModel = ActivationCodeModel( facilityId: projectID, - memberID: loggedUser.listMemberInformation[0].memberID, - loginDoctorID: loggedUser.listMemberInformation[0].employeeID, + memberID: loggedUser!.listMemberInformation![0].memberID, + loginDoctorID: loggedUser!.listMemberInformation![0].employeeID, otpSendType: authMethodType.getTypeIdService().toString(), ); await _authService.sendActivationCodeForDoctorApp(activationCodeModel); @@ -164,7 +164,7 @@ class AuthenticationViewModel extends BaseViewModel { setState(ViewState.ErrorLocal); } else { await sharedPref.setString(TOKEN, - _authService.activationCodeForDoctorAppRes.logInTokenID); + _authService.activationCodeForDoctorAppRes.logInTokenID!); setState(ViewState.Idle); } } @@ -178,12 +178,12 @@ class AuthenticationViewModel extends BaseViewModel { projectID: await sharedPref.getInt(PROJECT_ID) != null ? await sharedPref.getInt(PROJECT_ID) : user!.projectID, logInTokenID: await sharedPref.getString(TOKEN), activationCode: activationCode, - memberID:userInfo.userID!=null? int.parse(userInfo.userID):user.doctorID , + memberID:userInfo.userID!=null? int.parse(userInfo!.userID!):user!.doctorID , password: userInfo.password, - facilityId:userInfo.projectID!=null? userInfo.projectID.toString():user.projectID.toString(), + facilityId:userInfo.projectID!=null? userInfo.projectID.toString():user!.projectID.toString(), oTPSendType: await sharedPref.getInt(OTP_TYPE), iMEI: localToken, - loginDoctorID:userInfo.userID!=null? int.parse(userInfo.userID):user.editedBy,// loggedUser.listMemberInformation[0].employeeID, + loginDoctorID:userInfo.userID!=null? int.parse(userInfo!.userID!):user!.editedBy,// loggedUser.listMemberInformation[0].employeeID, isForSilentLogin:isSilentLogin, generalid: "Cs2020@2016\$2958"); await _authService.checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp); @@ -237,7 +237,7 @@ class AuthenticationViewModel extends BaseViewModel { await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID); await sharedPref.setString(TOKEN, - sendActivationCodeForDoctorAppResponseModel.authenticationTokenID); + sendActivationCodeForDoctorAppResponseModel.authenticationTokenID!); } saveObjToString(String key, value) async { @@ -323,12 +323,12 @@ class AuthenticationViewModel extends BaseViewModel { getDeviceInfoFromFirebase() async { _firebaseMessaging.setAutoInitEnabled(true); if (Platform.isIOS) { - _firebaseMessaging.requestNotificationPermissions(); + _firebaseMessaging.requestPermission(); } setState(ViewState.Busy); var token = await _firebaseMessaging.getToken(); if (localToken == "") { - localToken = token; + localToken = token!; await _authService.selectDeviceImei(localToken); if (_authService.hasError) { @@ -340,9 +340,9 @@ class AuthenticationViewModel extends BaseViewModel { sharedPref.setObj( LAST_LOGIN_USER, _authService.dashboardItemsList[0]); await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, - user.vidaRefreshTokenID); + user!.vidaRefreshTokenID!); await sharedPref.setString(VIDA_AUTH_TOKEN_ID, - user.vidaAuthTokenID); + user!.vidaAuthTokenID!); this.unverified = true; } setState(ViewState.Idle); diff --git a/lib/core/viewModel/doctor_replay_view_model.dart b/lib/core/viewModel/doctor_replay_view_model.dart index bb7dd336..de03c6e3 100644 --- a/lib/core/viewModel/doctor_replay_view_model.dart +++ b/lib/core/viewModel/doctor_replay_view_model.dart @@ -52,8 +52,8 @@ class DoctorReplayViewModel extends BaseViewModel { transactionNo: model.transactionNo.toString(), doctorResponse: response, infoStatus: 6, - createdBy: this.doctorProfile.doctorID, - infoEnteredBy: this.doctorProfile.doctorID, + createdBy: this.doctorProfile!.doctorID!, + infoEnteredBy: this.doctorProfile!.doctorID!, setupID: "010266"); setState(ViewState.BusyLocal); await _doctorReplyService.createDoctorResponse(createDoctorResponseModel); diff --git a/lib/core/viewModel/labs_view_model.dart b/lib/core/viewModel/labs_view_model.dart index aca7c9e0..05393f33 100644 --- a/lib/core/viewModel/labs_view_model.dart +++ b/lib/core/viewModel/labs_view_model.dart @@ -158,7 +158,7 @@ class LabsViewModel extends BaseViewModel { } getPatientLabResultHistoryByDescription( - {PatientLabOrders patientLabOrder, String procedureDescription, PatiantInformtion patient}) async { + {required PatientLabOrders patientLabOrder, required String procedureDescription, required PatiantInformtion patient}) async { setState(ViewState.Busy); await _labsService.getPatientLabOrdersResultHistoryByDescription( patientLabOrder: patientLabOrder, procedureDescription: procedureDescription, patient: patient); @@ -178,7 +178,7 @@ class LabsViewModel extends BaseViewModel { DrAppToastMsg.showSuccesToast(mes); } - Future getAllSpecialLabResult({int patientId}) async { + Future getAllSpecialLabResult({required int patientId}) async { setState(ViewState.Busy); await _labsService.getAllSpecialLabResult(mrn: patientId); if (_labsService.hasError) { diff --git a/lib/core/viewModel/patient-ucaf-viewmodel.dart b/lib/core/viewModel/patient-ucaf-viewmodel.dart index 7c3dfb4e..6ca5f94f 100644 --- a/lib/core/viewModel/patient-ucaf-viewmodel.dart +++ b/lib/core/viewModel/patient-ucaf-viewmodel.dart @@ -32,9 +32,9 @@ class UcafViewModel extends BaseViewModel { List get orderProcedures => _ucafService.orderProcedureList; - Function saveUCAFOnTap; + late Function saveUCAFOnTap; - String selectedLanguage; + late String selectedLanguage; String heightCm = "0"; String weightKg = "0"; String bodyMax = "0"; @@ -45,8 +45,8 @@ class UcafViewModel extends BaseViewModel { resetDataInFirst({bool firstPage = true}) { if(firstPage){ - _ucafService.patientVitalSignsHistory = null; - _ucafService.patientChiefComplaintList = null; + _ucafService.patientVitalSignsHistory = []; + _ucafService.patientChiefComplaintList = []; } _ucafService.patientAssessmentList = []; _ucafService.orderProcedureList = []; diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index a11bb8f6..2eb9772f 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -355,7 +355,7 @@ class PatientViewModel extends BaseViewModel { GetDiabeticChartValuesRequestModel requestModel = GetDiabeticChartValuesRequestModel( patientID: patient.patientId, - admissionNo: int.parse(patient.admissionNo), + admissionNo: int.parse(patient!.admissionNo!), patientTypeID: 1, patientType: 1, resultType: resultType, diff --git a/lib/core/viewModel/pednding_orders_view_model.dart b/lib/core/viewModel/pednding_orders_view_model.dart index cbf81c15..e89345ee 100644 --- a/lib/core/viewModel/pednding_orders_view_model.dart +++ b/lib/core/viewModel/pednding_orders_view_model.dart @@ -15,7 +15,7 @@ class PendingOrdersViewModel extends BaseViewModel { List get admissionOrderList => _pendingOrderService.admissionOrderList; - Future getPendingOrders({int patientId, int admissionNo}) async { + Future getPendingOrders({required int patientId, required int admissionNo}) async { hasError = false; setState(ViewState.Busy); await _pendingOrderService.getPendingOrders( @@ -28,7 +28,7 @@ class PendingOrdersViewModel extends BaseViewModel { } } - Future getAdmissionOrders({int patientId, int admissionNo}) async { + Future getAdmissionOrders({required int patientId, required int admissionNo}) async { hasError = false; setState(ViewState.Busy); await _pendingOrderService.getAdmissionOrders( diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index f7dfad9a..4de6bbe3 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -60,13 +60,13 @@ class ProcedureViewModel extends BaseViewModel { List _patientLabOrdersListClinic = []; List _patientLabOrdersListHospital = []; - Future getProcedure({int? mrn, String? patientType, int appointmentNo}) async { + Future getProcedure({int? mrn, String? patientType, int? appointmentNo}) async { hasError = false; await getDoctorProfile(); //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); - await _procedureService.getProcedure(mrn: mrn, appointmentNo: appointmentNo); + await _procedureService.getProcedure(mrn: mrn, appointmentNo: appointmentNo!); if (_procedureService.hasError) { error = _procedureService.error!; if (patientType == "7") @@ -155,7 +155,7 @@ class ProcedureViewModel extends BaseViewModel { error = _procedureService.error!; setState(ViewState.ErrorLocal); } else { - await getProcedure(mrn: mrn); + await getProcedure(mrn: mrn, appointmentNo: null); setState(ViewState.Idle); } } diff --git a/lib/core/viewModel/profile/discharge_summary_view_model.dart b/lib/core/viewModel/profile/discharge_summary_view_model.dart index b147a11b..e1fdb37c 100644 --- a/lib/core/viewModel/profile/discharge_summary_view_model.dart +++ b/lib/core/viewModel/profile/discharge_summary_view_model.dart @@ -15,7 +15,7 @@ class DischargeSummaryViewModel extends BaseViewModel { _dischargeSummaryService.pendingDischargeSummaryList; - Future getPendingDischargeSummary({int patientId, int admissionNo, }) async { + Future getPendingDischargeSummary({required int patientId, required int admissionNo, }) async { GetDischargeSummaryReqModel getDischargeSummaryReqModel = GetDischargeSummaryReqModel(admissionNo:admissionNo,patientID: patientId ); hasError = false; setState(ViewState.Busy); diff --git a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart index 1bb586c2..25c38d8f 100644 --- a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart +++ b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart @@ -4,7 +4,7 @@ class GetChiefComplaintReqModel { int? episodeId; int? episodeID; dynamic doctorID; - int admissionNo; + int? admissionNo; GetChiefComplaintReqModel({this.patientMRN, this.appointmentNo, this.episodeId, this.episodeID, this.doctorID, this.admissionNo}); diff --git a/lib/models/SOAP/post_chief_complaint_request_model.dart b/lib/models/SOAP/post_chief_complaint_request_model.dart index 142aadf3..56b97a92 100644 --- a/lib/models/SOAP/post_chief_complaint_request_model.dart +++ b/lib/models/SOAP/post_chief_complaint_request_model.dart @@ -2,7 +2,7 @@ class PostChiefComplaintRequestModel { int? appointmentNo; int? episodeID; int? patientMRN; - int admissionNo; + int? admissionNo; String? chiefComplaint; String? hopi; String? currentMedication; diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 2de4d13d..114de3d3 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -91,8 +91,8 @@ class TranslationBase { String? get inPatient => localizedValues['inPatient']![locale.languageCode]; String? get myInPatient => localizedValues['myInPatient']![locale.languageCode]; - String? get myInPatientTitle => localizedValues['myInPatientTitle'][locale.languageCode]; - String get inPatientLabel => localizedValues['inPatientLabel']![locale.languageCode]; + String? get myInPatientTitle => localizedValues['myInPatientTitle']![locale.languageCode]; + String? get inPatientLabel => localizedValues['inPatientLabel']![locale.languageCode]; String? get inPatientAll => localizedValues['inPatientAll']![locale.languageCode]; @@ -211,8 +211,8 @@ class TranslationBase { String? get replay => localizedValues['replay']![locale.languageCode]; - String? get progressNote =>localizedValues['progressNote'][locale.languageCode]; - String get operationReports => localizedValues['operationReports']![locale.languageCode]; + String? get progressNote =>localizedValues['progressNote']![locale.languageCode]; + String? get operationReports => localizedValues['operationReports']![locale.languageCode]; String? get progress => localizedValues['progress']![locale.languageCode]; @@ -294,10 +294,10 @@ class TranslationBase { String? get age => localizedValues['age']![locale.languageCode]; String? get nationality => localizedValues['nationality']![locale.languageCode]; - String get occupation => localizedValues['occupation'][locale.languageCode]; - String get healthID => localizedValues['healthID'][locale.languageCode]; - String get identityNumber => localizedValues['identityNumber'][locale.languageCode]; - String get maritalStatus => localizedValues['maritalStatus'][locale.languageCode]; + String? get occupation => localizedValues['occupation']![locale.languageCode]; + String? get healthID => localizedValues['healthID']![locale.languageCode]; + String? get identityNumber => localizedValues['identityNumber']![locale.languageCode]; + String? get maritalStatus => localizedValues['maritalStatus']![locale.languageCode]; String? get today => localizedValues['today']![locale.languageCode]; @@ -482,7 +482,7 @@ class TranslationBase { String? get noPrescription => localizedValues['no-priscription-listed']![locale.languageCode]; String? get next => localizedValues['next']![locale.languageCode]; - String get finish => localizedValues['finish'][locale.languageCode]; + String? get finish => localizedValues['finish']![locale.languageCode]; String? get previous => localizedValues['previous']![locale.languageCode]; @@ -991,9 +991,9 @@ class TranslationBase { String? get typeHereToReply => localizedValues['typeHereToReply']![locale.languageCode]; String? get searchHere => localizedValues['searchHere']![locale.languageCode]; String? get remove => localizedValues['remove']![locale.languageCode]; - String get inProgress => localizedValues['inProgress'][locale.languageCode]; - String get completed => localizedValues['Completed'][locale.languageCode]; - String get locked => localizedValues['Locked'][locale.languageCode]; + String? get inProgress => localizedValues['inProgress']![locale.languageCode]; + String? get completed => localizedValues['Completed']![locale.languageCode]; + String? get locked => localizedValues['Locked']![locale.languageCode]; String? get step => localizedValues['step']![locale.languageCode]; String? get fieldRequired => localizedValues['fieldRequired']![locale.languageCode]; @@ -1097,21 +1097,21 @@ class TranslationBase { String? get addPrescription => localizedValues['addPrescription']![locale.languageCode]; String? get edit => localizedValues['edit']![locale.languageCode]; String? get summeryReply => localizedValues['summeryReply']![locale.languageCode]; - String get severityValidationError => localizedValues['severityValidationError'][locale.languageCode]; - String get textCopiedSuccessfully => localizedValues['textCopiedSuccessfully'][locale.languageCode]; - String get roomNo => localizedValues['roomNo'][locale.languageCode]; - String get seeMore => localizedValues['seeMore'][locale.languageCode]; - String get replayCallStatus => localizedValues['replayCallStatus'][locale.languageCode]; - String get patientArrived => localizedValues['patientArrived'][locale.languageCode]; - String get calledAndNoResponse => localizedValues['calledAndNoResponse'][locale.languageCode]; - String get underProcess => localizedValues['underProcess'][locale.languageCode]; - String get textResponse => localizedValues['textResponse'][locale.languageCode]; - String get special => localizedValues['special'][locale.languageCode]; - String get requestType => localizedValues['requestType'][locale.languageCode]; - String get allClinic => localizedValues['allClinic'][locale.languageCode]; - String get notReplied => localizedValues['notReplied'][locale.languageCode]; - String get registerNewPatient => localizedValues['registerNewPatient'][locale.languageCode]; - String get registeraPatient => localizedValues['registeraPatient'][locale.languageCode]; + String? get severityValidationError => localizedValues['severityValidationError']![locale.languageCode]; + String? get textCopiedSuccessfully => localizedValues['textCopiedSuccessfully']![locale.languageCode]; + String? get roomNo => localizedValues['roomNo']![locale.languageCode]; + String? get seeMore => localizedValues['seeMore']![locale.languageCode]; + String? get replayCallStatus => localizedValues['replayCallStatus']![locale.languageCode]; + String? get patientArrived => localizedValues['patientArrived']![locale.languageCode]; + String? get calledAndNoResponse => localizedValues['calledAndNoResponse']![locale.languageCode]; + String? get underProcess => localizedValues['underProcess']![locale.languageCode]; + String? get textResponse => localizedValues['textResponse']![locale.languageCode]; + String? get special => localizedValues['special']![locale.languageCode]; + String? get requestType => localizedValues['requestType']![locale.languageCode]; + String? get allClinic => localizedValues['allClinic']![locale.languageCode]; + String? get notReplied => localizedValues['notReplied']![locale.languageCode]; + String? get registerNewPatient => localizedValues['registerNewPatient']![locale.languageCode]; + String? get registeraPatient => localizedValues['registeraPatient']![locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/patient_card/PatientCard.dart b/lib/widgets/patients/patient_card/PatientCard.dart index 88e72b7e..65876517 100644 --- a/lib/widgets/patients/patient_card/PatientCard.dart +++ b/lib/widgets/patients/patient_card/PatientCard.dart @@ -38,10 +38,10 @@ class PatientCard extends StatelessWidget { @override Widget build(BuildContext context) { - String nationalityName = patientInfo.nationalityName != null - ? patientInfo.nationalityName.trim() + String? nationalityName = patientInfo.nationalityName != null + ? patientInfo.nationalityName!.trim() : patientInfo.nationality != null - ? patientInfo.nationality.trim() + ? patientInfo.nationality!.trim() : patientInfo.nationalityId != null ? patientInfo.nationalityId @@ -283,7 +283,7 @@ class PatientCard extends StatelessWidget { child: Container( alignment: Alignment.centerRight, child: AppText( - nationalityName.truncate(14), + nationalityName!.truncate(14), fontWeight: FontWeight.bold, fontSize: 14, textOverflow: TextOverflow.ellipsis, @@ -352,16 +352,16 @@ class PatientCard extends StatelessWidget { ), CustomRow( label: - TranslationBase.of(context).age + " : ", + TranslationBase.of(context).age! + " : ", value: - "${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}", + "${AppDateUtils.getAgeByBirthday(patientInfo!.dateofBirth!, context, isServerFormat: !isFromLiveCare)}", ), if (isInpatient) CustomRow( label: patientInfo.admissionDate == null ? "" : TranslationBase.of(context) - .admissionDate + + .admissionDate! + " : ", value: patientInfo.admissionDate == null ? "" @@ -370,22 +370,22 @@ class PatientCard extends StatelessWidget { if (patientInfo.admissionDate != null) CustomRow( label: TranslationBase.of(context) - .numOfDays + + .numOfDays! + " : ", value: - "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}", + "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo!.admissionDate!)).inDays + 1}", ), if (patientInfo.admissionDate != null) CustomRow( label: TranslationBase.of(context) - .clinicName + + .clinicName! + " : ", value: "${patientInfo.clinicDescription}", ), if (patientInfo.admissionDate != null) CustomRow( label: - TranslationBase.of(context).roomNo + + TranslationBase.of(context).roomNo! + " : ", value: "${patientInfo.roomId}", ), @@ -394,9 +394,9 @@ class PatientCard extends StatelessWidget { children: [ CustomRow( label: TranslationBase.of(context) - .clinic + + .clinic! + " : ", - value: patientInfo.clinicName, + value: patientInfo!.clinicName!, ), ], ), diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index 700e7a2b..2bbb36a2 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -9,8 +9,8 @@ import 'package:provider/provider.dart'; // ignore: must_be_immutable class PatientProfileButton extends StatelessWidget { - final String nameLine1; - final String nameLine2; + final String? nameLine1; + final String? nameLine2; final String icon; final dynamic route; final PatiantInformtion patient; @@ -35,8 +35,8 @@ class PatientProfileButton extends StatelessWidget { required this.patient, required this.patientType, required this.arrivalType, - required this.nameLine1, - required this.nameLine2, + this.nameLine1, + this.nameLine2, required this.icon, this.route, this.isDisable = false, diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/patient-profile-app-bar.dart index 5158d466..64337c68 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.dart @@ -14,10 +14,27 @@ import 'large_avatar.dart'; class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { final PatientProfileAppBarModel patientProfileAppBarModel; - final bool isFromLabResult; + final double? height; + final bool isInpatient; + final bool isDischargedPatient; + final bool isFromLiveCare; + + final String? doctorName; + final String? branch; + final DateTime? appointmentDate; + final String? profileUrl; + final String? invoiceNO; + final String? orderNo; + final bool? isPrescriptions; + final bool? isMedicalFile; + final String? episode; + final String? visitDate; + final String? clinic; + final bool? isAppointmentHeader; + final bool? isFromLabResult; final VoidCallback? onPressed; - PatientProfileAppBar({required this.patientProfileAppBarModel, this.isFromLabResult = false, this.onPressed}); + PatientProfileAppBar({required this.patientProfileAppBarModel, this.isFromLabResult = false, this.onPressed, this.height, this.isInpatient = false, this.isDischargedPatient = false, this.isFromLiveCare= false, this.doctorName, this.branch, this.appointmentDate, this.profileUrl, this.invoiceNO, this.orderNo, this.isPrescriptions, this.isMedicalFile, this.episode, this.visitDate, this.clinic, this.isAppointmentHeader}); @override Widget build(BuildContext context) { @@ -185,7 +202,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { width: 1, ), AppText( - patient.patientId.toString(), + patientProfileAppBarModel.patient!.patientId.toString(), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, @@ -225,12 +242,12 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { ), HeaderRow( - label: TranslationBase.of(context).age + " : ", + label: TranslationBase.of(context).age! + " : ", value: - "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", + "${AppDateUtils.getAgeByBirthday(patientProfileAppBarModel.patient!.patientDetails != null ? patientProfileAppBarModel.patient!.patientDetails!.dateofBirth ?? "" : patientProfileAppBarModel.patient!.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", ),if (patientProfileAppBarModel.patient!.appointmentDate != null && patientProfileAppBarModel.patient!.appointmentDate!.isNotEmpty && - !isFromLabResult) + !isFromLabResult!) HeaderRow( label: TranslationBase.of(context).appointmentDate! + " : ", @@ -250,24 +267,24 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (patient.admissionDate != null && - patient.admissionDate.isNotEmpty) + if (patientProfileAppBarModel.patient!.admissionDate != null && + patientProfileAppBarModel.patient!.admissionDate!.isNotEmpty) HeaderRow( - label: patient.admissionDate == null + label: patientProfileAppBarModel.patient!.admissionDate == null ? "" - : TranslationBase.of(context).admissionDate + + : TranslationBase.of(context).admissionDate! + " : ", - value: patient.admissionDate == null + value: patientProfileAppBarModel.patient!.admissionDate == null ? "" - : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate.toString())))}", + : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.admissionDate.toString())))}", ), - if (patient.admissionDate != null) + if (patientProfileAppBarModel.patient!.admissionDate != null) HeaderRow( label: "${TranslationBase.of(context).numOfDays}: ", value: isDischargedPatient && - patient.dischargeDate != null - ? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}" - : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", + patientProfileAppBarModel.patient!.dischargeDate != null + ? "${AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.admissionDate!)).inDays + 1}" + : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.admissionDate!)).inDays + 1}", ) ], ), @@ -322,12 +339,12 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { 3.5, isCopyable: true, ), - if (orderNo != null && !isPrescriptions) + if (orderNo != null && !isPrescriptions!) HeaderRow( label: 'Order No: ', value: orderNo ?? '', ), - if (invoiceNO != null && !isPrescriptions) + if (invoiceNO != null && !isPrescriptions!) HeaderRow( label: 'Invoice: ', value: invoiceNO ?? "", @@ -342,23 +359,23 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { label: 'Clinic: ', value: clinic ?? '', ), - if (isMedicalFile && episode != null) + if (isMedicalFile! && episode != null) HeaderRow( label: 'Episode: ', value: episode ?? '', ), - if (isMedicalFile && visitDate != null) + if (isMedicalFile! && visitDate != null) HeaderRow( label: 'Visit Date: ', value: visitDate ?? '', ), - if (!isMedicalFile) + if (!isMedicalFile!) HeaderRow( - label: !isPrescriptions + label: !isPrescriptions! ? 'Result Date:' : 'Prescriptions Date ', value: - '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate!, isArabic: projectViewModel.isArabic)}', ), ]), ), @@ -396,8 +413,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { } class HeaderRow extends StatelessWidget { - final String label; - final String value; + final String? label; + final String? value; const HeaderRow({Key? key, this.label, this.value}) : super(key: key); diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart index f0678e22..f1ab00e0 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart @@ -24,7 +24,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget final bool isDischargedPatient; final bool isFromLiveCare; - final Stream videoCallDurationStream; + final Stream? videoCallDurationStream; PatientProfileHeaderNewDesignAppBar( this.patient, this.patientType, this.arrivalType, @@ -38,9 +38,9 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget Widget build(BuildContext context) { int gender = 1; if (patient.patientDetails != null) { - gender = patient.patientDetails.gender; + gender = patient.patientDetails!.gender!; } else { - gender = patient.gender; + gender = patient!.gender!; } return Container( padding: EdgeInsets.only( @@ -76,7 +76,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget " " + Helpers.capitalize(patient.lastName)) : Helpers.capitalize(patient.fullName ?? - patient.patientDetails.fullName), + patient.patientDetails!.fullName), fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -99,7 +99,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget eventCategory: "Patient Profile Header", eventAction: "Call Patient", ); - launch("tel://" + patient.mobileNumber); + launch("tel://" + patient!.mobileNumber!); }, child: Icon( Icons.phone, @@ -121,7 +121,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget padding: EdgeInsets.symmetric(vertical: 2, horizontal: 10), child: Text( - snapshot.data, + snapshot!.data!, style: TextStyle(color: Colors.white), ), ), @@ -186,7 +186,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget patient.arrivedOn != null ? AppDateUtils .convertStringToDateFormat( - patient.arrivedOn, + patient!.arrivedOn!, 'MM-dd-yyyy HH:mm') : '', fontFamily: 'Poppins', @@ -203,7 +203,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).appointmentDate + + TranslationBase.of(context).appointmentDate! + " : ", fontSize: 14, ), @@ -273,12 +273,12 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - patient.nationalityFlagURL, + patient!.nationalityFlagURL!, height: 25, width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { + errorBuilder: (BuildContext? context, + Object? exception, + StackTrace? stackTrace) { return Text(''); }, )) @@ -289,9 +289,9 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget ], ), HeaderRow( - label: TranslationBase.of(context).age + " : ", + label: TranslationBase.of(context).age! + " : ", value: - "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", + "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails!.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", ), if (isInpatient) Column( @@ -300,7 +300,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget HeaderRow( label: patient.admissionDate == null ? "" - : TranslationBase.of(context).admissionDate + + : TranslationBase.of(context).admissionDate! + " : ", value: patient.admissionDate == null ? "" @@ -310,8 +310,8 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget label: "${TranslationBase.of(context).numOfDays}: ", value: isDischargedPatient && patient.dischargeDate != null - ? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}" - : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", + ? "${AppDateUtils.getDateTimeFromServerFormat(patient!.dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate!)).inDays + 1}" + : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient!.admissionDate!)).inDays + 1}", ) ], ) @@ -326,7 +326,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget } convertDateFormat2(String str) { - String newDate; + late String newDate; const start = "/Date("; if (str.isNotEmpty) { const end = "+0300)"; @@ -343,7 +343,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget date.day.toString().padLeft(2, '0'); } - return newDate ?? ''; + return newDate??''; } isToday(date) { diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 55a3d105..5f417a20 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -16,7 +16,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { final bool isInpatient; ProfileMedicalInfoWidget( - {Key? key, this.patient, this.patientType, this.arrivalType, this.from, this.to, this.isInpatient}); + {Key? key, required this.patient, required this.patientType, required this.arrivalType, required this.from, required this.to, this.isInpatient = false}); @override Widget build(BuildContext context) { @@ -57,7 +57,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab, + nameLine1: TranslationBase.of(context).lab??'', nameLine2: TranslationBase.of(context).result, icon: 'patient/lab_results.png'), PatientProfileButton( diff --git a/lib/widgets/shared/app_texts_widget.dart b/lib/widgets/shared/app_texts_widget.dart index df02cdfd..57b85141 100644 --- a/lib/widgets/shared/app_texts_widget.dart +++ b/lib/widgets/shared/app_texts_widget.dart @@ -101,7 +101,7 @@ class _AppTextState extends State { return GestureDetector( child: Container( margin: widget.margin != null - ? EdgeInsets.all(widget.margin) + ? EdgeInsets.all(widget.margin!) : EdgeInsets.only( top: widget.marginTop!, right: widget.marginRight!, bottom: widget.marginBottom!, left: widget.marginLeft!), child: Column( @@ -111,7 +111,7 @@ class _AppTextState extends State { Stack( children: [ _textWidget(), - if (widget.readMore && text.length > widget.maxLength && hidden) + if (widget.readMore! && text.length > widget.maxLength! && hidden) Positioned( bottom: 0, left: 0, @@ -127,7 +127,7 @@ class _AppTextState extends State { ) ], ), - if (widget.allowExpand && widget.readMore && text.length > widget.maxLength) + if (widget.allowExpand! && widget.readMore! && text.length > widget.maxLength!) Padding( padding: EdgeInsets.only(top: 8.0, right: 8.0, bottom: 8.0), child: InkWell( @@ -157,14 +157,14 @@ class _AppTextState extends State { } Widget _textWidget() { - if (widget.isCopyable) { + if (widget.isCopyable!) { return Theme( data: ThemeData( textSelectionColor: Colors.lightBlueAccent, ), child: Container( child: SelectableText( - !hidden ? text : (text.substring(0, text.length > widget.maxLength ? widget.maxLength : text.length)), + !hidden ? text : (text.substring(0, text.length > widget.maxLength! ? widget.maxLength : text.length)), textAlign: widget.textAlign, // overflow: widget.maxLines != null // ? ((widget.maxLines > 1) @@ -174,12 +174,12 @@ class _AppTextState extends State { maxLines: widget.maxLines ?? null, style: widget.style != null ? _getFontStyle().copyWith( - fontStyle: widget.italic ? FontStyle.italic : null, + fontStyle: widget.italic! ? FontStyle.italic : null, color: widget.color, fontWeight: widget.fontWeight ?? _getFontWeight(), height: widget.fontHeight) : TextStyle( - fontStyle: widget.italic ? FontStyle.italic : null, + fontStyle: widget.italic! ? FontStyle.italic : null, color: widget.color != null ? widget.color : Colors.black, fontSize: widget.fontSize ?? _getFontSize(), letterSpacing: widget.letterSpacing ?? (widget.variant == "overline" ? 1.5 : null), @@ -192,18 +192,18 @@ class _AppTextState extends State { ); } else { return Text( - !hidden ? text : (text.substring(0, text.length > widget.maxLength ? widget.maxLength : text.length)), + !hidden ? text : (text.substring(0, text.length > widget.maxLength! ? widget.maxLength : text.length)), textAlign: widget.textAlign, - overflow: widget.maxLines != null ? ((widget.maxLines > 1) ? TextOverflow.fade : TextOverflow.ellipsis) : null, + overflow: widget.maxLines != null ? ((widget.maxLines! > 1) ? TextOverflow.fade : TextOverflow.ellipsis) : null, maxLines: widget.maxLines ?? null, style: widget.style != null ? _getFontStyle().copyWith( - fontStyle: widget.italic ? FontStyle.italic : null, + fontStyle: widget.italic! ? FontStyle.italic : null, color: widget.color, fontWeight: widget.fontWeight ?? _getFontWeight(), height: widget.fontHeight) : TextStyle( - fontStyle: widget.italic ? FontStyle.italic : null, + fontStyle: widget.italic! ? FontStyle.italic : null, color: widget.color != null ? widget.color : Colors.black, fontSize: widget.fontSize ?? _getFontSize(), letterSpacing: widget.letterSpacing ?? (widget.variant == "overline" ? 1.5 : null), diff --git a/lib/widgets/shared/bottom_navigation_item.dart b/lib/widgets/shared/bottom_navigation_item.dart index 0d5b09f6..37dbe28c 100644 --- a/lib/widgets/shared/bottom_navigation_item.dart +++ b/lib/widgets/shared/bottom_navigation_item.dart @@ -65,7 +65,7 @@ class BottomNavigationItem extends StatelessWidget { ), ], ), - if(currentIndex == 3 && dashboardViewModel.notRepliedCount != 0) + if(currentIndex == 3 && dashboardViewModel!.notRepliedCount != 0) Positioned( right: 18.0, bottom: 40.0, @@ -77,7 +77,7 @@ class BottomNavigationItem extends StatelessWidget { borderRadius: BorderRadius.circular(8), badgeContent: Container( // padding: EdgeInsets.all(2.0), - child: Text(dashboardViewModel.notRepliedCount.toString(), + child: Text(dashboardViewModel!.notRepliedCount.toString(), style: TextStyle( color: Colors.white, fontSize: 12.0)), ), diff --git a/lib/widgets/shared/buttons/app_buttons_widget.dart b/lib/widgets/shared/buttons/app_buttons_widget.dart index 96536f46..a4dafc9e 100644 --- a/lib/widgets/shared/buttons/app_buttons_widget.dart +++ b/lib/widgets/shared/buttons/app_buttons_widget.dart @@ -50,7 +50,6 @@ class _AppButtonState extends State { @override Widget build(BuildContext context) { return Container( - height: widget.height, height: widget.height, child: IgnorePointer( ignoring: widget.loading! || widget.disabled!, diff --git a/lib/widgets/shared/card_with_bg_widget.dart b/lib/widgets/shared/card_with_bg_widget.dart index cef5e947..1fcee64c 100644 --- a/lib/widgets/shared/card_with_bg_widget.dart +++ b/lib/widgets/shared/card_with_bg_widget.dart @@ -4,7 +4,7 @@ import 'package:provider/provider.dart'; class CardWithBgWidget extends StatelessWidget { final Widget widget; - final Color bgColor; + final Color? bgColor; final bool hasBorder; final double padding; final double marginLeft; @@ -12,7 +12,7 @@ class CardWithBgWidget extends StatelessWidget { CardWithBgWidget( {required this.widget, - required this.bgColor, + this.bgColor, this.hasBorder = true, this.padding = 15.0, this.marginLeft = 10.0, diff --git a/lib/widgets/shared/text_fields/app-textfield-custom.dart b/lib/widgets/shared/text_fields/app-textfield-custom.dart index 5483946c..a9da7546 100644 --- a/lib/widgets/shared/text_fields/app-textfield-custom.dart +++ b/lib/widgets/shared/text_fields/app-textfield-custom.dart @@ -24,7 +24,7 @@ class AppTextFieldCustom extends StatefulWidget { final int? maxLines; final List? inputFormatters; final Function(String)? onChanged; - final Function onFieldSubmitted; + final Function? onFieldSubmitted; final String? validationError; final bool? isPrscription; @@ -152,7 +152,7 @@ class _AppTextFieldCustomState extends State { widget.onChanged!(value); } }, - onFieldSubmitted: widget.onFieldSubmitted, + onFieldSubmitted: widget.onFieldSubmitted!(), obscureText: widget.isSecure!), ) : AppText( @@ -170,7 +170,7 @@ class _AppTextFieldCustomState extends State { ? Container( margin: EdgeInsets.only( bottom: widget.isSearchTextField - ? (widget.controller.text.isEmpty || + ? (widget.controller!.text.isEmpty || widget.controller == null) ? 10 : 25 @@ -187,7 +187,7 @@ class _AppTextFieldCustomState extends State { ), ), ), - if (widget.validationError != null && widget.validationError.isNotEmpty) TextFieldsError(error: widget.validationError!), + if (widget.validationError != null && widget.validationError!.isNotEmpty) TextFieldsError(error: widget.validationError!), ], ); } diff --git a/lib/widgets/shared/text_fields/app_text_field_custom_serach.dart b/lib/widgets/shared/text_fields/app_text_field_custom_serach.dart index 2a5304e2..cdc6b09d 100644 --- a/lib/widgets/shared/text_fields/app_text_field_custom_serach.dart +++ b/lib/widgets/shared/text_fields/app_text_field_custom_serach.dart @@ -7,7 +7,7 @@ import 'app-textfield-custom.dart'; class AppTextFieldCustomSearch extends StatelessWidget { const AppTextFieldCustomSearch({ - Key key, + Key? key, this.onChangeFun, this.positionedChild, this.marginTop, @@ -20,23 +20,23 @@ class AppTextFieldCustomSearch extends StatelessWidget { this.hintText, }); - final TextEditingController searchController; + final TextEditingController? searchController; - final Function onChangeFun; - final Function onFieldSubmitted; + final Function? onChangeFun; + final Function? onFieldSubmitted; - final Widget positionedChild; - final IconButton suffixIcon; - final double marginTop; - final String validationError; - final String hintText; + final Widget ?positionedChild; + final IconButton? suffixIcon; + final double? marginTop; + final String? validationError; + final String? hintText; - final TextInputType inputType; - final List inputFormatters; + final TextInputType? inputType; + final List? inputFormatters; @override Widget build(BuildContext context) { return Container( - margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: marginTop), + margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: marginTop!), child: Stack( children: [ AppTextFieldCustom( @@ -54,11 +54,11 @@ class AppTextFieldCustomSearch extends StatelessWidget { onPressed: () {}, ), controller: searchController, - onChanged: onChangeFun, + onChanged: onChangeFun!(), onFieldSubmitted: onFieldSubmitted, validationError: validationError), if (positionedChild != null) - Positioned(right: 35, top: 5, child: positionedChild) + Positioned(right: 35, top: 5, child: positionedChild!) ], ), ); diff --git a/lib/widgets/shared/text_fields/country_textfield_custom.dart b/lib/widgets/shared/text_fields/country_textfield_custom.dart index 51f586e1..145ece5e 100644 --- a/lib/widgets/shared/text_fields/country_textfield_custom.dart +++ b/lib/widgets/shared/text_fields/country_textfield_custom.dart @@ -13,7 +13,7 @@ class CountryTextField extends StatefulWidget { final String? keyId; final String? hintText; final double? width; - final Function(dynamic) okFunction; + final Function(dynamic)? okFunction; CountryTextField( {Key? key, @@ -41,14 +41,14 @@ class _CountryTextfieldState extends State { ? () { Helpers.hideKeyboard(context); ListSelectDialog dialog = ListSelectDialog( - list: widget.elementList, + list: widget.elementList!, attributeName: '${widget.keyName}', - attributeValueId: widget.elementList.length == 1 - ? widget.elementList[0]['${widget.keyId}'] + attributeValueId: widget.elementList!.length == 1 + ? widget.elementList![0]['${widget.keyId}'] : '${widget.keyId}', okText: TranslationBase.of(context).ok, okFunction: (selectedValue) => - widget.okFunction(selectedValue), + widget.okFunction!(selectedValue), ); showDialog( barrierDismissible: false, @@ -61,14 +61,14 @@ class _CountryTextfieldState extends State { : null, child: AppTextFieldCustom( hintText: widget.hintText, - dropDownText: widget.elementList.length == 1 - ? widget.elementList[0]['${widget.keyName}'] + dropDownText: widget.elementList!.length == 1 + ? widget.elementList![0]['${widget.keyName}'] : widget.element != null ? widget.element['${widget.keyName}'] : null, isTextFieldHasSuffix: true, validationError: - widget.elementList.length != 1 ? widget.elementError : null, + widget.elementList!.length != 1 ? widget.elementError : null, enabled: false, ), ), diff --git a/lib/widgets/shared/user-guid/CusomRow.dart b/lib/widgets/shared/user-guid/CusomRow.dart index b66d4926..a88e89dd 100644 --- a/lib/widgets/shared/user-guid/CusomRow.dart +++ b/lib/widgets/shared/user-guid/CusomRow.dart @@ -5,17 +5,17 @@ import '../app_texts_widget.dart'; class CustomRow extends StatelessWidget { const CustomRow({ - Key key, - this.label, - this.value, this.labelSize, this.valueSize, this.width, this.isCopyable= true, + Key? key, + this.label, + required this.value, this.labelSize, this.valueSize, this.width, this.isCopyable= true, }) : super(key: key); - final String label; + final String? label; final String value; - final double labelSize; - final double valueSize; - final double width; - final bool isCopyable; + final double? labelSize; + final double? valueSize; + final double? width; + final bool? isCopyable; @override Widget build(BuildContext context) { diff --git a/lib/widgets/transitions/slide_up_page.dart b/lib/widgets/transitions/slide_up_page.dart index ea9b520f..1893a172 100644 --- a/lib/widgets/transitions/slide_up_page.dart +++ b/lib/widgets/transitions/slide_up_page.dart @@ -9,9 +9,9 @@ class SlideUpPageRoute extends PageRouteBuilder { final Widget widget; final bool fullscreenDialog; final bool opaque; - final String settingRoute; + final String? settingRoute; - SlideUpPageRoute({required this.widget, this.fullscreenDialog = false, this.opaque = true, this.settingRoute}) + SlideUpPageRoute({required this.widget, this.fullscreenDialog = false, this.opaque = true, this.settingRoute}) : super( pageBuilder: ( BuildContext context, diff --git a/pubspec.lock b/pubspec.lock deleted file mode 100644 index 27ad91b3..00000000 --- a/pubspec.lock +++ /dev/null @@ -1,1340 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - _fe_analyzer_shared: - dependency: transitive - description: - name: _fe_analyzer_shared - url: "https://pub.dartlang.org" - source: hosted - version: "14.0.0" - analyzer: - dependency: transitive - description: - name: analyzer - url: "https://pub.dartlang.org" - source: hosted - version: "0.41.2" - archive: - dependency: transitive - description: - name: archive - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.6" - args: - dependency: transitive - description: - name: args - url: "https://pub.dartlang.org" - source: hosted - version: "1.6.0" - async: - dependency: transitive - description: - name: async - url: "https://pub.dartlang.org" - source: hosted - version: "2.8.1" - autocomplete_textfield: - dependency: "direct main" - description: - name: autocomplete_textfield - url: "https://pub.dartlang.org" - source: hosted - version: "1.7.3" - badges: - dependency: "direct main" - description: - name: badges - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - barcode_scan_fix: - dependency: "direct main" - description: - name: barcode_scan_fix - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.2" - bazel_worker: - dependency: transitive - description: - name: bazel_worker - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - build: - dependency: transitive - description: - name: build - url: "https://pub.dartlang.org" - source: hosted - version: "1.6.2" - build_config: - dependency: transitive - description: - name: build_config - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.5" - build_daemon: - dependency: transitive - description: - name: build_daemon - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.7" - build_modules: - dependency: transitive - description: - name: build_modules - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.4" - build_resolvers: - dependency: transitive - description: - name: build_resolvers - url: "https://pub.dartlang.org" - source: hosted - version: "1.5.3" - build_runner: - dependency: "direct dev" - description: - name: build_runner - url: "https://pub.dartlang.org" - source: hosted - version: "1.11.1" - build_runner_core: - dependency: transitive - description: - name: build_runner_core - url: "https://pub.dartlang.org" - source: hosted - version: "6.1.7" - build_web_compilers: - dependency: "direct dev" - description: - name: build_web_compilers - url: "https://pub.dartlang.org" - source: hosted - version: "2.16.3" - built_collection: - dependency: transitive - description: - name: built_collection - url: "https://pub.dartlang.org" - source: hosted - version: "5.1.0" - built_value: - dependency: transitive - description: - name: built_value - url: "https://pub.dartlang.org" - source: hosted - version: "8.1.0" - cached_network_image: - dependency: "direct main" - description: - name: cached_network_image - url: "https://pub.dartlang.org" - source: hosted - version: "2.5.1" - characters: - dependency: transitive - description: - name: characters - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.1" - charts_common: - dependency: transitive - description: - name: charts_common - url: "https://pub.dartlang.org" - source: hosted - version: "0.10.0" - charts_flutter: - dependency: "direct main" - description: - name: charts_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "0.10.0" - checked_yaml: - dependency: transitive - description: - name: checked_yaml - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.4" - chewie: - dependency: transitive - description: - name: chewie - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.2" - chewie_audio: - dependency: transitive - description: - name: chewie_audio - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - cli_util: - dependency: transitive - description: - name: cli_util - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - clock: - dependency: transitive - description: - name: clock - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - code_builder: - dependency: transitive - description: - name: code_builder - url: "https://pub.dartlang.org" - source: hosted - version: "3.7.0" - collection: - dependency: transitive - description: - name: collection - url: "https://pub.dartlang.org" - source: hosted - version: "1.15.0" - connectivity: - dependency: "direct main" - description: - name: connectivity - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.6" - connectivity_for_web: - dependency: transitive - description: - name: connectivity_for_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.0" - connectivity_macos: - dependency: transitive - description: - name: connectivity_macos - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - connectivity_platform_interface: - dependency: transitive - description: - name: connectivity_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - convert: - dependency: transitive - description: - name: convert - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.1" - crypto: - dependency: transitive - description: - name: crypto - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.1" - csslib: - dependency: transitive - description: - name: csslib - url: "https://pub.dartlang.org" - source: hosted - version: "0.17.0" - cupertino_icons: - dependency: "direct main" - description: - name: cupertino_icons - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.3" - dart_style: - dependency: transitive - description: - name: dart_style - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.10" - date_time_picker: - dependency: "direct main" - description: - name: date_time_picker - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - device_info: - dependency: "direct main" - description: - name: device_info - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.2" - device_info_platform_interface: - dependency: transitive - description: - name: device_info_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - dropdown_search: - dependency: "direct main" - description: - name: dropdown_search - url: "https://pub.dartlang.org" - source: hosted - version: "0.6.3" - equatable: - dependency: transitive - description: - name: equatable - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.3" - eva_icons_flutter: - dependency: "direct main" - description: - name: eva_icons_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.0" - expandable: - dependency: "direct main" - description: - name: expandable - url: "https://pub.dartlang.org" - source: hosted - version: "5.0.1" - fake_async: - dependency: transitive - description: - name: fake_async - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - ffi: - dependency: transitive - description: - name: ffi - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.2" - file: - dependency: transitive - description: - name: file - url: "https://pub.dartlang.org" - source: hosted - version: "6.1.2" - file_picker: - dependency: "direct main" - description: - name: file_picker - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.2+2" - firebase_core: - dependency: transitive - description: - name: firebase_core - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" - firebase_core_platform_interface: - dependency: transitive - description: - name: firebase_core_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "4.0.1" - firebase_core_web: - dependency: transitive - description: - name: firebase_core_web - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - firebase_messaging: - dependency: "direct main" - description: - name: firebase_messaging - url: "https://pub.dartlang.org" - source: hosted - version: "10.0.2" - firebase_messaging_platform_interface: - dependency: transitive - description: - name: firebase_messaging_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.2" - firebase_messaging_web: - dependency: transitive - description: - name: firebase_messaging_web - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.2" - fixnum: - dependency: transitive - description: - name: fixnum - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" - fl_chart: - dependency: "direct main" - description: - name: fl_chart - url: "https://pub.dartlang.org" - source: hosted - version: "0.36.2" - flutter: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_blurhash: - dependency: transitive - description: - name: flutter_blurhash - url: "https://pub.dartlang.org" - source: hosted - version: "0.5.0" - flutter_cache_manager: - dependency: transitive - description: - name: flutter_cache_manager - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.2" - flutter_colorpicker: - dependency: "direct main" - description: - name: flutter_colorpicker - url: "https://pub.dartlang.org" - source: hosted - version: "0.5.0" - flutter_device_type: - dependency: "direct main" - description: - name: flutter_device_type - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.0" - flutter_flexible_toast: - dependency: "direct main" - description: - name: flutter_flexible_toast - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.4" - flutter_gifimage: - dependency: "direct main" - description: - name: flutter_gifimage - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" - flutter_html: - dependency: "direct main" - description: - name: flutter_html - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - flutter_inappwebview: - dependency: transitive - description: - name: flutter_inappwebview - url: "https://pub.dartlang.org" - source: hosted - version: "5.3.2" - flutter_keyboard_visibility: - dependency: transitive - description: - name: flutter_keyboard_visibility - url: "https://pub.dartlang.org" - source: hosted - version: "5.0.2" - flutter_keyboard_visibility_platform_interface: - dependency: transitive - description: - name: flutter_keyboard_visibility_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - flutter_keyboard_visibility_web: - dependency: transitive - description: - name: flutter_keyboard_visibility_web - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - flutter_layout_grid: - dependency: transitive - description: - name: flutter_layout_grid - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" - flutter_localizations: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_math_fork: - dependency: transitive - description: - name: flutter_math_fork - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.3+1" - flutter_page_indicator: - dependency: transitive - description: - name: flutter_page_indicator - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.3" - flutter_plugin_android_lifecycle: - dependency: transitive - description: - name: flutter_plugin_android_lifecycle - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.2" - flutter_staggered_grid_view: - dependency: "direct main" - description: - name: flutter_staggered_grid_view - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.0" - flutter_svg: - dependency: transitive - description: - name: flutter_svg - url: "https://pub.dartlang.org" - source: hosted - version: "0.22.0" - flutter_swiper: - dependency: "direct main" - description: - name: flutter_swiper - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.6" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - flutter_web_plugins: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - font_awesome_flutter: - dependency: "direct main" - description: - name: font_awesome_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "9.1.0" - get_it: - dependency: "direct main" - description: - name: get_it - url: "https://pub.dartlang.org" - source: hosted - version: "7.1.3" - glob: - dependency: transitive - description: - name: glob - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - graphs: - dependency: transitive - description: - name: graphs - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - hexcolor: - dependency: "direct main" - description: - name: hexcolor - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.4" - hijri: - dependency: transitive - description: - name: hijri - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.3" - hijri_picker: - dependency: "direct main" - description: - name: hijri_picker - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - html: - dependency: "direct main" - description: - name: html - url: "https://pub.dartlang.org" - source: hosted - version: "0.15.0" - html_editor_enhanced: - dependency: "direct main" - description: - name: html_editor_enhanced - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.0+1-dev.1" - http: - dependency: "direct main" - description: - name: http - url: "https://pub.dartlang.org" - source: hosted - version: "0.13.3" - http_interceptor: - dependency: "direct main" - description: - name: http_interceptor - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.1" - http_multi_server: - dependency: transitive - description: - name: http_multi_server - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.0" - http_parser: - dependency: transitive - description: - name: http_parser - url: "https://pub.dartlang.org" - source: hosted - version: "4.0.0" - image: - dependency: transitive - description: - name: image - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.8" - imei_plugin: - dependency: "direct main" - description: - name: imei_plugin - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - infinite_listview: - dependency: transitive - description: - name: infinite_listview - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - intl: - dependency: "direct main" - description: - name: intl - url: "https://pub.dartlang.org" - source: hosted - version: "0.17.0" - io: - dependency: transitive - description: - name: io - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.5" - js: - dependency: transitive - description: - name: js - url: "https://pub.dartlang.org" - source: hosted - version: "0.6.3" - json_annotation: - dependency: transitive - description: - name: json_annotation - url: "https://pub.dartlang.org" - source: hosted - version: "4.0.1" - local_auth: - dependency: "direct main" - description: - name: local_auth - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.6" - logging: - dependency: transitive - description: - name: logging - url: "https://pub.dartlang.org" - source: hosted - version: "0.11.4" - maps_launcher: - dependency: "direct main" - description: - name: maps_launcher - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - matcher: - dependency: transitive - description: - name: matcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.10" - meta: - dependency: transitive - description: - name: meta - url: "https://pub.dartlang.org" - source: hosted - version: "1.7.0" - mime: - dependency: transitive - description: - name: mime - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.7" - nested: - dependency: transitive - description: - name: nested - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" - node_interop: - dependency: transitive - description: - name: node_interop - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.1" - node_io: - dependency: transitive - description: - name: node_io - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.1" - numberpicker: - dependency: transitive - description: - name: numberpicker - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.1" - numerus: - dependency: transitive - description: - name: numerus - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.1" - octo_image: - dependency: transitive - description: - name: octo_image - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.0" - package_config: - dependency: transitive - description: - name: package_config - url: "https://pub.dartlang.org" - source: hosted - version: "1.9.3" - path: - dependency: transitive - description: - name: path - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.0" - path_drawing: - dependency: transitive - description: - name: path_drawing - url: "https://pub.dartlang.org" - source: hosted - version: "0.5.1" - path_parsing: - dependency: transitive - description: - name: path_parsing - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.1" - path_provider: - dependency: transitive - description: - name: path_provider - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.7" - path_provider_android: - dependency: transitive - description: - name: path_provider_android - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.6" - path_provider_ios: - dependency: transitive - description: - name: path_provider_ios - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.6" - path_provider_linux: - dependency: transitive - description: - name: path_provider_linux - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - path_provider_macos: - dependency: transitive - description: - name: path_provider_macos - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.2" - path_provider_platform_interface: - dependency: transitive - description: - name: path_provider_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - path_provider_windows: - dependency: transitive - description: - name: path_provider_windows - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - pedantic: - dependency: transitive - description: - name: pedantic - url: "https://pub.dartlang.org" - source: hosted - version: "1.11.1" - percent_indicator: - dependency: "direct main" - description: - name: percent_indicator - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.1" - permission_handler: - dependency: "direct main" - description: - name: permission_handler - url: "https://pub.dartlang.org" - source: hosted - version: "8.1.1" - permission_handler_platform_interface: - dependency: transitive - description: - name: permission_handler_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "3.6.0" - petitparser: - dependency: transitive - description: - name: petitparser - url: "https://pub.dartlang.org" - source: hosted - version: "4.1.0" - platform: - dependency: transitive - description: - name: platform - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.0" - plugin_platform_interface: - dependency: transitive - description: - name: plugin_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - pointer_interceptor: - dependency: transitive - description: - name: pointer_interceptor - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.0+1" - pool: - dependency: transitive - description: - name: pool - url: "https://pub.dartlang.org" - source: hosted - version: "1.4.0" - process: - dependency: transitive - description: - name: process - url: "https://pub.dartlang.org" - source: hosted - version: "4.2.1" - protobuf: - dependency: transitive - description: - name: protobuf - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - provider: - dependency: "direct main" - description: - name: provider - url: "https://pub.dartlang.org" - source: hosted - version: "5.0.0" - pub_semver: - dependency: transitive - description: - name: pub_semver - url: "https://pub.dartlang.org" - source: hosted - version: "1.4.4" - pubspec_parse: - dependency: transitive - description: - name: pubspec_parse - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.8" - quiver: - dependency: "direct main" - description: - name: quiver - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.1" - rxdart: - dependency: transitive - description: - name: rxdart - url: "https://pub.dartlang.org" - source: hosted - version: "0.25.0" - scratch_space: - dependency: transitive - description: - name: scratch_space - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.4+3" - shared_preferences: - dependency: "direct main" - description: - name: shared_preferences - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.6" - shared_preferences_linux: - dependency: transitive - description: - name: shared_preferences_linux - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - shared_preferences_macos: - dependency: transitive - description: - name: shared_preferences_macos - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - shared_preferences_platform_interface: - dependency: transitive - description: - name: shared_preferences_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - shared_preferences_web: - dependency: transitive - description: - name: shared_preferences_web - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - shared_preferences_windows: - dependency: transitive - description: - name: shared_preferences_windows - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - shelf: - dependency: transitive - description: - name: shelf - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.4" - shelf_web_socket: - dependency: transitive - description: - name: shelf_web_socket - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.4+1" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.99" - source_maps: - dependency: transitive - description: - name: source_maps - url: "https://pub.dartlang.org" - source: hosted - version: "0.10.9" - source_span: - dependency: transitive - description: - name: source_span - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.1" - speech_to_text: - dependency: "direct main" - description: - path: speech_to_text - relative: true - source: path - version: "0.0.0" - sqflite: - dependency: transitive - description: - name: sqflite - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0+4" - sqflite_common: - dependency: transitive - description: - name: sqflite_common - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1+1" - stack_trace: - dependency: transitive - description: - name: stack_trace - url: "https://pub.dartlang.org" - source: hosted - version: "1.10.0" - sticky_headers: - dependency: "direct main" - description: - name: sticky_headers - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - stream_channel: - dependency: transitive - description: - name: stream_channel - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - stream_transform: - dependency: transitive - description: - name: stream_transform - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - string_scanner: - dependency: transitive - description: - name: string_scanner - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - synchronized: - dependency: transitive - description: - name: synchronized - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.0" - term_glyph: - dependency: transitive - description: - name: term_glyph - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - test_api: - dependency: transitive - description: - name: test_api - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.2" - timing: - dependency: transitive - description: - name: timing - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.1+3" - transformer_page_view: - dependency: transitive - description: - name: transformer_page_view - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.6" - tuple: - dependency: transitive - description: - name: tuple - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" - url_launcher: - dependency: "direct main" - description: - name: url_launcher - url: "https://pub.dartlang.org" - source: hosted - version: "6.0.6" - url_launcher_linux: - dependency: transitive - description: - name: url_launcher_linux - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - url_launcher_macos: - dependency: transitive - description: - name: url_launcher_macos - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - url_launcher_platform_interface: - dependency: transitive - description: - name: url_launcher_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.3" - url_launcher_web: - dependency: transitive - description: - name: url_launcher_web - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - url_launcher_windows: - dependency: transitive - description: - name: url_launcher_windows - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - uuid: - dependency: transitive - description: - name: uuid - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.5" - vector_math: - dependency: transitive - description: - name: vector_math - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - video_player: - dependency: transitive - description: - name: video_player - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.6" - video_player_platform_interface: - dependency: transitive - description: - name: video_player_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "4.1.0" - video_player_web: - dependency: transitive - description: - name: video_player_web - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - visibility_detector: - dependency: transitive - description: - name: visibility_detector - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - wakelock: - dependency: transitive - description: - name: wakelock - url: "https://pub.dartlang.org" - source: hosted - version: "0.5.2" - wakelock_macos: - dependency: transitive - description: - name: wakelock_macos - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.0+1" - wakelock_platform_interface: - dependency: transitive - description: - name: wakelock_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.1+1" - wakelock_web: - dependency: transitive - description: - name: wakelock_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0+1" - wakelock_windows: - dependency: transitive - description: - name: wakelock_windows - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.0" - watcher: - dependency: transitive - description: - name: watcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.7+15" - web_socket_channel: - dependency: transitive - description: - name: web_socket_channel - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - webview_flutter: - dependency: transitive - description: - name: webview_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.8" - win32: - dependency: transitive - description: - name: win32 - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.2" - xdg_directories: - dependency: transitive - description: - name: xdg_directories - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - xml: - dependency: transitive - description: - name: xml - url: "https://pub.dartlang.org" - source: hosted - version: "5.1.2" - yaml: - dependency: transitive - description: - name: yaml - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.1" -sdks: - dart: ">=2.14.0 <3.0.0" - flutter: ">=2.5.0" diff --git a/pubspec.yaml b/pubspec.yaml index 15c1a718..323cb1b0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -71,6 +71,7 @@ dependencies: # Firebase firebase_messaging: ^10.0.1 + firebase_analytics : ^8.3.4 #GIF image flutter_gifimage: ^1.0.1 From ec83d720384faba687bfe57ce7b468a8801e374e Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Mon, 22 Nov 2021 08:56:45 +0200 Subject: [PATCH 6/8] first step from fix screen --- lib/core/viewModel/dashboard_view_model.dart | 2 +- .../auth/verification_methods_screen.dart | 10 ++++---- .../doctor_replay/all_doctor_questions.dart | 8 +++---- .../doctor_replay/doctor_repaly_chat.dart | 18 +++++++------- .../doctor_replay/doctor_reply_screen.dart | 8 +++---- .../doctor_replay/doctor_reply_widget.dart | 6 ++--- .../not_replaied_doctor_questions.dart | 8 +++---- lib/screens/home/home_patient_card.dart | 6 ++--- lib/screens/home/home_screen.dart | 24 ++++--------------- 9 files changed, 38 insertions(+), 52 deletions(-) diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index 38bf85e6..2a064296 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -81,7 +81,7 @@ List get specialClinicalCareList => // setState(ViewState.Idle); } - Future changeClinic(int clinicId, AuthenticationViewModel authProvider) async { + Future changeClinic(var clinicId, AuthenticationViewModel authProvider) async { setState(ViewState.BusyLocal); await getDoctorProfile(); ClinicModel clinicModel = ClinicModel( diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index d22e13df..17aa4fdc 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -12,6 +12,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.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:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/secondary_button.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -25,6 +26,7 @@ import '../../widgets/auth/verification_methods_list.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); Helpers helpers = Helpers(); +///TODO Elham* check if this still in user or not class VerificationMethodsScreen extends StatefulWidget { final password; @@ -339,7 +341,7 @@ class _VerificationMethodsScreenState extends State { SecondaryButton( label: TranslationBase .of(context) - .useAnotherAccount, + .useAnotherAccount??'', color: Color(0xFFD02127), //fontWeight: FontWeight.w700, onTap: () { @@ -387,7 +389,7 @@ class _VerificationMethodsScreenState extends State { Helpers.showErrorToast(authenticationViewModel.error); } else { await sharedPref.setString(TOKEN, - authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID); + authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID!); if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) { GifLoaderDialogUtils.hideDialog(context); this.startSMSService(authMethodType,isSilentLogin: true); @@ -470,8 +472,8 @@ class _VerificationMethodsScreenState extends State { } } - checkActivationCode({String value,bool isSilentLogin = false}) async { - await authenticationViewModel.checkActivationCodeForDoctorApp(activationCode: value,isSilentLogin: isSilentLogin); + checkActivationCode({String? value,bool isSilentLogin = false}) async { + await authenticationViewModel.checkActivationCodeForDoctorApp(activationCode: value!,isSilentLogin: isSilentLogin); if (authenticationViewModel.state == ViewState.ErrorLocal) { Navigator.pop(context); Helpers.showErrorToast(authenticationViewModel.error); diff --git a/lib/screens/doctor/doctor_replay/all_doctor_questions.dart b/lib/screens/doctor/doctor_replay/all_doctor_questions.dart index ac6736e0..66f2e7aa 100644 --- a/lib/screens/doctor/doctor_replay/all_doctor_questions.dart +++ b/lib/screens/doctor/doctor_replay/all_doctor_questions.dart @@ -12,9 +12,8 @@ import 'package:flutter/material.dart'; import 'doctor_repaly_chat.dart'; class AllDoctorQuestions extends StatefulWidget { - final Function changeCurrentTab; - const AllDoctorQuestions({Key? key, this.changeCurrentTab}) : super(key: key); + const AllDoctorQuestions({Key? key}) : super(key: key); @override _AllDoctorQuestionsState createState() => _AllDoctorQuestionsState(); @@ -31,10 +30,9 @@ class _AllDoctorQuestionsState extends State { }, builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).replay2, isShowAppBar: false, body: model.listDoctorWorkingHoursTable.isEmpty - ?ErrorMessage(error: TranslationBase.of(context).noItem)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem) + ?ErrorMessage(error: TranslationBase.of(context).noItem!)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem) : Column( children: [ Expanded( @@ -82,7 +80,7 @@ class _AllDoctorQuestionsState extends State { }); model.getDoctorReply(pageIndex: pageIndex); } - return; + return false; }, ), ), diff --git a/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart b/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart index 85c06b18..39528c9c 100644 --- a/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart +++ b/lib/screens/doctor/doctor_replay/doctor_repaly_chat.dart @@ -7,11 +7,11 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/TextFields.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:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; @@ -24,7 +24,7 @@ class DoctorReplayChat extends StatefulWidget { final DoctorReplayViewModel previousModel; bool showMsgBox = false; DoctorReplayChat( - {Key? key, this.reply, this.previousModel, + {Key? key, required this.reply, required this.previousModel, }); @override @@ -37,8 +37,8 @@ class _DoctorReplayChatState extends State { @override Widget build(BuildContext context) { - if(widget.reply.doctorResponse.isNotEmpty){ - msgController.text = widget.reply.doctorResponse; + if(widget.reply.doctorResponse!.isNotEmpty){ + msgController.text = widget.reply.doctorResponse!; } else { widget.showMsgBox = true; @@ -172,7 +172,7 @@ class _DoctorReplayChatState extends State { margin: EdgeInsets.symmetric(horizontal: 0), child: InkWell( onTap: () { - launch("tel://" +widget.reply.mobileNumber); + launch("tel://" +widget.reply.mobileNumber!); }, child: Icon( Icons.phone, @@ -194,7 +194,7 @@ class _DoctorReplayChatState extends State { fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8, ), AppText( - widget.reply.createdOn !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn)):AppDateUtils.getHour(DateTime.now()), + widget.reply.createdOn !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn!)):AppDateUtils.getHour(DateTime.now()), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8, fontFamily: 'Poppins', color: Colors.white, @@ -236,7 +236,7 @@ class _DoctorReplayChatState extends State { SizedBox(height: 30,), SizedBox(height: 30,), - if(widget.reply.doctorResponse != null && widget.reply.doctorResponse.isNotEmpty) + if(widget.reply.doctorResponse != null && widget.reply.doctorResponse!.isNotEmpty) Align( alignment: Alignment.centerRight, child: Container( @@ -269,7 +269,7 @@ class _DoctorReplayChatState extends State { width: 50, height: 50, child: Image.asset( - widget.previousModel.doctorProfile.gender == 0 + widget.previousModel.doctorProfile!.gender == 0 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, @@ -280,7 +280,7 @@ class _DoctorReplayChatState extends State { Container( width: MediaQuery.of(context).size.width * 0.35, child: AppText( - widget.previousModel.doctorProfile.doctorName, + widget.previousModel.doctorProfile!.doctorName, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontFamily: 'Poppins', color: Color(0xFF2B353E), diff --git a/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart b/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart index 84c951f8..9bdfe49d 100644 --- a/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart +++ b/lib/screens/doctor/doctor_replay/doctor_reply_screen.dart @@ -28,7 +28,7 @@ import 'not_replaied_Doctor_Questions.dart'; class DoctorReplyScreen extends StatefulWidget { final Function changeCurrentTab; - const DoctorReplyScreen({Key? key, this.changeCurrentTab}) : super(key: key); + const DoctorReplyScreen({Key? key, required this.changeCurrentTab}) : super(key: key); @override _DoctorReplyScreenState createState() => _DoctorReplyScreenState(); @@ -36,7 +36,7 @@ class DoctorReplyScreen extends StatefulWidget { class _DoctorReplyScreenState extends State with SingleTickerProviderStateMixin { - TabController _tabController; + late TabController _tabController; int _activeTab = 0; int pageIndex = 1; @@ -69,7 +69,7 @@ class _DoctorReplyScreenState extends State return false; }, child: AppScaffold( - appBarTitle: TranslationBase.of(context).replay2, + appBarTitle: TranslationBase.of(context).replay2!, isShowAppBar: false, body: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -109,7 +109,7 @@ class _DoctorReplyScreenState extends State tabWidget( screenSize, _activeTab == 1, - TranslationBase.of(context).all, + TranslationBase.of(context).all!, ), ], ), diff --git a/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart b/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart index 77014074..c48dbf08 100644 --- a/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart +++ b/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart @@ -188,10 +188,10 @@ class _DoctorReplyWidgetState extends State { isCopyable:false, ), CustomRow( - label: TranslationBase.of(context).age + " : ", + label: TranslationBase.of(context).age! + " : ", isCopyable:false, value: - "${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth, context)}", + "${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth!, context)}", ), SizedBox( height: 8, @@ -213,7 +213,7 @@ class _DoctorReplyWidgetState extends State { children: [ new TextSpan( text: - TranslationBase.of(context).requestType + + TranslationBase.of(context).requestType! + ": ", style: TextStyle( fontSize: SizeConfig diff --git a/lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart b/lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart index 65b95217..1416e70a 100644 --- a/lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart +++ b/lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart @@ -14,7 +14,7 @@ import 'doctor_repaly_chat.dart'; class NotRepliedDoctorQuestions extends StatefulWidget { final Function changeCurrentTab; - const NotRepliedDoctorQuestions({Key? key, this.changeCurrentTab}) + const NotRepliedDoctorQuestions({Key? key, required this.changeCurrentTab}) : super(key: key); @override @@ -33,10 +33,10 @@ class _NotRepliedDoctorQuestionsState extends State { }, builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).replay2, + appBarTitle: TranslationBase.of(context).replay2!, isShowAppBar: false, body: model.listDoctorNotRepliedQuestions.isEmpty - ? ErrorMessage(error: TranslationBase.of(context).noItem) + ? ErrorMessage(error: TranslationBase.of(context).noItem!) : Column( children: [ Expanded( @@ -91,7 +91,7 @@ class _NotRepliedDoctorQuestionsState extends State { }); model.getDoctorReply(pageIndex: pageIndex, isGettingNotReply: true); } - return; + return false; }, ), ), diff --git a/lib/screens/home/home_patient_card.dart b/lib/screens/home/home_patient_card.dart index 704c9eb3..a1a5f8f8 100644 --- a/lib/screens/home/home_patient_card.dart +++ b/lib/screens/home/home_patient_card.dart @@ -6,7 +6,7 @@ import 'package:flutter/material.dart'; class HomePatientCard extends StatelessWidget { final Color backgroundColor; final IconData cardIcon; - final String cardIconImage; + final String? cardIconImage; final Color backgroundIconColor; final String text; final Color textColor; @@ -17,7 +17,7 @@ class HomePatientCard extends StatelessWidget { required this.backgroundColor, required this.backgroundIconColor, required this.cardIcon, - required this.cardIconImage, + this.cardIconImage, required this.text, required this.textColor, required this.onTap, @@ -75,7 +75,7 @@ class HomePatientCard extends StatelessWidget { color: textColor, ) : Image.asset( - cardIconImage, + cardIconImage!, height: iconSize, width: iconSize, ), diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index c609ad7a..2d469daf 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -21,6 +21,7 @@ import 'package:doctor_app_flutter/screens/patients/register_patient/RegisterPat import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widget.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:doctor_app_flutter/widgets/shared/errors/error_message.dart'; @@ -29,6 +30,7 @@ import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import 'package:sticky_headers/sticky_headers/widget.dart'; import '../../routes.dart'; import 'home_screen_header.dart'; @@ -51,7 +53,7 @@ class _HomeScreenState extends State { bool isExpanded = false; bool isInpatient = false; int sliderActiveIndex = 0; - String? clinicId; + var clinicId; late AuthenticationViewModel authenticationViewModel; int colorIndex = 0; final GlobalKey scaffoldKey = new GlobalKey(); @@ -328,22 +330,6 @@ class _HomeScreenState extends State { DashboardViewModel model, projectsProvider) { colorIndex = 0; - // List backgroundColors = List(3); - // backgroundColors[0] = Color(0xffD02127); - // backgroundColors[1] = Colors.grey[300]; - // backgroundColors[2] = Color(0xff2B353E); - // List backgroundIconColors = List(3); - // backgroundIconColors[0] = Colors.white12; - // backgroundIconColors[1] = Colors.white38; - // backgroundIconColors[2] = Colors.white10; - // List textColors = List(3); - // textColors[0] = Colors.white; - // textColors[1] = Color(0xFF353E47); - // textColors[2] = Colors.white; - // - // List patientCards = []; - // - List backgroundColors = []; backgroundColors.add(Color(0xffD02127)); backgroundColors.add(Colors.grey[300]!); @@ -407,7 +393,7 @@ class _HomeScreenState extends State { context, FadePage( page: InPatientScreen( - specialClinic: model.getSpecialClinic(clinicId ?? projectsProvider!.doctorClinicsList[0]!.clinicID!), + specialClinic: model.getSpecialClinic(clinicId ?? projectsProvider!.doctorClinicsList[0]!.clinicID!)!, ), ), ); @@ -421,7 +407,7 @@ class _HomeScreenState extends State { //TODO Elham* match the of the icon cardIcon: DoctorApp.arrival_patients, textColor: textColors[colorIndex], - text: TranslationBase.of(context).registerNewPatient, + text: TranslationBase.of(context).registerNewPatient!, onTap: () { Navigator.push( context, From 1f28a09043e0f525979ae3da8b121d6b391826c1 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Mon, 22 Nov 2021 10:15:12 +0200 Subject: [PATCH 7/8] first step from fix screen --- .../doctor_replay/all_doctor_questions.dart | 2 +- .../add_patient_sick_leave_screen.dart | 16 +- .../patient_sick_leave_screen.dart | 12 +- .../patients/In_patient/InPatientHeader.dart | 4 +- lib/screens/patients/In_patient/NoData.dart | 4 +- .../In_patient/in_patient_list_page.dart | 14 +- .../In_patient/in_patient_screen.dart | 16 +- .../In_patient/list_of_all_in_patient.dart | 14 +- .../In_patient/list_of_my_inpatient.dart | 11 +- .../profile/UCAF/ucaf_pager_screen.dart | 2 +- .../admission_orders_screen.dart | 25 +-- .../diabetic_chart/diabetic_chart.dart | 8 +- ...iabetic_details_blood_pressurewideget.dart | 4 +- .../line_chart_for_diabetic.dart | 4 +- .../profile/diagnosis/diagnosis_screen.dart | 16 +- .../all_discharge_summary.dart | 5 +- .../discharge_summary/discharge_summary.dart | 2 +- .../pending_discharge_summary.dart | 2 +- .../all_lab_special_result_page.dart | 2 +- .../nursing_note/nursing_note_screen.dart | 4 +- .../operation_report/operation_report.dart | 2 +- .../pending_orders/pending_orders_screen.dart | 2 +- .../profile/patient-profile-app-bar.dart | 207 +++++++++++------- lib/widgets/shared/app_scaffold_widget.dart | 2 +- 24 files changed, 202 insertions(+), 178 deletions(-) diff --git a/lib/screens/doctor/doctor_replay/all_doctor_questions.dart b/lib/screens/doctor/doctor_replay/all_doctor_questions.dart index 66f2e7aa..7088902b 100644 --- a/lib/screens/doctor/doctor_replay/all_doctor_questions.dart +++ b/lib/screens/doctor/doctor_replay/all_doctor_questions.dart @@ -32,7 +32,7 @@ class _AllDoctorQuestionsState extends State { baseViewModel: model, isShowAppBar: false, body: model.listDoctorWorkingHoursTable.isEmpty - ?ErrorMessage(error: TranslationBase.of(context).noItem!)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem) + ?ErrorMessage(error: TranslationBase.of(context).noItem!)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem!) : Column( children: [ Expanded( diff --git a/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart b/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart index 8c9f0f1d..9f42bbca 100644 --- a/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart +++ b/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart @@ -38,7 +38,7 @@ class AddPatientSickLeaveScreen extends StatefulWidget { AddPatientSickLeaveScreen( {this.appointmentNo, this.patientMRN, - this.patient, this.previousModel}); + required this.patient, required this.previousModel}); @override _AddPatientSickLeaveScreenState createState() => @@ -52,7 +52,7 @@ class _AddPatientSickLeaveScreenState extends State { TextEditingController _clinicController = new TextEditingController(); TextEditingController _doctorController = new TextEditingController(); TextEditingController _remarkController = new TextEditingController(); - DateTime currentDate; + late DateTime currentDate; AddSickLeaveRequest addSickLeave = AddSickLeaveRequest(); bool isFormSubmitted = false; @@ -85,8 +85,8 @@ class _AddPatientSickLeaveScreenState extends State { return BaseView( onModelReady: (model) async { await model.getDoctorProfile(); - _clinicController.text = model.doctorProfile.clinicDescription; - _doctorController.text = model.doctorProfile.doctorName; + _clinicController.text = model.doctorProfile!.clinicDescription!; + _doctorController.text = model.doctorProfile!.doctorName!; await model.preSickLeaveStatistics( widget.appointmentNo, widget.patientMRN); }, @@ -97,7 +97,7 @@ class _AddPatientSickLeaveScreenState extends State { child: AppScaffold( baseViewModel: model, appBar: BottomSheetTitle( - title: TranslationBase.of(context).addSickLeave, + title: TranslationBase.of(context).addSickLeave!, ), isShowAppBar: true, body: Center( @@ -112,9 +112,9 @@ class _AddPatientSickLeaveScreenState extends State { ), AppTextFieldCustom( height: Helpers.getTextFieldHeight(), - hintText: TranslationBase.of(context).sickLeave + + hintText: TranslationBase.of(context).sickLeave! + ' ' + - TranslationBase.of(context).days, + TranslationBase.of(context).days!, maxLines: 1, minLines: 1, dropDownColor: Colors.white, @@ -154,7 +154,7 @@ class _AddPatientSickLeaveScreenState extends State { minLines: 1, isTextFieldHasSuffix: true, suffixIcon: IconButton( - icon: Icon(Icons.calendar_today)), + icon: Icon(Icons.calendar_today), onPressed: () { },), inputFormatters: [ FilteringTextInputFormatter.allow( RegExp(ONLY_NUMBERS)) diff --git a/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart b/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart index 51c5b35b..a1817985 100644 --- a/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart +++ b/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart @@ -23,13 +23,13 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class PatientSickLeaveScreen extends StatelessWidget { - PatiantInformtion patient; + late PatiantInformtion patient; @override Widget build(BuildContext context) { ProjectViewModel projectsProvider = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; bool isInpatient = routeArgs['isInpatient']; return BaseView( @@ -84,7 +84,7 @@ class PatientSickLeaveScreen extends StatelessWidget { ), ), AddNewOrder( - label: TranslationBase.of(context).noSickLeaveApplied, + label: TranslationBase.of(context).noSickLeaveApplied!, onTap: () async { await locator().logEvent( eventCategory: "Add Sick Leave Screen" @@ -193,7 +193,7 @@ class PatientSickLeaveScreen extends StatelessWidget { CustomRow( label: TranslationBase.of( context) - .startDate + + .startDate! + ' ' ?? "", labelSize: SizeConfig @@ -217,7 +217,7 @@ class PatientSickLeaveScreen extends StatelessWidget { CustomRow( label: TranslationBase.of( context) - .endDate + + .endDate! + ' ' ?? "", labelSize: SizeConfig @@ -269,7 +269,7 @@ class PatientSickLeaveScreen extends StatelessWidget { ) : patient.patientStatusType != 43 ? ErrorMessage( - error: TranslationBase.of(context).noSickLeave, + error: TranslationBase.of(context).noSickLeave!, ) : SizedBox(), SizedBox( diff --git a/lib/screens/patients/In_patient/InPatientHeader.dart b/lib/screens/patients/In_patient/InPatientHeader.dart index f2d0f74e..3ee29b28 100644 --- a/lib/screens/patients/In_patient/InPatientHeader.dart +++ b/lib/screens/patients/In_patient/InPatientHeader.dart @@ -10,8 +10,8 @@ import 'package:provider/provider.dart'; class InPatientHeader extends StatelessWidget with PreferredSizeWidget { InPatientHeader( - {this.model, - this.specialClinic, + {required this.model, + required this.specialClinic, this.activeTab, this.selectedMapId, this.onChangeFunc}) diff --git a/lib/screens/patients/In_patient/NoData.dart b/lib/screens/patients/In_patient/NoData.dart index 0c48cd2a..89f7c65e 100644 --- a/lib/screens/patients/In_patient/NoData.dart +++ b/lib/screens/patients/In_patient/NoData.dart @@ -4,7 +4,7 @@ import 'package:flutter/material.dart'; class NoData extends StatelessWidget { const NoData({ - Key key, + Key? key, }) : super(key: key); @override @@ -13,7 +13,7 @@ class NoData extends StatelessWidget { child: SingleChildScrollView( child: Container( child: ErrorMessage( - error: TranslationBase.of(context).noDataAvailable)), + error: TranslationBase.of(context).noDataAvailable!)), ), ); } diff --git a/lib/screens/patients/In_patient/in_patient_list_page.dart b/lib/screens/patients/In_patient/in_patient_list_page.dart index 6e9ad14f..edbdd113 100644 --- a/lib/screens/patients/In_patient/in_patient_list_page.dart +++ b/lib/screens/patients/In_patient/in_patient_list_page.dart @@ -25,12 +25,12 @@ class InPatientListPage extends StatefulWidget { final Function onChangeValue; InPatientListPage( - {this.isMyInPatient, - this.patientSearchViewModel, - this.selectedClinicName, - this.onChangeValue, - this.isAllClinic, - this.showBottomSheet}); + {required this.isMyInPatient, + required this.patientSearchViewModel, + required this.selectedClinicName, + required this.onChangeValue, + required this.isAllClinic, + required this.showBottomSheet}); @override _InPatientListPageState createState() => _InPatientListPageState(); @@ -279,7 +279,7 @@ class _InPatientListPageState extends State { .patientSearchViewModel .InpatientClinicList[index]); widget.patientSearchViewModel - .filterByClinic(clinicName: value); + .filterByClinic(clinicName: value.toString()); }); }, activeColor: Colors.red, diff --git a/lib/screens/patients/In_patient/in_patient_screen.dart b/lib/screens/patients/In_patient/in_patient_screen.dart index b70d5788..940cc9e8 100644 --- a/lib/screens/patients/In_patient/in_patient_screen.dart +++ b/lib/screens/patients/In_patient/in_patient_screen.dart @@ -24,8 +24,8 @@ class InPatientScreen extends StatefulWidget { bool isAllClinic = true; bool showBottomSheet = false; - String selectedClinicName; - InPatientScreen({Key? key, this.specialClinic}); + late String selectedClinicName; + InPatientScreen({Key? key, required this.specialClinic}); @override _InPatientScreenState createState() => _InPatientScreenState(); @@ -33,9 +33,9 @@ class InPatientScreen extends StatefulWidget { class _InPatientScreenState extends State with SingleTickerProviderStateMixin { - TabController _tabController; + late TabController _tabController; int _activeTab = 0; - int selectedMapId; + late int selectedMapId; @override void initState() { @@ -79,7 +79,7 @@ class _InPatientScreenState extends State builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBar: InPatientHeader( + appBar: InPatientHeader( model: model, selectedMapId: selectedMapId, specialClinic: widget.specialClinic, @@ -136,13 +136,13 @@ class _InPatientScreenState extends State unselectedLabelColor: Colors.grey[800], tabs: [ tabWidget(screenSize, _activeTab == 0, - TranslationBase.of(context).inPatientAll, + TranslationBase.of(context).inPatientAll!, counter: model.inPatientList.length), tabWidget(screenSize, _activeTab == 1, - TranslationBase.of(context).myInPatientTitle, + TranslationBase.of(context).myInPatientTitle!, counter: model.myIinPatientList.length), tabWidget(screenSize, _activeTab == 2, - TranslationBase.of(context).discharged), + TranslationBase.of(context).discharged!), ], ), ), diff --git a/lib/screens/patients/In_patient/list_of_all_in_patient.dart b/lib/screens/patients/In_patient/list_of_all_in_patient.dart index 06634819..b29aafa2 100644 --- a/lib/screens/patients/In_patient/list_of_all_in_patient.dart +++ b/lib/screens/patients/In_patient/list_of_all_in_patient.dart @@ -7,10 +7,10 @@ import 'NoData.dart'; class ListOfAllInPatient extends StatelessWidget { const ListOfAllInPatient({ - Key key, - @required this.isAllClinic, - @required this.hasQuery, - this.patientSearchViewModel, + Key? key, + required this.isAllClinic, + required this.hasQuery, + required this.patientSearchViewModel, }) : super(key: key); final bool isAllClinic; @@ -42,7 +42,7 @@ class ListOfAllInPatient extends StatelessWidget { isInpatient: true, isMyPatient: patientSearchViewModel .filteredInPatientItems[index].doctorId == - patientSearchViewModel.doctorProfile.doctorID, + patientSearchViewModel.doctorProfile!.doctorID, onTap: () { FocusScopeNode currentFocus = FocusScope.of(context); if (!currentFocus.hasPrimaryFocus) { @@ -61,7 +61,7 @@ class ListOfAllInPatient extends StatelessWidget { "arrivalType": "1", "isMyPatient": patientSearchViewModel .filteredInPatientItems[index].doctorId == - patientSearchViewModel.doctorProfile.doctorID, + patientSearchViewModel.doctorProfile!.doctorID, }); }, ); @@ -77,7 +77,7 @@ class ListOfAllInPatient extends StatelessWidget { patientSearchViewModel.removeOnFilteredList(); } } - return; + return false; }, ), ), diff --git a/lib/screens/patients/In_patient/list_of_my_inpatient.dart b/lib/screens/patients/In_patient/list_of_my_inpatient.dart index f5f7c070..79b7c0df 100644 --- a/lib/screens/patients/In_patient/list_of_my_inpatient.dart +++ b/lib/screens/patients/In_patient/list_of_my_inpatient.dart @@ -6,10 +6,10 @@ import '../../../routes.dart'; import 'NoData.dart'; class ListOfMyInpatient extends StatelessWidget { const ListOfMyInpatient({ - Key key, - @required this.isAllClinic, - @required this.hasQuery, - this.patientSearchViewModel, + Key? key, + required this.isAllClinic, + required this.hasQuery, + required this.patientSearchViewModel, }) : super(key: key); final bool isAllClinic; @@ -56,9 +56,6 @@ class ListOfMyInpatient extends StatelessWidget { }, ); }), - onNotification: (t) { - return; - }, ), ), ); diff --git a/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart b/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart index 87be05b2..2be71d19 100644 --- a/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart +++ b/lib/screens/patients/profile/UCAF/ucaf_pager_screen.dart @@ -53,7 +53,7 @@ class _UCAFPagerScreenState extends State @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; patientType = routeArgs['patientType']; arrivalType = routeArgs['arrivalType']; diff --git a/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart b/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart index 41b8d0ee..0ec237da 100644 --- a/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart +++ b/lib/screens/patients/profile/admission-orders/admission_orders_screen.dart @@ -23,22 +23,22 @@ class AdmissionOrdersScreen extends StatefulWidget { class _AdmissionOrdersScreenState extends State { bool isDischargedPatient = false; - AuthenticationViewModel authenticationViewModel; + late AuthenticationViewModel authenticationViewModel; - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String arrivalType = routeArgs['arrivalType']; if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; return BaseView( onModelReady: (model) => model.getAdmissionOrders( - admissionNo: 2014005178, patientId: patient.patientMRN), + admissionNo: 2014005178, patientId: patient!.patientMRN!), builder: (_, model, w) => AppScaffold( baseViewModel: model, backgroundColor: Theme.of(context).scaffoldBackgroundColor, @@ -50,7 +50,7 @@ class _AdmissionOrdersScreenState extends State { body: model.admissionOrderList == null || model.admissionOrderList.length == 0 ? DrAppEmbeddedError( - error: TranslationBase.of(context).noDataAvailable) + error: TranslationBase.of(context).noDataAvailable!) : Container( color: Colors.grey[200], child: Column( @@ -257,21 +257,6 @@ class _AdmissionOrdersScreenState extends State { SizedBox( height: 8, ), - // Row( - // mainAxisAlignment: - // MainAxisAlignment.start, - // children: [ - // Expanded( - // child: AppText( - // model - // .admissionOrderList[ - // index] - // .notes, - // fontSize: 10, - // isCopyable: true, - // ), - // ), - // ]) ], ), SizedBox( diff --git a/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart b/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart index 1aea89c2..1802fc24 100644 --- a/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart +++ b/lib/screens/patients/profile/diabetic_chart/diabetic_chart.dart @@ -26,7 +26,7 @@ import 'diabetic_details_blood_pressurewideget.dart'; class DiabeticChart extends StatefulWidget { DiabeticChart({ - Key key, + Key? key, }) : super(key: key); @override @@ -45,11 +45,11 @@ class _DiabeticChartState extends State { DiabeticType(nameAr: "Blood Glucose(Glucometer)", nameEn: "Blood Glucose(Glucometer)", value: 4) ]; - DiabeticType selectedDiabeticType; + late DiabeticType selectedDiabeticType; @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; ProjectViewModel projectsProvider = Provider.of(context); return BaseView( @@ -199,7 +199,7 @@ class _DiabeticChartState extends State { ], ), ) - : ErrorMessage(error: TranslationBase.of(context).noItem), + : ErrorMessage(error: TranslationBase.of(context).noItem!), ], ), )), diff --git a/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart b/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart index c68f848f..af0c9f60 100644 --- a/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart +++ b/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart @@ -13,7 +13,7 @@ class DiabeticDetails extends StatefulWidget { final List diabeticDetailsList; DiabeticDetails( - {Key? key, this.diabeticDetailsList,}); + {Key? key, required this.diabeticDetailsList,}); @override _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); @@ -70,7 +70,7 @@ class _VitalSignDetailsWidgetState extends State { ), Table( border: TableBorder( - horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]), + horizontalInside: BorderSide(width: 1.0, color: Colors.grey[300]!), ), children: fullData(projectViewModel), ), diff --git a/lib/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart b/lib/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart index 1159e970..6f4005f1 100644 --- a/lib/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart +++ b/lib/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart @@ -12,7 +12,7 @@ class LineChartForDiabetic extends StatelessWidget { final bool isOX; LineChartForDiabetic( - {this.title, this.timeSeries1, this.indexes, this.isOX= false}); + {required this.title, required this.timeSeries1, required this.indexes, this.isOX= false}); List xAxixs = []; List yAxixs = []; @@ -93,7 +93,7 @@ class LineChartForDiabetic extends StatelessWidget { titlesData: FlTitlesData( bottomTitles: SideTitles( showTitles: true, - getTextStyles: (value) => const TextStyle( + getTextStyles: (value) => TextStyle( color: Colors.black, fontSize: 10, ), diff --git a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart index caa7421b..4241fc20 100644 --- a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart +++ b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart @@ -39,20 +39,20 @@ class DiagnosisScreen extends StatefulWidget { class _ProgressNoteState extends State { bool isDischargedPatient = false; - AuthenticationViewModel authenticationViewModel; - ProjectViewModel projectViewModel; + late AuthenticationViewModel authenticationViewModel; + late ProjectViewModel projectViewModel; getDiagnosisForInPatient(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); print(type); GetDiagnosisForInPatientRequestModel getDiagnosisForInPatientRequestModel = GetDiagnosisForInPatientRequestModel( - admissionNo: int.parse(patient.admissionNo), - patientTypeID: patient.patientType, + admissionNo: int.parse(patient!.admissionNo!), + patientTypeID: patient!.patientType!, patientID: patient.patientId, setupID: "010266"); model.getDiagnosisForInPatient(getDiagnosisForInPatientRequestModel); } @@ -61,7 +61,7 @@ class _ProgressNoteState extends State { Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; @@ -77,7 +77,7 @@ class _ProgressNoteState extends State { body: model.diagnosisForInPatientList == null || model.diagnosisForInPatientList.length == 0 ? DrAppEmbeddedError( - error: TranslationBase.of(context).noItem) + error: TranslationBase.of(context).noItem!) : Container( color: Colors.grey[200], child: Column( @@ -209,7 +209,7 @@ class _ProgressNoteState extends State { AppText( TranslationBase.of( context) - .icd + " : ", + .icd! + " : ", fontSize: 12, ), Expanded( diff --git a/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart index 73317d8d..c20abe4e 100644 --- a/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart @@ -14,9 +14,8 @@ import 'discharge_Summary_widget.dart'; class AllDischargeSummary extends StatefulWidget { - final Function changeCurrentTab; - const AllDischargeSummary({Key? key, this.changeCurrentTab}) : super(key: key); + const AllDischargeSummary({Key? key}) : super(key: key); @override _AllDischargeSummaryState createState() => _AllDischargeSummaryState(); @@ -35,7 +34,7 @@ class _AllDischargeSummaryState extends State { baseViewModel: model, isShowAppBar: false, body: model.pendingDischargeSummaryList.isEmpty - ?ErrorMessage(error: TranslationBase.of(context).noItem)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem) + ?ErrorMessage(error: TranslationBase.of(context).noItem!)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem!) : Column( children: [ Expanded( diff --git a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart index 3bcd673a..ad9ced55 100644 --- a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart @@ -57,7 +57,7 @@ class _DoctorReplyScreenState extends State @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; return WillPopScope( diff --git a/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart index 317eeb4d..ae746a93 100644 --- a/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart @@ -44,7 +44,7 @@ class _PendingDischargeSummaryState extends State { body: model.pendingDischargeSummaryList.isEmpty ? ErrorMessage( error: TranslationBase.of(context) - .noItem) // DrAppEmbeddedError(error: TranslationBase.of(context).noItem) + .noItem) // DrAppEmbeddedError(error: TranslationBase.of(context).noItem!) : Column( children: [ Expanded( diff --git a/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart b/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart index 4393b26f..f18d89c8 100644 --- a/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart +++ b/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart @@ -31,7 +31,7 @@ class _AllLabSpecialResultState extends State { @override void didChangeDependencies() { super.didChangeDependencies(); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; patient = routeArgs['patient']; patientType = routeArgs['patientType']; arrivalType = routeArgs['arrivalType']; diff --git a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart index 50d76dfb..09d5381f 100644 --- a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart +++ b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart @@ -45,7 +45,7 @@ class _ProgressNoteState extends State { getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); @@ -62,7 +62,7 @@ class _ProgressNoteState extends State { Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; diff --git a/lib/screens/patients/profile/operation_report/operation_report.dart b/lib/screens/patients/profile/operation_report/operation_report.dart index bc5ca8d7..4bea5b1d 100644 --- a/lib/screens/patients/profile/operation_report/operation_report.dart +++ b/lib/screens/patients/profile/operation_report/operation_report.dart @@ -50,7 +50,7 @@ class _ProgressNoteState extends State { Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; diff --git a/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart b/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart index c820fded..6ea8067a 100644 --- a/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart +++ b/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart @@ -13,7 +13,7 @@ class PendingOrdersScreen extends StatelessWidget { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; patient = routeArgs['patient']; String patientType = routeArgs['patientType']; diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/patient-profile-app-bar.dart index 64337c68..05372d81 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -13,7 +14,8 @@ import 'package:url_launcher/url_launcher.dart'; import 'large_avatar.dart'; class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { - final PatientProfileAppBarModel patientProfileAppBarModel; + final PatiantInformtion? patient; + final PatientProfileAppBarModel? patientProfileAppBarModel; final double? height; final bool isInpatient; final bool isDischargedPatient; @@ -34,17 +36,42 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { final bool? isFromLabResult; final VoidCallback? onPressed; - PatientProfileAppBar({required this.patientProfileAppBarModel, this.isFromLabResult = false, this.onPressed, this.height, this.isInpatient = false, this.isDischargedPatient = false, this.isFromLiveCare= false, this.doctorName, this.branch, this.appointmentDate, this.profileUrl, this.invoiceNO, this.orderNo, this.isPrescriptions, this.isMedicalFile, this.episode, this.visitDate, this.clinic, this.isAppointmentHeader}); + PatientProfileAppBar(this.patient, + { this.patientProfileAppBarModel, + this.isFromLabResult = false, + this.onPressed, + this.height, + this.isInpatient = false, + this.isDischargedPatient = false, + this.isFromLiveCare = false, + this.doctorName, + this.branch, + this.appointmentDate, + this.profileUrl, + this.invoiceNO, + this.orderNo, + this.isPrescriptions, + this.isMedicalFile, + this.episode, + this.visitDate, + this.clinic, + this.isAppointmentHeader}); + late PatiantInformtion localPatient; @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); + if (patient == null) { + localPatient = patientProfileAppBarModel!.patient!; + } else { + localPatient = patient!; + } int gender = 1; - if (patientProfileAppBarModel.patient!.patientDetails != null) { - gender = patientProfileAppBarModel.patient!.patientDetails!.gender!; + if (localPatient!.patientDetails != null) { + gender = localPatient!.patientDetails!.gender!; } else { - gender = patientProfileAppBarModel.patient!.gender!; + gender = localPatient!.gender!; } return Container( @@ -75,12 +102,12 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { ), Expanded( child: AppText( - patientProfileAppBarModel.patient!.firstName != null - ? (Helpers.capitalize(patientProfileAppBarModel.patient!.firstName) + + localPatient!.firstName != null + ? (Helpers.capitalize(localPatient!.firstName) + " " + - Helpers.capitalize(patientProfileAppBarModel.patient!.lastName)) - : Helpers.capitalize(patientProfileAppBarModel.patient!.fullName ?? - patientProfileAppBarModel.patient!.patientDetails!.fullName!), + Helpers.capitalize(localPatient!.lastName)) + : Helpers.capitalize(localPatient!.fullName ?? + localPatient!.patientDetails!.fullName!), fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -101,7 +128,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { margin: EdgeInsets.symmetric(horizontal: 4), child: InkWell( onTap: () { - launch("tel://" + patientProfileAppBarModel.patient!.mobileNumber!); + launch("tel://" + localPatient!.mobileNumber!); }, child: Icon( Icons.phone, @@ -109,24 +136,30 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { ), ), ), - if(patientProfileAppBarModel.videoCallDurationStream != null) - StreamBuilder( - stream: patientProfileAppBarModel.videoCallDurationStream, - builder: (BuildContext context, AsyncSnapshot snapshot) { - if(snapshot.hasData && snapshot.data != null) - return InkWell( - onTap: (){ - }, - child: Container( - decoration: BoxDecoration(color: Colors.red, borderRadius: BorderRadius.circular(20)), - padding: EdgeInsets.symmetric(vertical: 2, horizontal: 10), - child: Text(snapshot.data!, style: TextStyle(color: Colors.white),), - ), - ); - else - return Container(); - }, - ), + if (patientProfileAppBarModel!.videoCallDurationStream != null) + StreamBuilder( + stream: patientProfileAppBarModel!.videoCallDurationStream, + builder: + (BuildContext context, AsyncSnapshot snapshot) { + if (snapshot.hasData && snapshot.data != null) + return InkWell( + onTap: () {}, + child: Container( + decoration: BoxDecoration( + color: Colors.red, + borderRadius: BorderRadius.circular(20)), + padding: EdgeInsets.symmetric( + vertical: 2, horizontal: 10), + child: Text( + snapshot.data!, + style: TextStyle(color: Colors.white), + ), + ), + ); + else + return Container(); + }, + ), ]), ), Row(children: [ @@ -137,7 +170,9 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { width: SizeConfig.getTextMultiplierBasedOnWidth() * 20, height: SizeConfig.getTextMultiplierBasedOnWidth() * 20, child: Image.asset( - gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', + gender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', fit: BoxFit.cover, ), ), @@ -149,12 +184,12 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - patientProfileAppBarModel.patient!.patientStatusType != null + localPatient!.patientStatusType != null ? Container( child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - patientProfileAppBarModel.patient!.patientStatusType == 43 + localPatient!.patientStatusType == 43 ? AppText( TranslationBase.of(context).arrivedP, color: Colors.green, @@ -173,8 +208,11 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { .getTextMultiplierBasedOnWidth() * 3.5, ), - patientProfileAppBarModel.patient!.startTime != null - ? AppText(patientProfileAppBarModel.patient!.startTime != null ? patientProfileAppBarModel.patient!.startTime : '', + localPatient!.startTime != null + ? AppText( + localPatient!.startTime != null + ? localPatient!.startTime + : '', fontWeight: FontWeight.w700, fontSize: SizeConfig .getTextMultiplierBasedOnWidth() * @@ -202,7 +240,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { width: 1, ), AppText( - patientProfileAppBarModel.patient!.patientId.toString(), + localPatient!.patientId.toString(), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, @@ -215,23 +253,25 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { Row( children: [ AppText( - patientProfileAppBarModel.patient!.nationalityName ?? - patientProfileAppBarModel.patient!.nationality ?? - patientProfileAppBarModel.patient!.nationalityId ?? + localPatient!.nationalityName ?? + localPatient!.nationality ?? + localPatient!.nationalityId ?? '', fontWeight: FontWeight.bold, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, ), - patientProfileAppBarModel.patient!.nationalityFlagURL != null + localPatient!.nationalityFlagURL != null ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - patientProfileAppBarModel.patient!.nationalityFlagURL!, + localPatient!.nationalityFlagURL!, height: 25, width: 30, - errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { + errorBuilder: (BuildContext context, + Object exception, + StackTrace? stackTrace) { return Text('No Image'); }, )) @@ -244,47 +284,46 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { HeaderRow( label: TranslationBase.of(context).age! + " : ", value: - "${AppDateUtils.getAgeByBirthday(patientProfileAppBarModel.patient!.patientDetails != null ? patientProfileAppBarModel.patient!.patientDetails!.dateofBirth ?? "" : patientProfileAppBarModel.patient!.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", - ),if (patientProfileAppBarModel.patient!.appointmentDate != null && - patientProfileAppBarModel.patient!.appointmentDate!.isNotEmpty && + "${AppDateUtils.getAgeByBirthday(localPatient!.patientDetails != null ? localPatient!.patientDetails!.dateofBirth ?? "" : localPatient!.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", + ), + if (localPatient!.appointmentDate != null && + localPatient!.appointmentDate!.isNotEmpty && !isFromLabResult!) HeaderRow( - label: - TranslationBase.of(context).appointmentDate! + " : ", - value: - AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils.convertStringToDate(patientProfileAppBarModel.patient!.appointmentDate!)), + label: TranslationBase.of(context).appointmentDate! + + " : ", + value: AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils.convertStringToDate( + localPatient!.appointmentDate!)), ), - if (patientProfileAppBarModel.isFromLabResult!) - - HeaderRow( - label: "Result Date: ", - value: - '${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel.appointmentDate!, isArabic: projectViewModel.isArabic)}', - + if (patientProfileAppBarModel!.isFromLabResult!) + HeaderRow( + label: "Result Date: ", + value: + '${AppDateUtils.getDayMonthYearDateFormatted(patientProfileAppBarModel!.appointmentDate!, isArabic: projectViewModel.isArabic)}', ), // if(isInpatient) Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (patientProfileAppBarModel.patient!.admissionDate != null && - patientProfileAppBarModel.patient!.admissionDate!.isNotEmpty) + if (localPatient!.admissionDate != null && + localPatient!.admissionDate!.isNotEmpty) HeaderRow( - label: patientProfileAppBarModel.patient!.admissionDate == null + label: localPatient!.admissionDate == null ? "" : TranslationBase.of(context).admissionDate! + " : ", - value: patientProfileAppBarModel.patient!.admissionDate == null + value: localPatient!.admissionDate == null ? "" - : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.admissionDate.toString())))}", + : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(localPatient!.admissionDate.toString())))}", ), - if (patientProfileAppBarModel.patient!.admissionDate != null) + if (localPatient!.admissionDate != null) HeaderRow( label: "${TranslationBase.of(context).numOfDays}: ", value: isDischargedPatient && - patientProfileAppBarModel.patient!.dischargeDate != null - ? "${AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.admissionDate!)).inDays + 1}" - : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientProfileAppBarModel.patient!.admissionDate!)).inDays + 1}", + localPatient!.dischargeDate != null + ? "${AppDateUtils.getDateTimeFromServerFormat(localPatient!.dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(localPatient!.admissionDate!)).inDays + 1}" + : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(localPatient!.admissionDate!)).inDays + 1}", ) ], ), @@ -292,7 +331,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { ), ), ]), - if (patientProfileAppBarModel.isAppointmentHeader!) + if (patientProfileAppBarModel!.isAppointmentHeader!) Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -300,12 +339,16 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { width: 30, height: 30, margin: EdgeInsets.only( - left: projectViewModel.isArabic ? 10 : 85, right: projectViewModel.isArabic ? 85 : 10, top: 5), + left: projectViewModel.isArabic ? 10 : 85, + right: projectViewModel.isArabic ? 85 : 10, + top: 5), decoration: BoxDecoration( shape: BoxShape.rectangle, border: Border( - bottom: BorderSide(color: Colors.grey[400]!, width: 2.5), - left: BorderSide(color: Colors.grey[400]!, width: 2.5), + bottom: + BorderSide(color: Colors.grey[400]!, width: 2.5), + left: + BorderSide(color: Colors.grey[400]!, width: 2.5), )), ), Expanded( @@ -316,8 +359,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { children: [ Container( child: LargeAvatar( - name: patientProfileAppBarModel.doctorName ?? "", - url: patientProfileAppBarModel.profileUrl, + name: patientProfileAppBarModel!.doctorName ?? "", + url: patientProfileAppBarModel!.profileUrl, ), width: 25, height: 25, @@ -346,7 +389,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { ), if (invoiceNO != null && !isPrescriptions!) HeaderRow( - label: 'Invoice: ', + label: 'Invoice: ', value: invoiceNO ?? "", ), if (branch != null) @@ -376,8 +419,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { : 'Prescriptions Date ', value: '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate!, isArabic: projectViewModel.isArabic)}', - ), - ]), + ), + ]), ), ), ], @@ -395,21 +438,21 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { @override Size get preferredSize => Size( double.maxFinite, - patientProfileAppBarModel.height == 0 - ? patientProfileAppBarModel.isAppointmentHeader! + patientProfileAppBarModel!.height == 0 + ? patientProfileAppBarModel!.isAppointmentHeader! ? 270 - : ((patientProfileAppBarModel.patient!.appointmentDate!.isNotEmpty) - ? patientProfileAppBarModel.isFromLabResult! + : ((localPatient!.appointmentDate!.isNotEmpty) + ? patientProfileAppBarModel!.isFromLabResult! ? 190 : 170 - : patientProfileAppBarModel.patient!.admissionDate != null - ? patientProfileAppBarModel.isFromLabResult! + : localPatient!.admissionDate != null + ? patientProfileAppBarModel!.isFromLabResult! ? 190 : 170 - : patientProfileAppBarModel.isDischargedPatient! + : patientProfileAppBarModel!.isDischargedPatient! ? 240 : 130) - : patientProfileAppBarModel.height!); + : patientProfileAppBarModel!.height!); } class HeaderRow extends StatelessWidget { diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index a8c59032..5511f949 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -56,7 +56,7 @@ class AppScaffold extends StatelessWidget { extendBody: extendBody, bottomNavigationBar: bottomNavigationBar, appBar: isShowAppBar - ? patientProfileAppBarModel != null ? PatientProfileAppBar( + ? patientProfileAppBarModel != null ? PatientProfileAppBar(patientProfileAppBarModel!.patient!, patientProfileAppBarModel: patientProfileAppBarModel!,) : appBar ?? AppBar( elevation: 0, From d808f8b2ac3ed02dbddd5e7d69b133b43dbd955b Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Mon, 22 Nov 2021 11:26:11 +0200 Subject: [PATCH 8/8] 4 step from fix screen --- .../PatientMedicalReportViewModel.dart | 4 +- lib/screens/live_care/end_call_screen.dart | 19 +-- .../all_discharge_summary.dart | 7 +- .../discharge_Summary_widget.dart | 12 +- .../discharge_summary/discharge_summary.dart | 10 +- .../pending_discharge_summary.dart | 7 +- .../profile/lab_result/FlowChartPage.dart | 2 +- .../lab_result/LabResultHistoryPage.dart | 2 +- .../profile/lab_result/LabResultWidget.dart | 2 +- .../Lab_Result_history_details_wideget.dart | 4 +- .../lab_result/LineChartCurvedLabHistory.dart | 4 +- .../all_lab_special_result_page.dart | 22 +-- .../lab_result_history_chart_and_detials.dart | 6 +- .../lab_result/laboratory_result_widget.dart | 2 +- .../special_lab_result_details_page.dart | 2 +- .../AddVerifyMedicalReport.dart | 28 ++-- .../notes/note/progress_note_screen.dart | 12 +- .../nursing_note/nursing_note_screen.dart | 12 +- .../operation_report/operation_report.dart | 12 +- .../update_operation_report.dart | 22 +-- .../pending_orders/pending_orders_screen.dart | 128 +++++++++--------- .../register_patient/CustomEditableText.dart | 2 +- .../register_patient/VerifyMethodPage.dart | 6 +- .../base_add_procedure_tab_page.dart | 2 +- 24 files changed, 163 insertions(+), 166 deletions(-) diff --git a/lib/core/viewModel/PatientMedicalReportViewModel.dart b/lib/core/viewModel/PatientMedicalReportViewModel.dart index 59485e92..996766ec 100644 --- a/lib/core/viewModel/PatientMedicalReportViewModel.dart +++ b/lib/core/viewModel/PatientMedicalReportViewModel.dart @@ -68,9 +68,9 @@ class PatientMedicalReportViewModel extends BaseViewModel { } } - Future updateMedicalReport(PatiantInformtion patient, String htmlText, int limitNumber, String invoiceNumber) async { + Future updateMedicalReport(PatiantInformtion patient, String htmlText, int? limitNumber, String? invoiceNumber) async { setState(ViewState.Busy); - await _service.updateMedicalReport(patient, htmlText, limitNumber, invoiceNumber); + await _service.updateMedicalReport(patient, htmlText, limitNumber!, invoiceNumber!); if (_service.hasError) { error = _service.error!; await getMedicalReportList(patient); diff --git a/lib/screens/live_care/end_call_screen.dart b/lib/screens/live_care/end_call_screen.dart index 886061c8..a9ab2d9f 100644 --- a/lib/screens/live_care/end_call_screen.dart +++ b/lib/screens/live_care/end_call_screen.dart @@ -189,19 +189,20 @@ class _EndCallScreenState extends State { .of(context) .scaffoldBackgroundColor, isShowAppBar: true, - appBar: PatientProfileAppBar(patientProfileAppBarModel :PatientProfileAppBarModel(patient: patient!,isInpatient: isInpatient, - isDischargedPatient: isDischargedPatient, - height: (patient!.patientStatusType != null && patient!.patientStatusType == 43) - ? 210 - : isDischargedPatient - ? 240 - : 0, - ), + appBar: PatientProfileAppBar( + patient, onPressed: (){ Navigator.pop(context); }, - ), + isInpatient: isInpatient, + height: (patient!.patientStatusType != null && + patient!.patientStatusType == 43) + ? 210 + : isDischargedPatient + ? 240 + : 0, + isDischargedPatient: isDischargedPatient), body: Container( height: !isSearchAndOut ? isDischargedPatient diff --git a/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart index f29315ae..50e1cd4d 100644 --- a/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/all_discharge_summary.dart @@ -10,10 +10,9 @@ import 'package:flutter/material.dart'; import 'discharge_Summary_widget.dart'; class AllDischargeSummary extends StatefulWidget { - final Function changeCurrentTab; final PatiantInformtion patient; - const AllDischargeSummary({this.changeCurrentTab, this.patient}); + const AllDischargeSummary({ required this.patient}); @override _AllDischargeSummaryState createState() => _AllDischargeSummaryState(); @@ -27,7 +26,7 @@ class _AllDischargeSummaryState extends State { onModelReady: (model) { model.getAllDischargeSummary( patientId: widget.patient.patientId, - admissionNo: int.parse(widget.patient.admissionNo), + admissionNo: int.parse(widget.patient.admissionNo!), ); }, builder: (_, model, w) => AppScaffold( @@ -36,7 +35,7 @@ class _AllDischargeSummaryState extends State { body: // DrAppEmbeddedError(error: TranslationBase.of(context).noItem) model.allDisChargeSummaryList.isEmpty ? ErrorMessage( - error: TranslationBase.of(context).noDataAvailable) + error: TranslationBase.of(context).noDataAvailable!) : Column( children: [ Padding( diff --git a/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart b/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart index 9af1493c..33572f93 100644 --- a/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart +++ b/lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart @@ -17,7 +17,7 @@ class DischargeSummaryWidget extends StatefulWidget { final GetDischargeSummaryResModel dischargeSummary; bool isShowMore = false; - DischargeSummaryWidget({Key? key, this.dischargeSummary}); + DischargeSummaryWidget({Key? key, required this.dischargeSummary}); @override _DischargeSummaryWidgetState createState() => _DischargeSummaryWidgetState(); @@ -40,7 +40,7 @@ class _DischargeSummaryWidgetState extends State { borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all(color: Colors.grey[200], width: 0.5), + border: Border.all(color: Colors.grey[200]!, width: 0.5), ), child: Padding( padding: EdgeInsets.all(15.0), @@ -52,26 +52,26 @@ class _DischargeSummaryWidgetState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ CustomRow( - label: TranslationBase.of(context).doctorName + ": ", + label: TranslationBase.of(context).doctorName! + ": ", value: widget.dischargeSummary.createdByName.toString() ?? "".toString(), isCopyable: false, ), CustomRow( - label: TranslationBase.of(context).branch + ": ", + label: TranslationBase.of(context).branch! + ": ", value: widget.dischargeSummary.projectName.toString() ?? "".toString(), isCopyable: false, ), CustomRow( - label: TranslationBase.of(context).clinicName + ": ", + label: TranslationBase.of(context).clinicName! + ": ", value: widget.dischargeSummary.clinicName.toString() ?? "".toString(), isCopyable: false, ), CustomRow( - label: TranslationBase.of(context).dischargeDate + ": ", + label: TranslationBase.of(context).dischargeDate! + ": ", value: AppDateUtils.getDateTimeFromServerFormat( widget.dischargeSummary.createdOn) .day diff --git a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart index ae321872..b5ab77a7 100644 --- a/lib/screens/patients/profile/discharge_summary/discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/discharge_summary.dart @@ -12,9 +12,8 @@ import 'all_discharge_summary.dart'; import 'pending_discharge_summary.dart'; class DischargeSummaryPage extends StatefulWidget { - final Function changeCurrentTab; - const DischargeSummaryPage({Key? key, this.changeCurrentTab}) + const DischargeSummaryPage({Key? key, }) : super(key: key); @override @@ -23,7 +22,7 @@ class DischargeSummaryPage extends StatefulWidget { class _DoctorReplyScreenState extends State with SingleTickerProviderStateMixin { - TabController _tabController; + late TabController _tabController; int _activeTab = 0; int pageIndex = 1; @@ -54,11 +53,10 @@ class _DoctorReplyScreenState extends State return WillPopScope( onWillPop: () async { - widget.changeCurrentTab(); return false; }, child: AppScaffold( - appBarTitle: TranslationBase.of(context).replay2, + appBarTitle: TranslationBase.of(context).replay2!, isShowAppBar: true, // appBarTitle: TranslationBase.of(context).progressNote, appBar: PatientProfileAppBar( @@ -103,7 +101,7 @@ class _DoctorReplyScreenState extends State tabWidget( screenSize, _activeTab == 1, - TranslationBase.of(context).all, + TranslationBase.of(context).all!, ), ], ), diff --git a/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart index d25f41a1..a99ce464 100644 --- a/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart +++ b/lib/screens/patients/profile/discharge_summary/pending_discharge_summary.dart @@ -9,10 +9,9 @@ import 'package:flutter/material.dart'; import 'discharge_Summary_widget.dart'; class PendingDischargeSummary extends StatefulWidget { - final Function changeCurrentTab; final PatiantInformtion patient; - const PendingDischargeSummary({Key? key, this.changeCurrentTab, this.patient}) + const PendingDischargeSummary({Key? key, required this.patient}) : super(key: key); @override @@ -29,7 +28,7 @@ class _PendingDischargeSummaryState extends State { onModelReady: (model) { model.getPendingDischargeSummary( patientId: widget.patient.patientId, - admissionNo: int.parse(widget.patient.admissionNo), + admissionNo: int.parse(widget.patient.admissionNo!), ); }, builder: (_, model, w) => AppScaffold( @@ -38,7 +37,7 @@ class _PendingDischargeSummaryState extends State { body: model.pendingDischargeSummaryList.isEmpty ? ErrorMessage( error: TranslationBase.of(context) - .noDataAvailable) // DrAppEmbeddedError(error: TranslationBase.of(context).noItem!) + .noDataAvailable!) // DrAppEmbeddedError(error: TranslationBase.of(context).noItem!) : Column( children: [ Padding( diff --git a/lib/screens/patients/profile/lab_result/FlowChartPage.dart b/lib/screens/patients/profile/lab_result/FlowChartPage.dart index 3bf6929b..f0ee0404 100644 --- a/lib/screens/patients/profile/lab_result/FlowChartPage.dart +++ b/lib/screens/patients/profile/lab_result/FlowChartPage.dart @@ -20,7 +20,7 @@ class FlowChartPage extends StatelessWidget { final bool isInpatient; FlowChartPage( - {this.patientLabOrder, this.filterName, this.patient, this.isInpatient}); + {required this.patientLabOrder, required this.filterName, required this.patient, required this.isInpatient}); @override Widget build(BuildContext context) { diff --git a/lib/screens/patients/profile/lab_result/LabResultHistoryPage.dart b/lib/screens/patients/profile/lab_result/LabResultHistoryPage.dart index 118bc476..4a23710f 100644 --- a/lib/screens/patients/profile/lab_result/LabResultHistoryPage.dart +++ b/lib/screens/patients/profile/lab_result/LabResultHistoryPage.dart @@ -14,7 +14,7 @@ class LabResultHistoryPage extends StatelessWidget { final String filterName; final PatiantInformtion patient; - LabResultHistoryPage({this.patientLabOrder, this.filterName, this.patient}); + LabResultHistoryPage({required this.patientLabOrder, required this.filterName, required this.patient}); // TODO mosa UI changes @override Widget build(BuildContext context) { diff --git a/lib/screens/patients/profile/lab_result/LabResultWidget.dart b/lib/screens/patients/profile/lab_result/LabResultWidget.dart index 67e50e53..df0eef1f 100644 --- a/lib/screens/patients/profile/lab_result/LabResultWidget.dart +++ b/lib/screens/patients/profile/lab_result/LabResultWidget.dart @@ -220,7 +220,7 @@ class LabResultWidget extends StatelessWidget { FadePage( page: FlowChartPage( filterName: - patientLabResultList[index].description, + patientLabResultList[index].description!, patientLabOrder: patientLabOrder, patient: patient, isInpatient: isInpatient, diff --git a/lib/screens/patients/profile/lab_result/Lab_Result_history_details_wideget.dart b/lib/screens/patients/profile/lab_result/Lab_Result_history_details_wideget.dart index 490d0ec4..aa28c4ed 100644 --- a/lib/screens/patients/profile/lab_result/Lab_Result_history_details_wideget.dart +++ b/lib/screens/patients/profile/lab_result/Lab_Result_history_details_wideget.dart @@ -12,7 +12,7 @@ class LabResultHistoryDetailsWidget extends StatefulWidget { final List labResultHistory; LabResultHistoryDetailsWidget({ - this.labResultHistory, + required this.labResultHistory, }); @override @@ -72,7 +72,7 @@ class _VitalSignDetailsWidgetState extends State ), Table( border: TableBorder.symmetric( - inside: BorderSide(width: 1.0, color: Colors.grey[300]), + inside: BorderSide(width: 1.0, color: Colors.grey[300]!), ), children: fullData(projectViewModel), ), diff --git a/lib/screens/patients/profile/lab_result/LineChartCurvedLabHistory.dart b/lib/screens/patients/profile/lab_result/LineChartCurvedLabHistory.dart index e0d0323b..606c75a2 100644 --- a/lib/screens/patients/profile/lab_result/LineChartCurvedLabHistory.dart +++ b/lib/screens/patients/profile/lab_result/LineChartCurvedLabHistory.dart @@ -9,14 +9,14 @@ class LineChartCurvedLabHistory extends StatefulWidget { final String title; final List labResultHistory; - LineChartCurvedLabHistory({this.title, this.labResultHistory}); + LineChartCurvedLabHistory({required this.title, required this.labResultHistory}); @override State createState() => LineChartCurvedLabHistoryState(); } class LineChartCurvedLabHistoryState extends State { - bool isShowingMainData; + late bool isShowingMainData; List xAxixs = []; int indexes = 0; diff --git a/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart b/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart index f18d89c8..c24d0677 100644 --- a/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart +++ b/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart @@ -21,12 +21,12 @@ class AllLabSpecialResult extends StatefulWidget { } class _AllLabSpecialResultState extends State { - String patientType; + late String patientType; - String arrivalType; - PatiantInformtion patient; - bool isInpatient; - bool isFromLiveCare; + late String arrivalType; + late PatiantInformtion patient; + late bool isInpatient; + late bool isFromLiveCare; @override void didChangeDependencies() { @@ -46,7 +46,7 @@ class _AllLabSpecialResultState extends State { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => - model.getAllSpecialLabResult(patientId: patient.patientMRN), + model.getAllSpecialLabResult(patientId: patient!.patientMRN!), builder: (context, LabsViewModel model, widget) => AppScaffold( baseViewModel: model, backgroundColor: Colors.grey[100], @@ -71,9 +71,9 @@ class _AllLabSpecialResultState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).special + + TranslationBase.of(context).special! + " " + - TranslationBase.of(context).lab, + TranslationBase.of(context).lab!, style: "caption2", color: Colors.black, fontSize: 13, @@ -137,15 +137,15 @@ class _AllLabSpecialResultState extends State { model.allSpecialLabList[index] .isLiveCareAppointment ? TranslationBase.of(context) - .liveCare + .liveCare! .toUpperCase() : !model.allSpecialLabList[index] .isInOutPatient ? TranslationBase.of(context) - .inPatientLabel + .inPatientLabel! .toUpperCase() : TranslationBase.of(context) - .outpatient + .outpatient! .toUpperCase(), style: TextStyle(color: Colors.white), ), diff --git a/lib/screens/patients/profile/lab_result/lab_result_history_chart_and_detials.dart b/lib/screens/patients/profile/lab_result/lab_result_history_chart_and_detials.dart index 322eb817..fdf95b2c 100644 --- a/lib/screens/patients/profile/lab_result/lab_result_history_chart_and_detials.dart +++ b/lib/screens/patients/profile/lab_result/lab_result_history_chart_and_detials.dart @@ -9,9 +9,9 @@ import 'LineChartCurvedLabHistory.dart'; class LabResultHistoryChartAndDetails extends StatelessWidget { LabResultHistoryChartAndDetails({ - Key key, - @required this.labResultHistory, - @required this.name, + Key? key, + required this.labResultHistory, + required this.name, }) : super(key: key); final List labResultHistory; diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart index 54d894b6..e84552ba 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart @@ -151,7 +151,7 @@ class _LaboratoryResultWidgetState extends State { else if (widget.details == null) Container( child: ErrorMessage( - error: TranslationBase.of(context).noDataAvailable, + error: TranslationBase.of(context).noDataAvailable!, ), ), SizedBox( diff --git a/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart b/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart index 9a20209a..e338635a 100644 --- a/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart +++ b/lib/screens/patients/profile/lab_result/special_lab_result_details_page.dart @@ -13,7 +13,7 @@ class SpecialLabResultDetailsPage extends StatelessWidget { final String resultData; final PatiantInformtion patient; - const SpecialLabResultDetailsPage({Key? key, this.resultData, this.patient}) : super(key: key); + const SpecialLabResultDetailsPage({Key? key, required this.resultData, required this.patient}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart index 3f35fd80..66c63024 100644 --- a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart +++ b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart @@ -15,20 +15,20 @@ import 'package:permission_handler/permission_handler.dart'; class AddVerifyMedicalReport extends StatefulWidget { final PatiantInformtion patient; - final String patientType; - final String arrivalType; - final MedicalReportModel medicalReport; + final String?patientType; + final String? arrivalType; + final MedicalReportModel? medicalReport; final PatientMedicalReportViewModel model; - final MedicalReportStatus status; - final String medicalNote; + final MedicalReportStatus? status; + final String? medicalNote; const AddVerifyMedicalReport( {Key? key, - this.patient, + required this.patient, this.patientType, this.arrivalType, this.medicalReport, - this.model, + required this.model, this.status, this.medicalNote}) : super(key: key); @@ -71,11 +71,11 @@ class _AddVerifyMedicalReportState extends State { HtmlRichEditor( initialText: (widget.medicalReport != null ? widget.medicalNote - : widget.model.medicalReportTemplate[0].templateText.length > 0 + : widget.model.medicalReportTemplate[0].templateText!.length > 0 ? widget.model.medicalReportTemplate[0].templateText : ""), hint: "Write the medical report ", - height: MediaQuery.of(context).size.height * 0.75, + height: MediaQuery.of(context).size.height * 0.75, controller: _controller, ), ], ), @@ -101,7 +101,7 @@ class _AddVerifyMedicalReportState extends State { // disabled: progressNoteController.text.isEmpty, fontWeight: FontWeight.w700, onPressed: () async { - txtOfMedicalReport = await HtmlEditor.getText(); + txtOfMedicalReport = await _controller.getText(); if (txtOfMedicalReport.isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); @@ -109,8 +109,8 @@ class _AddVerifyMedicalReportState extends State { ?await widget.model.updateMedicalReport( widget.patient, txtOfMedicalReport, - widget.medicalReport != null ? widget.medicalReport.lineItemNo : null, - widget.medicalReport != null ? widget.medicalReport.invoiceNo : null) + widget.medicalReport != null ? widget.medicalReport!.lineItemNo : null, + widget.medicalReport != null ? widget.medicalReport!.invoiceNo : null) : await widget.model.addMedicalReport(widget.patient, txtOfMedicalReport); //model.getMedicalReportList(patient); @@ -138,10 +138,10 @@ class _AddVerifyMedicalReportState extends State { color: Color(0xff359846), fontWeight: FontWeight.w700, onPressed: () async { - txtOfMedicalReport = await HtmlEditor.getText(); + txtOfMedicalReport = await _controller.getText(); if (txtOfMedicalReport.isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); - await widget.model.verifyMedicalReport(widget.patient, widget.medicalReport); + await widget.model.verifyMedicalReport(widget.patient, widget.medicalReport!); GifLoaderDialogUtils.hideDialog(context); Navigator.pop(context); if (widget.model.state == ViewState.ErrorLocal) { diff --git a/lib/screens/patients/profile/notes/note/progress_note_screen.dart b/lib/screens/patients/profile/notes/note/progress_note_screen.dart index 9fae26f4..f17688f5 100644 --- a/lib/screens/patients/profile/notes/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/notes/note/progress_note_screen.dart @@ -87,7 +87,7 @@ class _ProgressNoteState extends State { body: model.patientProgressNoteList == null || model.patientProgressNoteList.length == 0 ? DrAppEmbeddedError( - error: TranslationBase.of(context).errorNoProgressNote) + error: TranslationBase.of(context).errorNoProgressNote!) : Container( color: Colors.grey[200], child: Column( @@ -113,8 +113,8 @@ class _ProgressNoteState extends State { ); }, label: widget.visitType == 3 - ? TranslationBase.of(context).addNewOrderSheet - : TranslationBase.of(context).addProgressNote, + ? TranslationBase.of(context).addNewOrderSheet! + : TranslationBase.of(context).addProgressNote!, ), Expanded( child: Container( @@ -129,7 +129,7 @@ class _ProgressNoteState extends State { .status == 1 && authenticationViewModel - .doctorProfile.doctorID != + .doctorProfile!.doctorID != model .patientProgressNoteList[ index] @@ -156,7 +156,7 @@ class _ProgressNoteState extends State { .status == 1 && authenticationViewModel - .doctorProfile.doctorID != + .doctorProfile!.doctorID != model .patientProgressNoteList[ index] @@ -201,7 +201,7 @@ class _ProgressNoteState extends State { .status != 4 && authenticationViewModel - .doctorProfile.doctorID == + .doctorProfile!.doctorID == model .patientProgressNoteList[ index] diff --git a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart index 09d5381f..6b608073 100644 --- a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart +++ b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart @@ -37,11 +37,11 @@ class NursingProgressNoteScreen extends StatefulWidget { } class _ProgressNoteState extends State { - List notesList; + late List notesList; var filteredNotesList; bool isDischargedPatient = false; - AuthenticationViewModel authenticationViewModel; - ProjectViewModel projectViewModel; + late AuthenticationViewModel authenticationViewModel; + late ProjectViewModel projectViewModel; getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async { @@ -52,8 +52,8 @@ class _ProgressNoteState extends State { print(type); GetNursingProgressNoteRequestModel getNursingProgressNoteRequestModel = GetNursingProgressNoteRequestModel( - admissionNo: int.parse(patient.admissionNo), - patientTypeID: patient.patientType, + admissionNo: int.parse(patient!.admissionNo!), + patientTypeID: patient!.patientType!, patientID: patient.patientId, setupID: "010266"); model.getNursingProgressNote(getNursingProgressNoteRequestModel); } @@ -79,7 +79,7 @@ class _ProgressNoteState extends State { body: model.patientNursingProgressNoteList == null || model.patientNursingProgressNoteList.length == 0 ? DrAppEmbeddedError( - error: TranslationBase.of(context).errorNoProgressNote) + error: TranslationBase.of(context).errorNoProgressNote!) : Container( color: Colors.grey[200], child: Column( diff --git a/lib/screens/patients/profile/operation_report/operation_report.dart b/lib/screens/patients/profile/operation_report/operation_report.dart index 4bea5b1d..376f8dbb 100644 --- a/lib/screens/patients/profile/operation_report/operation_report.dart +++ b/lib/screens/patients/profile/operation_report/operation_report.dart @@ -31,7 +31,7 @@ import '../../../../widgets/shared/app_texts_widget.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); class OperationReportScreen extends StatefulWidget { - final int visitType; + final int? visitType; const OperationReportScreen({Key? key, this.visitType}) : super(key: key); @@ -40,11 +40,11 @@ class OperationReportScreen extends StatefulWidget { } class _ProgressNoteState extends State { - List notesList; + late List notesList; var filteredNotesList; bool isDischargedPatient = false; - AuthenticationViewModel authenticationViewModel; - ProjectViewModel projectViewModel; + late AuthenticationViewModel authenticationViewModel; + late ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { @@ -55,7 +55,7 @@ class _ProgressNoteState extends State { if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; return BaseView( - onModelReady: (model) => model.getReservations(patient.patientMRN), + onModelReady: (model) => model.getReservations(patient!.patientMRN!), builder: (_, model, w) => AppScaffold( baseViewModel: model, backgroundColor: Theme.of(context).scaffoldBackgroundColor, @@ -71,7 +71,7 @@ class _ProgressNoteState extends State { model.reservationList == null || model.reservationList.length == 0 ? DrAppEmbeddedError( - error: TranslationBase.of(context).errorNoProgressNote) + error: TranslationBase.of(context).errorNoProgressNote!) : Expanded( child: Container( child: ListView.builder( diff --git a/lib/screens/patients/profile/operation_report/update_operation_report.dart b/lib/screens/patients/profile/operation_report/update_operation_report.dart index 8148e2a9..6ff2b7de 100644 --- a/lib/screens/patients/profile/operation_report/update_operation_report.dart +++ b/lib/screens/patients/profile/operation_report/update_operation_report.dart @@ -36,16 +36,16 @@ class UpdateOperationReport extends StatefulWidget { final GetReservationsResponseModel reservation; // final OperationReportViewModel operationReportViewModel; final PatiantInformtion patient; - final int visitType; + final int? visitType; final bool isUpdate; const UpdateOperationReport( {Key? key, // this.operationReportViewModel, - this.patient, + required this.patient, this.visitType, - this.isUpdate, - this.reservation}) + required this.isUpdate, + required this.reservation}) : super(key: key); @override @@ -53,12 +53,12 @@ class UpdateOperationReport extends StatefulWidget { } class _UpdateOperationReportState extends State { - int selectedType; + late int selectedType; bool isSubmitted = false; stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; var event = RobotProvider(); - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; TextEditingController preOpDiagmosisController = TextEditingController(); TextEditingController postOpDiagmosisNoteController = TextEditingController(); @@ -135,7 +135,7 @@ class _UpdateOperationReportState extends State { baseViewModel: model, backgroundColor: Theme.of(context).scaffoldBackgroundColor, appBar: BottomSheetTitle( - title: TranslationBase.of(context).operationReports, + title: TranslationBase.of(context).operationReports!, ), body: SingleChildScrollView( child: Container( @@ -540,8 +540,8 @@ class _UpdateOperationReportState extends State { child: AppButton( title: (widget.isUpdate ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).operationReports, + : TranslationBase.of(context).noteAdd)! + + TranslationBase.of(context).operationReports!, color: Color(0xff359846), // disabled: operationReportsController.text.isEmpty, fontWeight: FontWeight.w700, @@ -590,9 +590,9 @@ class _UpdateOperationReportState extends State { bloodLossDetailController.text, patientID: widget.patient.patientId, admissionNo: - int.parse(widget.patient.admissionNo), + int.parse(widget.patient.admissionNo!), createdBy: model - .doctorProfile.doctorID, + .doctorProfile!.doctorID!, setupID: "010266"); await model .updateOperationReport( diff --git a/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart b/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart index d2c5139a..c69f3868 100644 --- a/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart +++ b/lib/screens/patients/profile/pending_orders/pending_orders_screen.dart @@ -9,11 +9,11 @@ import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.d import 'package:flutter/material.dart'; class PendingOrdersScreen extends StatelessWidget { - const PendingOrdersScreen({Key? key}) : super(key: key); + const PendingOrdersScreen({Key key}) : super(key: key); @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; patient = routeArgs['patient']; String patientType = routeArgs['patientType']; @@ -24,73 +24,73 @@ class PendingOrdersScreen extends StatelessWidget { admissionNo: int.parse(patient.admissionNo)), builder: (BuildContext context, PendingOrdersViewModel model, Widget child) => - AppScaffold( - appBar: PatientProfileAppBar( - patient, - isInpatient: isInpatient, - ), - isShowAppBar: true, - baseViewModel: model, - appBarTitle: "Pending Orders", - body: model.pendingOrdersList == null || + AppScaffold( + appBar: PatientProfileAppBar( + patient, + isInpatient: isInpatient, + ), + isShowAppBar: true, + baseViewModel: model, + appBarTitle: "Pending Orders", + body: model.pendingOrdersList == null || model.pendingOrdersList.length == 0 - ? DrAppEmbeddedError( + ? DrAppEmbeddedError( error: TranslationBase.of(context).noDataAvailable) - : Column( - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - children: [ - Row( - children: [ - AppText( - TranslationBase.of(context).pending, - fontSize: 15.0, - fontWeight: FontWeight.w600, - fontFamily: 'Poppins', - ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).orders, - fontSize: 25.0, - fontWeight: FontWeight.w700, - ), - ], - ), - ], - ), + : Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( + children: [ + AppText( + TranslationBase.of(context).pending, + fontSize: 15.0, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + ), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).orders, + fontSize: 25.0, + fontWeight: FontWeight.w700, + ), + ], + ), + ], ), - Container( - child: ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model.pendingOrdersList.length, - itemBuilder: (BuildContext ctxt, int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), - border: Border.all( - color: Color(0xFF707070), width: 0.30), - ), - child: Padding( - padding: EdgeInsets.all(8.0), - child: AppText( - model.pendingOrdersList[index].notes), + ), + Container( + child: ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.pendingOrdersList.length, + itemBuilder: (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(10.0), ), + border: Border.all( + color: Color(0xFF707070), width: 0.30), ), - ); - })), - ], - ), - ), + child: Padding( + padding: EdgeInsets.all(8.0), + child: AppText( + model.pendingOrdersList[index].notes), + ), + ), + ); + })), + ], + ), + ), ); } } diff --git a/lib/screens/patients/register_patient/CustomEditableText.dart b/lib/screens/patients/register_patient/CustomEditableText.dart index 17405829..58713495 100644 --- a/lib/screens/patients/register_patient/CustomEditableText.dart +++ b/lib/screens/patients/register_patient/CustomEditableText.dart @@ -7,7 +7,7 @@ import 'package:flutter/material.dart'; class CustomEditableText extends StatefulWidget { CustomEditableText({ Key key, - @required this.controller, + required this.controller, this.hint, this.isEditable = false, this.isSubmitted, }) : super(key: key); diff --git a/lib/screens/patients/register_patient/VerifyMethodPage.dart b/lib/screens/patients/register_patient/VerifyMethodPage.dart index 8634e76e..f2d0646f 100644 --- a/lib/screens/patients/register_patient/VerifyMethodPage.dart +++ b/lib/screens/patients/register_patient/VerifyMethodPage.dart @@ -501,15 +501,15 @@ class _ActivationPageState extends State { counterText: " ", enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10)), - borderSide: BorderSide(color: Colors.grey[300]), + borderSide: BorderSide(color: Colors.grey[300]!), ), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Colors.grey[300]), + borderSide: BorderSide(color: Colors.grey[300]!), ), errorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Colors.grey[300]), + borderSide: BorderSide(color: Colors.grey[300]!), ), focusedErrorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), diff --git a/lib/screens/procedures/base_add_procedure_tab_page.dart b/lib/screens/procedures/base_add_procedure_tab_page.dart index 8d6a42e3..10bbe773 100644 --- a/lib/screens/procedures/base_add_procedure_tab_page.dart +++ b/lib/screens/procedures/base_add_procedure_tab_page.dart @@ -21,7 +21,7 @@ class BaseAddProcedureTabPage extends StatefulWidget { final ProcedureType? procedureType; const BaseAddProcedureTabPage( - {Key? key, this.model, this.prescriptionModel, this.patient, @required this.procedureType}) + {Key? key, this.model, this.prescriptionModel, this.patient, required this.procedureType}) : super(key: key); @override