fix issues

dev_v2.8_reverting
Elham Rababh 4 years ago
parent 44c5621b3f
commit a623f5418e

@ -23,7 +23,7 @@ class LoginScreen extends StatefulWidget {
} }
class _LoginScreenState extends State<LoginScreen> { class _LoginScreenState extends State<LoginScreen> {
String platformImei; late String platformImei;
bool allowCallApi = true; bool allowCallApi = true;
//TODO change AppTextFormField to AppTextFormFieldCustom //TODO change AppTextFormField to AppTextFormFieldCustom
@ -34,7 +34,7 @@ class _LoginScreenState extends State<LoginScreen> {
List<GetHospitalsResponseModel> projectsList = []; List<GetHospitalsResponseModel> projectsList = [];
FocusNode focusPass = FocusNode(); FocusNode focusPass = FocusNode();
FocusNode focusProject = FocusNode(); FocusNode focusProject = FocusNode();
AuthenticationViewModel authenticationViewModel; late AuthenticationViewModel authenticationViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -224,8 +224,8 @@ class _LoginScreenState extends State<LoginScreen> {
login( login(
context, context,
) async { ) async {
if (loginFormKey.currentState.validate()) { if (loginFormKey.currentState!.validate()) {
loginFormKey.currentState.save(); loginFormKey.currentState!.save();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await authenticationViewModel.login(authenticationViewModel.userInfo); await authenticationViewModel.login(authenticationViewModel.userInfo);
if (authenticationViewModel.state == ViewState.ErrorLocal) { if (authenticationViewModel.state == ViewState.ErrorLocal) {
@ -251,10 +251,10 @@ class _LoginScreenState extends State<LoginScreen> {
setState(() { setState(() {
authenticationViewModel.userInfo.projectID = authenticationViewModel.userInfo.projectID =
projectsList[index].facilityId; projectsList[index].facilityId;
projectIdController.text = projectsList[index].facilityName; projectIdController.text = projectsList[index].facilityName!;
}); });
primaryFocus.unfocus(); primaryFocus!.unfocus();
} }
String memberID = ""; String memberID = "";
@ -268,7 +268,7 @@ class _LoginScreenState extends State<LoginScreen> {
setState(() { setState(() {
authenticationViewModel.userInfo.projectID = authenticationViewModel.userInfo.projectID =
projectsList[0].facilityId; projectsList[0].facilityId;
projectIdController.text = projectsList[0].facilityName; projectIdController.text = projectsList[0].facilityName!;
}); });
} }
} }

@ -41,12 +41,12 @@ class VerificationMethodsScreen extends StatefulWidget {
} }
class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> { class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
ProjectViewModel projectsProvider; late ProjectViewModel projectsProvider;
bool isMoreOption = false; bool isMoreOption = false;
bool onlySMSBox = false; bool onlySMSBox = false;
AuthMethodTypes fingerPrintBefore; AuthMethodTypes? fingerPrintBefore;
AuthMethodTypes selectedOption; late AuthMethodTypes selectedOption;
AuthenticationViewModel authenticationViewModel; late AuthenticationViewModel authenticationViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -103,7 +103,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
), ),
AppText( AppText(
Helpers.convertToTitleCase( Helpers.convertToTitleCase(
authenticationViewModel.user.doctorName), authenticationViewModel.user!.doctorName??''),
fontSize: SizeConfig fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() * .getTextMultiplierBasedOnWidth() *
6, 6,
@ -187,7 +187,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
text: authenticationViewModel text: authenticationViewModel
.getType( .getType(
authenticationViewModel authenticationViewModel
.user .user!
.logInTypeID, .logInTypeID,
context), context),
style: TextStyle( style: TextStyle(
@ -217,25 +217,25 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
children: [ children: [
AppText( AppText(
authenticationViewModel authenticationViewModel
.user.editedOn != .user!.editedOn !=
null null
? AppDateUtils ? AppDateUtils
.getDayMonthYearDateFormatted( .getDayMonthYearDateFormatted(
AppDateUtils AppDateUtils
.convertStringToDate( .convertStringToDate(
authenticationViewModel authenticationViewModel
.user .user!
.editedOn), .editedOn!),
isMonthShort: true) isMonthShort: true)
: authenticationViewModel : authenticationViewModel
.user.createdOn != .user!.createdOn! !=
null null
? AppDateUtils.getDayMonthYearDateFormatted( ? AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils AppDateUtils
.convertStringToDate( .convertStringToDate(
authenticationViewModel authenticationViewModel
.user .user!
.createdOn), .createdOn!),
isMonthShort: true) isMonthShort: true)
: '--', : '--',
textAlign: TextAlign.right, textAlign: TextAlign.right,
@ -248,21 +248,21 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
), ),
AppText( AppText(
authenticationViewModel authenticationViewModel
.user.editedOn != .user!.editedOn! !=
null null
? AppDateUtils.getHour(AppDateUtils ? AppDateUtils.getHour(AppDateUtils
.convertStringToDate( .convertStringToDate(
authenticationViewModel authenticationViewModel
.user.editedOn)) .user!.editedOn!))
: authenticationViewModel : authenticationViewModel
.user.createdOn != .user!.createdOn! !=
null null
? AppDateUtils.getHour( ? AppDateUtils.getHour(
AppDateUtils AppDateUtils
.convertStringToDate( .convertStringToDate(
authenticationViewModel authenticationViewModel
.user .user!
.createdOn)) .createdOn!))
: '--', : '--',
textAlign: TextAlign.right, textAlign: TextAlign.right,
fontSize: SizeConfig fontSize: SizeConfig
@ -355,8 +355,8 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
SelectedAuthMethodTypesService SelectedAuthMethodTypesService
.getMethodsTypeService( .getMethodsTypeService(
authenticationViewModel authenticationViewModel
.user .user!
.logInTypeID), .logInTypeID!),
authenticateUser: authenticateUser:
(AuthMethodTypes (AuthMethodTypes
authMethodType, authMethodType,
@ -490,15 +490,12 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
); );
} }
sendActivationCodeByOtpNotificationType( sendActivationCodeByOtpNotificationType(AuthMethodTypes authMethodType) async {
AuthMethodTypes authMethodType) async { if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) {
if (authMethodType == AuthMethodTypes.SMS ||
authMethodType == AuthMethodTypes.WhatsApp) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await authenticationViewModel.sendActivationCodeForDoctorApp( await authenticationViewModel.sendActivationCodeForDoctorApp(
authMethodType: authMethodType, authMethodType: authMethodType, password: authenticationViewModel.userInfo.password!);
password: authenticationViewModel.userInfo.password);
if (authenticationViewModel.state == ViewState.ErrorLocal) { if (authenticationViewModel.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(authenticationViewModel.error); Helpers.showErrorToast(authenticationViewModel.error);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -523,12 +520,9 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
Helpers.showErrorToast(authenticationViewModel.error); Helpers.showErrorToast(authenticationViewModel.error);
} else { } else {
await sharedPref.setString( await sharedPref.setString(TOKEN,
TOKEN, authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID!);
authenticationViewModel if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) {
.activationCodeVerificationScreenRes.logInTokenID);
if (authMethodType == AuthMethodTypes.SMS ||
authMethodType == AuthMethodTypes.WhatsApp) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
this.startSMSService(authMethodType, isSilentLogin: true); this.startSMSService(authMethodType, isSilentLogin: true);
} else { } else {
@ -542,8 +536,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
authMethodType == AuthMethodTypes.FaceID) { authMethodType == AuthMethodTypes.FaceID) {
fingerPrintBefore = authMethodType; fingerPrintBefore = authMethodType;
} }
this.selectedOption = this.selectedOption = (fingerPrintBefore != null ? fingerPrintBefore : authMethodType)!;
fingerPrintBefore != null ? fingerPrintBefore : authMethodType;
switch (authMethodType) { switch (authMethodType) {
case AuthMethodTypes.SMS: case AuthMethodTypes.SMS:
@ -578,8 +571,8 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
context, context,
type, type,
authenticationViewModel.loggedUser != null authenticationViewModel.loggedUser != null
? authenticationViewModel.loggedUser.mobileNumber ? authenticationViewModel.loggedUser!.mobileNumber
: authenticationViewModel.user.mobile, : authenticationViewModel.user!.mobile,
(value) { (value) {
showDialog( showDialog(
context: context, context: context,
@ -601,11 +594,9 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
await authenticationViewModel.showIOSAuthMessages(); await authenticationViewModel.showIOSAuthMessages();
if (!mounted) return; if (!mounted) return;
if (authenticationViewModel.user != null && if (authenticationViewModel.user != null &&
(SelectedAuthMethodTypesService.getMethodsTypeService( (SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user!.logInTypeID!) ==
authenticationViewModel.user.logInTypeID) ==
AuthMethodTypes.Fingerprint || AuthMethodTypes.Fingerprint ||
SelectedAuthMethodTypesService.getMethodsTypeService( SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user!.logInTypeID!) ==
authenticationViewModel.user.logInTypeID) ==
AuthMethodTypes.FaceID)) { AuthMethodTypes.FaceID)) {
this.sendActivationCode(authMethodTypes); this.sendActivationCode(authMethodTypes);
} else { } else {
@ -616,19 +607,22 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
} }
} }
checkActivationCode({String value, bool isSilentLogin = false}) async { checkActivationCode({String? value,bool isSilentLogin = false}) async {
await authenticationViewModel.checkActivationCodeForDoctorApp( await authenticationViewModel.checkActivationCodeForDoctorApp(activationCode: value!,isSilentLogin: isSilentLogin);
activationCode: value, isSilentLogin: isSilentLogin);
if (authenticationViewModel.state == ViewState.ErrorLocal) { if (authenticationViewModel.state == ViewState.ErrorLocal) {
Navigator.pop(context); Navigator.pop(context);
Helpers.showErrorToast(authenticationViewModel.error); Helpers.showErrorToast(authenticationViewModel.error);
} else { } else {
await authenticationViewModel.onCheckActivationCodeSuccess(); await authenticationViewModel.onCheckActivationCodeSuccess();
if (value != null) { if(value !=null){
if (Navigator.canPop(context)) Navigator.pop(context); if(Navigator.canPop(context))
} Navigator.pop(context);
if (Navigator.canPop(context)) Navigator.pop(context); }
navigateToLandingPage(); if(Navigator.canPop(context))
Navigator.pop(context);
navigateToLandingPage();
} }
} }

@ -5,11 +5,11 @@ import 'package:provider/provider.dart';
import '../../locator.dart'; import '../../locator.dart';
class BaseView<T extends BaseViewModel> extends StatefulWidget { class BaseView<T extends BaseViewModel> extends StatefulWidget {
final Widget Function(BuildContext context, T model, Widget child) builder; final Widget Function(BuildContext context, T model, Widget? child) builder;
final Function(T) onModelReady; final Function(T)? onModelReady;
BaseView({ BaseView({
this.builder, required this.builder,
this.onModelReady, this.onModelReady,
}); });
@ -18,14 +18,14 @@ class BaseView<T extends BaseViewModel> extends StatefulWidget {
} }
class _BaseViewState<T extends BaseViewModel> extends State<BaseView<T>> { class _BaseViewState<T extends BaseViewModel> extends State<BaseView<T>> {
T model = locator<T>(); T? model = locator<T>();
bool isLogin = false; bool isLogin = false;
@override @override
void initState() { void initState() {
if (widget.onModelReady != null) { if (widget.onModelReady != null) {
widget.onModelReady(model); widget.onModelReady!(model!);
} }
super.initState(); super.initState();

@ -12,9 +12,8 @@ import 'package:flutter/material.dart';
import 'doctor_repaly_chat.dart'; import 'doctor_repaly_chat.dart';
class AllDoctorQuestions extends StatefulWidget { class AllDoctorQuestions extends StatefulWidget {
final Function changeCurrentTab;
const AllDoctorQuestions({Key ? key, this.changeCurrentTab}) : super(key: key); const AllDoctorQuestions({Key? key}) : super(key: key);
@override @override
_AllDoctorQuestionsState createState() => _AllDoctorQuestionsState(); _AllDoctorQuestionsState createState() => _AllDoctorQuestionsState();
@ -82,7 +81,7 @@ class _AllDoctorQuestionsState extends State<AllDoctorQuestions> {
}); });
model.getDoctorReply(pageIndex: pageIndex); model.getDoctorReply(pageIndex: pageIndex);
} }
return; return false;
}, },
), ),
), ),

@ -25,7 +25,7 @@ class DoctorReplayChat extends StatefulWidget {
final DoctorReplayViewModel previousModel; final DoctorReplayViewModel previousModel;
bool showMsgBox = false; bool showMsgBox = false;
DoctorReplayChat( DoctorReplayChat(
{Key ? key, this.reply, this.previousModel, {Key? key, required this.reply, required this.previousModel,
}); });
@override @override
@ -38,8 +38,8 @@ class _DoctorReplayChatState extends State<DoctorReplayChat> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if(widget.reply.doctorResponse.isNotEmpty){ if(widget.reply.doctorResponse!.isNotEmpty){
msgController.text = widget.reply.doctorResponse; msgController.text = widget.reply.doctorResponse!;
} else { } else {
widget.showMsgBox = true; widget.showMsgBox = true;
@ -173,7 +173,7 @@ class _DoctorReplayChatState extends State<DoctorReplayChat> {
margin: EdgeInsets.symmetric(horizontal: 0), margin: EdgeInsets.symmetric(horizontal: 0),
child: InkWell( child: InkWell(
onTap: () { onTap: () {
launch("tel://" +widget.reply.mobileNumber); launch("tel://" +widget.reply.mobileNumber!);
}, },
child: Icon( child: Icon(
Icons.phone, Icons.phone,
@ -195,7 +195,7 @@ class _DoctorReplayChatState extends State<DoctorReplayChat> {
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8,
), ),
AppText( AppText(
widget.reply.createdOn !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn)):AppDateUtils.getHour(DateTime.now()), widget.reply.createdOn !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn!)):AppDateUtils.getHour(DateTime.now()),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8,
fontFamily: 'Poppins', fontFamily: 'Poppins',
color: Colors.white, color: Colors.white,
@ -237,7 +237,7 @@ class _DoctorReplayChatState extends State<DoctorReplayChat> {
SizedBox(height: 30,), SizedBox(height: 30,),
SizedBox(height: 30,), SizedBox(height: 30,),
if(widget.reply.doctorResponse != null && widget.reply.doctorResponse.isNotEmpty) if(widget.reply.doctorResponse != null && widget.reply.doctorResponse!.isNotEmpty)
Align( Align(
alignment: Alignment.centerRight, alignment: Alignment.centerRight,
child: Container( child: Container(

@ -30,7 +30,7 @@ import 'not_replaied_Doctor_Questions.dart';
class DoctorReplyScreen extends StatefulWidget { class DoctorReplyScreen extends StatefulWidget {
final Function changeCurrentTab; final Function changeCurrentTab;
const DoctorReplyScreen({Key ? key, this.changeCurrentTab}) : super(key: key); const DoctorReplyScreen({Key? key, required this.changeCurrentTab}) : super(key: key);
@override @override
_DoctorReplyScreenState createState() => _DoctorReplyScreenState(); _DoctorReplyScreenState createState() => _DoctorReplyScreenState();
@ -38,7 +38,7 @@ class DoctorReplyScreen extends StatefulWidget {
class _DoctorReplyScreenState extends State<DoctorReplyScreen> class _DoctorReplyScreenState extends State<DoctorReplyScreen>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
TabController _tabController; late TabController _tabController;
int _activeTab = 0; int _activeTab = 0;
int pageIndex = 1; int pageIndex = 1;

@ -18,7 +18,7 @@ class DoctorReplyWidget extends StatefulWidget {
final ListGtMyPatientsQuestions reply; final ListGtMyPatientsQuestions reply;
bool isShowMore = false; bool isShowMore = false;
DoctorReplyWidget({Key ? key, this.reply}); DoctorReplyWidget({Key? key, required this.reply});
@override @override
_DoctorReplyWidgetState createState() => _DoctorReplyWidgetState(); _DoctorReplyWidgetState createState() => _DoctorReplyWidgetState();
@ -88,35 +88,21 @@ class _DoctorReplyWidgetState extends State<DoctorReplyWidget> {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
AppText( AppText(
AppDateUtils.getDateTimeFromServerFormat( AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn!).day.toString() +
widget.reply.createdOn)
.day
.toString() +
" " + " " +
AppDateUtils.getMonth( AppDateUtils.getMonth(
AppDateUtils.getDateTimeFromServerFormat( AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn!).month)
widget.reply.createdOn)
.month)
.toString() .toString()
.substring(0, 3) + .substring(0, 3) +
' ' + ' ' +
AppDateUtils.getDateTimeFromServerFormat( AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn!).year.toString(),
widget.reply.createdOn)
.year
.toString(),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
AppText( AppText(
AppDateUtils.getDateTimeFromServerFormat( AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn!).hour.toString() +
widget.reply.createdOn)
.hour
.toString() +
":" + ":" +
AppDateUtils.getDateTimeFromServerFormat( AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn!).minute.toString(),
widget.reply.createdOn)
.minute
.toString(),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
) )
@ -139,7 +125,7 @@ class _DoctorReplyWidgetState extends State<DoctorReplyWidget> {
margin: EdgeInsets.symmetric(horizontal: 4), margin: EdgeInsets.symmetric(horizontal: 4),
child: InkWell( child: InkWell(
onTap: () { onTap: () {
launch("tel://" + widget.reply.mobileNumber); launch("tel://" + widget.reply.mobileNumber!);
}, },
child: Icon( child: Icon(
Icons.phone, Icons.phone,
@ -208,7 +194,7 @@ class _DoctorReplyWidgetState extends State<DoctorReplyWidget> {
label: TranslationBase.of(context).age + " : ", label: TranslationBase.of(context).age + " : ",
isCopyable:false, isCopyable:false,
value: value:
"${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth, context)}", "${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth!, context)}",
), ),
SizedBox( SizedBox(
height: 8, height: 8,

@ -90,7 +90,7 @@ class _NotRepliedDoctorQuestionsState extends State<NotRepliedDoctorQuestions> {
}); });
model.getDoctorReply(pageIndex: pageIndex, isGettingNotReply: true); model.getDoctorReply(pageIndex: pageIndex, isGettingNotReply: true);
} }
return; return false;
}, },
), ),
), ),

@ -14,9 +14,8 @@ class PatientArrivalScreen extends StatefulWidget {
_PatientArrivalScreen createState() => _PatientArrivalScreen(); _PatientArrivalScreen createState() => _PatientArrivalScreen();
} }
class _PatientArrivalScreen extends State<PatientArrivalScreen> class _PatientArrivalScreen extends State<PatientArrivalScreen> with SingleTickerProviderStateMixin {
with SingleTickerProviderStateMixin { late TabController _tabController;
TabController _tabController;
var _patientSearchFormValues = PatientModel( var _patientSearchFormValues = PatientModel(
FirstName: "0", FirstName: "0",
MiddleName: "0", MiddleName: "0",

@ -13,11 +13,11 @@ import 'package:flutter/material.dart';
import 'label.dart'; import 'label.dart';
class DashboardReferralPatient extends StatelessWidget { class DashboardReferralPatient extends StatelessWidget {
final List<DashboardModel> dashboardItemList; final List<DashboardModel>? dashboardItemList;
final double height; final double? height;
final DashboardViewModel model; final DashboardViewModel? model;
const DashboardReferralPatient({Key ? key, this.dashboardItemList, this.height, this.model}) : super(key: key); const DashboardReferralPatient({Key? key, this.dashboardItemList, this.height, this.model}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(

@ -19,13 +19,9 @@ class DashboardSliderItemWidget extends StatelessWidget {
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Label(
margin: EdgeInsets.symmetric(horizontal: SizeConfig.widthMultiplier *1), firstLine: Helpers.getLabelFromKPI(item.kPIName!),
secondLine: Helpers.getNameFromKPI(item.kPIName!),
child: Label(
firstLine: Helpers.getLabelFromKPI(item.kPIName),
secondLine: Helpers.getNameFromKPI(item.kPIName),
),
), ),
], ],
), ),
@ -40,8 +36,8 @@ class DashboardSliderItemWidget extends StatelessWidget {
: 13), : 13),
child: ListView( child: ListView(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
children: List.generate(item.summaryoptions.length, (int index) { children: List.generate(item.summaryoptions!.length, (int index) {
return GetActivityCard(item.summaryoptions[index]); return GetActivityCard(item.summaryoptions![index]);
}))) })))
], ],
); );

@ -5,24 +5,22 @@ import 'package:hexcolor/hexcolor.dart';
class HomePageCard extends StatelessWidget { class HomePageCard extends StatelessWidget {
const HomePageCard( const HomePageCard(
{this.hasBorder = false, {this.hasBorder = false,
this.imageName, this.imageName,
this.child, required this.child,
this.onTap, required this.onTap,
Key ? key, Key? key,
this.color, required this.color,
this.opacity = 0.4, this.opacity = 0.4,
this.margin, this.width, this.gradient}) required this.margin, this.width})
: super(key: key); : super(key: key);
final bool hasBorder; final bool hasBorder;
final String imageName; final String? imageName;
final Widget child; final Widget child;
final GestureTapCallback onTap; final GestureTapCallback onTap;
final Color color; final Color color;
final double opacity; final double opacity;
final double width; final double? width;
final EdgeInsets margin; final EdgeInsets margin;
final LinearGradient gradient;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return InkWell( return InkWell(

@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
class HomePatientCard extends StatelessWidget { class HomePatientCard extends StatelessWidget {
final Color backgroundColor; final Color backgroundColor;
final IconData cardIcon; final IconData cardIcon;
final String cardIconImage; final String? cardIconImage;
final Color backgroundIconColor; final Color backgroundIconColor;
final String text; final String text;
final Color textColor; final Color textColor;
@ -15,14 +15,14 @@ class HomePatientCard extends StatelessWidget {
final LinearGradient gradient; final LinearGradient gradient;
HomePatientCard({ HomePatientCard({
this.backgroundColor, required this.backgroundColor,
this.backgroundIconColor, required this.backgroundIconColor,
this.cardIcon, required this.cardIcon,
this.cardIconImage, this.cardIconImage,
this.text, required this.text,
this.textColor, required this.textColor,
this.onTap, required this.onTap,
this.iconSize = 30, this.gradient, this.iconSize = 30, required this.gradient,
}); });
@override @override

@ -3,15 +3,16 @@ import 'package:doctor_app_flutter/config/size_config.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:flutter/material.dart'; import 'package:flutter/material.dart';
// ignore: must_be_immutable
class Label extends StatelessWidget { class Label extends StatelessWidget {
Label({ Label({
Key ? key, this.firstLine, this.secondLine, this.color= const Color(0xFF2E303A), this.secondLineFontSize, this.firstLineFontSize, Key? key, this.firstLine, this.secondLine, this.color= const Color(0xFF2E303A), this.secondLineFontSize, this.firstLineFontSize,
}) : super(key: key); }) : super(key: key);
final String firstLine; final String? firstLine;
final String secondLine; final String? secondLine;
Color color; Color color;
final double secondLineFontSize; final double? secondLineFontSize;
final double firstLineFontSize; final double? firstLineFontSize;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -23,7 +23,7 @@ import 'package:speech_to_text/speech_to_text.dart' as stt;
class LivaCareTransferToAdmin extends StatefulWidget { class LivaCareTransferToAdmin extends StatefulWidget {
final PatiantInformtion patient; final PatiantInformtion patient;
const LivaCareTransferToAdmin({Key ? key, this.patient}) : super(key: key); const LivaCareTransferToAdmin({Key? key, required this.patient}) : super(key: key);
@override @override
_LivaCareTransferToAdminState createState() => _LivaCareTransferToAdminState createState() =>
@ -34,10 +34,10 @@ class _LivaCareTransferToAdminState extends State<LivaCareTransferToAdmin> {
stt.SpeechToText speech = stt.SpeechToText(); stt.SpeechToText speech = stt.SpeechToText();
var reconizedWord; var reconizedWord;
var event = RobotProvider(); var event = RobotProvider();
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
TextEditingController noteController = TextEditingController(); TextEditingController noteController = TextEditingController();
String noteError; late String noteError;
void initState() { void initState() {
requestPermissions(); requestPermissions();

@ -31,8 +31,8 @@ class LiveCarePatientScreen extends StatefulWidget {
class _LiveCarePatientScreenState extends State<LiveCarePatientScreen> { class _LiveCarePatientScreenState extends State<LiveCarePatientScreen> {
final _controller = TextEditingController(); final _controller = TextEditingController();
Timer timer; late Timer timer;
LiveCarePatientViewModel _liveCareViewModel; late LiveCarePatientViewModel _liveCareViewModel;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -46,8 +46,8 @@ class _LiveCarePatientScreenState extends State<LiveCarePatientScreen> {
@override @override
void dispose() { void dispose() {
_liveCareViewModel.isLogin(0); _liveCareViewModel.isLogin(0);
_liveCareViewModel = null; // _liveCareViewModel = null!;
timer?.cancel(); timer.cancel();
super.dispose(); super.dispose();
} }

@ -21,7 +21,7 @@ DrAppSharedPreferances sharedPref = DrAppSharedPreferances();
class LiveCarePandingListScreen extends StatefulWidget { class LiveCarePandingListScreen extends StatefulWidget {
// In the constructor, require a item id. // In the constructor, require a item id.
LiveCarePandingListScreen({Key ? key}) : super(key: key); LiveCarePandingListScreen({Key? key}) : super(key: key);
@override @override
_LiveCarePandingListState createState() => _LiveCarePandingListState(); _LiveCarePandingListState createState() => _LiveCarePandingListState();
@ -31,7 +31,7 @@ class _LiveCarePandingListState extends State<LiveCarePandingListScreen> {
List<LiveCarePendingListResponse> _data = []; List<LiveCarePendingListResponse> _data = [];
Helpers helpers = new Helpers(); Helpers helpers = new Helpers();
bool _isInit = true; bool _isInit = true;
LiveCareViewModel _liveCareProvider; late LiveCareViewModel _liveCareProvider;
@override @override
void didChangeDependencies() { void didChangeDependencies() {
super.didChangeDependencies(); super.didChangeDependencies();
@ -96,7 +96,7 @@ class _LiveCarePandingListState extends State<LiveCarePandingListScreen> {
1, 1), 1, 1),
colors: [ colors: [
Colors.grey[ Colors.grey[
100], 100]!,
Colors.grey[ Colors.grey[
200], 200],
]), ]),

@ -19,7 +19,8 @@ class VideoCallPage extends StatefulWidget {
final PatiantInformtion patientData; final PatiantInformtion patientData;
final listContext; final listContext;
final LiveCarePatientViewModel model; final LiveCarePatientViewModel model;
VideoCallPage({this.patientData, this.listContext, this.model}); VideoCallPage(
{required this.patientData, this.listContext, required this.model});
@override @override
_VideoCallPageState createState() => _VideoCallPageState(); _VideoCallPageState createState() => _VideoCallPageState();
@ -28,10 +29,10 @@ class VideoCallPage extends StatefulWidget {
DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = DrAppSharedPreferances();
class _VideoCallPageState extends State<VideoCallPage> { class _VideoCallPageState extends State<VideoCallPage> {
Timer _timmerInstance; late Timer _timmerInstance;
int _start = 0; int _start = 0;
String _timmer = ''; String _timmer = '';
LiveCareViewModel _liveCareProvider; late LiveCareViewModel _liveCareProvider;
bool _isInit = true; bool _isInit = true;
var _tokenData; var _tokenData;
bool isTransfer = false; bool isTransfer = false;
@ -67,8 +68,12 @@ class _VideoCallPageState extends State<VideoCallPage> {
//'1_MX40NjgwMzIyNH5-MTU5MzY4MzYzODYwM35ucExWYVRVSm5Hcy9uWGZmM1lOa3czZHV-fg', //'1_MX40NjgwMzIyNH5-MTU5MzY4MzYzODYwM35ucExWYVRVSm5Hcy9uWGZmM1lOa3czZHV-fg',
kApiKey: '46209962', kApiKey: '46209962',
vcId: widget.patientData.vcId, vcId: widget.patientData.vcId,
isRecording: tokenData != null ? tokenData.isRecording: false, isRecording: tokenData != null ? tokenData.isRecording! : false,
patientName: widget.patientData.fullName ?? widget.patientData.firstName != null ? "${widget.patientData.firstName} ${widget.patientData.lastName}" : "-", patientName: widget.patientData.fullName != null
? widget.patientData.fullName!
: widget.patientData.firstName != null
? "${widget.patientData.firstName} ${widget.patientData.lastName}"
: "-",
tokenID: token, //"hfkjshdf347r8743", tokenID: token, //"hfkjshdf347r8743",
generalId: "Cs2020@2016\$2958", generalId: "Cs2020@2016\$2958",
doctorId: doctorprofile['DoctorID'], doctorId: doctorprofile['DoctorID'],
@ -78,13 +83,13 @@ class _VideoCallPageState extends State<VideoCallPage> {
}, },
onCallEnd: () { onCallEnd: () {
//TODO handling onCallEnd //TODO handling onCallEnd
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance!.addPostFrameCallback((_) {
changeRoute(context); changeRoute(context);
}); });
}, },
onCallNotRespond: (SessionStatusModel sessionStatusModel) { onCallNotRespond: (SessionStatusModel sessionStatusModel) {
//TODO handling onCalNotRespondEnd //TODO handling onCalNotRespondEnd
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance!.addPostFrameCallback((_) {
changeRoute(context); changeRoute(context);
}); });
}); });
@ -137,7 +142,7 @@ class _VideoCallPageState extends State<VideoCallPage> {
height: MediaQuery.of(context).size.height * 0.02, height: MediaQuery.of(context).size.height * 0.02,
), ),
Text( Text(
widget.patientData.fullName, widget.patientData.fullName!,
style: TextStyle( style: TextStyle(
color: Colors.deepPurpleAccent, color: Colors.deepPurpleAccent,
fontWeight: FontWeight.w900, fontWeight: FontWeight.w900,

@ -6,7 +6,6 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/medical-file/medical_file_details.dart'; import 'package:doctor_app_flutter/screens/medical-file/medical_file_details.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_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/doctor_card.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart';
@ -19,23 +18,23 @@ class HealthSummaryPage extends StatefulWidget {
} }
class _HealthSummaryPageState extends State<HealthSummaryPage> { class _HealthSummaryPageState extends State<HealthSummaryPage> {
PatiantInformtion patient; late PatiantInformtion patient;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
patient = routeArgs['patient']; patient = routeArgs['patient'];
String patientType = routeArgs['patientType']; String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType']; String arrivalType = routeArgs['arrivalType'];
bool isInpatient = routeArgs['isInpatient']; bool isInpatient = routeArgs['isInpatient'];
return BaseView<MedicalFileViewModel>( return BaseView<MedicalFileViewModel>(
onModelReady: (model) => model.getMedicalFile(mrn: patient.patientId), onModelReady: (model) => model.getMedicalFile(mrn: patient.patientId),
builder: (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold( builder: (BuildContext context, MedicalFileViewModel model, Widget? child) => AppScaffold(
appBar: PatientProfileAppBar( patientProfileAppBarModel: PatientProfileAppBarModel(
patient, patient: patient,
isInpatient: isInpatient, isInpatient: isInpatient,
), ),
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(), appBarTitle: TranslationBase.of(context).medicalReport!.toUpperCase(),
body: NetworkBaseView( body: NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: SingleChildScrollView( child: SingleChildScrollView(
@ -75,86 +74,88 @@ class _HealthSummaryPageState extends State<HealthSummaryPage> {
), ),
(model.medicalFileList != null && model.medicalFileList.length != 0) (model.medicalFileList != null && model.medicalFileList.length != 0)
? ListView.builder( ? ListView.builder(
//physics: , //physics: ,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
itemCount: model.medicalFileList[0].entityList[0].timelines.length, itemCount: model.medicalFileList[0].entityList![0].timelines!.length,
itemBuilder: (BuildContext ctxt, int index) { itemBuilder: (BuildContext ctxt, int index) {
return InkWell( return InkWell(
onTap: () async { onTap: () async{
if (model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0] if (model.medicalFileList[0].entityList![0].timelines![index].timeLineEvents![0]
.consulations.length != .consulations!.length !=
0) 0)
await locator<AnalyticsService>().logEvent( await locator<AnalyticsService>().logEvent(
eventCategory: "Health Summary Page", eventCategory: "Health Summary Page",
eventAction: "Health Summary Details", eventAction: "Health Summary Details",
); );Navigator.push(
Navigator.push( context,
context, MaterialPageRoute(
MaterialPageRoute( builder: (context) => MedicalFileDetails(
builder: (context) => MedicalFileDetails( age: patient.age is String ? patient.age ?? "" : "${patient.age}",
age: patient.age is String ? patient.age ?? "" : "${patient.age}", firstName: patient.firstName ?? "",
firstName: patient.firstName, lastName: patient.lastName ?? "",
lastName: patient.lastName, gender: patient.genderDescription ?? "",
gender: patient.genderDescription, encounterNumber: index,
encounterNumber: index, pp: patient.patientId,
pp: patient.patientId, patient: patient,
patient: patient, doctorName: model.medicalFileList[0].entityList![0].timelines![index]
doctorName: model.medicalFileList[0].entityList[0].timelines[index] .timeLineEvents![0].consulations!.isNotEmpty
.timeLineEvents[0].consulations.isNotEmpty ? model.medicalFileList[0].entityList![0].timelines![index].doctorName
? model.medicalFileList[0].entityList[0].timelines[index].doctorName : "",
: "", clinicName: model.medicalFileList[0].entityList![0].timelines![index]
clinicName: model.medicalFileList[0].entityList[0].timelines[index] .timeLineEvents![0].consulations!.isNotEmpty
.timeLineEvents[0].consulations.isNotEmpty ? model.medicalFileList[0].entityList![0].timelines![index].clinicName
? model.medicalFileList[0].entityList[0].timelines[index].clinicName : "",
: "", doctorImage: model.medicalFileList[0].entityList![0].timelines![index]
doctorImage: model.medicalFileList[0].entityList[0].timelines[index] .timeLineEvents![0].consulations!.isNotEmpty
.timeLineEvents[0].consulations.isNotEmpty ? model.medicalFileList[0].entityList![0].timelines![index].doctorImage
? model.medicalFileList[0].entityList[0].timelines[index].doctorImage : "",
: "", episode: model.medicalFileList[0].entityList![0].timelines![index]
episode: model.medicalFileList[0].entityList[0].timelines[index] .timeLineEvents![0].consulations!.isNotEmpty
.timeLineEvents[0].consulations.isNotEmpty ? model.medicalFileList[0].entityList![0].timelines![index]
? model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0] .timeLineEvents![0]
.consulations[0].episodeID .consulations![0].episodeID
.toString() .toString()
: "", : "",
vistDate: model.medicalFileList[0].entityList[0].timelines[index].date.toString()), vistDate: model.medicalFileList[0].entityList![0].timelines![index].date
settings: RouteSettings(name: 'MedicalFileDetails'), .toString()),
), settings: RouteSettings(name: 'MedicalFileDetails'),
); ),
},
child: DoctorCard(
doctorName: model.medicalFileList[0].entityList[0].timelines[index].doctorName,
clinic: model.medicalFileList[0].entityList[0].timelines[index].clinicName,
branch: model.medicalFileList[0].entityList[0].timelines[index].projectName,
profileUrl: model.medicalFileList[0].entityList[0].timelines[index].doctorImage,
appointmentDate: AppDateUtils.getDateTimeFromServerFormat(
model.medicalFileList[0].entityList[0].timelines[index].date,
),
isPrescriptions: true,
isShowEye: model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0]
.consulations.length !=
0
? true
: false),
); );
}) },
: Center( child: DoctorCard(
child: Column( doctorName:
crossAxisAlignment: CrossAxisAlignment.center, model.medicalFileList[0].entityList![0].timelines![index].doctorName ?? "",
children: [ clinic: model.medicalFileList[0].entityList![0].timelines![index].clinicName ?? "",
SizedBox( branch: model.medicalFileList[0].entityList![0].timelines![index].projectName ?? "",
height: 100, profileUrl:
model.medicalFileList[0].entityList![0].timelines![index].doctorImage ?? "",
appointmentDate: AppDateUtils.getDateTimeFromServerFormat(
model.medicalFileList[0].entityList![0].timelines![index].date ?? "",
), ),
Image.asset('assets/images/no-data.png'), isPrescriptions: true,
Padding( isShowEye: model.medicalFileList[0].entityList![0].timelines![index].timeLineEvents![0].consulations!.length !=
padding: const EdgeInsets.all(8.0), 0
child: AppText(TranslationBase.of(context).noMedicalFileFound), ? true
) : false),
], );
), })
: Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 100,
),
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(8.0),
child: AppText(TranslationBase.of(context).noMedicalFileFound),
) )
],
),
)
], ],
), ),
), ),

@ -33,7 +33,7 @@ DrAppSharedPreferances sharedPref = DrAppSharedPreferances();
class MedicineSearchScreen extends StatefulWidget with DrAppToastMsg { class MedicineSearchScreen extends StatefulWidget with DrAppToastMsg {
MedicineSearchScreen({this.changeLoadingState}); MedicineSearchScreen({this.changeLoadingState});
final Function changeLoadingState; final Function? changeLoadingState;
@override @override
_MedicineSearchState createState() => _MedicineSearchState(); _MedicineSearchState createState() => _MedicineSearchState();
@ -48,17 +48,16 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
bool _isInit = true; bool _isInit = true;
final SpeechToText speech = SpeechToText(); final SpeechToText speech = SpeechToText();
String lastStatus = ''; String lastStatus = '';
GetMedicationResponseModel _selectedMedication; late GetMedicationResponseModel _selectedMedication;
GlobalKey key = GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
// String lastWords; // String lastWords;
List<LocaleName> _localeNames = []; List<LocaleName> _localeNames = [];
String lastError; late String lastError;
double level = 0.0; double level = 0.0;
double minSoundLevel = 50000; double minSoundLevel = 50000;
double maxSoundLevel = -50000; double maxSoundLevel = -50000;
String reconizedWord; late String reconizedWord;
@override @override
void didChangeDependencies() { void didChangeDependencies() {

@ -23,8 +23,7 @@ class PharmaciesListScreen extends StatefulWidget {
final String url; final String url;
PharmaciesListScreen({Key ? key, @required this.itemID, this.url}) PharmaciesListScreen({Key? key, required this.itemID, required this.url}) : super(key: key);
: super(key: key);
@override @override
_PharmaciesListState createState() => _PharmaciesListState(); _PharmaciesListState createState() => _PharmaciesListState();
@ -32,8 +31,7 @@ class PharmaciesListScreen extends StatefulWidget {
class _PharmaciesListState extends State<PharmaciesListScreen> { class _PharmaciesListState extends State<PharmaciesListScreen> {
Helpers helpers = new Helpers(); Helpers helpers = new Helpers();
ProjectViewModel projectsProvider; late ProjectViewModel projectsProvider;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -230,9 +228,8 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
} }
//TODO CHECK THE URL IS NULL OR NOT //TODO CHECK THE URL IS NULL OR NOT
Uint8List dataFromBase64String(String base64String) { Uint8List? dataFromBase64String(String base64String) {
if(base64String !=null) if (base64String != null) return base64Decode(base64String);
return base64Decode(base64String);
} }
String base64String(Uint8List data) { String base64String(Uint8List data) {

@ -24,13 +24,13 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class PatientSickLeaveScreen extends StatelessWidget { class PatientSickLeaveScreen extends StatelessWidget {
PatiantInformtion patient; late PatiantInformtion patient;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectsProvider = Provider.of<ProjectViewModel>(context); ProjectViewModel projectsProvider = Provider.of<ProjectViewModel>(context);
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
patient = routeArgs['patient']; patient = routeArgs['patient'];
bool isInpatient = routeArgs['isInpatient']; bool isInpatient = routeArgs['isInpatient'];
return BaseView<SickLeaveViewModel>( return BaseView<SickLeaveViewModel>(

@ -10,7 +10,7 @@ import 'package:provider/provider.dart';
class InPatientHeader extends StatelessWidget with PreferredSizeWidget { class InPatientHeader extends StatelessWidget with PreferredSizeWidget {
InPatientHeader( InPatientHeader(
{ this.model, {required this.model,
this.specialClinic, this.specialClinic,
this.activeTab, this.activeTab,
this.selectedMapId, this.selectedMapId,

@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
class NoData extends StatelessWidget { class NoData extends StatelessWidget {
const NoData({ const NoData({
Key key, Key? key,
}) : super(key: key); }) : super(key: key);
@override @override

@ -25,12 +25,12 @@ class InPatientListPage extends StatefulWidget {
final Function onChangeValue; final Function onChangeValue;
InPatientListPage( InPatientListPage(
{this.isMyInPatient, {required this.isMyInPatient,
this.patientSearchViewModel, required this.patientSearchViewModel,
this.selectedClinicName, required this.selectedClinicName,
this.onChangeValue, required this.onChangeValue,
this.isAllClinic, required this.isAllClinic,
this.showBottomSheet}); required this.showBottomSheet});
@override @override
_InPatientListPageState createState() => _InPatientListPageState(); _InPatientListPageState createState() => _InPatientListPageState();
@ -280,7 +280,7 @@ class _InPatientListPageState extends State<InPatientListPage> {
.patientSearchViewModel .patientSearchViewModel
.InpatientClinicList[index]); .InpatientClinicList[index]);
widget.patientSearchViewModel widget.patientSearchViewModel
.filterByClinic(clinicName: value); .filterByClinic(clinicName: value.toString());
}); });
}, },
activeColor: Colors.red, activeColor: Colors.red,

@ -7,10 +7,10 @@ import 'NoData.dart';
class ListOfAllInPatient extends StatelessWidget { class ListOfAllInPatient extends StatelessWidget {
const ListOfAllInPatient({ const ListOfAllInPatient({
Key key, Key? key,
@required this.isAllClinic, required this.isAllClinic,
@required this.hasQuery, required this.hasQuery,
this.patientSearchViewModel, required this.patientSearchViewModel,
}) : super(key: key); }) : super(key: key);
final bool isAllClinic; final bool isAllClinic;
@ -77,7 +77,7 @@ class ListOfAllInPatient extends StatelessWidget {
patientSearchViewModel.removeOnFilteredList(); patientSearchViewModel.removeOnFilteredList();
} }
} }
return; return false;
}, },
), ),
), ),

@ -6,10 +6,10 @@ import '../../../routes.dart';
import 'NoData.dart'; import 'NoData.dart';
class ListOfMyInpatient extends StatelessWidget { class ListOfMyInpatient extends StatelessWidget {
const ListOfMyInpatient({ const ListOfMyInpatient({
Key key, Key? key,
@required this.isAllClinic, required this.isAllClinic,
@required this.hasQuery, required this.hasQuery,
this.patientSearchViewModel, required this.patientSearchViewModel,
}) : super(key: key); }) : super(key: key);
final bool isAllClinic; final bool isAllClinic;
@ -56,9 +56,6 @@ class ListOfMyInpatient extends StatelessWidget {
}, },
); );
}), }),
onNotification: (t) {
return;
},
), ),
), ),
); );

@ -20,7 +20,7 @@ import '../base/base_view.dart';
class InsuranceApprovalScreenNew extends StatefulWidget { class InsuranceApprovalScreenNew extends StatefulWidget {
final int appointmentNo; final int appointmentNo;
InsuranceApprovalScreenNew({this.appointmentNo}); InsuranceApprovalScreenNew({required this.appointmentNo});
@override @override
_InsuranceApprovalScreenNewState createState() => _InsuranceApprovalScreenNewState createState() =>

@ -16,8 +16,7 @@ class FilterDatePage extends StatefulWidget {
final OutPatientFilterType outPatientFilterType; final OutPatientFilterType outPatientFilterType;
final PatientSearchViewModel patientSearchViewModel; final PatientSearchViewModel patientSearchViewModel;
const FilterDatePage( const FilterDatePage({Key? key, required this.outPatientFilterType, required this.patientSearchViewModel})
{Key key, this.outPatientFilterType, this.patientSearchViewModel})
: super(key: key); : super(key: key);
@override @override
@ -63,16 +62,12 @@ class _FilterDatePageState extends State<FilterDatePage> {
color: Colors.white, color: Colors.white,
child: InkWell( child: InkWell(
onTap: () => selectDate(context, onTap: () => selectDate(context,
firstDate: firstDate: getFirstDate(widget.outPatientFilterType),
getFirstDate(widget.outPatientFilterType), lastDate: getLastDate(widget.outPatientFilterType)),
lastDate:
getLastDate(widget.outPatientFilterType)),
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration: textFieldSelectorDecoration(
TranslationBase.of(context).fromDate, TranslationBase.of(context).fromDate!,
widget.patientSearchViewModel widget.patientSearchViewModel.selectedFromDate != null
.selectedFromDate !=
null
? "${AppDateUtils.convertStringToDateFormat(widget.patientSearchViewModel.selectedFromDate.toString(), "yyyy-MM-dd")}" ? "${AppDateUtils.convertStringToDateFormat(widget.patientSearchViewModel.selectedFromDate.toString(), "yyyy-MM-dd")}"
: null, : null,
true, true,
@ -92,16 +87,12 @@ class _FilterDatePageState extends State<FilterDatePage> {
child: InkWell( child: InkWell(
onTap: () => selectDate(context, onTap: () => selectDate(context,
isFromDate: false, isFromDate: false,
firstDate: firstDate: getFirstDate(widget.outPatientFilterType),
getFirstDate(widget.outPatientFilterType), lastDate: getLastDate(widget.outPatientFilterType)),
lastDate:
getLastDate(widget.outPatientFilterType)),
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration: textFieldSelectorDecoration(
TranslationBase.of(context).toDate, TranslationBase.of(context).toDate!,
widget.patientSearchViewModel widget.patientSearchViewModel.selectedToDate != null
.selectedToDate !=
null
? "${AppDateUtils.convertStringToDateFormat(widget.patientSearchViewModel.selectedToDate.toString(), "yyyy-MM-dd")}" ? "${AppDateUtils.convertStringToDateFormat(widget.patientSearchViewModel.selectedToDate.toString(), "yyyy-MM-dd")}"
: null, : null,
true, true,
@ -199,16 +190,15 @@ class _FilterDatePageState extends State<FilterDatePage> {
)); ));
} }
selectDate(BuildContext context, selectDate(BuildContext context, {bool isFromDate = true, DateTime? firstDate, lastDate}) async {
{bool isFromDate = true, DateTime firstDate, lastDate}) async {
Helpers.hideKeyboard(context); Helpers.hideKeyboard(context);
DateTime selectedDate = isFromDate DateTime selectedDate = isFromDate
? this.widget.patientSearchViewModel.selectedFromDate ?? firstDate ? this.widget.patientSearchViewModel.selectedFromDate ?? firstDate
: this.widget.patientSearchViewModel.selectedToDate ?? lastDate; : this.widget.patientSearchViewModel.selectedToDate ?? lastDate;
final DateTime picked = await showDatePicker( final DateTime? picked = await showDatePicker(
context: context, context: context,
initialDate: selectedDate, initialDate: selectedDate,
firstDate: firstDate, firstDate: firstDate!,
lastDate: lastDate, lastDate: lastDate,
initialEntryMode: DatePickerEntryMode.calendar, initialEntryMode: DatePickerEntryMode.calendar,
); );

@ -7,7 +7,7 @@ import 'package:permission_handler/permission_handler.dart';
class AppPermissionsUtils { class AppPermissionsUtils {
static requestVideoCallPermission({BuildContext context, String type,Function onTapGrant}) async { static requestVideoCallPermission({required BuildContext context, required String type,required Function onTapGrant}) async {
var cameraPermission = Permission.camera; var cameraPermission = Permission.camera;
var microphonePermission = Permission.microphone; var microphonePermission = Permission.microphone;

@ -431,7 +431,7 @@ class AppDateUtils {
} }
static convertDateFormatImproved(String str) { static convertDateFormatImproved(String str) {
String newDate; String newDate ='';
const start = "/Date("; const start = "/Date(";
if (str.isNotEmpty) { if (str.isNotEmpty) {
const end = "+0300)"; const end = "+0300)";
@ -448,6 +448,6 @@ class AppDateUtils {
date.day.toString().padLeft(2, '0'); date.day.toString().padLeft(2, '0');
} }
return newDate ?? ''; return newDate ;
} }
} }

@ -32,7 +32,7 @@ class DrAppSharedPreferances {
return prefs.setInt(key, value); return prefs.setInt(key, value);
} }
getString(String key) async { getString (String key) async {
final SharedPreferences prefs = await _prefs; final SharedPreferences prefs = await _prefs;
return prefs.getString(key); return prefs.getString(key);
} }
@ -40,7 +40,7 @@ class DrAppSharedPreferances {
/// Get String [key] the key was saved /// Get String [key] the key was saved
getStringWithDefaultValue(String key, String defaultVal) async { getStringWithDefaultValue(String key, String defaultVal) async {
final SharedPreferences prefs = await _prefs; final SharedPreferences prefs = await _prefs;
String value = prefs.getString(key); String? value = prefs.getString(key);
return value == null ? defaultVal : value; return value == null ? defaultVal : value;
} }

@ -1,10 +1,5 @@
extension Extension on Object { extension Extension on Object {
bool isNullOrEmpty() => this == null || this == ''; bool isNullOrEmpty() => this == '';
bool isNullEmptyOrFalse() => this == null || this == '' || !this;
bool isNullEmptyZeroOrFalse() =>
this == null || this == '' || !this || this == 0;
} }
/// truncate the [String] without cutting words. The length is calculated with the suffix. /// truncate the [String] without cutting words. The length is calculated with the suffix.

@ -47,7 +47,7 @@ class Helpers {
), ),
actions: [ actions: [
AppButton( AppButton(
onPressed: okFunction, onPressed: okFunction(),
title: TranslationBase.of(context).noteConfirm, title: TranslationBase.of(context).noteConfirm,
fontColor: Colors.white, fontColor: Colors.white,
color: AppGlobal.appGreenColor, color: AppGlobal.appGreenColor,
@ -231,14 +231,13 @@ class Helpers {
static String parseHtmlString(String htmlString) { static String parseHtmlString(String htmlString) {
final document = parse(htmlString); final document = parse(htmlString);
final String parsedString = parse(document.body.text).documentElement.text; final String parsedString = parse(document.body!.text).documentElement!.text;
return parsedString; return parsedString;
} }
static InputDecoration textFieldSelectorDecoration( static InputDecoration textFieldSelectorDecoration(String hintText, String? selectedText, bool isDropDown,
String hintText, String selectedText, bool isDropDown, {Icon? suffixIcon, Color? dropDownColor}) {
{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),
@ -300,9 +299,23 @@ class Helpers {
return htmlRegex.hasMatch(text); return htmlRegex.hasMatch(text);
} }
static String timeFrom({Duration duration}) { static getNameFromKPI(String kpi) {
if (kpi.indexOf("(") > -1)
return kpi.substring(0, kpi.indexOf("("));
else
return kpi;
}
static getLabelFromKPI(String kpi) {
if (kpi.indexOf("(") > -1 && kpi.indexOf(")") > -1)
return kpi.substring(kpi.indexOf("(") + 1, kpi.indexOf(")"));
else
return '';
}
static String timeFrom({Duration? duration}) {
String twoDigits(int n) => n.toString().padLeft(2, "0"); String twoDigits(int n) => n.toString().padLeft(2, "0");
String twoDigitMinutes = twoDigits(duration.inMinutes.remainder(60)); String twoDigitMinutes = twoDigits(duration!.inMinutes.remainder(60));
String twoDigitSeconds = twoDigits(duration.inSeconds.remainder(60)); String twoDigitSeconds = twoDigits(duration.inSeconds.remainder(60));
return "$twoDigitMinutes:$twoDigitSeconds"; return "$twoDigitMinutes:$twoDigitSeconds";
} }

File diff suppressed because it is too large Load Diff

@ -71,11 +71,11 @@ import 'package:hexcolor/hexcolor.dart';
class MethodTypeCard extends StatelessWidget { class MethodTypeCard extends StatelessWidget {
const MethodTypeCard({ const MethodTypeCard({
Key ? key, Key? key,
this.assetPath, required this.assetPath,
this.onTap, required this.onTap,
this.label, required this.label,
this.height = 20, this.isSvg = true, this.height = 20, this.isSvg =true,
}) : super(key: key); }) : super(key: key);
final String assetPath; final String assetPath;
final GestureTapCallback onTap; final GestureTapCallback onTap;

@ -16,7 +16,7 @@ class SMSOTP {
final Function onFailure; final Function onFailure;
final context; final context;
int remainingTime = 600; late int remainingTime = 600;
SMSOTP( SMSOTP(
this.context, this.context,
@ -26,7 +26,7 @@ class SMSOTP {
this.onFailure, this.onFailure,
); );
final verifyAccountForm = GlobalKey<FormState>(); late final verifyAccountForm = GlobalKey<FormState>();
TextEditingController digit1 = TextEditingController(text: ""); TextEditingController digit1 = TextEditingController(text: "");
TextEditingController digit2 = TextEditingController(text: ""); TextEditingController digit2 = TextEditingController(text: "");
@ -43,10 +43,10 @@ class SMSOTP {
final focusD2 = FocusNode(); final focusD2 = FocusNode();
final focusD3 = FocusNode(); final focusD3 = FocusNode();
final focusD4 = FocusNode(); final focusD4 = FocusNode();
String errorMsg; late String errorMsg;
ProjectViewModel projectProvider; late ProjectViewModel projectProvider;
String displayTime = ''; late String displayTime = '';
bool isClosed = false; late bool isClosed = false;
displayDialog(BuildContext context) async { displayDialog(BuildContext context) async {
double dialogWidth = MediaQuery.of(context).size.width * 0.90; double dialogWidth = MediaQuery.of(context).size.width * 0.90;
double dialogInputWidth = (dialogWidth / 4) - double dialogInputWidth = (dialogWidth / 4) -
@ -357,15 +357,15 @@ class SMSOTP {
counterText: " ", counterText: " ",
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10)), borderRadius: BorderRadius.all(Radius.circular(10)),
borderSide: BorderSide(color: Colors.grey[300]), borderSide: BorderSide(color: Colors.grey[300]!),
), ),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)), borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Colors.grey[300]), borderSide: BorderSide(color: Colors.grey[300]!),
), ),
errorBorder: OutlineInputBorder( errorBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)), borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Colors.grey[300]), borderSide: BorderSide(color: Colors.grey[300]!),
), ),
focusedErrorBorder: OutlineInputBorder( focusedErrorBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)), borderRadius: BorderRadius.all(Radius.circular(10.0)),
@ -375,7 +375,7 @@ class SMSOTP {
} }
// ignore: missing_return // ignore: missing_return
String validateCodeDigit(value) { String? validateCodeDigit(value) {
if (value.isEmpty) { if (value.isEmpty) {
return ' '; return ' ';
} else if (value.length == 3) { } else if (value.length == 3) {
@ -386,27 +386,21 @@ class SMSOTP {
} }
checkValue() async { checkValue() async {
if (verifyAccountForm.currentState.validate()) { if (verifyAccountForm.currentState!.validate()) {
onSuccess(digit1.text.toString() + onSuccess(digit1.text.toString() + digit2.text.toString() + digit3.text.toString() + digit4.text.toString());
digit2.text.toString() +
digit3.text.toString() +
digit4.text.toString());
this.isClosed = true; this.isClosed = true;
} }
} }
getSecondsAsDigitalClock(int inputSeconds) { getSecondsAsDigitalClock(int inputSeconds) {
var sec_num = var sec_num = int.parse(inputSeconds.toString()); // don't forget the second param
int.parse(inputSeconds.toString()); // don't forget the second param
var hours = (sec_num / 3600).floor(); var hours = (sec_num / 3600).floor();
var minutes = ((sec_num - hours * 3600) / 60).floor(); var minutes = ((sec_num - hours * 3600) / 60).floor();
var seconds = sec_num - hours * 3600 - minutes * 60; var seconds = sec_num - hours * 3600 - minutes * 60;
var minutesString = ""; var minutesString = "";
var secondsString = ""; var secondsString = "";
minutesString = minutesString = minutes < 10 ? "0" + minutes.toString() : minutes.toString();
minutes < 10 ? "0" + minutes.toString() : minutes.toString(); secondsString = seconds < 10 ? "0" + seconds.toString() : seconds.toString();
secondsString =
seconds < 10 ? "0" + seconds.toString() : seconds.toString();
return minutesString + ":" + secondsString; return minutesString + ":" + secondsString;
} }

@ -9,16 +9,16 @@ import 'package:provider/provider.dart';
class VerificationMethodsList extends StatefulWidget { class VerificationMethodsList extends StatefulWidget {
final AuthMethodTypes authMethodType; final AuthMethodTypes authMethodType;
final Function(AuthMethodTypes type, bool isActive) authenticateUser; final Function(AuthMethodTypes type, bool isActive)? authenticateUser;
final Function onShowMore; final GestureTapCallback? onShowMore;
final AuthenticationViewModel authenticationViewModel; final AuthenticationViewModel authenticationViewModel;
const VerificationMethodsList( const VerificationMethodsList(
{Key ? key, {Key? key,
this.authMethodType, required this.authMethodType,
this.authenticateUser, this.authenticateUser,
this.onShowMore, this.onShowMore,
this.authenticationViewModel}) required this.authenticationViewModel})
: super(key: key); : super(key: key);
@override @override
@ -28,7 +28,7 @@ class VerificationMethodsList extends StatefulWidget {
class _VerificationMethodsListState extends State<VerificationMethodsList> { class _VerificationMethodsListState extends State<VerificationMethodsList> {
final LocalAuthentication auth = LocalAuthentication(); final LocalAuthentication auth = LocalAuthentication();
ProjectViewModel projectsProvider; ProjectViewModel? projectsProvider;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -39,7 +39,7 @@ class _VerificationMethodsListState extends State<VerificationMethodsList> {
return MethodTypeCard( return MethodTypeCard(
assetPath: 'assets/images/svgs/verification/verify-whtsapp.svg', assetPath: 'assets/images/svgs/verification/verify-whtsapp.svg',
onTap: () => onTap: () =>
{widget.authenticateUser(AuthMethodTypes.WhatsApp, true)}, {widget.authenticateUser!(AuthMethodTypes.WhatsApp, true)},
label: TranslationBase label: TranslationBase
.of(context) .of(context)
.verifyWith+ TranslationBase.of(context).verifyWhatsApp, .verifyWith+ TranslationBase.of(context).verifyWhatsApp,
@ -48,7 +48,7 @@ class _VerificationMethodsListState extends State<VerificationMethodsList> {
case AuthMethodTypes.SMS: case AuthMethodTypes.SMS:
return MethodTypeCard( return MethodTypeCard(
assetPath: "assets/images/svgs/verification/verify-sms.svg", assetPath: "assets/images/svgs/verification/verify-sms.svg",
onTap: () => {widget.authenticateUser(AuthMethodTypes.SMS, true)}, onTap: () => {widget.authenticateUser!(AuthMethodTypes.SMS, true)},
label:TranslationBase label:TranslationBase
.of(context) .of(context)
.verifyWith+ TranslationBase.of(context).verifySMS, .verifyWith+ TranslationBase.of(context).verifySMS,
@ -58,10 +58,8 @@ class _VerificationMethodsListState extends State<VerificationMethodsList> {
return MethodTypeCard( return MethodTypeCard(
assetPath: 'assets/images/svgs/verification/verify-finger.svg', assetPath: 'assets/images/svgs/verification/verify-finger.svg',
onTap: () async { onTap: () async {
if (await widget.authenticationViewModel if (await widget.authenticationViewModel.checkIfBiometricAvailable(BiometricType.fingerprint)) {
.checkIfBiometricAvailable(BiometricType.fingerprint)) { widget.authenticateUser!(AuthMethodTypes.Fingerprint, true);
widget.authenticateUser(AuthMethodTypes.Fingerprint, true);
} }
}, },
label: TranslationBase label: TranslationBase
@ -73,9 +71,8 @@ class _VerificationMethodsListState extends State<VerificationMethodsList> {
return MethodTypeCard( return MethodTypeCard(
assetPath: 'assets/images/svgs/verification/verify-face.svg', assetPath: 'assets/images/svgs/verification/verify-face.svg',
onTap: () async { onTap: () async {
if (await widget.authenticationViewModel if (await widget.authenticationViewModel.checkIfBiometricAvailable(BiometricType.face)) {
.checkIfBiometricAvailable(BiometricType.face)) { widget.authenticateUser!(AuthMethodTypes.FaceID, true);
widget.authenticateUser(AuthMethodTypes.FaceID, true);
} }
}, },
label: TranslationBase label: TranslationBase
@ -87,10 +84,9 @@ class _VerificationMethodsListState extends State<VerificationMethodsList> {
default: default:
return MethodTypeCard( return MethodTypeCard(
assetPath: 'assets/images/login/more_icon.png', assetPath: 'assets/images/login/more_icon.png',
onTap: widget.onShowMore, onTap: widget.onShowMore!,
isSvg: false, label: TranslationBase.of(context).moreVerification!,
label: TranslationBase.of(context).moreVerification, // height: 40,
height: 0,
); );
} }
} }

@ -17,9 +17,9 @@ class AppLineChart extends StatelessWidget {
final bool stacked; final bool stacked;
AppLineChart( AppLineChart(
{Key ? key, {Key? key,
@required this.seriesList, required this.seriesList,
this.chartTitle, required this.chartTitle,
this.animate = true, this.animate = true,
this.includeArea = false, this.includeArea = false,
this.stacked = true}); this.stacked = true});

@ -12,11 +12,11 @@ import 'package:flutter/material.dart';
/// [endDate] the end date /// [endDate] the end date
class AppTimeSeriesChart extends StatelessWidget { class AppTimeSeriesChart extends StatelessWidget {
AppTimeSeriesChart({ AppTimeSeriesChart({
Key ? key, Key? key,
@required this.seriesList, required this.seriesList,
this.chartName = '', this.chartName = '',
this.startDate, required this.startDate,
this.endDate, required this.endDate,
}); });
final String chartName; final String chartName;

@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
class GaugeChart extends StatelessWidget { class GaugeChart extends StatelessWidget {
final List<charts.Series> seriesList; final List<charts.Series> seriesList;
final bool animate; final bool? animate;
GaugeChart(this.seriesList, {this.animate}); GaugeChart(this.seriesList, {this.animate});

@ -20,7 +20,7 @@ class GetOutPatientStack extends StatelessWidget {
value.summaryoptions value.summaryoptions
.sort((Summaryoptions a, Summaryoptions b) => b.value - a.value); .sort((Summaryoptions a, Summaryoptions b) => b.value - a.value);
var list = new List<Widget>(); var list = <Widget>[];
value.summaryoptions.forEach((result) => value.summaryoptions.forEach((result) =>
{list.add(getStack(result, value.summaryoptions.first.value,context,barHeight))}); {list.add(getStack(result, value.summaryoptions.first.value,context,barHeight))});
return Container( return Container(
@ -103,7 +103,7 @@ class GetOutPatientStack extends StatelessWidget {
child: Container( child: Container(
child: SizedBox(), child: SizedBox(),
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
height: max != 0 ? ((barHeight) * value.value) / max : 0, height: max != 0 ? ((barHeight) * value.value!) / max : 0,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(4),
color: Color(0xFFD02127).withOpacity(0.39), color: Color(0xFFD02127).withOpacity(0.39),

@ -6,8 +6,8 @@ import 'package:flutter/material.dart';
class RowCounts extends StatelessWidget { class RowCounts extends StatelessWidget {
final name; final name;
final int count; final int count;
final double? height;
final Color c; final Color c;
final double height;
RowCounts(this.name, this.count, this.c, {this.height}); RowCounts(this.name, this.count, this.c, {this.height});

@ -27,17 +27,17 @@ class CustomItem extends StatelessWidget {
final BoxDecoration decoration; final BoxDecoration decoration;
CustomItem( CustomItem(
{Key ? key, {Key? key,
this.startIcon, required this.startIcon,
this.disabled: false, this.disabled: false,
this.onTap, required this.onTap,
this.startIconColor, required this.startIconColor,
this.endIcon = EvaIcons.chevronRight, this.endIcon = EvaIcons.chevronRight,
this.padding, required this.padding,
this.child, required this.child,
this.endIconColor, required this.endIconColor,
this.endIconSize = 20, this.endIconSize = 20,
this.decoration, required this.decoration,
this.startIconSize = 19}) this.startIconSize = 19})
: super(key: key); : super(key: key);

@ -14,15 +14,15 @@ import 'package:flutter/material.dart';
class FlexibleContainer extends StatelessWidget { class FlexibleContainer extends StatelessWidget {
final double widthFactor; final double widthFactor;
final double heightFactor; final double heightFactor;
final EdgeInsets padding; final EdgeInsets? padding;
final Widget child; final Widget child;
FlexibleContainer({ FlexibleContainer({
Key ? key, Key? key,
this.widthFactor = 0.9, this.widthFactor = 0.9,
this.heightFactor = 1, this.heightFactor = 1,
this.padding, this.padding,
this.child, required this.child,
}) : super(key: key); }) : super(key: key);
@override @override

@ -10,7 +10,7 @@ class AskPermissionDialog extends StatefulWidget {
final String type; final String type;
final Function onTapGrant; final Function onTapGrant;
AskPermissionDialog({this.type, this.onTapGrant}); AskPermissionDialog({required this.type, required this.onTapGrant});
@override @override
_AskPermissionDialogState createState() => _AskPermissionDialogState(); _AskPermissionDialogState createState() => _AskPermissionDialogState();

@ -11,7 +11,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
class LabResultWidget extends StatefulWidget { class LabResultWidget extends StatefulWidget {
final List<LabResult> labResult; final List<LabResult> labResult;
LabResultWidget({Key ? key, this.labResult}); LabResultWidget({Key? key, required this.labResult});
@override @override
_LabResultWidgetState createState() => _LabResultWidgetState(); _LabResultWidgetState createState() => _LabResultWidgetState();
@ -137,7 +137,7 @@ class _LabResultWidgetState extends State<LabResultWidget> {
child: Center( child: Center(
child: AppText( child: AppText(
'${result.description}', '${result.description}',
color: Colors.grey[800], color: Colors.grey![800],
), ),
), ),
height: 60, height: 60,
@ -147,16 +147,14 @@ class _LabResultWidgetState extends State<LabResultWidget> {
child: Container( child: Container(
child: Center( child: Center(
child: AppText('${result.resultValue}', child: AppText('${result.resultValue}',
color: Colors.grey[800]), color: Colors.grey![800]),
), ),
height: 60), height: 60),
), ),
Expanded( Expanded(
child: Container( child: Container(
child: Center( child: Center(
child: AppText( child: AppText('${result.referenceRange}', color: Colors.grey[800]),
'${result.referenceRange}',
color: Colors.grey[800]),
), ),
height: 60), height: 60),
), ),

@ -19,11 +19,11 @@ class MyReferralPatientWidget extends StatefulWidget {
final Function expandClick; final Function expandClick;
MyReferralPatientWidget( MyReferralPatientWidget(
{Key ? key, {Key? key,
this.myReferralPatientModel, required this.myReferralPatientModel,
this.model, required this.model,
this.isExpand, required this.isExpand,
this.expandClick}); required this.expandClick});
@override @override
_MyReferralPatientWidgetState createState() => _MyReferralPatientWidgetState createState() =>
@ -33,8 +33,8 @@ class MyReferralPatientWidget extends StatefulWidget {
class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> { class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
bool _isLoading = false; bool _isLoading = false;
final _formKey = GlobalKey<FormState>(); final _formKey = GlobalKey<FormState>();
String error; late String error;
TextEditingController answerController; late TextEditingController answerController;
@override @override
void initState() { void initState() {
@ -127,7 +127,7 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
margin: margin:
EdgeInsets.symmetric(horizontal: 8, vertical: 8), EdgeInsets.symmetric(horizontal: 8, vertical: 8),
child: InkWell( child: InkWell(
onTap: widget.expandClick, onTap: widget.expandClick(),
child: Image.asset( child: Image.asset(
"assets/images/ic_circle_arrow.png", "assets/images/ic_circle_arrow.png",
width: 25, width: 25,
@ -323,7 +323,7 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
), ),
SizedBox( SizedBox(
child: AppText( child: AppText(
'${DateFormat('dd/MM/yyyy').format(widget.myReferralPatientModel.mAXResponseTime)}', '${DateFormat('dd/MM/yyyy').format(widget.myReferralPatientModel.mAXResponseTime!)}',
fontSize: 1.7 * SizeConfig.textMultiplier, fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
textAlign: TextAlign.start, textAlign: TextAlign.start,
@ -434,7 +434,7 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
title : TranslationBase.of(context).replay, title : TranslationBase.of(context).replay,
onPressed: () async { onPressed: () async {
final form = _formKey.currentState; final form = _formKey.currentState;
if (form.validate()) { if (form!.validate()) {
try { try {
await widget.model.replay( await widget.model.replay(
answerController.text.toString(), answerController.text.toString(),

@ -13,13 +13,13 @@ import 'package:provider/provider.dart';
class MyScheduleWidget extends StatelessWidget { class MyScheduleWidget extends StatelessWidget {
final ListDoctorWorkingHoursTable workingHoursTable; final ListDoctorWorkingHoursTable workingHoursTable;
MyScheduleWidget({Key ? key, this.workingHoursTable}); MyScheduleWidget({Key? key, required this.workingHoursTable});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
List<WorkingHours> workingHours = Helpers.getWorkingHours( List<WorkingHours> workingHours = Helpers.getWorkingHours(
workingHoursTable.workingHours, workingHoursTable.workingHours!,
); );
return Row( return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -34,13 +34,15 @@ class MyScheduleWidget extends StatelessWidget {
height: 10, height: 10,
), ),
AppText( AppText(
projectViewModel.isArabic?AppDateUtils.getWeekDayArabic(workingHoursTable.date.weekday): AppDateUtils.getWeekDay(workingHoursTable.date.weekday) , projectViewModel.isArabic
? AppDateUtils.getWeekDayArabic(workingHoursTable.date!.weekday)
: AppDateUtils.getWeekDay(workingHoursTable.date!.weekday),
fontSize: 16, fontSize: 16,
fontFamily: 'Poppins', fontFamily: 'Poppins',
// fontSize: 18 // fontSize: 18
), ),
AppText( AppText(
' ${workingHoursTable.date.day} ${(AppDateUtils.getMonth(workingHoursTable.date.month).toString().substring(0, 3))}', ' ${workingHoursTable.date!.day} ${(AppDateUtils.getMonth(workingHoursTable.date!.month).toString().substring(0, 3))}',
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -52,15 +54,14 @@ class MyScheduleWidget extends StatelessWidget {
Container( Container(
width: MediaQuery.of(context).size.width * 0.55, width: MediaQuery.of(context).size.width * 0.55,
child: CardWithBgWidget( child: CardWithBgWidget(
bgColor: AppDateUtils.isToday(workingHoursTable.date) bgColor: AppDateUtils.isToday(workingHoursTable.date!) ? Colors.green[500]! : Colors.transparent,
? AppGlobal.appGreenColor
: Colors.transparent,
// hasBorder: false, // hasBorder: false,
widget: Container( widget: Container(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
if (AppDateUtils.isToday(workingHoursTable.date)) if (AppDateUtils.isToday(workingHoursTable.date!))
AppText( AppText(
"Today", "Today",
fontSize: 1.8 * SizeConfig.textMultiplier, fontSize: 1.8 * SizeConfig.textMultiplier,

@ -18,11 +18,11 @@ import '../shared/rounded_container_widget.dart';
*/ */
class MedicineItemWidget extends StatefulWidget { class MedicineItemWidget extends StatefulWidget {
final String label; final String? label;
final Color backgroundColor; final Color backgroundColor;
final bool showBorder; final bool showBorder;
final Color borderColor; final Color borderColor;
final String url; final String? url;
MedicineItemWidget( MedicineItemWidget(
{@required this.label, {@required this.label,
@ -52,7 +52,7 @@ class _MedicineItemWidgetState extends State<MedicineItemWidget> {
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(7)), borderRadius: BorderRadius.all(Radius.circular(7)),
child: Image.network( child: Image.network(
widget.url, widget.url!,
height: SizeConfig.imageSizeMultiplier * 15, height: SizeConfig.imageSizeMultiplier * 15,
width: SizeConfig.imageSizeMultiplier * 15, width: SizeConfig.imageSizeMultiplier * 15,
fit: BoxFit.cover, fit: BoxFit.cover,
@ -62,9 +62,7 @@ class _MedicineItemWidgetState extends State<MedicineItemWidget> {
Expanded( Expanded(
child: Padding( child: Padding(
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: Align( child: Align(alignment: Alignment.centerLeft, child: AppText(widget.label)))),
alignment: Alignment.centerLeft,
child: AppText(widget.label)))),
Icon(EvaIcons.eye) Icon(EvaIcons.eye)
], ],
), ),

Loading…
Cancel
Save