update_flutter_3.16.0_voipcall
Aamir Muhammad 2 years ago
parent bb86949f65
commit b83c48abe5

@ -65,5 +65,9 @@
</array> </array>
<key>UIViewControllerBasedStatusBarAppearance</key> <key>UIViewControllerBasedStatusBarAppearance</key>
<false/> <false/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict> </dict>
</plist> </plist>

@ -3,19 +3,17 @@ import 'dart:io' show Platform;
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/service/NavigationService.dart';
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/service/NavigationService.dart';
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../locator.dart';
import '../routes.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
Utils helpers = new Utils(); Utils helpers = new Utils();
@ -37,7 +35,7 @@ class BaseAppClient {
bool callLog = true; bool callLog = true;
try { try {
Map<String, dynamic>? profile = await sharedPref.getObj(DOCTOR_PROFILE); Map<String, dynamic>? profile = await sharedPref.getObj(DOCTOR_PROFILE);
String token = await sharedPref.getString(TOKEN); String? token = await sharedPref.getString(TOKEN);
if (profile != null) { if (profile != null) {
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
@ -90,7 +88,10 @@ class BaseAppClient {
body['VidaRefreshTokenID'] = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); body['VidaRefreshTokenID'] = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
} }
int projectID = await sharedPref.getInt(PROJECT_ID); int? projectID = await sharedPref.getInt(PROJECT_ID);
// if (projectID != null) {
// projectID = 2;
// }
if (projectID == 2 || projectID == 3) if (projectID == 2 || projectID == 3)
body['PatientOutSA'] = true; body['PatientOutSA'] = true;
else if ((body.containsKey('facilityId') && body['facilityId'] == 2 || body['facilityId'] == 3) || body['ProjectID'] == 2 || body['ProjectID'] == 3) else if ((body.containsKey('facilityId') && body['facilityId'] == 2 || body['facilityId'] == 3) || body['ProjectID'] == 2 || body['ProjectID'] == 3)
@ -148,7 +149,7 @@ class BaseAppClient {
{required Map<String, dynamic> body, {required Map<String, dynamic> body,
required Function(dynamic response, int statusCode) onSuccess, required Function(dynamic response, int statusCode) onSuccess,
required Function(String error, int statusCode) onFailure, required Function(String error, int statusCode) onFailure,
PatiantInformtion? patient, PatiantInformtion? patient,
bool isExternal = false}) async { bool isExternal = false}) async {
String url = BASE_URL + endPoint; String url = BASE_URL + endPoint;

@ -1,4 +1,3 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/auth/activation_Code_req_model.dart'; import 'package:doctor_app_flutter/core/model/auth/activation_Code_req_model.dart';
import 'package:doctor_app_flutter/core/model/auth/activation_code_for_verification_screen_model.dart'; import 'package:doctor_app_flutter/core/model/auth/activation_code_for_verification_screen_model.dart';
@ -8,39 +7,29 @@ import 'package:doctor_app_flutter/core/model/auth/imei_details.dart';
import 'package:doctor_app_flutter/core/model/auth/insert_imei_model.dart'; import 'package:doctor_app_flutter/core/model/auth/insert_imei_model.dart';
import 'package:doctor_app_flutter/core/model/auth/new_login_information_response_model.dart'; import 'package:doctor_app_flutter/core/model/auth/new_login_information_response_model.dart';
import 'package:doctor_app_flutter/core/model/auth/send_activation_code_for_doctor_app_response_model.dart'; import 'package:doctor_app_flutter/core/model/auth/send_activation_code_for_doctor_app_response_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/model/doctor/profile_req_Model.dart'; import 'package:doctor_app_flutter/core/model/doctor/profile_req_Model.dart';
import 'package:doctor_app_flutter/core/model/doctor/user_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/user_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
class AuthenticationService extends BaseService { class AuthenticationService extends BaseService {
List<GetIMEIDetailsModel> _imeiDetails = []; List<GetIMEIDetailsModel> _imeiDetails = [];
List<GetIMEIDetailsModel> get dashboardItemsList => _imeiDetails; List<GetIMEIDetailsModel> get dashboardItemsList => _imeiDetails;
NewLoginInformationModel _loginInfo = NewLoginInformationModel(); late NewLoginInformationModel _loginInfo;
NewLoginInformationModel get loginInfo => _loginInfo; NewLoginInformationModel get loginInfo => _loginInfo;
SendActivationCodeForDoctorAppResponseModel SendActivationCodeForDoctorAppResponseModel _activationCodeVerificationScreenRes = SendActivationCodeForDoctorAppResponseModel();
_activationCodeVerificationScreenRes =
SendActivationCodeForDoctorAppResponseModel();
SendActivationCodeForDoctorAppResponseModel SendActivationCodeForDoctorAppResponseModel get activationCodeVerificationScreenRes => _activationCodeVerificationScreenRes;
get activationCodeVerificationScreenRes =>
_activationCodeVerificationScreenRes;
SendActivationCodeForDoctorAppResponseModel _activationCodeForDoctorAppRes = SendActivationCodeForDoctorAppResponseModel _activationCodeForDoctorAppRes = SendActivationCodeForDoctorAppResponseModel();
SendActivationCodeForDoctorAppResponseModel();
SendActivationCodeForDoctorAppResponseModel SendActivationCodeForDoctorAppResponseModel get activationCodeForDoctorAppRes => _activationCodeForDoctorAppRes;
get activationCodeForDoctorAppRes => _activationCodeForDoctorAppRes; CheckActivationCodeForDoctorAppResponseModel _checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel();
CheckActivationCodeForDoctorAppResponseModel
_checkActivationCodeForDoctorAppRes =
CheckActivationCodeForDoctorAppResponseModel();
CheckActivationCodeForDoctorAppResponseModel CheckActivationCodeForDoctorAppResponseModel get checkActivationCodeForDoctorAppRes => _checkActivationCodeForDoctorAppRes;
get checkActivationCodeForDoctorAppRes => late Map<String, dynamic> _insertDeviceImeiRes;
_checkActivationCodeForDoctorAppRes;
Map<String, dynamic> _insertDeviceImeiRes = {};
List<DoctorProfileModel> _doctorProfilesList = []; List<DoctorProfileModel> _doctorProfilesList = [];
@ -48,8 +37,7 @@ class AuthenticationService extends BaseService {
Future selectDeviceImei(imei) async { Future selectDeviceImei(imei) async {
try { try {
await baseAppClient.post(SELECT_DEVICE_IMEI, await baseAppClient.post(SELECT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
_imeiDetails = []; _imeiDetails = [];
response['List_DoctorDeviceDetails'].forEach((v) { response['List_DoctorDeviceDetails'].forEach((v) {
_imeiDetails.add(GetIMEIDetailsModel.fromJson(v)); _imeiDetails.add(GetIMEIDetailsModel.fromJson(v));
@ -68,8 +56,7 @@ class AuthenticationService extends BaseService {
hasError = false; hasError = false;
_loginInfo = NewLoginInformationModel(); _loginInfo = NewLoginInformationModel();
try { try {
await baseAppClient.post(LOGIN_URL, await baseAppClient.post(LOGIN_URL, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
_loginInfo = NewLoginInformationModel.fromJson(response); _loginInfo = NewLoginInformationModel.fromJson(response);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -81,16 +68,12 @@ class AuthenticationService extends BaseService {
} }
} }
Future sendActivationCodeVerificationScreen( Future sendActivationCodeVerificationScreen(ActivationCodeForVerificationScreenModel activationCodeModel) async {
ActivationCodeForVerificationScreenModel activationCodeModel) async {
hasError = false; hasError = false;
_activationCodeVerificationScreenRes = _activationCodeVerificationScreenRes = SendActivationCodeForDoctorAppResponseModel();
SendActivationCodeForDoctorAppResponseModel();
try { try {
await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN, await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) { _activationCodeVerificationScreenRes = SendActivationCodeForDoctorAppResponseModel.fromJson(response);
_activationCodeVerificationScreenRes =
SendActivationCodeForDoctorAppResponseModel.fromJson(response);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
@ -101,16 +84,12 @@ class AuthenticationService extends BaseService {
} }
} }
Future sendActivationCodeForDoctorApp( Future sendActivationCodeForDoctorApp(ActivationCodeModel activationCodeModel) async {
ActivationCodeModel activationCodeModel) async {
hasError = false; hasError = false;
_activationCodeForDoctorAppRes = _activationCodeForDoctorAppRes = SendActivationCodeForDoctorAppResponseModel();
SendActivationCodeForDoctorAppResponseModel();
try { try {
await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_DOCTOR_APP, await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_DOCTOR_APP, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) { _activationCodeForDoctorAppRes = SendActivationCodeForDoctorAppResponseModel.fromJson(response);
_activationCodeForDoctorAppRes =
SendActivationCodeForDoctorAppResponseModel.fromJson(response);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
@ -121,16 +100,12 @@ class AuthenticationService extends BaseService {
} }
} }
Future checkActivationCodeForDoctorApp( Future checkActivationCodeForDoctorApp(CheckActivationCodeRequestModel checkActivationCodeRequestModel) async {
CheckActivationCodeRequestModel checkActivationCodeRequestModel) async {
hasError = false; hasError = false;
_checkActivationCodeForDoctorAppRes = _checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel();
CheckActivationCodeForDoctorAppResponseModel();
try { try {
await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP, await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) { _checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel.fromJson(response);
_checkActivationCodeForDoctorAppRes =
CheckActivationCodeForDoctorAppResponseModel.fromJson(response);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
@ -145,8 +120,7 @@ class AuthenticationService extends BaseService {
hasError = false; hasError = false;
_insertDeviceImeiRes = {}; _insertDeviceImeiRes = {};
try { try {
await baseAppClient.post(INSERT_DEVICE_IMEI, await baseAppClient.post(INSERT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
_insertDeviceImeiRes = response; _insertDeviceImeiRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -161,8 +135,7 @@ class AuthenticationService extends BaseService {
Future getDoctorProfileBasedOnClinic(ProfileReqModel profileReqModel) async { Future getDoctorProfileBasedOnClinic(ProfileReqModel profileReqModel) async {
hasError = false; hasError = false;
try { try {
await baseAppClient.post(GET_DOC_PROFILES, await baseAppClient.post(GET_DOC_PROFILES, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
_doctorProfilesList.clear(); _doctorProfilesList.clear();
response['DoctorProfileList'].forEach((v) { response['DoctorProfileList'].forEach((v) {
_doctorProfilesList.add(DoctorProfileModel.fromJson(v)); _doctorProfilesList.add(DoctorProfileModel.fromJson(v));

@ -11,19 +11,19 @@ import 'package:doctor_app_flutter/core/model/auth/imei_details.dart';
import 'package:doctor_app_flutter/core/model/auth/insert_imei_model.dart'; import 'package:doctor_app_flutter/core/model/auth/insert_imei_model.dart';
import 'package:doctor_app_flutter/core/model/auth/new_login_information_response_model.dart'; import 'package:doctor_app_flutter/core/model/auth/new_login_information_response_model.dart';
import 'package:doctor_app_flutter/core/model/auth/send_activation_code_for_doctor_app_response_model.dart'; import 'package:doctor_app_flutter/core/model/auth/send_activation_code_for_doctor_app_response_model.dart';
import 'package:doctor_app_flutter/core/model/doctor/clinic_model.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/model/doctor/profile_req_Model.dart';
import 'package:doctor_app_flutter/core/model/doctor/user_model.dart';
import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_request_model.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_request_model.dart';
import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart';
import 'package:doctor_app_flutter/core/service/authentication_service.dart'; import 'package:doctor_app_flutter/core/service/authentication_service.dart';
import 'package:doctor_app_flutter/core/service/hospitals/hospitals_service.dart'; import 'package:doctor_app_flutter/core/service/hospitals/hospitals_service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/core/model/doctor/clinic_model.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/model/doctor/profile_req_Model.dart';
import 'package:doctor_app_flutter/core/model/doctor/user_model.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:local_auth/local_auth.dart'; import 'package:local_auth/local_auth.dart';
@ -113,11 +113,11 @@ class AuthenticationViewModel extends BaseViewModel {
error = _authService.error; error = _authService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else { } else {
sharedPref.setInt(PROJECT_ID, userInfo.projectID!); await sharedPref.setInt(PROJECT_ID, userInfo.projectID!);
loggedUser = loginInfo; loggedUser = loginInfo;
saveObjToString(LOGGED_IN_USER, loginInfo); await saveObjToString(LOGGED_IN_USER, loginInfo);
sharedPref.remove(LAST_LOGIN_USER); await sharedPref.remove(LAST_LOGIN_USER);
sharedPref.setString(TOKEN, loginInfo.logInTokenID!); await sharedPref.setString(TOKEN, loginInfo.logInTokenID!);
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }

@ -17,9 +17,10 @@ Utils helpers = Utils();
class ProjectViewModel with ChangeNotifier { class ProjectViewModel with ChangeNotifier {
DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = DrAppSharedPreferances();
late Locale _appLocale;
String currentLanguage = 'ar'; Locale _appLocale = Locale('ar');
String? currentLanguage = 'ar';
bool _isArabic = false; bool _isArabic = false;
bool isInternetConnection = true; bool isInternetConnection = true;
List<ClinicModel> doctorClinicsList = []; List<ClinicModel> doctorClinicsList = [];

@ -8,7 +8,6 @@ import 'package:doctor_app_flutter/widgets/shared/app_drawer_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_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/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/bottom_nav_bar.dart'; import 'package:doctor_app_flutter/widgets/shared/bottom_nav_bar.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';

@ -118,7 +118,6 @@ void setupLocator() {
locator.registerLazySingleton(() => InterventionMedicationService()); locator.registerLazySingleton(() => InterventionMedicationService());
locator.registerLazySingleton(() => ERSignInService()); locator.registerLazySingleton(() => ERSignInService());
/// View Model /// View Model
locator.registerFactory(() => DoctorReplayViewModel()); locator.registerFactory(() => DoctorReplayViewModel());
locator.registerFactory(() => ScheduleViewModel()); locator.registerFactory(() => ScheduleViewModel());

@ -1,21 +1,19 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/service/NavigationService.dart';
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/livecare_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/livecare_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:firebase_analytics/firebase_analytics.dart';
import 'package:firebase_analytics/observer.dart';
import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import './config/size_config.dart';
import './routes.dart';
import 'config/config.dart';
import 'core/service/AnalyticsService.dart';
import 'core/service/NavigationService.dart';
import 'core/viewModel/authentication_view_model.dart';
import 'locator.dart';
import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:provider/provider.dart';
void main() async { void main() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
@ -34,8 +32,7 @@ class MyApp extends StatelessWidget {
SizeConfig().init(constraints, orientation); SizeConfig().init(constraints, orientation);
return MultiProvider( return MultiProvider(
providers: [ providers: [
ChangeNotifierProvider<AuthenticationViewModel>( ChangeNotifierProvider<AuthenticationViewModel>(create: (context) => AuthenticationViewModel()),
create: (context) => AuthenticationViewModel()),
ChangeNotifierProvider<ProjectViewModel>( ChangeNotifierProvider<ProjectViewModel>(
create: (context) => ProjectViewModel(), create: (context) => ProjectViewModel(),
), ),
@ -48,37 +45,38 @@ class MyApp extends StatelessWidget {
) )
], ],
child: Consumer<ProjectViewModel>( child: Consumer<ProjectViewModel>(
builder: (context, projectProvider, child) => MaterialApp( builder: (context, projectProvider, child) => MaterialApp(
showSemanticsDebugger: false, showSemanticsDebugger: false,
title: 'Doctors App', title: 'Doctors App',
locale: projectProvider.appLocal, locale: projectProvider.appLocal,
localizationsDelegates: [ localizationsDelegates: [
TranslationBaseDelegate(), TranslationBaseDelegate(),
GlobalMaterialLocalizations.delegate, GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate, GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate, GlobalCupertinoLocalizations.delegate,
DefaultCupertinoLocalizations.delegate DefaultCupertinoLocalizations.delegate
], ],
supportedLocales: [ supportedLocales: [
const Locale('ar', ''), // Arabic const Locale('ar', ''), // Arabic
const Locale('en', ''), // English const Locale('en', ''), // English
], ],
theme: ThemeData( theme: ThemeData(
primarySwatch: Colors.grey, primarySwatch: Colors.grey,
primaryColor: Colors.grey, primaryColor: Colors.grey,
//buttonColor: HexColor('#D02127'), //buttonColor: HexColor('#D02127'),
fontFamily: 'Poppins', fontFamily: 'Poppins',
dividerColor: Colors.grey[350], dividerColor: Colors.grey[350],
backgroundColor: Color.fromRGBO(255, 255, 255, 1), backgroundColor: Color.fromRGBO(255, 255, 255, 1),
), useMaterial3: false),
navigatorKey: locator<NavigationService>().navigatorKey, navigatorKey: locator<NavigationService>().navigatorKey,
navigatorObservers: [ navigatorObservers: [
locator<AnalyticsService>().getAnalyticsObserver(), locator<AnalyticsService>().getAnalyticsObserver(),
], ],
initialRoute: INIT_ROUTE, initialRoute: INIT_ROUTE,
routes: routes, routes: routes,
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
)), ),
),
); );
}); });
}, },

@ -55,8 +55,7 @@ const String ORDER_NOTE = 'patients/order-note';
const String MY_REFERRAL_DETAIL = 'my_referral_detail'; const String MY_REFERRAL_DETAIL = 'my_referral_detail';
const String REFER_PATIENT_TO_DOCTOR = 'patients/refer-to-doctor'; const String REFER_PATIENT_TO_DOCTOR = 'patients/refer-to-doctor';
const String REFER_IN_PATIENT_TO_DOCTOR = 'patients/refer-in-patient-to-doctor'; const String REFER_IN_PATIENT_TO_DOCTOR = 'patients/refer-in-patient-to-doctor';
const String PATIENT_INSURANCE_APPROVALS_NEW = const String PATIENT_INSURANCE_APPROVALS_NEW = 'patients/patient_insurance_approvals_new';
'patients/patient_insurance_approvals_new';
const String VITAL_SIGN_DETAILS = 'patients/vital-sign-details'; const String VITAL_SIGN_DETAILS = 'patients/vital-sign-details';
const String CREATE_EPISODE = 'patients/create-episode'; const String CREATE_EPISODE = 'patients/create-episode';
const String UPDATE_EPISODE = 'patients/update-episode'; const String UPDATE_EPISODE = 'patients/update-episode';
@ -83,12 +82,11 @@ const String NURSING_PROGRESS_NOTE = 'nursing_progress_note';
const String DIAGNOSIS_FOR_IN_PATIENT = 'get_diagnosis_for_in_patient'; const String DIAGNOSIS_FOR_IN_PATIENT = 'get_diagnosis_for_in_patient';
const String DIABETIC_CHART_VALUES = 'get_diabetic_chart_values'; const String DIABETIC_CHART_VALUES = 'get_diabetic_chart_values';
const String VTE_ASSESSMENT = 'vte_assessment '; const String VTE_ASSESSMENT = 'vte_assessment ';
const String DISCHARGE_SUMMARY = 'discharge_summary'; const String DISCHARGE_SUMMARY = 'discharge_summary';
const String PHARMACY_INTERVENTION = 'new_medication'; const String PHARMACY_INTERVENTION = 'new_medication';
const String INTERVENTION_MEDICATION = 'intervention_medication'; const String INTERVENTION_MEDICATION = 'intervention_medication';
//todo: change the routing way. //todo: change the routing way.
var routes = { var routes = {
ROOT: (_) => RootPage(), ROOT: (_) => RootPage(),

@ -3,8 +3,8 @@ import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart';
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_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/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
@ -44,146 +44,106 @@ class _LoginScreenState extends State<LoginScreen> {
Container( Container(
margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 30), margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 30),
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: Column( child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Column( Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
//TODO Use App Text rather than text Column(
Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Column( SizedBox(
crossAxisAlignment: CrossAxisAlignment.start, height: 30,
children: <Widget>[
SizedBox(
height: 30,
),
],
), ),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 10,
),
Text(
TranslationBase.of(context).welcomeTo,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins'),
),
Text(
TranslationBase.of(context)
.drSulaimanAlHabib,
style: TextStyle(
color: Color(0xFF2B353E),
fontWeight: FontWeight.bold,
fontSize: SizeConfig.isMobile
? 24
: SizeConfig.realScreenWidth! *
0.029,
fontFamily: 'Poppins'),
),
Text(
"Doctor App",
style: TextStyle(
fontSize: SizeConfig.isMobile
? 16
: SizeConfig.realScreenWidth! *
0.030,
fontWeight: FontWeight.w600,
color: Color(0xFFD02127)),
),
]),
], ],
)),
SizedBox(
height: 40,
), ),
Form( Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
key: loginFormKey, SizedBox(
child: Column( height: 10,
mainAxisAlignment: MainAxisAlignment.spaceBetween, ),
children: <Widget>[ Text(
Container( TranslationBase.of(context).welcomeTo,
width: SizeConfig.realScreenWidth! * 0.90, style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, fontFamily: 'Poppins'),
height: SizeConfig.realScreenHeight! * 0.65, ),
child: Column( Text(
crossAxisAlignment: TranslationBase.of(context).drSulaimanAlHabib,
CrossAxisAlignment.start, style: TextStyle(color: Color(0xFF2B353E), fontWeight: FontWeight.bold, fontSize: SizeConfig.isMobile ? 24 : SizeConfig.realScreenWidth! * 0.029, fontFamily: 'Poppins'),
children: [ ),
buildSizedBox(), Text(
AppTextFieldCustom( "Doctor App",
hintText: style: TextStyle(fontSize: SizeConfig.isMobile ? 16 : SizeConfig.realScreenWidth! * 0.030, fontWeight: FontWeight.w600, color: Color(0xFFD02127)),
TranslationBase.of(context).enterId,
hasBorder: true,
controller: userIdController,
onChanged: (value) {
if (value != null)
setState(() {
authenticationViewModel.userInfo
.userID = value.trim();
});
},
),
buildSizedBox(),
AppTextFieldCustom(
hintText: TranslationBase.of(context)
.enterPassword,
hasBorder: true,
isSecure: true,
controller: passwordController,
onChanged: (value) {
if (value != null)
setState(() {
authenticationViewModel.userInfo
.password = value.trim();
});
// if(allowCallApi) {
this.getProjects(
authenticationViewModel
.userInfo.userID);
// setState(() {
// allowCallApi = false;
// });
// }
},
onClick: () {},
),
buildSizedBox(),
AppTextFieldCustom(
hintText: TranslationBase.of(context)
.selectYourProject,
hasBorder: true,
controller: projectIdController,
isTextFieldHasSuffix: true,
enabled: false,
onClick: () {
Utils.showCupertinoPicker(
context,
projectsList,
'facilityName',
onSelectProject,
authenticationViewModel);
},
),
buildSizedBox()
]),
),
],
), ),
) ]),
], ],
)),
SizedBox(
height: 40,
),
Form(
key: loginFormKey,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
width: SizeConfig.realScreenWidth! * 0.90,
height: SizeConfig.realScreenHeight! * 0.65,
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
buildSizedBox(),
AppTextFieldCustom(
hintText: TranslationBase.of(context).enterId,
hasBorder: true,
controller: userIdController,
onChanged: (value) {
if (value != null) authenticationViewModel.userInfo.userID = value.trim();
print(authenticationViewModel.userInfo.userID);
//setState(() {});
},
onClick: () {},
onFieldSubmitted: () {},
),
buildSizedBox(),
AppTextFieldCustom(
hintText: TranslationBase.of(context).enterPassword,
hasBorder: true,
isSecure: true,
controller: passwordController,
onChanged: (value) {
if (value != null) authenticationViewModel.userInfo.password = value.trim();
getProjects(authenticationViewModel.userInfo.userID);
setState(() {});
},
onClick: () {},
onFieldSubmitted: () {},
),
buildSizedBox(),
AppTextFieldCustom(
hintText: TranslationBase.of(context).selectYourProject,
hasBorder: true,
controller: projectIdController,
isTextFieldHasSuffix: true,
enabled: false,
onClick: () {
if (projectsList.isNotEmpty) Utils.showCupertinoPicker(context, projectsList, 'facilityName', onSelectProject, authenticationViewModel);
},
onFieldSubmitted: () {},
onChanged: (value) {},
),
buildSizedBox()
]),
),
],
),
) )
])) ],
)
]))
]), ]),
), ),
bottomSheet: Container( bottomSheet: Container(
height: 90, height: 100,
width: double.infinity, width: double.infinity,
child: Center( child: Center(
child: FractionallySizedBox( child: FractionallySizedBox(
@ -195,8 +155,7 @@ class _LoginScreenState extends State<LoginScreen> {
title: TranslationBase.of(context).login, title: TranslationBase.of(context).login,
color: AppGlobal.appRedColor, color: AppGlobal.appRedColor,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
disabled: authenticationViewModel.userInfo.userID == null || disabled: authenticationViewModel.userInfo.userID == null || authenticationViewModel.userInfo.password == null,
authenticationViewModel.userInfo.password == null,
onPressed: () { onPressed: () {
login(context); login(context);
}, },
@ -246,8 +205,7 @@ class _LoginScreenState extends State<LoginScreen> {
onSelectProject(index) { onSelectProject(index) {
setState(() { setState(() {
authenticationViewModel.userInfo.projectID = authenticationViewModel.userInfo.projectID = projectsList[index].facilityId;
projectsList[index].facilityId;
projectIdController.text = projectsList[index].facilityName!; projectIdController.text = projectsList[index].facilityName!;
}); });
@ -264,8 +222,7 @@ class _LoginScreenState extends State<LoginScreen> {
if (authenticationViewModel.state == ViewState.Idle) { if (authenticationViewModel.state == ViewState.Idle) {
projectsList = authenticationViewModel.hospitals; projectsList = authenticationViewModel.hospitals;
setState(() { setState(() {
authenticationViewModel.userInfo.projectID = authenticationViewModel.userInfo.projectID = projectsList[0].facilityId;
projectsList[0].facilityId;
projectIdController.text = projectsList[0].facilityName!; projectIdController.text = projectsList[0].facilityName!;
}); });
} }

@ -23,7 +23,7 @@ import '../../utils/dr_app_shared_pref.dart';
import '../../utils/utils.dart'; import '../../utils/utils.dart';
import '../../widgets/auth/verification_methods_list.dart'; import '../../widgets/auth/verification_methods_list.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = DrAppSharedPreferances();
Utils helpers = Utils(); Utils helpers = Utils();
///TODO Elham* check if this still in user or not ///TODO Elham* check if this still in user or not
@ -45,7 +45,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
late AuthMethodTypes fingerPrintBefore; late AuthMethodTypes fingerPrintBefore;
late AuthMethodTypes selectedOption; late AuthMethodTypes selectedOption;
AuthenticationViewModel authenticationViewModel = AuthenticationViewModel(); late AuthenticationViewModel authenticationViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -94,7 +94,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
letterSpacing: -0.72, letterSpacing: -0.72,
), ),
AppText( AppText(
Utils.convertToTitleCase(authenticationViewModel.user.doctorName!), Utils.convertToTitleCase(authenticationViewModel.user.doctorName ?? ""),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 6, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 6,
color: AppGlobal.appTextColor, color: AppGlobal.appTextColor,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,

@ -1,14 +1,14 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.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/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/button_bottom_sheet.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/button_bottom_sheet.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
@ -26,8 +26,7 @@ class LivaCareTransferToAdmin extends StatefulWidget {
const LivaCareTransferToAdmin({Key? key, this.patient}) : super(key: key); const LivaCareTransferToAdmin({Key? key, this.patient}) : super(key: key);
@override @override
_LivaCareTransferToAdminState createState() => _LivaCareTransferToAdminState createState() => _LivaCareTransferToAdminState();
_LivaCareTransferToAdminState();
} }
class _LivaCareTransferToAdminState extends State<LivaCareTransferToAdmin> { class _LivaCareTransferToAdminState extends State<LivaCareTransferToAdmin> {
@ -59,8 +58,7 @@ class _LivaCareTransferToAdminState extends State<LivaCareTransferToAdmin> {
onModelReady: (model) {}, onModelReady: (model) {},
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: appBarTitle: "${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin}",
"${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin}",
backgroundColor: Theme.of(context).scaffoldBackgroundColor, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
isShowAppBar: true, isShowAppBar: true,
body: Container( body: Container(
@ -81,21 +79,21 @@ class _LivaCareTransferToAdminState extends State<LivaCareTransferToAdmin> {
minLines: 25, minLines: 25,
hasBorder: true, hasBorder: true,
validationError: noteError!, validationError: noteError!,
onClick: () {},
onFieldSubmitted: () {},
onChanged: (String? value) {},
), ),
Positioned( Positioned(
top: -2, top: -2,
//MediaQuery.of(context).size.height * 0, //MediaQuery.of(context).size.height * 0,
right: projectViewModel.isArabic right: projectViewModel.isArabic ? MediaQuery.of(context).size.width * 0.75 : 15,
? MediaQuery.of(context).size.width * 0.75
: 15,
child: Column( child: Column(
children: [ children: [
IconButton( IconButton(
icon: Icon(DoctorApp.speechtotext, icon: Icon(DoctorApp.speechtotext, color: Colors.black, size: 35),
color: Colors.black, size: 35),
onPressed: () { onPressed: () {
initSpeechState() initSpeechState().then((value) => {onVoiceText()});
.then((value) => {onVoiceText()});
}, },
), ),
], ],
@ -106,8 +104,7 @@ class _LivaCareTransferToAdminState extends State<LivaCareTransferToAdmin> {
), ),
), ),
ButtonBottomSheet( ButtonBottomSheet(
title: title: "${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin}",
"${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin}",
onPressed: () { onPressed: () {
setState(() { setState(() {
if (noteController.text.isEmpty) { if (noteController.text.isEmpty) {
@ -116,19 +113,16 @@ class _LivaCareTransferToAdminState extends State<LivaCareTransferToAdmin> {
noteError = null; noteError = null;
} }
if (noteController.text.isNotEmpty) { if (noteController.text.isNotEmpty) {
Utils.showConfirmationDialog(context, Utils.showConfirmationDialog(context, "${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin} ?",
"${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin} ?",
() async { () async {
Navigator.of(context).pop(); Navigator.of(context).pop();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.transferToAdmin( await model.transferToAdmin(widget.patient!.vcId!, noteController.text);
widget.patient!.vcId!, noteController.text);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error); DrAppToastMsg.showErrorToast(model.error);
} else { } else {
DrAppToastMsg.showSuccesToast( DrAppToastMsg.showSuccesToast("You successfully transfer to admin");
"You successfully transfer to admin");
Navigator.of(context).pop(); Navigator.of(context).pop();
Navigator.of(context).pop(); Navigator.of(context).pop();
Navigator.of(context).pop(); Navigator.of(context).pop();
@ -148,8 +142,7 @@ class _LivaCareTransferToAdminState extends State<LivaCareTransferToAdmin> {
onVoiceText() async { onVoiceText() async {
new SpeechToText(context: context).showAlertDialog(context); new SpeechToText(context: context).showAlertDialog(context);
var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode;
bool available = await speech.initialize( bool available = await speech.initialize(onStatus: statusListener, onError: errorListener);
onStatus: statusListener, onError: errorListener);
if (available) { if (available) {
speech.listen( speech.listen(
onResult: resultListener, onResult: resultListener,
@ -193,8 +186,7 @@ class _LivaCareTransferToAdminState extends State<LivaCareTransferToAdmin> {
} }
Future<void> initSpeechState() async { Future<void> initSpeechState() async {
bool hasSpeech = await speech.initialize( bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener);
onError: errorListener, onStatus: statusListener);
print(hasSpeech); print(hasSpeech);
if (!mounted) return; if (!mounted) return;
} }

@ -86,6 +86,7 @@ class _LiveCarePatientScreenState extends State<LiveCarePatientScreen> {
iconSize: 20, iconSize: 20,
onPressed: () {}, onPressed: () {},
), ),
onFieldSubmitted: () {},
), ),
model.state == ViewState.Idle model.state == ViewState.Idle
? Expanded( ? Expanded(

@ -95,7 +95,7 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
onFieldSubmitted: (value) { onFieldSubmitted: (value) {
searchMedicine(context, model); searchMedicine(context, model);
}, },
marginTop: 5, marginTop: 5, onChangeFun: (){},
), ),
Container( Container(
margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: 0), margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: 0),

@ -1,23 +1,22 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/sickleave/add_sickleave_request.dart'; import 'package:doctor_app_flutter/core/model/sickleave/add_sickleave_request.dart';
import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_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/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_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/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
@ -113,12 +112,14 @@ class _AddPatientSickLeaveScreenState extends State<AddPatientSickLeaveScreen> {
inputType: TextInputType.number, inputType: TextInputType.number,
controller: _numberOfDayController, controller: _numberOfDayController,
onChanged: (value) { onChanged: (value) {
if (value.isNotEmpty) if (value != null)
setState(() { setState(() {
addSickLeave.noOfDays = value; addSickLeave.noOfDays = value;
}); });
}, },
validationError: isFormSubmitted && (addSickLeave.noOfDays == null) ? TranslationBase.of(context).pleaseEnterNoOfDays : "", validationError: isFormSubmitted && (addSickLeave.noOfDays == null) ? TranslationBase.of(context).pleaseEnterNoOfDays : "",
onClick: () {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -146,6 +147,7 @@ class _AddPatientSickLeaveScreenState extends State<AddPatientSickLeaveScreen> {
}); });
}, },
validationError: isFormSubmitted && (addSickLeave.startDate == null) ? TranslationBase.of(context).pleaseEnterDate : "", validationError: isFormSubmitted && (addSickLeave.startDate == null) ? TranslationBase.of(context).pleaseEnterDate : "",
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 5, height: 5,
@ -161,6 +163,8 @@ class _AddPatientSickLeaveScreenState extends State<AddPatientSickLeaveScreen> {
inputFormatters: [FilteringTextInputFormatter.allow(RegExp(ONLY_NUMBERS))], inputFormatters: [FilteringTextInputFormatter.allow(RegExp(ONLY_NUMBERS))],
controller: _clinicController, controller: _clinicController,
onChanged: (value) {}, onChanged: (value) {},
onClick: () {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -207,6 +211,8 @@ class _AddPatientSickLeaveScreenState extends State<AddPatientSickLeaveScreen> {
inputFormatters: [FilteringTextInputFormatter.allow(RegExp(ONLY_NUMBERS))], inputFormatters: [FilteringTextInputFormatter.allow(RegExp(ONLY_NUMBERS))],
controller: _doctorController, controller: _doctorController,
onChanged: (value) {}, onChanged: (value) {},
onClick: () {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -224,6 +230,8 @@ class _AddPatientSickLeaveScreenState extends State<AddPatientSickLeaveScreen> {
addSickLeave.remarks = value; addSickLeave.remarks = value;
}); });
}, },
onClick: () {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 12 : 10) + 20, height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 12 : 10) + 20,

@ -58,8 +58,10 @@ class _DischargedPatientState extends State<DischargedPatient> {
DoctorApp.filter_1, DoctorApp.filter_1,
color: Colors.black, color: Colors.black,
), ),
iconSize: 20, onPressed: () { }, iconSize: 20,
onPressed: () {},
), ),
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 5, height: 5,
@ -72,136 +74,70 @@ class _DischargedPatientState extends State<DischargedPatient> {
model.filterData.length, model.filterData.length,
(index) => InkWell( (index) => InkWell(
onTap: () { onTap: () {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(PATIENTS_PROFILE,
PATIENTS_PROFILE, arguments: {"patient": model.filterData[index], "patientType": "1", "isSearch": false, "isInpatient": true, "isDischargedPatient": true});
arguments: {
"patient":
model.filterData[index],
"patientType": "1",
"isSearch": false,
"isInpatient": true,
"isDischargedPatient": true
});
}, },
child: Container( child: Container(
width: double.maxFinite, width: double.maxFinite,
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
padding: EdgeInsets.only( padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5),
left: 0,
right: 5,
bottom: 5,
top: 5),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius: BorderRadius.circular(15),
BorderRadius.circular(15),
color: Colors.white, color: Colors.white,
), ),
child: Column( child: Column(
children: [ children: [
Padding( Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(left: 12.0),
left: 12.0),
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment
.spaceBetween,
children: [ children: [
Row(children: [ Row(children: [
Container( Container(
width: 170, width: 170,
child: AppText( child: AppText(
(Utils.capitalize(model (Utils.capitalize(model.filterData[index].firstName) + " " + Utils.capitalize(model.filterData[index].lastName)),
.filterData[
index]
.firstName) +
" " +
Utils.capitalize(model
.filterData[
index]
.lastName)),
fontSize: 16, fontSize: 16,
fontWeight: fontWeight: FontWeight.bold,
FontWeight fontFamily: 'Poppins',
.bold, textOverflow: TextOverflow.ellipsis,
fontFamily:
'Poppins',
textOverflow:
TextOverflow
.ellipsis,
), ),
), ),
model.filterData[index] model.filterData[index].gender == 1
.gender ==
1
? Icon( ? Icon(
DoctorApp DoctorApp.male_2,
.male_2, color: Colors.blue,
color: Colors
.blue,
) )
: Icon( : Icon(
DoctorApp DoctorApp.female_1,
.female_1, color: Colors.pink,
color: Colors
.pink,
), ),
]), ]),
Row( Row(
children: [ children: [
AppText( AppText(
model.filterData[index].nationalityName != model.filterData[index].nationalityName != null
null ? model.filterData[index].nationalityName!.trim()
? model : model.filterData[index].nationality != null
.filterData[ ? model.filterData[index].nationality!.trim()
index] : model.filterData[index].nationalityId != null
.nationalityName
!.trim()
: model.filterData[index].nationality !=
null
? model
.filterData[
index]
.nationality
!.trim()
: model.filterData[index].nationalityId !=
null
? model.filterData[index].nationalityId! ? model.filterData[index].nationalityId!
: "", : "",
fontWeight: fontWeight: FontWeight.bold,
FontWeight
.bold,
fontSize: 14, fontSize: 14,
textOverflow: textOverflow: TextOverflow.ellipsis,
TextOverflow
.ellipsis,
), ),
model.filterData[index].nationality != model.filterData[index].nationality != null || model.filterData[index].nationalityId != null
null ||
model.filterData[index].nationalityId !=
null
? ClipRRect( ? ClipRRect(
borderRadius: borderRadius: BorderRadius.circular(20.0),
BorderRadius.circular( child: Image.network(
20.0), model.filterData[index].nationalityFlagURL != null ? model.filterData[index].nationalityFlagURL! : '',
child: Image height: 25,
.network( width: 30,
model.filterData[index].nationalityFlagURL != errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
null
? model.filterData[index].nationalityFlagURL!
: '',
height:
25,
width:
30,
errorBuilder: (BuildContext context,
Object
exception,
StackTrace?
stackTrace) {
return AppText( return AppText(
'', '',
fontSize: fontSize: 10,
10,
); );
}, },
)) ))
@ -213,26 +149,16 @@ class _DischargedPatientState extends State<DischargedPatient> {
Row( Row(
children: <Widget>[ children: <Widget>[
Column( Column(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.start,
MainAxisAlignment
.start,
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: padding: EdgeInsets.only(left: 12.0),
EdgeInsets.only(
left: 12.0),
child: Container( child: Container(
width: 60, width: 60,
height: 60, height: 60,
child: child: Image.asset(
Image.asset( model.filterData[index].gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png',
model.filterData[index] fit: BoxFit.cover,
.gender ==
1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit
.cover,
), ),
), ),
), ),
@ -243,118 +169,57 @@ class _DischargedPatientState extends State<DischargedPatient> {
), ),
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment
.start,
children: [ children: [
Container( Container(
child: RichText( child: RichText(
text: text: new TextSpan(
style: new TextStyle(fontSize: 2.0 * SizeConfig.textMultiplier!, color: Colors.black),
children: <TextSpan>[
new TextSpan(text: TranslationBase.of(context).fileNumber, style: TextStyle(fontSize: 14, fontFamily: 'Poppins')),
new TextSpan( new TextSpan(
style: new TextStyle( text: model.filterData[index].patientId.toString(),
fontSize: 2.0 * style: TextStyle(fontWeight: FontWeight.w700, fontFamily: 'Poppins', fontSize: 15)),
SizeConfig
.textMultiplier!,
color: Colors
.black),
children: <
TextSpan>[
new TextSpan(
text: TranslationBase.of(context)
.fileNumber,
style: TextStyle(
fontSize:
14,
fontFamily:
'Poppins')),
new TextSpan(
text: model
.filterData[
index]
.patientId
.toString(),
style: TextStyle(
fontWeight: FontWeight
.w700,
fontFamily:
'Poppins',
fontSize:
15)),
], ],
), ),
), ),
), ),
Container( Container(
child: RichText( child: RichText(
text: text: new TextSpan(
new TextSpan( style: new TextStyle(
style: fontSize: 2.0 * SizeConfig.textMultiplier!,
new TextStyle( color: Colors.black,
fontSize: 2.0 * fontFamily: 'Poppins',
SizeConfig
.textMultiplier!,
color: Colors
.black,
fontFamily:
'Poppins',
), ),
children: < children: <TextSpan>[
TextSpan>[
new TextSpan( new TextSpan(
text: model.filterData[index].admissionDate == text: model.filterData[index].admissionDate == null ? "" : TranslationBase.of(context).admissionDate + " : ",
null style: TextStyle(fontSize: 14)),
? ""
: TranslationBase.of(context).admissionDate +
" : ",
style: TextStyle(
fontSize:
14)),
new TextSpan( new TextSpan(
text: model.filterData[index].admissionDate == text: model.filterData[index].admissionDate == null
null
? "" ? ""
: "${AppDateUtils.convertDateFromServerFormat(model.filterData[index].admissionDate.toString(), 'yyyy-MM-dd')}", : "${AppDateUtils.convertDateFromServerFormat(model.filterData[index].admissionDate.toString(), 'yyyy-MM-dd')}",
style: TextStyle( style: TextStyle(fontWeight: FontWeight.w700, fontSize: 15)),
fontWeight:
FontWeight.w700,
fontSize: 15)),
], ],
), ),
), ),
), ),
Container( Container(
child: RichText( child: RichText(
text: text: new TextSpan(
new TextSpan( style: new TextStyle(
style: fontSize: 2.0 * SizeConfig.textMultiplier!,
new TextStyle( color: Colors.black,
fontSize: 2.0 * fontFamily: 'Poppins',
SizeConfig
.textMultiplier!,
color: Colors
.black,
fontFamily:
'Poppins',
), ),
children: < children: <TextSpan>[
TextSpan>[ new TextSpan(text: model.filterData[index].dischargeDate == null ? "" : "Discharge Date : ", style: TextStyle(fontSize: 14)),
new TextSpan(
text: model.filterData[index].dischargeDate ==
null
? ""
: "Discharge Date : ",
style: TextStyle(
fontSize:
14)),
new TextSpan( new TextSpan(
text: model.filterData[index].dischargeDate == text: model.filterData[index].dischargeDate == null
null
? "" ? ""
: "${AppDateUtils.convertDateFromServerFormat(model.filterData[index].dischargeDate.toString(), 'yyyy-MM-dd')}", : "${AppDateUtils.convertDateFromServerFormat(model.filterData[index].dischargeDate.toString(), 'yyyy-MM-dd')}",
style: TextStyle( style: TextStyle(fontWeight: FontWeight.w700, fontSize: 15)),
fontWeight:
FontWeight.w700,
fontSize: 15)),
], ],
), ),
), ),
@ -364,17 +229,12 @@ class _DischargedPatientState extends State<DischargedPatient> {
AppText( AppText(
"${TranslationBase.of(context).numOfDays}: ", "${TranslationBase.of(context).numOfDays}: ",
fontSize: 14, fontSize: 14,
fontWeight: fontWeight: FontWeight.w300,
FontWeight
.w300,
), ),
AppText( AppText(
"${AppDateUtils.convertStringToDate(model.filterData[index].dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate!)).inDays + 1}", "${AppDateUtils.convertStringToDate(model.filterData[index].dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate!)).inDays + 1}",
fontSize: fontSize: 15,
15, fontWeight: FontWeight.w700),
fontWeight:
FontWeight
.w700),
], ],
), ),
], ],

@ -135,7 +135,7 @@ class _InPatientListPageState extends State<InPatientListPage> {
isSortDes = !isSortDes; isSortDes = !isSortDes;
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
}, },
), ), onFieldSubmitted: (){},
), ),
widget.patientSearchViewModel!.state == ViewState.Idle widget.patientSearchViewModel!.state == ViewState.Idle
? (widget.isMyInPatient && widget.patientSearchViewModel!.myIinPatientList.length > 0) ? (widget.isMyInPatient && widget.patientSearchViewModel!.myIinPatientList.length > 0)

@ -191,7 +191,7 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
model.sortOutPatient(isDes: isSortDes); model.sortOutPatient(isDes: isSortDes);
isSortDes = !isSortDes; isSortDes = !isSortDes;
}, },
), ), onFieldSubmitted: (){},
), ),
Expanded( Expanded(
child: Container( child: Container(

@ -1,10 +1,10 @@
import 'package:doctor_app_flutter/core/enum/patient_type.dart'; import 'package:doctor_app_flutter/core/enum/patient_type.dart';
import 'package:doctor_app_flutter/core/model/patient/patient_model.dart';
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.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/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/core/model/patient/patient_model.dart';
import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
@ -91,7 +91,7 @@ class _PatientsSearchResultScreenState
), ),
iconSize: 20, onPressed: () { }, iconSize: 20, onPressed: () { },
// padding: EdgeInsets.only(bottom: 30), // padding: EdgeInsets.only(bottom: 30),
), ), onFieldSubmitted: (){},
), ),
SizedBox( SizedBox(
height: 10.0, height: 10.0,

@ -11,7 +11,6 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_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/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_field_custom_serach.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_field_custom_serach.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
@ -45,48 +44,37 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
child: Center( child: Center(
child: Column( child: Column(
children: [ children: [
BottomSheetTitle( BottomSheetTitle(title: TranslationBase.of(context).searchPatient),
title: TranslationBase.of(context).searchPatient),
FractionallySizedBox( FractionallySizedBox(
// widthFactor: 0.9, // widthFactor: 0.9,
child: Container( child: Container(
color: Theme.of(context).scaffoldBackgroundColor, color: Theme.of(context).scaffoldBackgroundColor,
child: Column( child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
crossAxisAlignment: CrossAxisAlignment.start, SizedBox(
children: [ height: 16,
SizedBox( ),
height: 16, SizedBox(
), height: 10,
SizedBox( ),
height: 10, AppTextFieldCustomSearch(
), searchController: patientFileInfoController,
AppTextFieldCustomSearch( onChangeFun: (value) {},
searchController: patientFileInfoController, marginTop: 5,
onChangeFun: (value) {}, inputFormatters: [FilteringTextInputFormatter.allow(RegExp(ONLY_NUMBERS))],
marginTop: 5, inputType: TextInputType.number,
inputFormatters: [ validationError: (isFormSubmitted &&
FilteringTextInputFormatter.allow( (patientFileInfoController.text.isEmpty && firstNameInfoController.text.isEmpty && middleNameInfoController.text.isEmpty && lastNameFileInfoController.text.isEmpty))
RegExp(ONLY_NUMBERS)) ? TranslationBase.of(context).emptyMessage
], : "",
inputType: TextInputType.number, onFieldSubmitted: () {},
validationError: (isFormSubmitted && ),
(patientFileInfoController.text.isEmpty && SizedBox(
firstNameInfoController height: 5,
.text.isEmpty && ),
middleNameInfoController SizedBox(
.text.isEmpty && height: MediaQuery.of(context).size.height * 0.12,
lastNameFileInfoController ),
.text.isEmpty)) ])),
? TranslationBase.of(context).emptyMessage
: "",
),
SizedBox(
height: 5,
),
SizedBox(
height: MediaQuery.of(context).size.height * 0.12,
),
])),
), ),
], ],
), ),
@ -137,52 +125,31 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
setState(() { setState(() {
isFormSubmitted = true; isFormSubmitted = true;
}); });
PatientSearchRequestModel patientSearchRequestModel = PatientSearchRequestModel patientSearchRequestModel = PatientSearchRequestModel(doctorID: authenticationViewModel.doctorProfile!.doctorID);
PatientSearchRequestModel(
doctorID: authenticationViewModel.doctorProfile!.doctorID);
if (showOther) { if (showOther) {
patientSearchRequestModel.firstName = patientSearchRequestModel.firstName = firstNameInfoController.text.trim().isEmpty ? "0" : firstNameInfoController.text.trim();
firstNameInfoController.text.trim().isEmpty patientSearchRequestModel.middleName = middleNameInfoController.text.trim().isEmpty ? "0" : middleNameInfoController.text.trim();
? "0" patientSearchRequestModel.lastName = lastNameFileInfoController.text.isEmpty ? "0" : lastNameFileInfoController.text.trim();
: firstNameInfoController.text.trim();
patientSearchRequestModel.middleName =
middleNameInfoController.text.trim().isEmpty
? "0"
: middleNameInfoController.text.trim();
patientSearchRequestModel.lastName =
lastNameFileInfoController.text.isEmpty
? "0"
: lastNameFileInfoController.text.trim();
} }
if (patientFileInfoController.text.isNotEmpty) { if (patientFileInfoController.text.isNotEmpty) {
if (patientFileInfoController.text.length == 10 && if (patientFileInfoController.text.length == 10 && (patientFileInfoController.text[0] == '2' || patientFileInfoController.text[0] == '1')) {
(patientFileInfoController.text[0] == '2' || patientSearchRequestModel.identificationNo = patientFileInfoController.text;
patientFileInfoController.text[0] == '1')) {
patientSearchRequestModel.identificationNo =
patientFileInfoController.text;
patientSearchRequestModel.searchType = 2; patientSearchRequestModel.searchType = 2;
patientSearchRequestModel.patientID = 0; patientSearchRequestModel.patientID = 0;
} else if ((patientFileInfoController.text.length == 10 || } else if ((patientFileInfoController.text.length == 10 || patientFileInfoController.text.length == 9) &&
patientFileInfoController.text.length == 9) && ((patientFileInfoController.text[0] == '0' && patientFileInfoController.text[1] == '5') || patientFileInfoController.text[0] == '5')) {
((patientFileInfoController.text[0] == '0' &&
patientFileInfoController.text[1] == '5') ||
patientFileInfoController.text[0] == '5')) {
patientSearchRequestModel.mobileNo = patientFileInfoController.text; patientSearchRequestModel.mobileNo = patientFileInfoController.text;
patientSearchRequestModel.searchType = 0; patientSearchRequestModel.searchType = 0;
} else { } else {
patientSearchRequestModel.patientID = patientSearchRequestModel.patientID = int.parse(patientFileInfoController.text);
int.parse(patientFileInfoController.text);
patientSearchRequestModel.searchType = 1; patientSearchRequestModel.searchType = 1;
} }
} }
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (patientFileInfoController.text.isNotEmpty || if (patientFileInfoController.text.isNotEmpty || firstNameInfoController.text.isNotEmpty || middleNameInfoController.text.isNotEmpty || lastNameFileInfoController.text.isNotEmpty) {
firstNameInfoController.text.isNotEmpty ||
middleNameInfoController.text.isNotEmpty ||
lastNameFileInfoController.text.isNotEmpty) {
setState(() { setState(() {
isFormSubmitted = false; isFormSubmitted = false;
}); });
@ -192,8 +159,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
builder: (BuildContext context) => PatientsSearchResultScreen( builder: (BuildContext context) => PatientsSearchResultScreen(
selectedPatientType: selectedPatientType, selectedPatientType: selectedPatientType,
patientSearchRequestModel: patientSearchRequestModel, patientSearchRequestModel: patientSearchRequestModel,
isSearchWithKeyInfo: isSearchWithKeyInfo: patientFileInfoController.text.isNotEmpty ? true : false,
patientFileInfoController.text.isNotEmpty ? true : false,
isSearch: true, isSearch: true,
isSearchAndOut: true, isSearchAndOut: true,
searchKey: patientFileInfoController.text, searchKey: patientFileInfoController.text,

@ -10,7 +10,6 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class UCAFInputScreen extends StatefulWidget { class UCAFInputScreen extends StatefulWidget {
final PatiantInformtion patient; final PatiantInformtion patient;
@ -67,17 +66,14 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: false,
body: model.patientVitalSignsHistory != null && body: model.patientVitalSignsHistory != null && model.patientVitalSignsHistory.length > 0 && model.patientChiefComplaintList != null && model.patientChiefComplaintList.length > 0
model.patientVitalSignsHistory.length > 0 &&
model.patientChiefComplaintList != null &&
model.patientChiefComplaintList.length > 0
? Column( ? Column(
children: [ children: [
Expanded( Expanded(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Center( child: Center(
child: FractionallySizedBox( child: FractionallySizedBox(
widthFactor: .9, widthFactor: .9,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
@ -98,8 +94,7 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
), ),
AppText( AppText(
"BP (H/L)", "BP (H/L)",
fontSize: fontSize: SizeConfig.textMultiplier! * 1.8,
SizeConfig.textMultiplier! * 1.8,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
), ),
@ -108,21 +103,18 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
), ),
AppText( AppText(
"${model.bloodPressure}", "${model.bloodPressure}",
fontSize: fontSize: SizeConfig.textMultiplier! * 2,
SizeConfig.textMultiplier! * 2,
color: Colors.grey.shade800, color: Colors.grey.shade800,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
], ],
), ),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
"${TranslationBase.of(context).temperature}", "${TranslationBase.of(context).temperature}",
fontSize: fontSize: SizeConfig.textMultiplier! * 1.8,
SizeConfig.textMultiplier! * 1.8,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
), ),
@ -132,8 +124,7 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
Expanded( Expanded(
child: AppText( child: AppText(
"${model.temperatureCelcius}(C), ${(double.parse(model.temperatureCelcius) * (9 / 5) + 32).toStringAsFixed(2)}(F)", "${model.temperatureCelcius}(C), ${(double.parse(model.temperatureCelcius) * (9 / 5) + 32).toStringAsFixed(2)}(F)",
fontSize: fontSize: SizeConfig.textMultiplier! * 2,
SizeConfig.textMultiplier! * 2,
color: Colors.grey.shade800, color: Colors.grey.shade800,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
@ -147,8 +138,7 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
children: [ children: [
AppText( AppText(
"${TranslationBase.of(context).pulseBeats}:", "${TranslationBase.of(context).pulseBeats}:",
fontSize: fontSize: SizeConfig.textMultiplier! * 1.8,
SizeConfig.textMultiplier! * 1.8,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
), ),
@ -157,8 +147,7 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
), ),
AppText( AppText(
"${model.hartRat}", "${model.hartRat}",
fontSize: fontSize: SizeConfig.textMultiplier! * 2,
SizeConfig.textMultiplier! * 2,
color: Colors.grey.shade800, color: Colors.grey.shade800,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
@ -168,8 +157,7 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
height: 20, height: 20,
), ),
AppText( AppText(
Utils.convertToTitleCase(TranslationBase.of(context) Utils.convertToTitleCase(TranslationBase.of(context).chiefComplaintsAndSymptoms),
.chiefComplaintsAndSymptoms),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier! * 2.2, fontSize: SizeConfig.textMultiplier! * 2.2,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
@ -179,16 +167,16 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
height: 10, height: 10,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: hintText: TranslationBase.of(context).instruction,
TranslationBase.of(context).instruction, dropDownText: Utils.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint! + '\n'),
dropDownText: Utils.parseHtmlString(model
.patientChiefComplaintList[0]
.chiefComplaint! + '\n'),
controller: _additionalComplaintsController, controller: _additionalComplaintsController,
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
enabled: false, enabled: false,
minLines: 1, minLines: 1,
maxLines: 20, maxLines: 20,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 8, height: 8,
@ -201,12 +189,10 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
), ),
], ],
) )
: model.patientChiefComplaintList != null || : model.patientChiefComplaintList != null || model.patientVitalSignsHistory != null
model.patientVitalSignsHistory != null
? Center( ? Center(
child: ErrorMessage( child: ErrorMessage(
error: model.patientVitalSignsHistory == null || error: model.patientVitalSignsHistory == null || model.patientVitalSignsHistory.length == 0
model.patientVitalSignsHistory.length == 0
? TranslationBase.of(context).vitalSignEmptyMsg ? TranslationBase.of(context).vitalSignEmptyMsg
: TranslationBase.of(context).chiefComplaintEmptyMsg)) : TranslationBase.of(context).chiefComplaintEmptyMsg))
: Container(), : Container(),

@ -1,11 +1,11 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart'; import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
@ -19,9 +19,9 @@ import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dar
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../../../routes.dart'; import '../../../../routes.dart';
class AdmissionRequestFirstScreen extends StatefulWidget { class AdmissionRequestFirstScreen extends StatefulWidget {
@ -135,6 +135,8 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
DrAppToastMsg.showErrorToast("Empty List"); DrAppToastMsg.showErrorToast("Empty List");
} }
}, },
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 20, height: 20,
@ -171,6 +173,8 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
} }
} }
: () {}, : () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 16, height: 16,
@ -229,6 +233,9 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
maxLines: 4, maxLines: 4,
validationError: sickLeaveCommentError, validationError: sickLeaveCommentError,
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -263,6 +270,8 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
DrAppToastMsg.showErrorToast("Empty List"); DrAppToastMsg.showErrorToast("Empty List");
} }
}, },
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -273,6 +282,9 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
minLines: 4, minLines: 4,
maxLines: 6, maxLines: 6,
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -284,6 +296,9 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
maxLines: 6, maxLines: 6,
validationError: medicalHistoryError, validationError: medicalHistoryError,
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -295,6 +310,9 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestFirstScree
maxLines: 4, maxLines: 4,
validationError: surgicalHistoryError, validationError: surgicalHistoryError,
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 100, height: 100,

@ -3,11 +3,11 @@ import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart'; import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
@ -126,6 +126,9 @@ class _AdmissionRequestSecondScreenState extends State<AdmissionRequestSecondScr
validationError: costError, validationError: costError,
inputType: TextInputType.number, inputType: TextInputType.number,
inputFormatters: [FilteringTextInputFormatter.allow(RegExp(ONLY_NUMBERS))], inputFormatters: [FilteringTextInputFormatter.allow(RegExp(ONLY_NUMBERS))],
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -137,6 +140,9 @@ class _AdmissionRequestSecondScreenState extends State<AdmissionRequestSecondScr
validationError: plansError, validationError: plansError,
minLines: 4, minLines: 4,
maxLines: 6, maxLines: 6,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -148,6 +154,9 @@ class _AdmissionRequestSecondScreenState extends State<AdmissionRequestSecondScr
validationError: otherInterventionsError, validationError: otherInterventionsError,
minLines: 2, minLines: 2,
maxLines: 4, maxLines: 4,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -172,6 +181,9 @@ class _AdmissionRequestSecondScreenState extends State<AdmissionRequestSecondScr
RegExp(ONLY_NUMBERS), RegExp(ONLY_NUMBERS),
) )
], ],
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -200,6 +212,8 @@ class _AdmissionRequestSecondScreenState extends State<AdmissionRequestSecondScr
}); });
}); });
}, },
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -234,6 +248,8 @@ class _AdmissionRequestSecondScreenState extends State<AdmissionRequestSecondScr
DrAppToastMsg.showErrorToast("Empty List"); DrAppToastMsg.showErrorToast("Empty List");
} }
}, },
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -267,6 +283,8 @@ class _AdmissionRequestSecondScreenState extends State<AdmissionRequestSecondScr
DrAppToastMsg.showErrorToast("Empty List"); DrAppToastMsg.showErrorToast("Empty List");
} }
}, },
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -301,6 +319,8 @@ class _AdmissionRequestSecondScreenState extends State<AdmissionRequestSecondScr
DrAppToastMsg.showErrorToast("Empty List"); DrAppToastMsg.showErrorToast("Empty List");
} }
}, },
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -312,6 +332,9 @@ class _AdmissionRequestSecondScreenState extends State<AdmissionRequestSecondScr
validationError: treatmentsError, validationError: treatmentsError,
minLines: 3, minLines: 3,
maxLines: 5, maxLines: 5,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -323,6 +346,9 @@ class _AdmissionRequestSecondScreenState extends State<AdmissionRequestSecondScr
validationError: complicationsError, validationError: complicationsError,
minLines: 3, minLines: 3,
maxLines: 5, maxLines: 5,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -334,6 +360,9 @@ class _AdmissionRequestSecondScreenState extends State<AdmissionRequestSecondScr
validationError: proceduresError, validationError: proceduresError,
minLines: 3, minLines: 3,
maxLines: 5, maxLines: 5,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -368,6 +397,8 @@ class _AdmissionRequestSecondScreenState extends State<AdmissionRequestSecondScr
DrAppToastMsg.showErrorToast("Empty List"); DrAppToastMsg.showErrorToast("Empty List");
} }
}, },
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 100, height: 100,

@ -2,11 +2,11 @@ import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart'; import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
@ -120,6 +120,8 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestThirdScree
DrAppToastMsg.showErrorToast("Empty List"); DrAppToastMsg.showErrorToast("Empty List");
} }
}, },
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -154,6 +156,8 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestThirdScree
DrAppToastMsg.showErrorToast("Empty List"); DrAppToastMsg.showErrorToast("Empty List");
} }
}, },
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -188,6 +192,8 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestThirdScree
DrAppToastMsg.showErrorToast("Empty List"); DrAppToastMsg.showErrorToast("Empty List");
} }
}, },
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,

@ -14,8 +14,8 @@ 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/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_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/loader/gif_loader_dialog_utils.dart';
@ -26,6 +26,7 @@ import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_recognition_error.dart';
import 'package:speech_to_text/speech_to_text.dart' as stt; import 'package:speech_to_text/speech_to_text.dart' as stt;
import '../../../../../widgets/shared/dialogs/dailog-list-select.dart'; import '../../../../../widgets/shared/dialogs/dailog-list-select.dart';
import '../../../../base/base_view.dart'; import '../../../../base/base_view.dart';
@ -138,7 +139,8 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
} }
: null, : null,
child: AppTextFieldCustom( child: AppTextFieldCustom(
hintText: TranslationBase.of(context).selectCondition, //'Select Condition', hintText: TranslationBase.of(context).selectCondition,
//'Select Condition',
dropDownText: model.stpMasterList.length == 1 dropDownText: model.stpMasterList.length == 1
? model.stpMasterList[0]['Description'] ? model.stpMasterList[0]['Description']
: selectValue == null : selectValue == null
@ -146,6 +148,9 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
: selectValue['Description'], : selectValue['Description'],
enabled: false, enabled: false,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
), ),
), ),
@ -171,6 +176,9 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: progressNoteController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError: progressNoteController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
Positioned( Positioned(
top: -2, top: -2,

@ -1,18 +1,18 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/profile/operation_report_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/model/operation_report/create_update_operation_report_request_model.dart'; import 'package:doctor_app_flutter/core/model/operation_report/create_update_operation_report_request_model.dart';
import 'package:doctor_app_flutter/core/model/operation_report/get_operation_details_response_modle.dart'; import 'package:doctor_app_flutter/core/model/operation_report/get_operation_details_response_modle.dart';
import 'package:doctor_app_flutter/core/model/operation_report/get_reservations_response_model.dart'; import 'package:doctor_app_flutter/core/model/operation_report/get_reservations_response_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/profile/operation_report_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_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/loader/gif_loader_dialog_utils.dart';
@ -144,6 +144,9 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
minLines: 1, minLines: 1,
enabled: false, enabled: false,
hasBorder: true, hasBorder: true,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 4, height: 4,
@ -156,6 +159,9 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: preOpDiagmosisController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError: preOpDiagmosisController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 4, height: 4,
@ -168,6 +174,9 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: postOpDiagmosisNoteController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError: postOpDiagmosisNoteController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 4, height: 4,
@ -180,6 +189,9 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: surgeonController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError: surgeonController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 4, height: 4,
@ -193,6 +205,9 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: assistantNoteController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError: assistantNoteController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 4, height: 4,
@ -206,6 +221,9 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: operationController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError: operationController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 4, height: 4,
@ -220,6 +238,9 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: inasionController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError: inasionController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 4, height: 4,
@ -233,6 +254,9 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: findingController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError: findingController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 4, height: 4,
@ -246,6 +270,9 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: surgeryProcedureController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError: surgeryProcedureController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 4, height: 4,
@ -259,6 +286,9 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: postOpInstructionController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError: postOpInstructionController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 4, height: 4,
@ -271,6 +301,9 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: complicationDetailsController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError: complicationDetailsController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 4, height: 4,
@ -284,6 +317,9 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: bloodLossDetailController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError: bloodLossDetailController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 4, height: 4,
@ -297,6 +333,9 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: histopathSpecimenController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError: histopathSpecimenController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 4, height: 4,
@ -310,6 +349,9 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: microbiologySpecimenController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError: microbiologySpecimenController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 4, height: 4,
@ -323,6 +365,9 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: otherSpecimenController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError: otherSpecimenController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 4, height: 4,
@ -336,6 +381,9 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: scrubNurseController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError: scrubNurseController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 4, height: 4,
@ -349,6 +397,9 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: circulatingNurseController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError: circulatingNurseController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 4, height: 4,
@ -362,6 +413,9 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: BloodTransfusedDetailController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError: BloodTransfusedDetailController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 4, height: 4,
@ -375,6 +429,9 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,
validationError: anasthetistController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", validationError: anasthetistController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 250, height: 250,

@ -1,17 +1,17 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/bottom_sheet/custom_bottom_sheet_container.dart'; import 'package:doctor_app_flutter/widgets/bottom_sheet/custom_bottom_sheet_container.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart'; import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_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/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
@ -20,7 +20,6 @@ import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils
import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart'; import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_recognition_error.dart';
@ -227,6 +226,8 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
); );
} }
: () {}, : () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -265,6 +266,8 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
); );
} }
: () {}, : () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -304,6 +307,8 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
); );
} }
: () {}, : () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -345,6 +350,8 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
DrAppToastMsg.showErrorToast("There is no doctors for this clinic"); DrAppToastMsg.showErrorToast("There is no doctors for this clinic");
} }
}, },
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -378,6 +385,8 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
}, },
); );
}, },
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -422,6 +431,8 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
}, },
); );
}, },
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -430,6 +441,9 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
hintText: TranslationBase.of(context).ext, hintText: TranslationBase.of(context).ext,
controller: _extController, controller: _extController,
inputType: TextInputType.text, inputType: TextInputType.text,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -443,6 +457,9 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
minLines: 4, minLines: 4,
maxLines: 6, maxLines: 6,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
Positioned( Positioned(
top: 0, top: 0,

@ -1,8 +1,8 @@
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
@ -16,7 +16,6 @@ import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dar
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class PatientMakeReferralScreen extends StatefulWidget { class PatientMakeReferralScreen extends StatefulWidget {
// previous design page is: ReferPatientScreen // previous design page is: ReferPatientScreen
@ -212,6 +211,8 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
); );
} }
: () {}, : () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -250,6 +251,8 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
); );
} }
: () {}, : () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -289,6 +292,8 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
); );
} }
: () {}, : () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -330,6 +335,8 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
DrAppToastMsg.showErrorToast("There is no doctors for this clinic"); DrAppToastMsg.showErrorToast("There is no doctors for this clinic");
} }
}, },
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -350,6 +357,8 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
onClick: () { onClick: () {
_selectDate(context, model); _selectDate(context, model);
}, },
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -360,6 +369,9 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
minLines: 4, minLines: 4,
maxLines: 6, maxLines: 6,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
], ],
), ),

@ -9,8 +9,8 @@ import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_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/loader/gif_loader_dialog_utils.dart';
@ -27,21 +27,13 @@ class AddReplayOnReferralPatient extends StatefulWidget {
final AddReferredRemarksRequestModel? myReferralInPatientRequestModel; final AddReferredRemarksRequestModel? myReferralInPatientRequestModel;
final bool isEdited; final bool isEdited;
const AddReplayOnReferralPatient( const AddReplayOnReferralPatient({Key? key, this.patientReferralViewModel, this.myReferralInPatientModel, this.isEdited = false, this.myReferralInPatientRequestModel}) : super(key: key);
{Key? key,
this.patientReferralViewModel,
this.myReferralInPatientModel,
this.isEdited = false,
this.myReferralInPatientRequestModel})
: super(key: key);
@override @override
_AddReplayOnReferralPatientState createState() => _AddReplayOnReferralPatientState createState() => _AddReplayOnReferralPatientState();
_AddReplayOnReferralPatientState();
} }
class _AddReplayOnReferralPatientState class _AddReplayOnReferralPatientState extends State<AddReplayOnReferralPatient> {
extends State<AddReplayOnReferralPatient> {
bool isSubmitted = false; bool isSubmitted = false;
int replay = 1; int replay = 1;
int reject = 2; int reject = 2;
@ -54,8 +46,7 @@ class _AddReplayOnReferralPatientState
void initState() { void initState() {
requestPermissions(); requestPermissions();
super.initState(); super.initState();
replayOnReferralController.text = replayOnReferralController.text = widget.myReferralInPatientModel!.referredDoctorRemarks ?? "";
widget.myReferralInPatientModel!.referredDoctorRemarks ?? "";
} }
@override @override
@ -87,11 +78,10 @@ class _AddReplayOnReferralPatientState
maxLines: 35, maxLines: 35,
minLines: 25, minLines: 25,
hasBorder: true, hasBorder: true,
validationError: replayOnReferralController validationError: replayOnReferralController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
.text.isEmpty && onClick: () {},
isSubmitted onChanged: (value) {},
? TranslationBase.of(context).emptyMessage onFieldSubmitted: () {},
: "",
), ),
Positioned( Positioned(
top: 0, top: 0,
@ -149,25 +139,17 @@ class _AddReplayOnReferralPatientState
); );
if (replayOnReferralController.text.isNotEmpty) { if (replayOnReferralController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await widget.patientReferralViewModel await widget.patientReferralViewModel!.replayReferred(replayOnReferralController.text.trim(), widget.myReferralInPatientModel!, reject);
!.replayReferred( if (widget.patientReferralViewModel!.state == ViewState.ErrorLocal) {
replayOnReferralController.text.trim(), Utils.showErrorToast(widget.patientReferralViewModel!.error);
widget.myReferralInPatientModel!,
reject);
if (widget.patientReferralViewModel!.state ==
ViewState.ErrorLocal) {
Utils.showErrorToast(
widget.patientReferralViewModel!.error);
} else { } else {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
DrAppToastMsg.showSuccesToast( DrAppToastMsg.showSuccesToast("Has been rejected");
"Has been rejected");
Navigator.of(context).pop(); Navigator.of(context).pop();
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
} else { } else {
Utils.showErrorToast( Utils.showErrorToast("You can't add empty reply");
"You can't add empty reply");
setState(() { setState(() {
isSubmitted = false; isSubmitted = false;
}); });
@ -189,25 +171,17 @@ class _AddReplayOnReferralPatientState
}); });
if (replayOnReferralController.text.isNotEmpty) { if (replayOnReferralController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await widget.patientReferralViewModel await widget.patientReferralViewModel!.replayReferred(replayOnReferralController.text.trim(), widget.myReferralInPatientModel!, replay);
!.replayReferred( if (widget.patientReferralViewModel!.state == ViewState.ErrorLocal) {
replayOnReferralController.text.trim(), Utils.showErrorToast(widget.patientReferralViewModel!.error);
widget.myReferralInPatientModel!,
replay);
if (widget.patientReferralViewModel!.state ==
ViewState.ErrorLocal) {
Utils.showErrorToast(
widget.patientReferralViewModel!.error);
} else { } else {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
DrAppToastMsg.showSuccesToast( DrAppToastMsg.showSuccesToast("Your Reply Added Successfully");
"Your Reply Added Successfully");
Navigator.of(context).pop(); Navigator.of(context).pop();
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
} else { } else {
Utils.showErrorToast( Utils.showErrorToast("You can't add empty reply");
"You can't add empty reply");
setState(() { setState(() {
isSubmitted = false; isSubmitted = false;
}); });
@ -232,8 +206,7 @@ class _AddReplayOnReferralPatientState
onVoiceText() async { onVoiceText() async {
new SpeechToText(context: context).showAlertDialog(context); new SpeechToText(context: context).showAlertDialog(context);
var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode;
bool available = await speech.initialize( bool available = await speech.initialize(onStatus: statusListener, onError: errorListener);
onStatus: statusListener, onError: errorListener);
if (available) { if (available) {
speech.listen( speech.listen(
onResult: resultListener, onResult: resultListener,

@ -2,18 +2,18 @@ import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/patch_assessment_req_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/Assessment/patch_assessment_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/post_assessment_request_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/Assessment/post_assessment_request_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_assement.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_assement.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/bottom_sheet/custom_bottom_sheet_container.dart'; import 'package:doctor_app_flutter/widgets/bottom_sheet/custom_bottom_sheet_container.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_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/app_texts_widget.dart';
@ -119,6 +119,9 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
isTextFieldHasSuffix: false, isTextFieldHasSuffix: false,
enabled: false, enabled: false,
controller: appointmentIdController, controller: appointmentIdController,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
), ),
SizedBox( SizedBox(
@ -176,6 +179,8 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
), ),
onPressed: () {}, onPressed: () {},
), ),
onChanged: (value) {},
onFieldSubmitted: () {},
)), )),
), ),
if (widget.mySelectedAssessment!.selectedICD != null) if (widget.mySelectedAssessment!.selectedICD != null)
@ -233,6 +238,8 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
enabled: false, enabled: false,
hasBorder: true, hasBorder: true,
validationError: isFormSubmitted && widget.mySelectedAssessment!.selectedDiagnosisCondition == null ? TranslationBase.of(context).emptyMessage : "", validationError: isFormSubmitted && widget.mySelectedAssessment!.selectedDiagnosisCondition == null ? TranslationBase.of(context).emptyMessage : "",
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -269,6 +276,8 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
controller: typeController, controller: typeController,
hasBorder: true, hasBorder: true,
validationError: isFormSubmitted && widget.mySelectedAssessment!.selectedDiagnosisType == null ? TranslationBase.of(context).emptyMessage : "", validationError: isFormSubmitted && widget.mySelectedAssessment!.selectedDiagnosisType == null ? TranslationBase.of(context).emptyMessage : "",
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -284,6 +293,8 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
onChanged: (value) { onChanged: (value) {
widget.mySelectedAssessment!.remark = remarkController.text; widget.mySelectedAssessment!.remark = remarkController.text;
}, },
onClick: () {},
onFieldSubmitted: () {},
), ),
), ),
SizedBox( SizedBox(

@ -1,8 +1,8 @@
// ignore: must_be_immutable // ignore: must_be_immutable
import 'package:doctor_app_flutter/config/size_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/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';
@ -248,6 +248,8 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
onChanged: (value) { onChanged: (value) {
examination.remark = value; examination.remark = value;
}, },
onClick: () {},
onFieldSubmitted: () {},
), ),
), ),
], ],

@ -1,7 +1,7 @@
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -15,20 +15,13 @@ class ExaminationsListSearchWidget extends StatefulWidget {
final List<MasterKeyModel>? masterList; final List<MasterKeyModel>? masterList;
final List<MySelectedExamination>? mySelectedExamination; final List<MySelectedExamination>? mySelectedExamination;
ExaminationsListSearchWidget( ExaminationsListSearchWidget({this.removeExamination, this.addExamination, this.isServiceSelected, this.masterList, this.mySelectedExamination});
{this.removeExamination,
this.addExamination,
this.isServiceSelected,
this.masterList,
this.mySelectedExamination});
@override @override
_ExaminationsListSearchWidgetState createState() => _ExaminationsListSearchWidgetState createState() => _ExaminationsListSearchWidgetState();
_ExaminationsListSearchWidgetState();
} }
class _ExaminationsListSearchWidgetState class _ExaminationsListSearchWidgetState extends State<ExaminationsListSearchWidget> {
extends State<ExaminationsListSearchWidget> {
int expandedIndex = -1; int expandedIndex = -1;
List<MasterKeyModel> items = []; List<MasterKeyModel> items = [];
TextEditingController filteredSearchController = TextEditingController(); TextEditingController filteredSearchController = TextEditingController();
@ -50,13 +43,17 @@ class _ExaminationsListSearchWidgetState
hasBorder: false, hasBorder: false,
controller: filteredSearchController, controller: filteredSearchController,
onChanged: (value) { onChanged: (value) {
filterSearchResults(value); if (value != null) filterSearchResults(value);
}, },
suffixIcon: IconButton( suffixIcon: IconButton(
icon: Icon( icon: Icon(
Icons.search, Icons.search,
color: Colors.black, color: Colors.black,
), onPressed: () { },), ),
onPressed: () {},
),
onClick: () {},
onFieldSubmitted: () {},
), ),
DividerWithSpacesAround( DividerWithSpacesAround(
height: 2, height: 2,
@ -90,8 +87,7 @@ class _ExaminationsListSearchWidgetState
if (query.isNotEmpty) { if (query.isNotEmpty) {
List<MasterKeyModel> dummyListData = []; List<MasterKeyModel> dummyListData = [];
dummySearchList.forEach((item) { dummySearchList.forEach((item) {
if (item.nameAr!.toLowerCase().contains(query.toLowerCase()) || if (item.nameAr!.toLowerCase().contains(query.toLowerCase()) || item.nameEn!.toLowerCase().contains(query.toLowerCase())) {
item.nameEn!.toLowerCase().contains(query.toLowerCase())) {
dummyListData.add(item); dummyListData.add(item);
} }
}); });

@ -4,15 +4,15 @@ import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/GetGetProgressNoteResModel.dart'; import 'package:doctor_app_flutter/core/model/SOAP/progress_note/GetGetProgressNoteResModel.dart';
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/get_progress_note_req_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/progress_note/get_progress_note_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/post_progress_note_request_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/progress_note/post_progress_note_request_model.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/plan/plan_call_back.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/plan/plan_call_back.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_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/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
@ -30,31 +30,20 @@ class UpdatePlanPage extends StatefulWidget {
final int? currentIndex; final int? currentIndex;
UpdatePlanPage( UpdatePlanPage({Key? key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, this.currentIndex, this.sOAPViewModel, this.changeStateFun});
{Key? key,
this.changePageViewIndex,
this.patientInfo,
this.changeLoadingState,
this.currentIndex,
this.sOAPViewModel,
this.changeStateFun});
@override @override
_UpdatePlanPageState createState() => _UpdatePlanPageState(); _UpdatePlanPageState createState() => _UpdatePlanPageState();
} }
class _UpdatePlanPageState extends State<UpdatePlanPage> class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack {
implements PlanCallBack {
bool isAddProgress = true; bool isAddProgress = true;
bool isProgressExpanded = true; bool isProgressExpanded = true;
GetPatientProgressNoteResModel patientProgressNote = GetPatientProgressNoteResModel patientProgressNote = GetPatientProgressNoteResModel();
GetPatientProgressNoteResModel();
TextEditingController progressNoteController = TextEditingController progressNoteController = TextEditingController(text: null);
TextEditingController(text: null);
BoxDecoration containerBorderDecoration( BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) {
Color containerColor, Color borderColor) {
return BoxDecoration( return BoxDecoration(
color: containerColor, color: containerColor,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
@ -76,35 +65,25 @@ class _UpdatePlanPageState extends State<UpdatePlanPage>
} }
} }
getPatientProgressNote(SOAPViewModel model, getPatientProgressNote(SOAPViewModel model, {bool isAddProgress = false}) async {
{bool isAddProgress = false}) async { GetProgressNoteReqModel getGetProgressNoteReqModel = GetProgressNoteReqModel(
GetProgressNoteReqModel getGetProgressNoteReqModel = appointmentNo: int.parse(widget.patientInfo!.appointmentNo.toString()),
GetProgressNoteReqModel( patientMRN: widget.patientInfo!.patientMRN,
appointmentNo: episodeID: widget.patientInfo!.episodeNo.toString(),
int.parse(widget.patientInfo!.appointmentNo.toString()), editedBy: '',
patientMRN: widget.patientInfo!.patientMRN, doctorID: '');
episodeID: widget.patientInfo!.episodeNo.toString(), await widget.sOAPViewModel!.getPatientProgressNote(getGetProgressNoteReqModel);
editedBy: '',
doctorID: '');
await widget.sOAPViewModel
!.getPatientProgressNote(getGetProgressNoteReqModel);
///TODO set progressNote in model; ///TODO set progressNote in model;
if (widget.sOAPViewModel!.patientProgressNoteList.isNotEmpty) { if (widget.sOAPViewModel!.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Utils.parseHtmlString( progressNoteController.text = Utils.parseHtmlString(widget.sOAPViewModel!.patientProgressNoteList[0].planNote!);
widget.sOAPViewModel!.patientProgressNoteList[0].planNote!);
patientProgressNote.planNote = progressNoteController.text; patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName = patientProgressNote.createdByName = widget.sOAPViewModel!.patientProgressNoteList[0].createdByName;
widget.sOAPViewModel!.patientProgressNoteList[0].createdByName; patientProgressNote.createdOn = widget.sOAPViewModel!.patientProgressNoteList[0].createdOn;
patientProgressNote.createdOn = patientProgressNote.editedOn = widget.sOAPViewModel!.patientProgressNoteList[0].editedOn;
widget.sOAPViewModel!.patientProgressNoteList[0].createdOn; patientProgressNote.editedByName = widget.sOAPViewModel!.patientProgressNoteList[0].editedByName;
patientProgressNote.editedOn = patientProgressNote.appointmentNo = widget.sOAPViewModel!.patientProgressNoteList[0].appointmentNo;
widget.sOAPViewModel!.patientProgressNoteList[0].editedOn;
patientProgressNote.editedByName =
widget.sOAPViewModel!.patientProgressNoteList[0].editedByName;
patientProgressNote.appointmentNo =
widget.sOAPViewModel!.patientProgressNoteList[0].appointmentNo;
setState(() { setState(() {
isAddProgress = isAddProgress; isAddProgress = isAddProgress;
widget.sOAPViewModel!.isAddProgress = isAddProgress; widget.sOAPViewModel!.isAddProgress = isAddProgress;
@ -118,31 +97,22 @@ class _UpdatePlanPageState extends State<UpdatePlanPage>
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
widget.sOAPViewModel!.setPlanCallBack(this); widget.sOAPViewModel!.setPlanCallBack(this);
GetProgressNoteReqModel getGetProgressNoteReqModel = GetProgressNoteReqModel getGetProgressNoteReqModel = GetProgressNoteReqModel(
GetProgressNoteReqModel( appointmentNo: int.parse(widget.patientInfo!.appointmentNo.toString()),
appointmentNo: patientMRN: widget.patientInfo!.patientMRN,
int.parse(widget.patientInfo!.appointmentNo.toString()), episodeID: widget.patientInfo!.episodeNo.toString(),
patientMRN: widget.patientInfo!.patientMRN, editedBy: '',
episodeID: widget.patientInfo!.episodeNo.toString(), doctorID: '');
editedBy: '', await widget.sOAPViewModel!.getPatientProgressNote(getGetProgressNoteReqModel);
doctorID: '');
await widget.sOAPViewModel
!.getPatientProgressNote(getGetProgressNoteReqModel);
if (widget.sOAPViewModel!.patientProgressNoteList.isNotEmpty) { if (widget.sOAPViewModel!.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Utils.parseHtmlString( progressNoteController.text = Utils.parseHtmlString(widget.sOAPViewModel!.patientProgressNoteList[0].planNote!);
widget.sOAPViewModel!.patientProgressNoteList[0].planNote!);
patientProgressNote.planNote = progressNoteController.text; patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName = patientProgressNote.createdByName = widget.sOAPViewModel!.patientProgressNoteList[0].createdByName;
widget.sOAPViewModel!.patientProgressNoteList[0].createdByName; patientProgressNote.createdOn = widget.sOAPViewModel!.patientProgressNoteList[0].createdOn;
patientProgressNote.createdOn = patientProgressNote.editedOn = widget.sOAPViewModel!.patientProgressNoteList[0].editedOn;
widget.sOAPViewModel!.patientProgressNoteList[0].createdOn; patientProgressNote.editedByName = widget.sOAPViewModel!.patientProgressNoteList[0].editedByName;
patientProgressNote.editedOn = patientProgressNote.appointmentNo = widget.sOAPViewModel!.patientProgressNoteList[0].appointmentNo;
widget.sOAPViewModel!.patientProgressNoteList[0].editedOn;
patientProgressNote.editedByName =
widget.sOAPViewModel!.patientProgressNoteList[0].editedByName;
patientProgressNote.appointmentNo =
widget.sOAPViewModel!.patientProgressNoteList[0].appointmentNo;
widget.sOAPViewModel!.progressNoteText = progressNoteController.text; widget.sOAPViewModel!.progressNoteText = progressNoteController.text;
setState(() { setState(() {
@ -185,95 +155,70 @@ class _UpdatePlanPageState extends State<UpdatePlanPage>
children: [ children: [
if (isAddProgress) if (isAddProgress)
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 10, right: 10, top: 15),
left: 10, right: 10, top: 15),
child: AppTextFieldCustom( child: AppTextFieldCustom(
hintText: TranslationBase.of(context) hintText: TranslationBase.of(context).progressNote,
.progressNote,
controller: progressNoteController, controller: progressNoteController,
minLines: 2, minLines: 2,
maxLines: 4, maxLines: 4,
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
onChanged: (value) { onChanged: (value) {
setState(() { if (value != null)
patientProgressNote.planNote = setState(() {
value; patientProgressNote.planNote = value;
model.progressNoteText = value; model.progressNoteText = value;
widget.changeStateFun!(); widget.changeStateFun!();
}); });
}, },
onClick: () {},
onFieldSubmitted: () {},
), ),
), ),
SizedBox( SizedBox(
height: 9, height: 9,
), ),
if (patientProgressNote.planNote != null && if (patientProgressNote.planNote != null && !isAddProgress)
!isAddProgress)
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: 5, left: 5,
right: 5, right: 5,
), ),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Row( Row(
children: [ children: [
AppText( AppText(
'Appointment No: ', 'Appointment No: ',
fontSize: SizeConfig fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
.getTextMultiplierBasedOnWidth() *
3,
letterSpacing: -0.4, letterSpacing: -0.4,
color: Color(0xFF575757), color: Color(0xFF575757),
), ),
AppText( AppText(
patientProgressNote patientProgressNote.appointmentNo != null ? patientProgressNote.appointmentNo.toString() : '',
.appointmentNo !=
null
? patientProgressNote
.appointmentNo
.toString()
: '',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.48, letterSpacing: -0.48,
color: Color(0xFF2B353E), color: Color(0xFF2B353E),
fontSize: SizeConfig fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6,
.getTextMultiplierBasedOnWidth() *
3.6,
), ),
], ],
), ),
AppText( AppText(
patientProgressNote.createdOn != patientProgressNote.createdOn != null
null ? AppDateUtils.getDayMonthYearDateFormatted(DateTime.parse(patientProgressNote.createdOn!))
? AppDateUtils : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()),
.getDayMonthYearDateFormatted(
DateTime.parse(
patientProgressNote
.createdOn!))
: AppDateUtils
.getDayMonthYearDateFormatted(
DateTime.now()),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: SizeConfig fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6,
.getTextMultiplierBasedOnWidth() *
3.6,
) )
], ],
), ),
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.end,
MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
// Row( // Row(
// children: [ // children: [
@ -288,19 +233,10 @@ class _UpdatePlanPageState extends State<UpdatePlanPage>
// ], // ],
// ), // ),
AppText( AppText(
patientProgressNote.createdOn != patientProgressNote.createdOn != null ? AppDateUtils.getHour(DateTime.parse(patientProgressNote.createdOn!)) : AppDateUtils.getHour(DateTime.now()),
null
? AppDateUtils.getHour(
DateTime.parse(
patientProgressNote
.createdOn!))
: AppDateUtils.getHour(
DateTime.now()),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Color(0xFF575757), color: Color(0xFF575757),
fontSize: SizeConfig fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6,
.getTextMultiplierBasedOnWidth() *
3.6,
) )
], ],
), ),
@ -308,8 +244,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage>
height: 8, height: 8,
), ),
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.start,
MainAxisAlignment.start,
children: [ children: [
Expanded( Expanded(
child: AppText( child: AppText(
@ -321,8 +256,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage>
onTap: () { onTap: () {
setState(() { setState(() {
isAddProgress = true; isAddProgress = true;
widget.sOAPViewModel widget.sOAPViewModel!.isAddProgress = true;
!.isAddProgress = true;
}); });
}, },
child: Icon( child: Icon(
@ -341,8 +275,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage>
isExpanded: isProgressExpanded, isExpanded: isProgressExpanded,
), ),
SizedBox( SizedBox(
height: SizeConfig.heightMultiplier! * height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 20 : 10),
(SizeConfig.isHeightVeryShort ? 20 : 10),
), ),
], ],
), ),
@ -355,53 +288,41 @@ class _UpdatePlanPageState extends State<UpdatePlanPage>
submitPlan(SOAPViewModel model) async { submitPlan(SOAPViewModel model) async {
if (progressNoteController.text.isNotEmpty) { if (progressNoteController.text.isNotEmpty) {
widget.changeLoadingState!(true); widget.changeLoadingState!(true);
PostProgressNoteRequestModel postProgressNoteRequestModel = PostProgressNoteRequestModel postProgressNoteRequestModel = new PostProgressNoteRequestModel(
new PostProgressNoteRequestModel( patientMRN: widget.patientInfo!.patientMRN,
patientMRN: widget.patientInfo!.patientMRN, episodeId: widget.patientInfo!.episodeNo!,
episodeId: widget.patientInfo!.episodeNo!, appointmentNo: widget.patientInfo!.appointmentNo,
appointmentNo: widget.patientInfo!.appointmentNo, planNote: patientProgressNote.planNote,
planNote: patientProgressNote.planNote, doctorID: '',
doctorID: '', editedBy: '');
editedBy: '');
if (widget.sOAPViewModel!.patientProgressNoteList.isEmpty) { if (widget.sOAPViewModel!.patientProgressNoteList.isEmpty) {
await widget.sOAPViewModel await widget.sOAPViewModel!.postProgressNote(postProgressNoteRequestModel);
! .postProgressNote(postProgressNoteRequestModel);
} else { } else {
Map<String, dynamic> profile = await sharedPref.getObj(DOCTOR_PROFILE); Map<String, dynamic> profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
postProgressNoteRequestModel.editedBy = doctorProfile.doctorID; postProgressNoteRequestModel.editedBy = doctorProfile.doctorID;
await widget.sOAPViewModel await widget.sOAPViewModel!.patchProgressNote(postProgressNoteRequestModel);
!.patchProgressNote(postProgressNoteRequestModel);
} }
if (widget.sOAPViewModel!.state == ViewState.ErrorLocal) { if (widget.sOAPViewModel!.state == ViewState.ErrorLocal) {
Utils.showErrorToast(widget.sOAPViewModel!.error); Utils.showErrorToast(widget.sOAPViewModel!.error);
} else { } else {
GetProgressNoteReqModel getGetProgressNoteReqModel = GetProgressNoteReqModel getGetProgressNoteReqModel = GetProgressNoteReqModel(
GetProgressNoteReqModel( appointmentNo: int.parse(widget.patientInfo!.appointmentNo.toString()),
appointmentNo: patientMRN: widget.patientInfo!.patientMRN,
int.parse(widget.patientInfo!.appointmentNo.toString()), episodeID: widget.patientInfo!.episodeNo.toString(),
patientMRN: widget.patientInfo!.patientMRN, editedBy: '',
episodeID: widget.patientInfo!.episodeNo.toString(), doctorID: '');
editedBy: '', await widget.sOAPViewModel!.getPatientProgressNote(getGetProgressNoteReqModel);
doctorID: '');
await widget.sOAPViewModel
!.getPatientProgressNote(getGetProgressNoteReqModel);
if (widget.sOAPViewModel!.patientProgressNoteList.isNotEmpty) { if (widget.sOAPViewModel!.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Utils.parseHtmlString( progressNoteController.text = Utils.parseHtmlString(widget.sOAPViewModel!.patientProgressNoteList[0].planNote!);
widget.sOAPViewModel!.patientProgressNoteList[0].planNote!);
patientProgressNote.planNote = progressNoteController.text; patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName = patientProgressNote.createdByName = widget.sOAPViewModel!.patientProgressNoteList[0].createdByName;
widget.sOAPViewModel!.patientProgressNoteList[0].createdByName; patientProgressNote.createdOn = widget.sOAPViewModel!.patientProgressNoteList[0].createdOn;
patientProgressNote.createdOn = patientProgressNote.editedOn = widget.sOAPViewModel!.patientProgressNoteList[0].editedOn;
widget.sOAPViewModel!.patientProgressNoteList[0].createdOn; patientProgressNote.editedByName = widget.sOAPViewModel!.patientProgressNoteList[0].editedByName;
patientProgressNote.editedOn = patientProgressNote.appointmentNo = widget.sOAPViewModel!.patientProgressNoteList[0].appointmentNo;
widget.sOAPViewModel!.patientProgressNoteList[0].editedOn;
patientProgressNote.editedByName =
widget.sOAPViewModel!.patientProgressNoteList[0].editedByName;
patientProgressNote.appointmentNo =
widget.sOAPViewModel!.patientProgressNoteList[0].appointmentNo;
setState(() { setState(() {
isAddProgress = false; isAddProgress = false;

@ -1,16 +1,15 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart';
import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart';
import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -132,9 +131,12 @@ class _AddAllergiesItemState extends State<AddAllergiesItem> {
maxLines: 1, maxLines: 1,
minLines: 1, minLines: 1,
height: Utils.getTextFieldHeight(), height: Utils.getTextFieldHeight(),
validationError: validationError: mySelectedAllergy != null && mySelectedAllergy.selectedAllergySeverity == null && mySelectedAllergy.hasValidationError!
mySelectedAllergy != null && mySelectedAllergy.selectedAllergySeverity == null && mySelectedAllergy.hasValidationError! ? TranslationBase.of(context).severityValidationError : "", ? TranslationBase.of(context).severityValidationError
: "",
controller: severityController, controller: severityController,
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -149,6 +151,8 @@ class _AddAllergiesItemState extends State<AddAllergiesItem> {
mySelectedAllergy.remark = value; mySelectedAllergy.remark = value;
}, },
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
onClick: () {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,

@ -1,11 +1,10 @@
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart';
import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'allergies_item.dart'; import 'allergies_item.dart';
@ -36,12 +35,10 @@ class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget {
: super(key: key); : super(key: key);
@override @override
_MasterKeyCheckboxSearchAllergiesWidgetState createState() => _MasterKeyCheckboxSearchAllergiesWidgetState createState() => _MasterKeyCheckboxSearchAllergiesWidgetState();
_MasterKeyCheckboxSearchAllergiesWidgetState();
} }
class _MasterKeyCheckboxSearchAllergiesWidgetState class _MasterKeyCheckboxSearchAllergiesWidgetState extends State<MasterKeyCheckboxSearchAllergiesWidget> {
extends State<MasterKeyCheckboxSearchAllergiesWidget> {
List<MasterKeyModel> items = []; List<MasterKeyModel> items = [];
TextEditingController filteredSearchController = TextEditingController(); TextEditingController filteredSearchController = TextEditingController();
@ -61,9 +58,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
height: Utils.getTextFieldHeight(), height: Utils.getTextFieldHeight(),
child: Center( child: Center(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column( child: Column(
children: [ children: [
AppTextFieldCustom( AppTextFieldCustom(
@ -72,13 +67,17 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
hasBorder: false, hasBorder: false,
controller: filteredSearchController, controller: filteredSearchController,
onChanged: (value) { onChanged: (value) {
filterSearchResults(value); if (value != null) filterSearchResults(value);
}, },
suffixIcon: IconButton( suffixIcon: IconButton(
icon: Icon( icon: Icon(
Icons.search, Icons.search,
color: Colors.black, color: Colors.black,
), onPressed: () { },), ),
onPressed: () {},
),
onClick: () {},
onFieldSubmitted: () {},
), ),
DividerWithSpacesAround(), DividerWithSpacesAround(),
SizedBox( SizedBox(
@ -88,8 +87,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
child: FractionallySizedBox( child: FractionallySizedBox(
widthFactor: 0.9, widthFactor: 0.9,
child: Container( child: Container(
height: height: MediaQuery.of(context).size.height * 0.60,
MediaQuery.of(context).size.height * 0.60,
child: ListView.builder( child: ListView.builder(
itemCount: items.length, itemCount: items.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
@ -98,10 +96,8 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
model: widget.model, model: widget.model,
removeAllergy: widget.removeAllergy, removeAllergy: widget.removeAllergy,
addAllergy: widget.addAllergy, addAllergy: widget.addAllergy,
isServiceSelected: isServiceSelected: widget.isServiceSelected,
widget.isServiceSelected, getServiceSelectedAllergy: widget.getServiceSelectedAllergy,
getServiceSelectedAllergy:
widget.getServiceSelectedAllergy,
); );
}, },
), ),
@ -126,8 +122,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
if (query.isNotEmpty) { if (query.isNotEmpty) {
List<MasterKeyModel> dummyListData = []; List<MasterKeyModel> dummyListData = [];
dummySearchList.forEach((items) { dummySearchList.forEach((items) {
if (items.nameAr!.toLowerCase().contains(query.toLowerCase()) || if (items.nameAr!.toLowerCase().contains(query.toLowerCase()) || items.nameEn!.toLowerCase().contains(query.toLowerCase())) {
items.nameEn!.toLowerCase().contains(query.toLowerCase())) {
dummyListData.add(items); dummyListData.add(items);
} }
}); });

@ -42,6 +42,9 @@ class UpdateChiefComplaints extends StatelessWidget {
hasBorder: true, hasBorder: true,
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
validationError: complaintsControllerError != '' ? complaintsControllerError : "", validationError: complaintsControllerError != '' ? complaintsControllerError : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 20, height: 20,
@ -55,6 +58,9 @@ class UpdateChiefComplaints extends StatelessWidget {
minLines: 7, minLines: 7,
hasBorder: true, hasBorder: true,
validationError: illnessControllerError != '' ? illnessControllerError : "", validationError: illnessControllerError != '' ? illnessControllerError : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -73,6 +79,9 @@ class UpdateChiefComplaints extends StatelessWidget {
hasBorder: true, hasBorder: true,
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
validationError: medicationControllerError != '' ? medicationControllerError : "", validationError: medicationControllerError != '' ? medicationControllerError : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 10, height: 10,

@ -2,13 +2,13 @@
import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/bottom_sheet/custom_bottom_sheet_container.dart'; import 'package:doctor_app_flutter/widgets/bottom_sheet/custom_bottom_sheet_container.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_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/app_texts_widget.dart';
@ -116,11 +116,16 @@ class _AddMedicationState extends State<AddMedication> {
maxLines: 1, maxLines: 1,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
suffixIcon: IconButton( suffixIcon: IconButton(
icon: Icon( icon: Icon(
Icons.search, Icons.search,
color: Colors.grey.shade600, color: Colors.grey.shade600,
), onPressed: () { },), ),
onPressed: () {},
),
enabled: false, enabled: false,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
), ),
), ),
@ -170,13 +175,15 @@ class _AddMedicationState extends State<AddMedication> {
}, },
); );
} }
: (){}, : () {},
hintText: TranslationBase.of(context).doseTime, hintText: TranslationBase.of(context).doseTime,
maxLines: 1, maxLines: 1,
minLines: 1, minLines: 1,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
controller: doseController, controller: doseController,
validationError: isFormSubmitted && _selectedMedicationDose == null ? TranslationBase.of(context).emptyMessage : "", validationError: isFormSubmitted && _selectedMedicationDose == null ? TranslationBase.of(context).emptyMessage : "",
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 5, height: 5,
@ -207,12 +214,14 @@ class _AddMedicationState extends State<AddMedication> {
}, },
); );
} }
: (){}, : () {},
hintText: TranslationBase.of(context).strength, hintText: TranslationBase.of(context).strength,
maxLines: 1, maxLines: 1,
minLines: 1, minLines: 1,
controller: strengthController, controller: strengthController,
validationError: isFormSubmitted && _selectedMedicationStrength == null ? TranslationBase.of(context).emptyMessage : "", validationError: isFormSubmitted && _selectedMedicationStrength == null ? TranslationBase.of(context).emptyMessage : "",
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 5, height: 5,
@ -246,12 +255,14 @@ class _AddMedicationState extends State<AddMedication> {
}, },
); );
} }
: (){}, : () {},
hintText: TranslationBase.of(context).route, hintText: TranslationBase.of(context).route,
maxLines: 1, maxLines: 1,
minLines: 1, minLines: 1,
controller: routeController, controller: routeController,
validationError: isFormSubmitted && _selectedMedicationRoute == null ? TranslationBase.of(context).emptyMessage : "", validationError: isFormSubmitted && _selectedMedicationRoute == null ? TranslationBase.of(context).emptyMessage : "",
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 5, height: 5,
@ -283,7 +294,7 @@ class _AddMedicationState extends State<AddMedication> {
}, },
); );
} }
: (){}, : () {},
hintText: TranslationBase.of(context).frequency, hintText: TranslationBase.of(context).frequency,
enabled: false, enabled: false,
maxLines: 1, maxLines: 1,
@ -291,6 +302,8 @@ class _AddMedicationState extends State<AddMedication> {
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
controller: frequencyController, controller: frequencyController,
validationError: isFormSubmitted && _selectedMedicationFrequency == null ? TranslationBase.of(context).emptyMessage : "", validationError: isFormSubmitted && _selectedMedicationFrequency == null ? TranslationBase.of(context).emptyMessage : "",
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: SizeConfig.heightMultiplier! * height: SizeConfig.heightMultiplier! *

@ -79,13 +79,13 @@ class _CustomEditableTextState extends State<CustomEditableText> {
hintText: widget.hint, hintText: widget.hint,
//TranslationBase.of(context).addoperationReports, //TranslationBase.of(context).addoperationReports,
controller: widget.controller, controller: widget.controller,
validationError: validationError: widget.controller.text.isEmpty && widget.isSubmitted ? TranslationBase.of(context).emptyMessage : "",
widget.controller.text.isEmpty && widget.isSubmitted
? TranslationBase.of(context).emptyMessage
: "",
maxLines: 1, maxLines: 1,
minLines: 1, minLines: 1,
hasBorder: true, hasBorder: true,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
], ],
); );

@ -2,15 +2,15 @@ import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/PatientRegistration/PatientRegistrationModel.dart'; import 'package:doctor_app_flutter/core/model/PatientRegistration/PatientRegistrationModel.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/profile/operation_report_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/profile/operation_report_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.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/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_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/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
@ -29,22 +29,16 @@ class RegisterConfirmationPatientPage extends StatefulWidget {
final PatiantInformtion? patient; final PatiantInformtion? patient;
final PatientRegistrationViewModel? model; final PatientRegistrationViewModel? model;
const RegisterConfirmationPatientPage( const RegisterConfirmationPatientPage({Key? key, this.operationReportViewModel, this.patient, this.model}) : super(key: key);
{Key? key, this.operationReportViewModel, this.patient, this.model})
: super(key: key);
@override @override
_RegisterConfirmationPatientPageState createState() => _RegisterConfirmationPatientPageState createState() => _RegisterConfirmationPatientPageState();
_RegisterConfirmationPatientPageState();
} }
class _RegisterConfirmationPatientPageState class _RegisterConfirmationPatientPageState extends State<RegisterConfirmationPatientPage> {
extends State<RegisterConfirmationPatientPage> {
bool isSubmitted = false; bool isSubmitted = false;
late ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
TextEditingController firstNameN = TextEditingController(), TextEditingController firstNameN = TextEditingController(), middleNameN = TextEditingController(), lastNameN = TextEditingController();
middleNameN = TextEditingController(),
lastNameN = TextEditingController();
TextEditingController firstNameAr = TextEditingController(); TextEditingController firstNameAr = TextEditingController();
TextEditingController middleNameAr = TextEditingController(); TextEditingController middleNameAr = TextEditingController();
TextEditingController lastNameAr = TextEditingController(); TextEditingController lastNameAr = TextEditingController();
@ -54,17 +48,13 @@ class _RegisterConfirmationPatientPageState
@override @override
void initState() { void initState() {
firstNameN = TextEditingController( firstNameN = TextEditingController(text: widget.model!.getPatientInfoResponseModel.firstNameEn);
text: widget.model!.getPatientInfoResponseModel.firstNameEn);
middleNameN = TextEditingController(text: ""); middleNameN = TextEditingController(text: "");
lastNameN = TextEditingController( lastNameN = TextEditingController(text: widget.model!.getPatientInfoResponseModel.lastNameEn);
text: widget.model!.getPatientInfoResponseModel.lastNameEn);
firstNameAr = TextEditingController( firstNameAr = TextEditingController(text: widget.model!.getPatientInfoResponseModel.firstNameAr);
text: widget.model!.getPatientInfoResponseModel.firstNameAr);
middleNameAr = TextEditingController(text: ""); middleNameAr = TextEditingController(text: "");
lastNameAr = TextEditingController( lastNameAr = TextEditingController(text: widget.model!.getPatientInfoResponseModel.lastNameAr);
text: widget.model!.getPatientInfoResponseModel.lastNameAr);
emailAddressController = TextEditingController(text: ""); emailAddressController = TextEditingController(text: "");
super.initState(); super.initState();
} }
@ -95,49 +85,27 @@ class _RegisterConfirmationPatientPageState
widthFactor: 0.9, widthFactor: 0.9,
child: Column( child: Column(
children: [ children: [
CustomEditableText( CustomEditableText(controller: firstNameN, isSubmitted: isSubmitted, hint: TranslationBase.of(context).firstName),
controller: firstNameN,
isSubmitted: isSubmitted,
hint: TranslationBase.of(context).firstName),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
CustomEditableText( CustomEditableText(controller: middleNameN, isEditable: middleNameN.text.isEmpty, isSubmitted: isSubmitted, hint: TranslationBase.of(context).middleName),
controller: middleNameN,
isEditable: middleNameN.text.isEmpty,
isSubmitted: isSubmitted,
hint: TranslationBase.of(context).middleName),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
CustomEditableText( CustomEditableText(controller: lastNameN, isSubmitted: isSubmitted, hint: TranslationBase.of(context).lastName),
controller: lastNameN,
isSubmitted: isSubmitted,
hint: TranslationBase.of(context).lastName),
SizedBox( SizedBox(
height: 20, height: 20,
), ),
CustomEditableText( CustomEditableText(controller: firstNameAr, isSubmitted: isSubmitted, hint: TranslationBase.of(context).firstNameInAr),
controller: firstNameAr,
isSubmitted: isSubmitted,
hint:
TranslationBase.of(context).firstNameInAr),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
CustomEditableText( CustomEditableText(controller: middleNameAr, isEditable: middleNameN.text.isEmpty, isSubmitted: isSubmitted, hint: TranslationBase.of(context).middleNameInAr),
controller: middleNameAr,
isEditable: middleNameN.text.isEmpty,
isSubmitted: isSubmitted,
hint:
TranslationBase.of(context).middleNameInAr),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
CustomEditableText( CustomEditableText(controller: lastNameAr, isSubmitted: isSubmitted, hint: TranslationBase.of(context).lastNameInAr),
controller: lastNameAr,
isSubmitted: isSubmitted,
hint: TranslationBase.of(context).lastNameInAr),
SizedBox( SizedBox(
height: 20, height: 20,
), ),
@ -147,18 +115,12 @@ class _RegisterConfirmationPatientPageState
child: Column( child: Column(
children: [ children: [
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [ children: [
Column( Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(TranslationBase.of(context).healthID, fontSize: 12, color: Colors.black),
TranslationBase.of(context)
.healthID,
fontSize: 12,
color: Colors.black),
AppText( AppText(
"${widget.model!.getPatientInfoResponseModel.healthId}", "${widget.model!.getPatientInfoResponseModel.healthId}",
fontSize: 12, fontSize: 12,
@ -167,14 +129,9 @@ class _RegisterConfirmationPatientPageState
], ],
), ),
Column( Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(TranslationBase.of(context).identityNumber, fontSize: 12, color: Colors.black),
TranslationBase.of(context)
.identityNumber,
fontSize: 12,
color: Colors.black),
AppText( AppText(
"${widget.model!.getPatientInfoResponseModel.idNumber}", "${widget.model!.getPatientInfoResponseModel.idNumber}",
fontSize: 12, fontSize: 12,
@ -191,18 +148,12 @@ class _RegisterConfirmationPatientPageState
height: 20, height: 20,
), ),
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [ children: [
Column( Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(TranslationBase.of(context).nationality, fontSize: 12, color: Colors.black),
TranslationBase.of(context)
.nationality,
fontSize: 12,
color: Colors.black),
AppText( AppText(
"${widget.model!.getPatientInfoResponseModel.nationality}", "${widget.model!.getPatientInfoResponseModel.nationality}",
fontSize: 12, fontSize: 12,
@ -211,14 +162,9 @@ class _RegisterConfirmationPatientPageState
], ],
), ),
Column( Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(TranslationBase.of(context).occupation, fontSize: 12, color: Colors.black),
TranslationBase.of(context)
.occupation,
fontSize: 12,
color: Colors.black),
AppText( AppText(
"${widget.model!.getPatientInfoResponseModel.occupation}", "${widget.model!.getPatientInfoResponseModel.occupation}",
fontSize: 12, fontSize: 12,
@ -235,18 +181,12 @@ class _RegisterConfirmationPatientPageState
height: 20, height: 20,
), ),
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [ children: [
Column( Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(TranslationBase.of(context).mobileNo, fontSize: 12, color: Colors.black),
TranslationBase.of(context)
.mobileNo,
fontSize: 12,
color: Colors.black),
AppText( AppText(
"${widget.model!.checkPatientForRegistrationModel!.patientMobileNumber}", "${widget.model!.checkPatientForRegistrationModel!.patientMobileNumber}",
fontSize: 12, fontSize: 12,
@ -272,8 +212,7 @@ class _RegisterConfirmationPatientPageState
onClick: () { onClick: () {
openMaritalStatusList(context); openMaritalStatusList(context);
}, },
hintText: hintText: TranslationBase.of(context).maritalStatus,
TranslationBase.of(context).maritalStatus,
maxLines: 1, maxLines: 1,
minLines: 1, minLines: 1,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
@ -284,6 +223,8 @@ class _RegisterConfirmationPatientPageState
// ? TranslationBase.of(context) // ? TranslationBase.of(context)
// .emptyMessage // .emptyMessage
// : null, // : null,
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 20, height: 20,
@ -305,6 +246,8 @@ class _RegisterConfirmationPatientPageState
// ? TranslationBase.of(context) // ? TranslationBase.of(context)
// .emptyMessage // .emptyMessage
// : null, // : null,
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 20, height: 20,
@ -316,11 +259,11 @@ class _RegisterConfirmationPatientPageState
maxLines: 1, maxLines: 1,
minLines: 1, minLines: 1,
hasBorder: true, hasBorder: true,
validationError: validationError: emailAddressController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
emailAddressController.text.isEmpty &&
isSubmitted onClick: () {},
? TranslationBase.of(context).emptyMessage onChanged: (value) {},
: "", onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 400, height: 400,
@ -375,87 +318,59 @@ class _RegisterConfirmationPatientPageState
isSubmitted = true; isSubmitted = true;
}); });
if (isFormValid()) { if (isFormValid()) {
print(widget print(widget.model!.getPatientInfoResponseModel.dateOfBirth);
.model!.getPatientInfoResponseModel.dateOfBirth);
var dateFormat = DateFormat('MM/dd/yyyy').parse(widget var dateFormat = DateFormat('MM/dd/yyyy').parse(widget.model!.getPatientInfoResponseModel.dateOfBirth!);
.model!.getPatientInfoResponseModel.dateOfBirth!); String wellFormat = "${dateFormat.day}\/${dateFormat.month}\/${dateFormat.year}";
String wellFormat =
"${dateFormat.day}\/${dateFormat.month}\/${dateFormat.year}";
print( print(
dateFormat.toUtc().toString(), dateFormat.toUtc().toString(),
); );
JDateModel hijriDate = JDateModel( JDateModel hijriDate = JDateModel(
dateTime: DateTime( dateTime: DateTime(dateFormat.year, dateFormat.month, dateFormat.day),
dateFormat.year, dateFormat.month, dateFormat.day),
); );
// return ; // return ;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
PatientRegistrationModel patientRegistrationModel = PatientRegistrationModel patientRegistrationModel = PatientRegistrationModel(
PatientRegistrationModel( patientobject: Patientobject(
patientobject: Patientobject( tempValue: true,
tempValue: true, patientIdentificationNo: widget.model!.checkPatientForRegistrationModel!.patientIdentificationID.toString(),
patientIdentificationNo: widget patientIdentificationType: 1,
.model! firstName: firstNameAr.text,
.checkPatientForRegistrationModel! firstNameN: firstNameN.text,
.patientIdentificationID lastName: lastNameAr.text,
.toString(), lastNameN: lastNameN.text,
patientIdentificationType: 1, middleName: middleNameAr.text,
firstName: firstNameAr.text, middleNameN: middleNameN.text,
firstNameN: firstNameN.text, strDateofBirth: dateFormat.toUtc().toString(),
lastName: lastNameAr.text, dateofBirth: AppDateUtils.convertToServerFormat(widget.model!.getPatientInfoResponseModel.dateOfBirth!, 'MM/dd/yyyy'),
lastNameN: lastNameN.text, dateofBirthN: '$hijriDate',
middleName: middleNameAr.text, gender: (widget.model!.getPatientInfoResponseModel.gender == "M") ? 1 : 2,
middleNameN: middleNameN.text, sourceType: "1",
strDateofBirth: dateFormat.toUtc().toString(),
dateofBirth: AppDateUtils.convertToServerFormat(
widget.model!.getPatientInfoResponseModel
.dateOfBirth!,
'MM/dd/yyyy'),
dateofBirthN: '$hijriDate',
gender:
(widget.model!.getPatientInfoResponseModel.gender == "M")
? 1
: 2,
sourceType: "1",
patientOutSA: 0,
nationalityID: widget
.model!
.getPatientInfoResponseModel
.nationalityCode,
//todo Elham* change static value to dynamic
preferredLanguage: selectedLang.toString(),
marital: "0",
eHealthIDField: widget.model!
.getPatientInfoResponseModel.healthId,
emailAddress: emailAddressController.text,
mobileNumber: widget
.model!
.checkPatientForRegistrationModel!
.patientMobileNumber),
isHijri: 0,
logInTokenID: "zjgvKtLC/EK+saznJ/OkiA==",
isDentalAllowedBackend: false,
patientOutSA: 0, patientOutSA: 0,
sessionID: null, nationalityID: widget.model!.getPatientInfoResponseModel.nationalityCode,
patientMobileNumber: widget //todo Elham* change static value to dynamic
.model! preferredLanguage: selectedLang.toString(),
.checkPatientForRegistrationModel! marital: "0",
.patientMobileNumber eHealthIDField: widget.model!.getPatientInfoResponseModel.healthId,
.toString(), emailAddress: emailAddressController.text,
healthId: widget.model!.getPatientInfoResponseModel.healthId, mobileNumber: widget.model!.checkPatientForRegistrationModel!.patientMobileNumber),
generalid: GENERAL_ID, isHijri: 0,
patientIdentificationID: widget.model!.checkPatientForRegistrationModel!.patientIdentificationID.toString(), logInTokenID: "zjgvKtLC/EK+saznJ/OkiA==",
dOB: wellFormat, isDentalAllowedBackend: false,
zipCode: widget.model!.checkPatientForRegistrationModel!.zipCode); patientOutSA: 0,
await widget.model! sessionID: null,
.registrationPatient(patientRegistrationModel); patientMobileNumber: widget.model!.checkPatientForRegistrationModel!.patientMobileNumber.toString(),
healthId: widget.model!.getPatientInfoResponseModel.healthId,
generalid: GENERAL_ID,
patientIdentificationID: widget.model!.checkPatientForRegistrationModel!.patientIdentificationID.toString(),
dOB: wellFormat,
zipCode: widget.model!.checkPatientForRegistrationModel!.zipCode);
await widget.model!.registrationPatient(patientRegistrationModel);
if (widget.model!.state == ViewState.ErrorLocal) { if (widget.model!.state == ViewState.ErrorLocal) {
Utils.showErrorToast(widget.model!.error); Utils.showErrorToast(widget.model!.error);
} else { } else {
DrAppToastMsg.showSuccesToast( DrAppToastMsg.showSuccesToast("Patient added Successfully");
"Patient added Successfully");
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
@ -500,10 +415,7 @@ class _RegisterConfirmationPatientPageState
onTap: () { onTap: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
child: Icon(DoctorApp.close_1, child: Icon(DoctorApp.close_1, size: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5, color: Color(0xFF2B353E))),
size: SizeConfig.getTextMultiplierBasedOnWidth() *
4.5,
color: Color(0xFF2B353E))),
), ),
], ],
), ),
@ -608,10 +520,7 @@ class _RegisterConfirmationPatientPageState
onTap: () { onTap: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
child: Icon(DoctorApp.close_1, child: Icon(DoctorApp.close_1, size: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5, color: Color(0xFF2B353E))),
size: SizeConfig.getTextMultiplierBasedOnWidth() *
4.5,
color: Color(0xFF2B353E))),
), ),
], ],
), ),

@ -6,8 +6,8 @@ import 'package:doctor_app_flutter/core/model/PatientRegistration/CheckPatientFo
import 'package:doctor_app_flutter/core/model/PatientRegistration/GetPatientInfoRequestModel.dart'; import 'package:doctor_app_flutter/core/model/PatientRegistration/GetPatientInfoRequestModel.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_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/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
@ -23,13 +23,10 @@ class RegisterSearchPatientPage extends StatefulWidget {
final Function? changePageViewIndex; final Function? changePageViewIndex;
final PatientRegistrationViewModel? model; final PatientRegistrationViewModel? model;
const RegisterSearchPatientPage( const RegisterSearchPatientPage({Key? key, this.changePageViewIndex, this.model}) : super(key: key);
{Key? key, this.changePageViewIndex, this.model})
: super(key: key);
@override @override
_RegisterSearchPatientPageState createState() => _RegisterSearchPatientPageState createState() => _RegisterSearchPatientPageState();
_RegisterSearchPatientPageState();
} }
class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> { class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
@ -42,14 +39,12 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
bool isSubmitted = false; bool isSubmitted = false;
TextEditingController _phoneController = TextEditingController _phoneController = TextEditingController(text: "508079569");
TextEditingController(text: "508079569");
TextEditingController _phoneCode = TextEditingController(text: "966"); TextEditingController _phoneCode = TextEditingController(text: "966");
String phoneError = ''; String phoneError = '';
TextEditingController _idController = TextEditingController _idController = TextEditingController(text: "1062938285");
TextEditingController(text: "1062938285");
String idError = ''; String idError = '';
DateTime? _birthDateInGregorian; DateTime? _birthDateInGregorian;
@ -111,9 +106,7 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenSize = MediaQuery final screenSize = MediaQuery.of(context).size;
.of(context)
.size;
/// TODO Elham* add transaltion /// TODO Elham* add transaltion
@ -131,9 +124,7 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase TranslationBase.of(context).askForIdentification,
.of(context)
.askForIdentification,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier! * 2.2, fontSize: SizeConfig.textMultiplier! * 2.2,
fontWeight: FontWeight.w800, fontWeight: FontWeight.w800,
@ -163,19 +154,17 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
Column( Column(
children: [ children: [
Container( Container(
width: MediaQuery width: MediaQuery.of(context).size.width * 0.28,
.of(context)
.size
.width * 0.28,
child: AppTextFieldCustom( child: AppTextFieldCustom(
height: screenSize.height * 0.075, height: screenSize.height * 0.075,
hintText: TranslationBase hintText: TranslationBase.of(context).codeNo,
.of(context)
.codeNo,
inputType: TextInputType.phone, inputType: TextInputType.phone,
controller: _phoneCode, controller: _phoneCode,
validationError: phoneError, validationError: phoneError,
enabled: false, enabled: false,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
), ),
if (_phoneController.text.isEmpty && isSubmitted) if (_phoneController.text.isEmpty && isSubmitted)
@ -192,17 +181,13 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
// width: MediaQuery.of(context).size.width*0.7, // width: MediaQuery.of(context).size.width*0.7,
child: AppTextFieldCustom( child: AppTextFieldCustom(
height: screenSize.height * 0.075, height: screenSize.height * 0.075,
hintText: TranslationBase hintText: TranslationBase.of(context).phoneNumber,
.of(context)
.phoneNumber,
inputType: TextInputType.phone, inputType: TextInputType.phone,
controller: _phoneController, controller: _phoneController,
validationError: validationError: _phoneController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
_phoneController.text.isEmpty && isSubmitted onClick: () {},
? TranslationBase onChanged: (value) {},
.of(context) onFieldSubmitted: () {},
.emptyMessage
: "",
), ),
), ),
), ),
@ -213,24 +198,19 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
), ),
AppTextFieldCustom( AppTextFieldCustom(
height: screenSize.height * 0.075, height: screenSize.height * 0.075,
hintText: TranslationBase hintText: TranslationBase.of(context).iDNumber,
.of(context)
.iDNumber,
inputType: TextInputType.phone, inputType: TextInputType.phone,
controller: _idController, controller: _idController,
validationError: _idController.text.isEmpty && isSubmitted validationError: _idController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
? TranslationBase onClick: () {},
.of(context) onChanged: (value) {},
.emptyMessage onFieldSubmitted: () {},
: "",
), ),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
AppText( AppText(
TranslationBase TranslationBase.of(context).calender,
.of(context)
.calender,
fontSize: SizeConfig.textMultiplier! * 1.8, fontSize: SizeConfig.textMultiplier! * 1.8,
fontWeight: FontWeight.w800, fontWeight: FontWeight.w800,
), ),
@ -241,10 +221,7 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
children: [ children: [
Expanded( Expanded(
child: RadioListTile<CalenderType>( child: RadioListTile<CalenderType>(
title: title: AppText(TranslationBase.of(context).gregorian),
AppText(TranslationBase
.of(context)
.gregorian),
value: CalenderType.Gregorian, value: CalenderType.Gregorian,
groupValue: calenderType, groupValue: calenderType,
onChanged: (CalenderType? value) { onChanged: (CalenderType? value) {
@ -256,9 +233,7 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
), ),
Expanded( Expanded(
child: RadioListTile<CalenderType>( child: RadioListTile<CalenderType>(
title: AppText(TranslationBase title: AppText(TranslationBase.of(context).hijri),
.of(context)
.hijri),
value: CalenderType.Hijri, value: CalenderType.Hijri,
groupValue: calenderType, groupValue: calenderType,
onChanged: (CalenderType? value) { onChanged: (CalenderType? value) {
@ -275,18 +250,11 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
), ),
AppTextFieldCustom( AppTextFieldCustom(
height: screenSize.height * 0.075, height: screenSize.height * 0.075,
hintText: TranslationBase hintText: TranslationBase.of(context).birthdate,
.of(context)
.birthdate,
dropDownText: getBirthdate(), dropDownText: getBirthdate(),
enabled: false, enabled: false,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
validationError: validationError: _birthDateInGregorian == null && isSubmitted ? TranslationBase.of(context).emptyMessage : "",
_birthDateInGregorian == null && isSubmitted
? TranslationBase
.of(context)
.emptyMessage
: "",
suffixIcon: IconButton( suffixIcon: IconButton(
icon: Icon( icon: Icon(
Icons.calendar_today, Icons.calendar_today,
@ -298,45 +266,41 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
if (_birthDateInGregorian == null) { if (_birthDateInGregorian == null) {
_birthDateInGregorian = DateTime.now(); _birthDateInGregorian = DateTime.now();
} }
_selectDate(context, _birthDateInGregorian!, _selectDate(context, _birthDateInGregorian!, (dynamic selectedDate) {
(dynamic selectedDate) { setState(() {
setState(() { if (calenderType == CalenderType.Hijri) {
if (calenderType == CalenderType.Hijri) { birthDateInHijri = selectedDate;
birthDateInHijri = selectedDate; // _birthDateInGregorian = HijriCalendar()
// _birthDateInGregorian = HijriCalendar() // .hijriToGregorian(
// .hijriToGregorian( // birthDateInHijri.hYear,
// birthDateInHijri.hYear, // birthDateInHijri.hMonth,
// birthDateInHijri.hMonth, // birthDateInHijri.hDay);
// birthDateInHijri.hDay); //
//
_birthDateInGregorian = DateTime.parse(JHijri( _birthDateInGregorian =
fDay: birthDateInHijri.jhijri!.day, DateTime.parse(JHijri(fDay: birthDateInHijri.jhijri!.day, fMonth: birthDateInHijri.jhijri!.month, fYear: birthDateInHijri.jhijri!.year).toString());
fMonth: birthDateInHijri.jhijri!.month,
fYear: birthDateInHijri.jhijri!.year)
.toString());
print(_birthDateInGregorian);
print(birthDateInHijri);
} else {
_birthDateInGregorian = selectedDate;
// birthDateInHijri = HijriCalendar()
// .gregorianToHijri(
// selectedDate.year,
// selectedDate.month,
// selectedDate.day) as HijriCalendar;
print(_birthDateInGregorian); birthDateInHijri = JDateModel(dateTime: selectedDate);
print(birthDateInHijri);
} else {
_birthDateInGregorian = selectedDate;
// birthDateInHijri = HijriCalendar()
// .gregorianToHijri(
// selectedDate.year,
// selectedDate.month,
// selectedDate.day) as HijriCalendar;
birthDateInHijri = print(_birthDateInGregorian);
JDateModel(dateTime: selectedDate); print(birthDateInHijri.dateTime);
print(birthDateInHijri.jhijri);
print(_birthDateInGregorian); }
print(birthDateInHijri.dateTime); });
print(birthDateInHijri.jhijri); });
}
});
});
}, },
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 70, height: 70,
@ -356,9 +320,7 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
Expanded( Expanded(
child: Container( child: Container(
child: AppButton( child: AppButton(
title: TranslationBase title: TranslationBase.of(context).cancel,
.of(context)
.cancel,
hasBorder: true, hasBorder: true,
// vPadding: 12, // vPadding: 12,
hPadding: 8, hPadding: 8,
@ -377,9 +339,7 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
Expanded( Expanded(
child: Container( child: Container(
child: AppButton( child: AppButton(
title: TranslationBase title: TranslationBase.of(context).next,
.of(context)
.next,
hasBorder: true, hasBorder: true,
borderColor: Color(0xFFB8382B), borderColor: Color(0xFFB8382B),
color: AppGlobal.appRedColor, color: AppGlobal.appRedColor,
@ -389,21 +349,15 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
isSubmitted = true; isSubmitted = true;
}); });
if (country == null) { if (country == null) {
countryError = TranslationBase countryError = TranslationBase.of(context).fieldRequired;
.of(context)
.fieldRequired;
} else { } else {
countryError = ""; countryError = "";
} }
if (isFormValid()) { if (isFormValid()) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
CheckPatientForRegistrationModel CheckPatientForRegistrationModel checkPatientForRegistrationModel = CheckPatientForRegistrationModel(
checkPatientForRegistrationModel = patientIdentificationID: int.parse(_idController.text),
CheckPatientForRegistrationModel( patientMobileNumber: int.parse(_phoneController.text),
patientIdentificationID:
int.parse(_idController.text),
patientMobileNumber:
int.parse(_phoneController.text),
zipCode: _phoneCode.text, zipCode: _phoneCode.text,
isHijri: 0, isHijri: 0,
patientID: 0, patientID: 0,
@ -411,14 +365,9 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
isDentalAllowedBackend: false, isDentalAllowedBackend: false,
patientOutSA: 0, patientOutSA: 0,
generalid: GENERAL_ID, generalid: GENERAL_ID,
dOB: dOB: "${AppDateUtils.convertStringToDateFormat(_birthDateInGregorian.toString(), "yyyy/MM/dd")}");
"${AppDateUtils.convertStringToDateFormat( await widget.model!.checkPatientForRegistration(checkPatientForRegistrationModel);
_birthDateInGregorian.toString(), GetPatientInfoRequestModel getPatientInfoRequestModel = GetPatientInfoRequestModel(
"yyyy/MM/dd")}");
await widget.model!.checkPatientForRegistration(
checkPatientForRegistrationModel);
GetPatientInfoRequestModel getPatientInfoRequestModel =
GetPatientInfoRequestModel(
//TODO Elham* this return the static to dynamic //TODO Elham* this return the static to dynamic
patientIdentificationID: "1062938285", patientIdentificationID: "1062938285",
// _idController.text, // _idController.text,
@ -427,14 +376,12 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
patientOutSA: 0, patientOutSA: 0,
generalid: GENERAL_ID, generalid: GENERAL_ID,
sessionID: null, sessionID: null,
dOB: dOB: "31/07/1988", //"${AppDateUtils.convertStringToDateFormat(_birthDate.toString(), "dd/MM/yyyy")}"
"31/07/1988", //"${AppDateUtils.convertStringToDateFormat(_birthDate.toString(), "dd/MM/yyyy")}"
); );
if (widget.model!.state == ViewState.ErrorLocal) { if (widget.model!.state == ViewState.ErrorLocal) {
Utils.showErrorToast(widget.model!.error); Utils.showErrorToast(widget.model!.error);
} else { } else {
await widget.model! await widget.model!.getPatientInfo(getPatientInfoRequestModel);
.getPatientInfo(getPatientInfoRequestModel);
if (widget.model!.state == ViewState.ErrorLocal) { if (widget.model!.state == ViewState.ErrorLocal) {
Utils.showErrorToast(widget.model!.error); Utils.showErrorToast(widget.model!.error);
} else { } else {
@ -454,18 +401,13 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
} }
isFormValid() { isFormValid() {
if (_phoneController.text != null && if (_phoneController.text != null && _phoneController.text.isNotEmpty && _idController.text != null && _idController.text.isNotEmpty && _birthDateInGregorian != null) {
_phoneController.text.isNotEmpty &&
_idController.text != null &&
_idController.text.isNotEmpty &&
_birthDateInGregorian != null) {
return true; return true;
} }
return false; return false;
} }
Future _selectDate(BuildContext context, DateTime dateTime, Future _selectDate(BuildContext context, DateTime dateTime, Function(dynamic) updateDate) async {
Function(dynamic) updateDate) async {
if (calenderType == CalenderType.Hijri) { if (calenderType == CalenderType.Hijri) {
JDateModel hijriDate = JDateModel(dateTime: DateTime.now()); JDateModel hijriDate = JDateModel(dateTime: DateTime.now());
final JPickerValue? pickedH = await showGlobalDatePicker( final JPickerValue? pickedH = await showGlobalDatePicker(
@ -487,9 +429,7 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
final DateTime? picked = await showDatePicker( final DateTime? picked = await showDatePicker(
context: context, context: context,
initialDate: dateTime ?? DateTime.now(), initialDate: dateTime ?? DateTime.now(),
firstDate: DateTime(DateTime firstDate: DateTime(DateTime.now().year - 150),
.now()
.year - 150),
lastDate: DateTime.now(), lastDate: DateTime.now(),
initialEntryMode: DatePickerEntryMode.calendar, initialEntryMode: DatePickerEntryMode.calendar,
); );
@ -499,16 +439,13 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
} }
} }
void openListDialogField(String attributeName, String attributeValueId, void openListDialogField(String attributeName, String attributeValueId, List<dynamic> list, Function(dynamic selectedValue) okFunction) {
List<dynamic> list, Function(dynamic selectedValue) okFunction) {
ListSelectDialog dialog = ListSelectDialog( ListSelectDialog dialog = ListSelectDialog(
list: list, list: list,
attributeName: attributeName, attributeName: attributeName,
attributeValueId: attributeValueId, attributeValueId: attributeValueId,
usingSearch: true, usingSearch: true,
okText: TranslationBase okText: TranslationBase.of(context).ok,
.of(context)
.ok,
okFunction: (selectedValue) { okFunction: (selectedValue) {
okFunction(selectedValue); okFunction(selectedValue);
}, },
@ -526,10 +463,7 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
if (calenderType == CalenderType.Hijri) { if (calenderType == CalenderType.Hijri) {
return birthDateInHijri != null ? "$birthDateInHijri" : null; return birthDateInHijri != null ? "$birthDateInHijri" : null;
} else { } else {
return _birthDateInGregorian != null return _birthDateInGregorian != null ? "${AppDateUtils.convertStringToDateFormat(_birthDateInGregorian.toString(), "yyyy/MM/dd")}" : null;
? "${AppDateUtils.convertStringToDateFormat(
_birthDateInGregorian.toString(), "yyyy/MM/dd")}"
: null;
} }
} }
} }

@ -13,18 +13,18 @@ import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/screens/prescription/prescription_text_filed.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_text_filed.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.dart'; import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_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/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart'; import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_recognition_error.dart';
import 'package:speech_to_text/speech_to_text.dart' as stt; import 'package:speech_to_text/speech_to_text.dart' as stt;
import '../../../widgets/transitions/slide_up_page.dart'; import '../../../widgets/transitions/slide_up_page.dart';
import 'add_drug/add_drug_widget.dart'; import 'add_drug/add_drug_widget.dart';
@ -182,10 +182,11 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
isTextFieldHasSuffix: false, isTextFieldHasSuffix: false,
enabled: true, enabled: true,
controller: strengthController, controller: strengthController,
onChanged: (String value) { onChanged: (value) {
setState(() { if (value != null)
strengthChar = value.length; setState(() {
}); strengthChar = value.length;
});
if (strengthChar! >= 5) { if (strengthChar! >= 5) {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(
TranslationBase.of(context).only5DigitsAllowedForStrength, TranslationBase.of(context).only5DigitsAllowedForStrength,
@ -195,6 +196,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
inputType: TextInputType.numberWithOptions( inputType: TextInputType.numberWithOptions(
decimal: true, decimal: true,
), ),
onClick: () {},
onFieldSubmitted: () {},
), ),
), ),
SizedBox( SizedBox(
@ -246,8 +249,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
frequency = selectedValue; frequency = selectedValue;
frequency['isDefault'] = true; frequency['isDefault'] = true;
if (widget.selectedMedication != null && duration != null && frequency != null && strengthController.text != null) { if (widget.selectedMedication != null && duration != null && frequency != null && strengthController.text != null) {
widget.medicineViewModel widget.medicineViewModel!
!.getBoxQuantity(freq: frequency['parameterCode'], duration: duration['id'], itemCode: widget.selectedMedication!.itemId, strength: double.parse(strengthController.text)); .getBoxQuantity(freq: frequency['parameterCode'], duration: duration['id'], itemCode: widget.selectedMedication!.itemId, strength: double.parse(strengthController.text));
return; return;
} }
@ -279,6 +282,9 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: AppTextFieldCustom( child: AppTextFieldCustom(
hintText: widget.medicineViewModel!.patientAssessmentList[0].icdCode10ID.toString(), hintText: widget.medicineViewModel!.patientAssessmentList[0].icdCode10ID.toString(),
enabled: true, enabled: true,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
), ),
Container( Container(
@ -288,6 +294,9 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
maxLines: 5, maxLines: 5,
hintText: widget.medicineViewModel!.patientAssessmentList[0].asciiDesc.toString(), hintText: widget.medicineViewModel!.patientAssessmentList[0].asciiDesc.toString(),
enabled: true, enabled: true,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
), ),
], ],
@ -306,9 +315,13 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
icon: Icon( icon: Icon(
Icons.calendar_today, Icons.calendar_today,
color: Colors.black, color: Colors.black,
), onPressed: () { }, ),
onPressed: () {},
), ),
dropDownText: selectedDate != null ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" : "", dropDownText: selectedDate != null ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" : "",
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
enabled: false, enabled: false,
), ),
), ),
@ -339,6 +352,9 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
isTextFieldHasSuffix: false, isTextFieldHasSuffix: false,
dropDownText: uom != null ? uom : null, dropDownText: uom != null ? uom : null,
enabled: false, enabled: false,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
), ),
SizedBox(height: spaceBetweenTextFields), SizedBox(height: spaceBetweenTextFields),
@ -349,6 +365,9 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
isTextFieldHasSuffix: false, isTextFieldHasSuffix: false,
dropDownText: box != null ? widget.medicineViewModel!.boxQuintity.toString() : "", dropDownText: box != null ? widget.medicineViewModel!.boxQuintity.toString() : "",
enabled: false, enabled: false,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
), ),
SizedBox(height: spaceBetweenTextFields), SizedBox(height: spaceBetweenTextFields),

@ -4,26 +4,26 @@ import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_req_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_req_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/prescription/prescription_text_filed.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_text_filed.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.dart'; import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_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/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart'; import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
@ -341,10 +341,11 @@ class _PrescriptionCheckOutScreenState extends State<PrescriptionCheckOutScreen>
isTextFieldHasSuffix: false, isTextFieldHasSuffix: false,
enabled: true, enabled: true,
controller: strengthController, controller: strengthController,
onChanged: (String value) { onChanged: (value) {
setState(() { if (value != null)
strengthChar = value.length; setState(() {
}); strengthChar = value.length;
});
if (strengthChar! >= 5) { if (strengthChar! >= 5) {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(
TranslationBase.of(context).only5DigitsAllowedForStrength, TranslationBase.of(context).only5DigitsAllowedForStrength,
@ -354,6 +355,8 @@ class _PrescriptionCheckOutScreenState extends State<PrescriptionCheckOutScreen>
inputType: TextInputType.numberWithOptions( inputType: TextInputType.numberWithOptions(
decimal: true, decimal: true,
), ),
onClick: () {},
onFieldSubmitted: () {},
), ),
), ),
SizedBox( SizedBox(

@ -1,8 +1,7 @@
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class PrescriptionTextFiled extends StatefulWidget { class PrescriptionTextFiled extends StatefulWidget {
@ -56,6 +55,9 @@ class _PrescriptionTextFiledState extends State<PrescriptionTextFiled> {
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
validationError: widget.elementList!.length != 1 ? widget.elementError! : "", validationError: widget.elementList!.length != 1 ? widget.elementError! : "",
enabled: false, enabled: false,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
), ),
); );

@ -21,13 +21,10 @@ class AddProcedurePage extends StatefulWidget {
final PatiantInformtion? patient; final PatiantInformtion? patient;
final ProcedureType procedureType; final ProcedureType procedureType;
const AddProcedurePage( const AddProcedurePage({Key? key, this.model, this.patient, required this.procedureType}) : super(key: key);
{Key? key, this.model, this.patient, required this.procedureType})
: super(key: key);
@override @override
_AddProcedurePageState createState() => _AddProcedurePageState( _AddProcedurePageState createState() => _AddProcedurePageState(patient: patient, model: model, procedureType: this.procedureType);
patient: patient, model: model, procedureType: this.procedureType);
} }
class _AddProcedurePageState extends State<AddProcedurePage> { class _AddProcedurePageState extends State<AddProcedurePage> {
@ -56,14 +53,9 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<ProcedureViewModel>( return BaseView<ProcedureViewModel>(
onModelReady: (model) { onModelReady: (model) {
model.getProcedureCategory( model.getProcedureCategory(categoryName: procedureType!.getCategoryName(), categoryID: procedureType!.getCategoryId(), patientId: patient!.patientId);
categoryName: procedureType!.getCategoryName(),
categoryID: procedureType!.getCategoryId(),
patientId: patient!.patientId);
}, },
builder: builder: (BuildContext context, ProcedureViewModel model, Widget? child) => AppScaffold(
(BuildContext context, ProcedureViewModel model, Widget? child) =>
AppScaffold(
isShowAppBar: false, isShowAppBar: false,
body: SingleChildScrollView( body: SingleChildScrollView(
child: FractionallySizedBox( child: FractionallySizedBox(
@ -86,66 +78,50 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
Column( Column(
children: [ children: [
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context).pleaseEnterProcedure,
.pleaseEnterProcedure,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 20, fontSize: 20,
), ),
], ],
), ),
SizedBox( SizedBox(
height: MediaQuery.of(context).size.height * height: MediaQuery.of(context).size.height * 0.02,
0.02,
), ),
Row( Row(
children: [ children: [
Container( Container(
width: width: MediaQuery.of(context).size.width * 0.79,
MediaQuery.of(context).size.width *
0.79,
child: AppTextFieldCustom( child: AppTextFieldCustom(
hintText: TranslationBase.of(context) hintText: TranslationBase.of(context).searchProcedureHere,
.searchProcedureHere,
isTextFieldHasSuffix: false, isTextFieldHasSuffix: false,
maxLines: 1, maxLines: 1,
minLines: 1, minLines: 1,
hasBorder: true, hasBorder: true,
controller: procedureName, controller: procedureName,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
), ),
), ),
SizedBox( SizedBox(
width: width: MediaQuery.of(context).size.width * 0.02,
MediaQuery.of(context).size.width *
0.02,
), ),
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: () async { onTap: () async {
if (procedureName.text.isNotEmpty && if (procedureName.text.isNotEmpty && procedureName.text.length >= 3) {
procedureName.text.length >= GifLoaderDialogUtils.showMyDialog(context);
3) { await model.getProcedureCategory(patientId: patient!.patientId, categoryName: procedureName.text, isLocalBusy: true);
GifLoaderDialogUtils.showMyDialog( if (model.state == ViewState.ErrorLocal) {
context); DrAppToastMsg.showErrorToast(model.error);
await model.getProcedureCategory(
patientId: patient!.patientId,
categoryName:
procedureName.text,
isLocalBusy: true);
if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} }
GifLoaderDialogUtils.hideDialog( GifLoaderDialogUtils.hideDialog(context);
context);
} else { } else {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(
TranslationBase.of(context) TranslationBase.of(context).atLeastThreeCharacters,
.atLeastThreeCharacters,
); );
} }
}, },
@ -159,16 +135,12 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
), ),
], ],
), ),
if ((procedureType == ProcedureType.PROCEDURE if ((procedureType == ProcedureType.PROCEDURE ? procedureName.text.isNotEmpty : true) && model.categoriesList.length != 0)
? procedureName.text.isNotEmpty
: true) &&
model.categoriesList.length != 0)
NetworkBaseView( NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: EntityListCheckboxSearchWidget( child: EntityListCheckboxSearchWidget(
model: widget.model!, model: widget.model!,
masterList: masterList: model.categoriesList[0].entityList!,
model.categoriesList[0].entityList!,
removeProcedure: (item) { removeProcedure: (item) {
setState(() { setState(() {
entityList.remove(item); entityList.remove(item);
@ -180,9 +152,7 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
}); });
}, },
addSelectedHistories: () {}, addSelectedHistories: () {},
isEntityListSelected: (master) => isEntityListSelected: (master) => widget.model!.isEntityListSelected(master, entityList),
widget.model!.isEntityListSelected(
master, entityList),
)), )),
SizedBox( SizedBox(
height: 10, height: 10,
@ -208,8 +178,7 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
if (entityList.isEmpty == true) { if (entityList.isEmpty == true) {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(
TranslationBase.of(context) TranslationBase.of(context).fillTheMandatoryProcedureDetails,
.fillTheMandatoryProcedureDetails,
); );
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
return; return;

@ -48,12 +48,10 @@ class EntityListCheckboxSearchFavProceduresWidget extends StatefulWidget {
: super(key: key); : super(key: key);
@override @override
_EntityListCheckboxSearchFavProceduresWidgetState createState() => _EntityListCheckboxSearchFavProceduresWidgetState createState() => _EntityListCheckboxSearchFavProceduresWidgetState();
_EntityListCheckboxSearchFavProceduresWidgetState();
} }
class _EntityListCheckboxSearchFavProceduresWidgetState class _EntityListCheckboxSearchFavProceduresWidgetState extends State<EntityListCheckboxSearchFavProceduresWidget> {
extends State<EntityListCheckboxSearchFavProceduresWidget> {
int selectedType = 0; int selectedType = 0;
int typeUrgent = 0; int typeUrgent = 0;
int typeRegular = 0; int typeRegular = 0;
@ -87,22 +85,19 @@ class _EntityListCheckboxSearchFavProceduresWidgetState
child: Center( child: Center(
child: Container( child: Container(
margin: EdgeInsets.only(top: 15), margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(8), color: Colors.white),
borderRadius: BorderRadius.circular(8), color: Colors.white),
child: ListView( child: ListView(
children: [ children: [
AppTextFieldCustomSearch( AppTextFieldCustomSearch(
searchController: patientFileInfoController, searchController: patientFileInfoController,
onChangeFun: (value) { onChangeFun: (value) {
widget.model!.filterProcedureSearchResults( widget.model!.filterProcedureSearchResults(value, widget.masterList, items);
value, widget.masterList, items);
}, },
marginTop: 5, marginTop: 5,
inputFormatters: [ inputFormatters: [FilteringTextInputFormatter.allow(RegExp(ONLY_LETTERS))],
FilteringTextInputFormatter.allow(RegExp(ONLY_LETTERS))
],
inputType: TextInputType.text, inputType: TextInputType.text,
hintText: TranslationBase.of(context).searchFavoriteTemplate, hintText: TranslationBase.of(context).searchFavoriteTemplate,
onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
height: 15, height: 15,
@ -117,17 +112,14 @@ class _EntityListCheckboxSearchFavProceduresWidgetState
addFavProcedure: widget.addFavProcedure!, addFavProcedure: widget.addFavProcedure!,
selectProcedures: widget.selectProcedures!, selectProcedures: widget.selectProcedures!,
isEntityListSelected: widget.isEntityListSelected!, isEntityListSelected: widget.isEntityListSelected!,
isEntityFavListSelected: isEntityFavListSelected: widget.isEntityFavListSelected!,
widget.isEntityFavListSelected!,
isProcedure: widget.isProcedure, isProcedure: widget.isProcedure,
groupProcedures: widget.groupProcedures!); groupProcedures: widget.groupProcedures!);
}).toList(), }).toList(),
) )
: Center( : Center(
child: Container( child: Container(
child: AppText( child: AppText(TranslationBase.of(context).sorryNoMatch, color: AppGlobal.appRedColor),
TranslationBase.of(context).sorryNoMatch,
color: AppGlobal.appRedColor),
), ),
) )
], ],

@ -4,7 +4,6 @@ import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_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/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';

@ -1,9 +1,9 @@
import 'package:connectivity/connectivity.dart'; import 'package:connectivity/connectivity.dart';
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/doctor/list_doctor_working_hours_table_model.dart';
import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart';
import 'package:doctor_app_flutter/core/service/NavigationService.dart'; import 'package:doctor_app_flutter/core/service/NavigationService.dart';
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
import 'package:doctor_app_flutter/core/model/doctor/list_doctor_working_hours_table_model.dart';
import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -12,21 +12,20 @@ import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:html/parser.dart'; import 'package:html/parser.dart';
import '../update_page.dart';
import '../config/size_config.dart'; import '../config/size_config.dart';
import '../locator.dart'; import '../locator.dart';
import '../update_page.dart';
import '../utils/dr_app_toast_msg.dart'; import '../utils/dr_app_toast_msg.dart';
import 'dr_app_shared_pref.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = DrAppSharedPreferances();
class Utils { class Utils {
static int cupertinoPickerIndex = 0; static int cupertinoPickerIndex = 0;
get currentLanguage => null; get currentLanguage => null;
static showConfirmationDialog( static showConfirmationDialog(BuildContext context, String message, Function okFunction) {
BuildContext context, String message, Function okFunction) {
return showDialog( return showDialog(
context: context, context: context,
barrierDismissible: false, // user must tap button! barrierDismissible: false, // user must tap button!
@ -63,8 +62,7 @@ class Utils {
}); });
} }
static showCupertinoPicker(context, List<GetHospitalsResponseModel> items, static showCupertinoPicker(context, List<GetHospitalsResponseModel> items, decKey, onSelectFun, AuthenticationViewModel model) {
decKey, onSelectFun, AuthenticationViewModel model) {
showModalBottomSheet( showModalBottomSheet(
isDismissible: false, isDismissible: false,
context: context, context: context,
@ -82,8 +80,7 @@ class Utils {
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[ children: <Widget>[
CupertinoButton( CupertinoButton(
child: Text(TranslationBase.of(context).cancel, child: Text(TranslationBase.of(context).cancel, style: textStyle(context)),
style: textStyle(context)),
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
}, },
@ -101,26 +98,19 @@ class Utils {
], ],
), ),
), ),
Container( Container(height: SizeConfig.realScreenHeight! * 0.3, color: Color(0xfff7f7f7), child: buildPickerItems(context, items, decKey, onSelectFun, model))
height: SizeConfig.realScreenHeight! * 0.3,
color: Color(0xfff7f7f7),
child: buildPickerItems(
context, items, decKey, onSelectFun, model))
], ],
), ),
); );
}); });
} }
static TextStyle textStyle(context) => static TextStyle textStyle(context) => TextStyle(color: Theme.of(context).primaryColor);
TextStyle(color: Theme.of(context).primaryColor);
static buildPickerItems(context, List<GetHospitalsResponseModel> items, static buildPickerItems(context, List<GetHospitalsResponseModel> items, decKey, onSelectFun, model) {
decKey, onSelectFun, model) {
return CupertinoPicker( return CupertinoPicker(
magnification: 1.5, magnification: 1.5,
scrollController: scrollController: FixedExtentScrollController(initialItem: cupertinoPickerIndex),
FixedExtentScrollController(initialItem: cupertinoPickerIndex),
children: items.map((item) { children: items.map((item) {
return Text( return Text(
'${item.facilityName}', '${item.facilityName}',
@ -146,10 +136,8 @@ class Utils {
} }
static Future<bool> checkConnection() async { static Future<bool> checkConnection() async {
ConnectivityResult connectivityResult = ConnectivityResult connectivityResult = await (Connectivity().checkConnectivity());
await (Connectivity().checkConnectivity()); if ((connectivityResult == ConnectivityResult.mobile) || (connectivityResult == ConnectivityResult.wifi)) {
if ((connectivityResult == ConnectivityResult.mobile) ||
(connectivityResult == ConnectivityResult.wifi)) {
return true; return true;
} else { } else {
return false; return false;
@ -162,8 +150,7 @@ class Utils {
listOfHours.forEach((element) { listOfHours.forEach((element) {
WorkingHours workingHours = WorkingHours(); WorkingHours workingHours = WorkingHours();
var from = element.substring( var from = element.substring(element.indexOf('m ') + 2, element.indexOf('To') - 1);
element.indexOf('m ') + 2, element.indexOf('To') - 1);
workingHours.from = from.trim(); workingHours.from = from.trim();
var to = element.substring(element.indexOf('To') + 2); var to = element.substring(element.indexOf('To') + 2);
workingHours.to = to.trim(); workingHours.to = to.trim();
@ -231,9 +218,7 @@ class Utils {
return parsedString; return parsedString;
} }
static InputDecoration textFieldSelectorDecoration( static InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {Icon? suffixIcon, Color? dropDownColor}) {
String hintText, String selectedText, bool isDropDown,
{Icon? suffixIcon, Color? dropDownColor}) {
return InputDecoration( return InputDecoration(
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
@ -263,9 +248,7 @@ class Utils {
); );
} }
static BoxDecoration containerBorderDecoration( static BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor, {double borderWidth = -1}) {
Color containerColor, Color borderColor,
{double borderWidth = -1}) {
return BoxDecoration( return BoxDecoration(
color: containerColor, color: containerColor,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
@ -325,8 +308,6 @@ class Utils {
return kpi; return kpi;
} }
static String convertToTitleCase(String text) { static String convertToTitleCase(String text) {
if (text == null) { if (text == null) {
return ""; return "";

@ -1,7 +1,4 @@
import 'dart:ui';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
@ -43,7 +40,7 @@ class AppButton extends StatefulWidget {
this.radius = 8.0, this.radius = 8.0,
this.hasBorder = false, this.hasBorder = false,
this.borderColor = Colors.white, this.borderColor = Colors.white,
this.height = 5, this.height = 50,
}); });
_AppButtonState createState() => _AppButtonState(); _AppButtonState createState() => _AppButtonState();
@ -80,8 +77,7 @@ class _AppButtonState extends State<AppButton> {
splashColor: widget.color, splashColor: widget.color,
child: Padding( child: Padding(
padding: (widget.hPadding > 0 || widget.vPadding > 0) padding: (widget.hPadding > 0 || widget.vPadding > 0)
? EdgeInsets.symmetric( ? EdgeInsets.symmetric(vertical: widget.vPadding, horizontal: widget.hPadding)
vertical: widget.vPadding, horizontal: widget.hPadding)
: EdgeInsets.only( : EdgeInsets.only(
top: widget.padding, top: widget.padding,
bottom: widget.padding, bottom: widget.padding,
@ -92,8 +88,7 @@ class _AppButtonState extends State<AppButton> {
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
if (widget.icon != null) if (widget.icon != null) Container(width: 25, height: 25, child: widget.icon),
Container(width: 25, height: 25, child: widget.icon),
if (widget.iconData != null) if (widget.iconData != null)
Icon( Icon(
widget.iconData, widget.iconData,

@ -6,8 +6,7 @@ class GifLoaderContainer extends StatefulWidget {
_GifLoaderContainerState createState() => _GifLoaderContainerState(); _GifLoaderContainerState createState() => _GifLoaderContainerState();
} }
class _GifLoaderContainerState extends State<GifLoaderContainer> class _GifLoaderContainerState extends State<GifLoaderContainer> with TickerProviderStateMixin {
with TickerProviderStateMixin {
late GifController controller1; late GifController controller1;
@override @override
@ -15,8 +14,8 @@ class _GifLoaderContainerState extends State<GifLoaderContainer>
controller1 = GifController(vsync: this); controller1 = GifController(vsync: this);
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
controller1.repeat( // controller1.repeat(
min: 0, max: 11, period: Duration(milliseconds: 750), reverse: true); // min: 0, max: 11, period: Duration(milliseconds: 750), reverse: true);
}); });
super.initState(); super.initState();
} }
@ -35,8 +34,7 @@ class _GifLoaderContainerState extends State<GifLoaderContainer>
// margin: EdgeInsets.only(bottom: 40), // margin: EdgeInsets.only(bottom: 40),
child: Gif( child: Gif(
controller: controller1, controller: controller1,
image: AssetImage( image: AssetImage("assets/images/progress-loading-red.gif"), //NetworkImage("http://img.mp.itc.cn/upload/20161107/5cad975eee9e4b45ae9d3c1238ccf91e.jpg"),
"assets/images/progress-loading-red.gif"), //NetworkImage("http://img.mp.itc.cn/upload/20161107/5cad975eee9e4b45ae9d3c1238ccf91e.jpg"),
), ),
)); ));
} }

@ -1,11 +1,10 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -22,25 +21,14 @@ class MasterKeyCheckboxSearchWidget extends StatefulWidget {
final String? buttonName; final String? buttonName;
final String? hintSearchText; final String? hintSearchText;
MasterKeyCheckboxSearchWidget( MasterKeyCheckboxSearchWidget({Key? key, this.model, this.addSelectedHistories, this.removeHistory, this.masterList, this.addHistory, this.isServiceSelected, this.buttonName, this.hintSearchText})
{Key? key,
this.model,
this.addSelectedHistories,
this.removeHistory,
this.masterList,
this.addHistory,
this.isServiceSelected,
this.buttonName,
this.hintSearchText})
: super(key: key); : super(key: key);
@override @override
_MasterKeyCheckboxSearchWidgetState createState() => _MasterKeyCheckboxSearchWidgetState createState() => _MasterKeyCheckboxSearchWidgetState();
_MasterKeyCheckboxSearchWidgetState();
} }
class _MasterKeyCheckboxSearchWidgetState class _MasterKeyCheckboxSearchWidgetState extends State<MasterKeyCheckboxSearchWidget> {
extends State<MasterKeyCheckboxSearchWidget> {
List<MasterKeyModel> items = []; List<MasterKeyModel> items = [];
TextEditingController filteredSearchController = TextEditingController(); TextEditingController filteredSearchController = TextEditingController();
@ -70,9 +58,7 @@ class _MasterKeyCheckboxSearchWidgetState
height: MediaQuery.of(context).size.height * 0.60, height: MediaQuery.of(context).size.height * 0.60,
child: Center( child: Center(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: ListView( child: ListView(
children: [ children: [
AppTextFieldCustom( AppTextFieldCustom(
@ -82,8 +68,8 @@ class _MasterKeyCheckboxSearchWidgetState
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
hasBorder: false, hasBorder: false,
controller: filteredSearchController, controller: filteredSearchController,
onChanged: (value) { onChanged: (String? value) {
filterSearchResults(value); filterSearchResults(value!);
}, },
suffixIcon: IconButton( suffixIcon: IconButton(
icon: Icon( icon: Icon(
@ -92,6 +78,8 @@ class _MasterKeyCheckboxSearchWidgetState
), ),
onPressed: () {}, onPressed: () {},
), ),
onClick: () {},
onFieldSubmitted: () {},
), ),
// SizedBox(height: 15,), // SizedBox(height: 15,),
@ -105,8 +93,7 @@ class _MasterKeyCheckboxSearchWidgetState
InkWell( InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
if (widget if (widget.isServiceSelected!(historyInfo)) {
.isServiceSelected!(historyInfo)) {
widget.removeHistory!(historyInfo); widget.removeHistory!(historyInfo);
} else { } else {
widget.addHistory!(historyInfo); widget.addHistory!(historyInfo);
@ -116,15 +103,12 @@ class _MasterKeyCheckboxSearchWidgetState
child: Row( child: Row(
children: [ children: [
Checkbox( Checkbox(
value: widget value: widget.isServiceSelected!(historyInfo),
.isServiceSelected!(historyInfo),
activeColor: Colors.red[800], activeColor: Colors.red[800],
onChanged: (bool? newValue) { onChanged: (bool? newValue) {
setState(() { setState(() {
if (widget.isServiceSelected!( if (widget.isServiceSelected!(historyInfo)) {
historyInfo)) { widget.removeHistory!(historyInfo);
widget
.removeHistory!(historyInfo);
} else { } else {
widget.addHistory!(historyInfo); widget.addHistory!(historyInfo);
} }
@ -138,9 +122,7 @@ class _MasterKeyCheckboxSearchWidgetState
: historyInfo.nameEn! : historyInfo.nameEn!
: historyInfo.nameEn!, : historyInfo.nameEn!,
color: Color(0xFF575757), color: Color(0xFF575757),
fontSize: SizeConfig fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge ? 3 : 3.8),
.getTextMultiplierBasedOnWidth() *
(SizeConfig.isWidthLarge ? 3 : 3.8),
letterSpacing: -0.56, letterSpacing: -0.56,
), ),
), ),
@ -172,8 +154,7 @@ class _MasterKeyCheckboxSearchWidgetState
if (query.isNotEmpty) { if (query.isNotEmpty) {
List<MasterKeyModel> dummyListData = []; List<MasterKeyModel> dummyListData = [];
dummySearchList.forEach((item) { dummySearchList.forEach((item) {
if (item.nameAr!.toLowerCase().contains(query.toLowerCase()) || if (item.nameAr!.toLowerCase().contains(query.toLowerCase()) || item.nameEn!.toLowerCase().contains(query.toLowerCase())) {
item.nameEn!.toLowerCase().contains(query.toLowerCase())) {
dummyListData.add(item); dummyListData.add(item);
} }
}); });

@ -11,7 +11,7 @@ import '../app_texts_widget.dart';
class AppTextFieldCustom extends StatefulWidget { class AppTextFieldCustom extends StatefulWidget {
final double height; final double height;
final Function? onClick; final Function()? onClick;
final String? hintText; final String? hintText;
final TextEditingController? controller; final TextEditingController? controller;
final bool isTextFieldHasSuffix; final bool isTextFieldHasSuffix;
@ -24,8 +24,8 @@ class AppTextFieldCustom extends StatefulWidget {
final int minLines; final int minLines;
final int maxLines; final int maxLines;
final List<TextInputFormatter>? inputFormatters; final List<TextInputFormatter>? inputFormatters;
final Function(String)? onChanged; final Function(String? value) onChanged;
final Function? onFieldSubmitted; final Function onFieldSubmitted;
final String? validationError; final String? validationError;
final bool isPrscription; final bool isPrscription;
@ -48,13 +48,13 @@ class AppTextFieldCustom extends StatefulWidget {
this.minLines = 1, this.minLines = 1,
this.maxLines = 1, this.maxLines = 1,
this.inputFormatters, this.inputFormatters,
this.onChanged, required this.onChanged,
this.validationError, this.validationError,
this.isPrscription = false, this.isPrscription = false,
this.isSecure = false, this.isSecure = false,
this.focus = false, this.focus = false,
this.isSearchTextField = false, this.isSearchTextField = false,
this.onFieldSubmitted, required this.onFieldSubmitted,
}); });
@override @override
@ -91,27 +91,21 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
TextInputType localKeyboardType = widget.inputType ?? TextInputType localKeyboardType = widget.inputType ?? (widget.maxLines == 1 ? TextInputType.text : TextInputType.multiline);
(widget.maxLines == 1 ? TextInputType.text : TextInputType.multiline);
return Column( return Column(
children: [ children: [
Container( Container(
height: widget.height != 0 && widget.maxLines == 1 height: widget.height != 0 && widget.maxLines == 1 ? widget.height + 8 : null, //MediaQuery.of(context).size.height * 0.098,
? widget.height + 8
: null, //MediaQuery.of(context).size.height * 0.098,
decoration: widget.hasBorder decoration: widget.hasBorder
? TextFieldsUtils.containerBorderDecoration( ? TextFieldsUtils.containerBorderDecoration(
Color(0Xffffffff), Color(0Xffffffff),
widget.validationError == null widget.validationError == null ? Color(0xFFEFEFEF) : Colors.red.shade700,
? Color(0xFFEFEFEF)
: Colors.red.shade700,
) )
: null, : null,
padding: padding: EdgeInsets.only(top: 4.0, bottom: 0.0, left: 8.0, right: 8.0),
EdgeInsets.only(top: 4.0, bottom: 0.0, left: 8.0, right: 8.0),
child: InkWell( child: InkWell(
onTap: widget.onClick!() ?? null, onTap: widget.onClick ?? null,
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
@ -136,40 +130,25 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
), ),
widget.dropDownText == null widget.dropDownText == null
? Container( ? Container(
height: height: widget.height != 0 && widget.maxLines == 1 ? widget.height - 22 : null,
widget.height != 0 && widget.maxLines == 1
? widget.height - 22
: null,
child: RawKeyboardListener( child: RawKeyboardListener(
focusNode: FocusNode(), focusNode: FocusNode(),
autofocus: false, autofocus: false,
onKey: (rawKeyEvent) { onKey: (rawKeyEvent) {
final isFormSkippedEnterEvent = final isFormSkippedEnterEvent = rawKeyEvent is RawKeyDownEvent && rawKeyEvent.isKeyPressed(LogicalKeyboardKey.enter);
rawKeyEvent is RawKeyDownEvent &&
rawKeyEvent.isKeyPressed(
LogicalKeyboardKey.enter);
final needToInsertNewLine = final needToInsertNewLine = isFormSkippedEnterEvent && localKeyboardType == TextInputType.multiline;
isFormSkippedEnterEvent &&
localKeyboardType ==
TextInputType.multiline;
if (needToInsertNewLine) { if (needToInsertNewLine) {
TextEditingControllerHelper.insertText( TextEditingControllerHelper.insertText(widget.controller!, '\n');
widget.controller!, '\n');
} }
}, },
child: TextFormField( child: TextFormField(
textAlign: projectViewModel.isArabic textAlign: projectViewModel.isArabic ? TextAlign.right : TextAlign.left,
? TextAlign.right
: TextAlign.left,
focusNode: _focusNode, focusNode: _focusNode,
textAlignVertical: TextAlignVertical.top, textAlignVertical: TextAlignVertical.top,
decoration: TextFieldsUtils decoration: TextFieldsUtils.textFieldSelectorDecoration(widget.hintText!, "", true),
.textFieldSelectorDecoration(
widget.hintText!, "", true),
style: TextStyle( style: TextStyle(
fontSize: fontSize: SizeConfig.textMultiplier! * 1.7,
SizeConfig.textMultiplier! * 1.7,
fontFamily: 'Poppins', fontFamily: 'Poppins',
color: Color(0xFF575757), color: Color(0xFF575757),
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
@ -180,18 +159,14 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
enabled: widget.enabled, enabled: widget.enabled,
minLines: widget.minLines, minLines: widget.minLines,
maxLines: widget.maxLines, maxLines: widget.maxLines,
inputFormatters: inputFormatters: widget.inputFormatters != null ? widget.inputFormatters : [],
widget.inputFormatters != null
? widget.inputFormatters
: [],
onChanged: (value) { onChanged: (value) {
setState(() {});
if (widget.onChanged != null) { if (widget.onChanged != null) {
widget.onChanged!(value); widget.onChanged(value);
} }
setState(() {});
}, },
onFieldSubmitted: onFieldSubmitted: widget.onFieldSubmitted(),
widget.onFieldSubmitted!(),
obscureText: widget.isSecure), obscureText: widget.isSecure),
), ),
) )
@ -210,8 +185,7 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
? Container( ? Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
bottom: widget.isSearchTextField bottom: widget.isSearchTextField
? (widget.controller!.text.isEmpty || ? (widget.controller!.text.isEmpty || widget.controller == null)
widget.controller == null)
? 10 ? 10
: 25 : 25
: 0), : 0),
@ -219,9 +193,7 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
: InkWell( : InkWell(
child: Icon( child: Icon(
Icons.keyboard_arrow_down, Icons.keyboard_arrow_down,
color: widget.dropDownColor != null color: widget.dropDownColor != null ? widget.dropDownColor : Color(0xff2E303A),
? widget.dropDownColor
: Color(0xff2E303A),
size: 12.0, size: 12.0,
), ),
) )
@ -230,9 +202,7 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
), ),
), ),
), ),
if (widget.validationError != null && if (widget.validationError != null && widget.validationError!.isNotEmpty) TextFieldsError(error: widget.validationError!),
widget.validationError!.isNotEmpty)
TextFieldsError(error: widget.validationError!),
], ],
); );
} }
@ -248,8 +218,7 @@ class TextEditingControllerHelper {
} }
final text = controller.text; final text = controller.text;
final newText = final newText = text.replaceRange(selection.start, selection.end, textToInsert);
text.replaceRange(selection.start, selection.end, textToInsert);
controller.value = controller.value.copyWith( controller.value = controller.value.copyWith(
text: newText, text: newText,
selection: TextSelection.collapsed( selection: TextSelection.collapsed(

@ -9,7 +9,7 @@ import 'app-textfield-custom.dart';
class AppTextFieldCustomSearch extends StatelessWidget { class AppTextFieldCustomSearch extends StatelessWidget {
const AppTextFieldCustomSearch({ const AppTextFieldCustomSearch({
Key? key, Key? key,
this.onChangeFun, required this.onChangeFun,
this.positionedChild, this.positionedChild,
this.marginTop, this.marginTop,
this.suffixIcon, this.suffixIcon,
@ -17,15 +17,15 @@ class AppTextFieldCustomSearch extends StatelessWidget {
this.inputType, this.inputType,
this.inputFormatters, this.inputFormatters,
this.searchController, this.searchController,
this.onFieldSubmitted, required this.onFieldSubmitted,
this.hintText, this.hintText,
this.height, this.height,
}); });
final TextEditingController? searchController; final TextEditingController? searchController;
final Function? onChangeFun; final Function onChangeFun;
final Function? onFieldSubmitted; final Function onFieldSubmitted;
final Widget? positionedChild; final Widget? positionedChild;
final IconButton? suffixIcon; final IconButton? suffixIcon;
@ -45,28 +45,26 @@ class AppTextFieldCustomSearch extends StatelessWidget {
child: Stack( child: Stack(
children: [ children: [
AppTextFieldCustom( AppTextFieldCustom(
height: height ?? 0, height: height ?? 0,
hintText: hintText: hintText ?? TranslationBase.of(context).searchPatientName,
hintText ?? TranslationBase.of(context).searchPatientName, isTextFieldHasSuffix: true,
isTextFieldHasSuffix: true, isSearchTextField: true,
isSearchTextField: true, inputFormatters: inputFormatters,
inputFormatters: inputFormatters, suffixIcon: suffixIcon ??
suffixIcon: suffixIcon ?? IconButton(
IconButton( icon: Icon(
icon: Icon( Icons.search,
Icons.search, color: Colors.black,
color: Colors.black,
),
onPressed: () {},
), ),
controller: searchController, onPressed: () {},
onChanged: onChangeFun!(), ),
onFieldSubmitted: onFieldSubmitted, controller: searchController,
validationError: validationError), onChanged: onChangeFun(),
if (positionedChild != null) onFieldSubmitted: onFieldSubmitted(),
projectViewModel.isArabic validationError: validationError,
? Positioned(left: 35, top: 5, child: positionedChild!) onClick: () {},
: Positioned(right: 35, top: 5, child: positionedChild!) ),
if (positionedChild != null) projectViewModel.isArabic ? Positioned(left: 35, top: 5, child: positionedChild!) : Positioned(right: 35, top: 5, child: positionedChild!)
], ],
), ),
); );

@ -1,8 +1,7 @@
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class CountryTextField extends StatefulWidget { class CountryTextField extends StatefulWidget {
@ -15,17 +14,7 @@ class CountryTextField extends StatefulWidget {
final double? width; final double? width;
final Function(dynamic)? okFunction; final Function(dynamic)? okFunction;
CountryTextField( CountryTextField({Key? key, required this.element, required this.elementError, this.width, this.elementList, this.keyName, this.keyId, this.hintText, this.okFunction}) : super(key: key);
{Key? key,
required this.element,
required this.elementError,
this.width,
this.elementList,
this.keyName,
this.keyId,
this.hintText,
this.okFunction})
: super(key: key);
@override @override
_CountryTextfieldState createState() => _CountryTextfieldState(); _CountryTextfieldState createState() => _CountryTextfieldState();
@ -43,12 +32,9 @@ class _CountryTextfieldState extends State<CountryTextField> {
ListSelectDialog dialog = ListSelectDialog( ListSelectDialog dialog = ListSelectDialog(
list: widget.elementList!, list: widget.elementList!,
attributeName: '${widget.keyName}', attributeName: '${widget.keyName}',
attributeValueId: widget.elementList!.length == 1 attributeValueId: widget.elementList!.length == 1 ? widget.elementList![0]['${widget.keyId}'] : '${widget.keyId}',
? widget.elementList![0]['${widget.keyId}']
: '${widget.keyId}',
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) => okFunction: (selectedValue) => widget.okFunction!(selectedValue),
widget.okFunction!(selectedValue),
); );
showDialog( showDialog(
barrierDismissible: false, barrierDismissible: false,
@ -67,9 +53,11 @@ class _CountryTextfieldState extends State<CountryTextField> {
? widget.element['${widget.keyName}'] ? widget.element['${widget.keyName}']
: null, : null,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
validationError: validationError: widget.elementList!.length != 1 ? widget.elementError : null,
widget.elementList!.length != 1 ? widget.elementError : null,
enabled: false, enabled: false,
onClick: () {},
onChanged: (String? value) {},
onFieldSubmitted: () {},
), ),
), ),
); );

Loading…
Cancel
Save