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> {
String platformImei;
late String platformImei;
bool allowCallApi = true;
//TODO change AppTextFormField to AppTextFormFieldCustom
@ -34,7 +34,7 @@ class _LoginScreenState extends State<LoginScreen> {
List<GetHospitalsResponseModel> projectsList = [];
FocusNode focusPass = FocusNode();
FocusNode focusProject = FocusNode();
AuthenticationViewModel authenticationViewModel;
late AuthenticationViewModel authenticationViewModel;
@override
Widget build(BuildContext context) {
@ -224,8 +224,8 @@ class _LoginScreenState extends State<LoginScreen> {
login(
context,
) async {
if (loginFormKey.currentState.validate()) {
loginFormKey.currentState.save();
if (loginFormKey.currentState!.validate()) {
loginFormKey.currentState!.save();
GifLoaderDialogUtils.showMyDialog(context);
await authenticationViewModel.login(authenticationViewModel.userInfo);
if (authenticationViewModel.state == ViewState.ErrorLocal) {
@ -251,10 +251,10 @@ class _LoginScreenState extends State<LoginScreen> {
setState(() {
authenticationViewModel.userInfo.projectID =
projectsList[index].facilityId;
projectIdController.text = projectsList[index].facilityName;
projectIdController.text = projectsList[index].facilityName!;
});
primaryFocus.unfocus();
primaryFocus!.unfocus();
}
String memberID = "";
@ -268,7 +268,7 @@ class _LoginScreenState extends State<LoginScreen> {
setState(() {
authenticationViewModel.userInfo.projectID =
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> {
ProjectViewModel projectsProvider;
late ProjectViewModel projectsProvider;
bool isMoreOption = false;
bool onlySMSBox = false;
AuthMethodTypes fingerPrintBefore;
AuthMethodTypes selectedOption;
AuthenticationViewModel authenticationViewModel;
AuthMethodTypes? fingerPrintBefore;
late AuthMethodTypes selectedOption;
late AuthenticationViewModel authenticationViewModel;
@override
Widget build(BuildContext context) {
@ -103,7 +103,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
),
AppText(
Helpers.convertToTitleCase(
authenticationViewModel.user.doctorName),
authenticationViewModel.user!.doctorName??''),
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
6,
@ -187,7 +187,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
text: authenticationViewModel
.getType(
authenticationViewModel
.user
.user!
.logInTypeID,
context),
style: TextStyle(
@ -217,25 +217,25 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
children: [
AppText(
authenticationViewModel
.user.editedOn !=
.user!.editedOn !=
null
? AppDateUtils
.getDayMonthYearDateFormatted(
AppDateUtils
.convertStringToDate(
authenticationViewModel
.user
.editedOn),
.user!
.editedOn!),
isMonthShort: true)
: authenticationViewModel
.user.createdOn !=
.user!.createdOn! !=
null
? AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils
.convertStringToDate(
authenticationViewModel
.user
.createdOn),
.user!
.createdOn!),
isMonthShort: true)
: '--',
textAlign: TextAlign.right,
@ -248,21 +248,21 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
),
AppText(
authenticationViewModel
.user.editedOn !=
.user!.editedOn! !=
null
? AppDateUtils.getHour(AppDateUtils
.convertStringToDate(
authenticationViewModel
.user.editedOn))
.user!.editedOn!))
: authenticationViewModel
.user.createdOn !=
.user!.createdOn! !=
null
? AppDateUtils.getHour(
AppDateUtils
.convertStringToDate(
authenticationViewModel
.user
.createdOn))
.user!
.createdOn!))
: '--',
textAlign: TextAlign.right,
fontSize: SizeConfig
@ -355,8 +355,8 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
SelectedAuthMethodTypesService
.getMethodsTypeService(
authenticationViewModel
.user
.logInTypeID),
.user!
.logInTypeID!),
authenticateUser:
(AuthMethodTypes
authMethodType,
@ -490,15 +490,12 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
);
}
sendActivationCodeByOtpNotificationType(
AuthMethodTypes authMethodType) async {
if (authMethodType == AuthMethodTypes.SMS ||
authMethodType == AuthMethodTypes.WhatsApp) {
sendActivationCodeByOtpNotificationType(AuthMethodTypes authMethodType) async {
if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) {
GifLoaderDialogUtils.showMyDialog(context);
await authenticationViewModel.sendActivationCodeForDoctorApp(
authMethodType: authMethodType,
password: authenticationViewModel.userInfo.password);
authMethodType: authMethodType, password: authenticationViewModel.userInfo.password!);
if (authenticationViewModel.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(authenticationViewModel.error);
GifLoaderDialogUtils.hideDialog(context);
@ -523,12 +520,9 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
GifLoaderDialogUtils.hideDialog(context);
Helpers.showErrorToast(authenticationViewModel.error);
} else {
await sharedPref.setString(
TOKEN,
authenticationViewModel
.activationCodeVerificationScreenRes.logInTokenID);
if (authMethodType == AuthMethodTypes.SMS ||
authMethodType == AuthMethodTypes.WhatsApp) {
await sharedPref.setString(TOKEN,
authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID!);
if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) {
GifLoaderDialogUtils.hideDialog(context);
this.startSMSService(authMethodType, isSilentLogin: true);
} else {
@ -542,8 +536,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
authMethodType == AuthMethodTypes.FaceID) {
fingerPrintBefore = authMethodType;
}
this.selectedOption =
fingerPrintBefore != null ? fingerPrintBefore : authMethodType;
this.selectedOption = (fingerPrintBefore != null ? fingerPrintBefore : authMethodType)!;
switch (authMethodType) {
case AuthMethodTypes.SMS:
@ -578,8 +571,8 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
context,
type,
authenticationViewModel.loggedUser != null
? authenticationViewModel.loggedUser.mobileNumber
: authenticationViewModel.user.mobile,
? authenticationViewModel.loggedUser!.mobileNumber
: authenticationViewModel.user!.mobile,
(value) {
showDialog(
context: context,
@ -601,11 +594,9 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
await authenticationViewModel.showIOSAuthMessages();
if (!mounted) return;
if (authenticationViewModel.user != null &&
(SelectedAuthMethodTypesService.getMethodsTypeService(
authenticationViewModel.user.logInTypeID) ==
(SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user!.logInTypeID!) ==
AuthMethodTypes.Fingerprint ||
SelectedAuthMethodTypesService.getMethodsTypeService(
authenticationViewModel.user.logInTypeID) ==
SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user!.logInTypeID!) ==
AuthMethodTypes.FaceID)) {
this.sendActivationCode(authMethodTypes);
} else {
@ -616,19 +607,22 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
}
}
checkActivationCode({String value, bool isSilentLogin = false}) async {
await authenticationViewModel.checkActivationCodeForDoctorApp(
activationCode: value, isSilentLogin: isSilentLogin);
checkActivationCode({String? value,bool isSilentLogin = false}) async {
await authenticationViewModel.checkActivationCodeForDoctorApp(activationCode: value!,isSilentLogin: isSilentLogin);
if (authenticationViewModel.state == ViewState.ErrorLocal) {
Navigator.pop(context);
Helpers.showErrorToast(authenticationViewModel.error);
} else {
await authenticationViewModel.onCheckActivationCodeSuccess();
if (value != null) {
if (Navigator.canPop(context)) Navigator.pop(context);
}
if (Navigator.canPop(context)) Navigator.pop(context);
navigateToLandingPage();
if(value !=null){
if(Navigator.canPop(context))
Navigator.pop(context);
}
if(Navigator.canPop(context))
Navigator.pop(context);
navigateToLandingPage();
}
}

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

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

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

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

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

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

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

@ -13,11 +13,11 @@ import 'package:flutter/material.dart';
import 'label.dart';
class DashboardReferralPatient extends StatelessWidget {
final List<DashboardModel> dashboardItemList;
final double height;
final DashboardViewModel model;
final List<DashboardModel>? dashboardItemList;
final double? height;
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
Widget build(BuildContext context) {
return Container(

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

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

@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
class HomePatientCard extends StatelessWidget {
final Color backgroundColor;
final IconData cardIcon;
final String cardIconImage;
final String? cardIconImage;
final Color backgroundIconColor;
final String text;
final Color textColor;
@ -15,14 +15,14 @@ class HomePatientCard extends StatelessWidget {
final LinearGradient gradient;
HomePatientCard({
this.backgroundColor,
this.backgroundIconColor,
this.cardIcon,
this.cardIconImage,
this.text,
this.textColor,
this.onTap,
this.iconSize = 30, this.gradient,
required this.backgroundColor,
required this.backgroundIconColor,
required this.cardIcon,
this.cardIconImage,
required this.text,
required this.textColor,
required this.onTap,
this.iconSize = 30, required this.gradient,
});
@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:flutter/material.dart';
// ignore: must_be_immutable
class Label extends StatelessWidget {
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);
final String firstLine;
final String secondLine;
final String? firstLine;
final String? secondLine;
Color color;
final double secondLineFontSize;
final double firstLineFontSize;
final double? secondLineFontSize;
final double? firstLineFontSize;
@override
Widget build(BuildContext context) {

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

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

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

@ -19,7 +19,8 @@ class VideoCallPage extends StatefulWidget {
final PatiantInformtion patientData;
final listContext;
final LiveCarePatientViewModel model;
VideoCallPage({this.patientData, this.listContext, this.model});
VideoCallPage(
{required this.patientData, this.listContext, required this.model});
@override
_VideoCallPageState createState() => _VideoCallPageState();
@ -28,10 +29,10 @@ class VideoCallPage extends StatefulWidget {
DrAppSharedPreferances sharedPref = DrAppSharedPreferances();
class _VideoCallPageState extends State<VideoCallPage> {
Timer _timmerInstance;
late Timer _timmerInstance;
int _start = 0;
String _timmer = '';
LiveCareViewModel _liveCareProvider;
late LiveCareViewModel _liveCareProvider;
bool _isInit = true;
var _tokenData;
bool isTransfer = false;
@ -67,8 +68,12 @@ class _VideoCallPageState extends State<VideoCallPage> {
//'1_MX40NjgwMzIyNH5-MTU5MzY4MzYzODYwM35ucExWYVRVSm5Hcy9uWGZmM1lOa3czZHV-fg',
kApiKey: '46209962',
vcId: widget.patientData.vcId,
isRecording: tokenData != null ? tokenData.isRecording: false,
patientName: widget.patientData.fullName ?? widget.patientData.firstName != null ? "${widget.patientData.firstName} ${widget.patientData.lastName}" : "-",
isRecording: tokenData != null ? tokenData.isRecording! : false,
patientName: widget.patientData.fullName != null
? widget.patientData.fullName!
: widget.patientData.firstName != null
? "${widget.patientData.firstName} ${widget.patientData.lastName}"
: "-",
tokenID: token, //"hfkjshdf347r8743",
generalId: "Cs2020@2016\$2958",
doctorId: doctorprofile['DoctorID'],
@ -78,13 +83,13 @@ class _VideoCallPageState extends State<VideoCallPage> {
},
onCallEnd: () {
//TODO handling onCallEnd
WidgetsBinding.instance.addPostFrameCallback((_) {
WidgetsBinding.instance!.addPostFrameCallback((_) {
changeRoute(context);
});
},
onCallNotRespond: (SessionStatusModel sessionStatusModel) {
//TODO handling onCalNotRespondEnd
WidgetsBinding.instance.addPostFrameCallback((_) {
WidgetsBinding.instance!.addPostFrameCallback((_) {
changeRoute(context);
});
});
@ -137,7 +142,7 @@ class _VideoCallPageState extends State<VideoCallPage> {
height: MediaQuery.of(context).size.height * 0.02,
),
Text(
widget.patientData.fullName,
widget.patientData.fullName!,
style: TextStyle(
color: Colors.deepPurpleAccent,
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/util/date-utils.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_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart';
@ -19,23 +18,23 @@ class HealthSummaryPage extends StatefulWidget {
}
class _HealthSummaryPageState extends State<HealthSummaryPage> {
PatiantInformtion patient;
late PatiantInformtion patient;
@override
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
patient = routeArgs['patient'];
String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType'];
bool isInpatient = routeArgs['isInpatient'];
return BaseView<MedicalFileViewModel>(
onModelReady: (model) => model.getMedicalFile(mrn: patient.patientId),
builder: (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold(
appBar: PatientProfileAppBar(
patient,
builder: (BuildContext context, MedicalFileViewModel model, Widget? child) => AppScaffold(
patientProfileAppBarModel: PatientProfileAppBarModel(
patient: patient,
isInpatient: isInpatient,
),
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(),
appBarTitle: TranslationBase.of(context).medicalReport!.toUpperCase(),
body: NetworkBaseView(
baseViewModel: model,
child: SingleChildScrollView(
@ -75,86 +74,88 @@ class _HealthSummaryPageState extends State<HealthSummaryPage> {
),
(model.medicalFileList != null && model.medicalFileList.length != 0)
? ListView.builder(
//physics: ,
physics: NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model.medicalFileList[0].entityList[0].timelines.length,
itemBuilder: (BuildContext ctxt, int index) {
return InkWell(
onTap: () async {
if (model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0]
.consulations.length !=
0)
await locator<AnalyticsService>().logEvent(
eventCategory: "Health Summary Page",
eventAction: "Health Summary Details",
);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => MedicalFileDetails(
age: patient.age is String ? patient.age ?? "" : "${patient.age}",
firstName: patient.firstName,
lastName: patient.lastName,
gender: patient.genderDescription,
encounterNumber: index,
pp: patient.patientId,
patient: patient,
doctorName: model.medicalFileList[0].entityList[0].timelines[index]
.timeLineEvents[0].consulations.isNotEmpty
? model.medicalFileList[0].entityList[0].timelines[index].doctorName
: "",
clinicName: model.medicalFileList[0].entityList[0].timelines[index]
.timeLineEvents[0].consulations.isNotEmpty
? model.medicalFileList[0].entityList[0].timelines[index].clinicName
: "",
doctorImage: model.medicalFileList[0].entityList[0].timelines[index]
.timeLineEvents[0].consulations.isNotEmpty
? model.medicalFileList[0].entityList[0].timelines[index].doctorImage
: "",
episode: model.medicalFileList[0].entityList[0].timelines[index]
.timeLineEvents[0].consulations.isNotEmpty
? model.medicalFileList[0].entityList[0].timelines[index].timeLineEvents[0]
.consulations[0].episodeID
.toString()
: "",
vistDate: model.medicalFileList[0].entityList[0].timelines[index].date.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),
//physics: ,
physics: NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model.medicalFileList[0].entityList![0].timelines!.length,
itemBuilder: (BuildContext ctxt, int index) {
return InkWell(
onTap: () async{
if (model.medicalFileList[0].entityList![0].timelines![index].timeLineEvents![0]
.consulations!.length !=
0)
await locator<AnalyticsService>().logEvent(
eventCategory: "Health Summary Page",
eventAction: "Health Summary Details",
);Navigator.push(
context,
MaterialPageRoute(
builder: (context) => MedicalFileDetails(
age: patient.age is String ? patient.age ?? "" : "${patient.age}",
firstName: patient.firstName ?? "",
lastName: patient.lastName ?? "",
gender: patient.genderDescription ?? "",
encounterNumber: index,
pp: patient.patientId,
patient: patient,
doctorName: model.medicalFileList[0].entityList![0].timelines![index]
.timeLineEvents![0].consulations!.isNotEmpty
? model.medicalFileList[0].entityList![0].timelines![index].doctorName
: "",
clinicName: model.medicalFileList[0].entityList![0].timelines![index]
.timeLineEvents![0].consulations!.isNotEmpty
? model.medicalFileList[0].entityList![0].timelines![index].clinicName
: "",
doctorImage: model.medicalFileList[0].entityList![0].timelines![index]
.timeLineEvents![0].consulations!.isNotEmpty
? model.medicalFileList[0].entityList![0].timelines![index].doctorImage
: "",
episode: model.medicalFileList[0].entityList![0].timelines![index]
.timeLineEvents![0].consulations!.isNotEmpty
? model.medicalFileList[0].entityList![0].timelines![index]
.timeLineEvents![0]
.consulations![0].episodeID
.toString()
: "",
vistDate: model.medicalFileList[0].entityList![0].timelines![index].date
.toString()),
settings: RouteSettings(name: 'MedicalFileDetails'),
),
);
})
: Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 100,
},
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 ?? "",
),
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(8.0),
child: AppText(TranslationBase.of(context).noMedicalFileFound),
)
],
),
isPrescriptions: true,
isShowEye: model.medicalFileList[0].entityList![0].timelines![index].timeLineEvents![0].consulations!.length !=
0
? 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 {
MedicineSearchScreen({this.changeLoadingState});
final Function changeLoadingState;
final Function? changeLoadingState;
@override
_MedicineSearchState createState() => _MedicineSearchState();
@ -48,17 +48,16 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
bool _isInit = true;
final SpeechToText speech = SpeechToText();
String lastStatus = '';
GetMedicationResponseModel _selectedMedication;
GlobalKey key =
new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
late GetMedicationResponseModel _selectedMedication;
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
// String lastWords;
List<LocaleName> _localeNames = [];
String lastError;
late String lastError;
double level = 0.0;
double minSoundLevel = 50000;
double maxSoundLevel = -50000;
String reconizedWord;
late String reconizedWord;
@override
void didChangeDependencies() {

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

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

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

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

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

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

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

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

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

@ -7,7 +7,7 @@ import 'package:permission_handler/permission_handler.dart';
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 microphonePermission = Permission.microphone;

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

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

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

@ -47,7 +47,7 @@ class Helpers {
),
actions: [
AppButton(
onPressed: okFunction,
onPressed: okFunction(),
title: TranslationBase.of(context).noteConfirm,
fontColor: Colors.white,
color: AppGlobal.appGreenColor,
@ -231,14 +231,13 @@ class Helpers {
static String parseHtmlString(String 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;
}
static InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown,
{Icon suffixIcon, Color dropDownColor}) {
static InputDecoration textFieldSelectorDecoration(String hintText, String? selectedText, bool isDropDown,
{Icon? suffixIcon, Color? dropDownColor}) {
return InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
@ -300,9 +299,23 @@ class Helpers {
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 twoDigitMinutes = twoDigits(duration.inMinutes.remainder(60));
String twoDigitMinutes = twoDigits(duration!.inMinutes.remainder(60));
String twoDigitSeconds = twoDigits(duration.inSeconds.remainder(60));
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 {
const MethodTypeCard({
Key ? key,
this.assetPath,
this.onTap,
this.label,
this.height = 20, this.isSvg = true,
Key? key,
required this.assetPath,
required this.onTap,
required this.label,
this.height = 20, this.isSvg =true,
}) : super(key: key);
final String assetPath;
final GestureTapCallback onTap;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save