Null Safety Updates 3.16

update_flutter_3.16.0_voipcall
Aamir Muhammad 2 years ago
parent ea7744254b
commit 1bc355b2c4

@ -8,7 +8,6 @@ import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import './config/size_config.dart'; import './config/size_config.dart';
import './routes.dart'; import './routes.dart';
import 'config/config.dart'; import 'config/config.dart';
@ -16,6 +15,7 @@ import 'core/service/AnalyticsService.dart';
import 'core/service/NavigationService.dart'; import 'core/service/NavigationService.dart';
import 'core/viewModel/authentication_view_model.dart'; import 'core/viewModel/authentication_view_model.dart';
import 'locator.dart'; import 'locator.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
void main() async { void main() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();

@ -17,12 +17,12 @@ import 'package:flutter/material.dart';
import 'entity_list_checkbox_search_widget.dart'; import 'entity_list_checkbox_search_widget.dart';
class AddProcedurePage extends StatefulWidget { class AddProcedurePage extends StatefulWidget {
final ProcedureViewModel model; final ProcedureViewModel? model;
final PatiantInformtion patient; final PatiantInformtion? patient;
final ProcedureType procedureType; final ProcedureType procedureType;
const AddProcedurePage( const AddProcedurePage(
{Key key, this.model, this.patient, @required this.procedureType}) {Key? key, this.model, this.patient, required this.procedureType})
: super(key: key); : super(key: key);
@override @override
@ -31,10 +31,10 @@ class AddProcedurePage extends StatefulWidget {
} }
class _AddProcedurePageState extends State<AddProcedurePage> { class _AddProcedurePageState extends State<AddProcedurePage> {
int selectedType; int? selectedType;
ProcedureViewModel model; ProcedureViewModel? model;
PatiantInformtion patient; PatiantInformtion? patient;
ProcedureType procedureType; ProcedureType? procedureType;
_AddProcedurePageState({this.patient, this.model, this.procedureType}); _AddProcedurePageState({this.patient, this.model, this.procedureType});
@ -57,11 +57,12 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
return BaseView<ProcedureViewModel>( return BaseView<ProcedureViewModel>(
onModelReady: (model) { onModelReady: (model) {
model.getProcedureCategory( model.getProcedureCategory(
categoryName: procedureType.getCategoryName(), categoryName: procedureType!.getCategoryName(),
categoryID: procedureType.getCategoryId(), categoryID: procedureType!.getCategoryId(),
patientId: patient.patientId); patientId: patient!.patientId);
}, },
builder: (BuildContext context, ProcedureViewModel model, Widget child) => builder:
(BuildContext context, ProcedureViewModel model, Widget? child) =>
AppScaffold( AppScaffold(
isShowAppBar: false, isShowAppBar: false,
body: SingleChildScrollView( body: SingleChildScrollView(
@ -97,13 +98,14 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
], ],
), ),
SizedBox( SizedBox(
height: height: MediaQuery.of(context).size.height *
MediaQuery.of(context).size.height * 0.02, 0.02,
), ),
Row( Row(
children: [ children: [
Container( Container(
width: MediaQuery.of(context).size.width * width:
MediaQuery.of(context).size.width *
0.79, 0.79,
child: AppTextFieldCustom( child: AppTextFieldCustom(
hintText: TranslationBase.of(context) hintText: TranslationBase.of(context)
@ -116,19 +118,22 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
), ),
), ),
SizedBox( SizedBox(
width: MediaQuery.of(context).size.width * width:
MediaQuery.of(context).size.width *
0.02, 0.02,
), ),
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: () async { onTap: () async {
if (procedureName.text.isNotEmpty && if (procedureName.text.isNotEmpty &&
procedureName.text.length >= 3) { procedureName.text.length >=
3) {
GifLoaderDialogUtils.showMyDialog( GifLoaderDialogUtils.showMyDialog(
context); context);
await model.getProcedureCategory( await model.getProcedureCategory(
patientId: patient.patientId, patientId: patient!.patientId,
categoryName: procedureName.text, categoryName:
procedureName.text,
isLocalBusy: true); isLocalBusy: true);
if (model.state == if (model.state ==
ViewState.ErrorLocal) { ViewState.ErrorLocal) {
@ -161,8 +166,9 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
NetworkBaseView( NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: EntityListCheckboxSearchWidget( child: EntityListCheckboxSearchWidget(
model: widget.model, model: widget.model!,
masterList: model.categoriesList[0].entityList, masterList:
model.categoriesList[0].entityList!,
removeProcedure: (item) { removeProcedure: (item) {
setState(() { setState(() {
entityList.remove(item); entityList.remove(item);
@ -174,8 +180,9 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
}); });
}, },
addSelectedHistories: () {}, addSelectedHistories: () {},
isEntityListSelected: (master) => widget.model isEntityListSelected: (master) =>
.isEntityListSelected(master, entityList), widget.model!.isEntityListSelected(
master, entityList),
)), )),
SizedBox( SizedBox(
height: 10, height: 10,
@ -195,7 +202,7 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
height: 0, height: 0,
) )
: CustomBottomSheetContainer( : CustomBottomSheetContainer(
label: procedureType.getAddButtonTitle(context), label: procedureType!.getAddButtonTitle(context),
onTap: () async { onTap: () async {
{ {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
@ -208,7 +215,7 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
return; return;
} }
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await widget.model.preparePostProcedure( await widget.model!.preparePostProcedure(
orderType: selectedType.toString(), orderType: selectedType.toString(),
entityList: entityList, entityList: entityList,
patient: patient, patient: patient,

@ -13,17 +13,17 @@ import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class BaseAddProcedureTabPage extends StatefulWidget { class BaseAddProcedureTabPage extends StatefulWidget {
final ProcedureViewModel previousProcedureViewModel; final ProcedureViewModel? previousProcedureViewModel;
final PrescriptionViewModel prescriptionModel; final PrescriptionViewModel? prescriptionModel;
final PatiantInformtion patient; final PatiantInformtion? patient;
final ProcedureType procedureType; final ProcedureType procedureType;
const BaseAddProcedureTabPage( const BaseAddProcedureTabPage(
{Key key, {Key? key,
this.previousProcedureViewModel, this.previousProcedureViewModel,
this.prescriptionModel, this.prescriptionModel,
this.patient, this.patient,
@required this.procedureType}) required this.procedureType})
: super(key: key); : super(key: key);
@override @override
@ -33,12 +33,12 @@ class BaseAddProcedureTabPage extends StatefulWidget {
class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage> class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
final PatiantInformtion patient; final PatiantInformtion? patient;
final ProcedureType procedureType; final ProcedureType? procedureType;
_BaseAddProcedureTabPageState({this.patient, this.procedureType}); _BaseAddProcedureTabPageState({this.patient, this.procedureType});
TabController _tabController; late TabController _tabController;
int _activeTab = 0; int _activeTab = 0;
@override @override
@ -71,12 +71,12 @@ class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage>
categoryID: widget.procedureType.getCategoryId()); categoryID: widget.procedureType.getCategoryId());
} }
}, },
builder: (BuildContext context, ProcedureViewModel model, Widget child) => builder: (BuildContext context, ProcedureViewModel model, Widget? child) =>
AppScaffold( AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
appBar: BottomSheetTitle( appBar: BottomSheetTitle(
title: procedureType.getToolbarLabel(context), title: procedureType!.getToolbarLabel(context),
), ),
body: NetworkBaseView( body: NetworkBaseView(
baseViewModel: model, baseViewModel: model,
@ -97,10 +97,10 @@ class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage>
unselectedLabelColor: Colors.grey[800], unselectedLabelColor: Colors.grey[800],
tabs: [ tabs: [
TabWidget.tabWidget(screenSize, _activeTab == 0, TabWidget.tabWidget(screenSize, _activeTab == 0,
procedureType.getFavouriteTabName(context), procedureType!.getFavouriteTabName(context),
isFirst: true, context: context), isFirst: true, context: context),
TabWidget.tabWidget(screenSize, _activeTab == 1, TabWidget.tabWidget(screenSize, _activeTab == 1,
procedureType.getAllLabelName(context), procedureType!.getAllLabelName(context),
isLast: true, context: context), isLast: true, context: context),
], ],
), ),
@ -121,15 +121,15 @@ class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage>
), ),
if (widget.procedureType == ProcedureType.PRESCRIPTION) if (widget.procedureType == ProcedureType.PRESCRIPTION)
AddPrescription( AddPrescription(
widget.prescriptionModel, widget.prescriptionModel!,
widget.patient, widget.patient!,
widget.prescriptionModel.prescriptionList, widget.prescriptionModel!.prescriptionList,
) )
else else
AddProcedurePage( AddProcedurePage(
model: widget.previousProcedureViewModel ?? model, model: widget.previousProcedureViewModel ?? model,
patient: patient, patient: patient,
procedureType: procedureType, procedureType: procedureType!,
), ),
], ],
), ),

@ -13,15 +13,15 @@ import 'package:flutter/material.dart';
import '../../config/config.dart'; import '../../config/config.dart';
class EntityListCheckboxSearchWidget extends StatefulWidget { class EntityListCheckboxSearchWidget extends StatefulWidget {
final ProcedureViewModel model; final ProcedureViewModel? model;
final Function addSelectedHistories; final Function? addSelectedHistories;
final Function(EntityList) removeProcedure; final Function(EntityList)? removeProcedure;
final Function(EntityList) addProcedure; final Function(EntityList)? addProcedure;
final bool Function(EntityList) isEntityListSelected; final bool Function(EntityList)? isEntityListSelected;
final List<EntityList> masterList; final List<EntityList>? masterList;
EntityListCheckboxSearchWidget({ EntityListCheckboxSearchWidget({
Key key, Key? key,
this.model, this.model,
this.addSelectedHistories, this.addSelectedHistories,
this.removeProcedure, this.removeProcedure,
@ -38,8 +38,8 @@ class EntityListCheckboxSearchWidget extends StatefulWidget {
class _EntityListCheckboxSearchWidgetState class _EntityListCheckboxSearchWidgetState
extends State<EntityListCheckboxSearchWidget> { extends State<EntityListCheckboxSearchWidget> {
int selectedType = 0; int selectedType = 0;
int typeUrgent; int typeUrgent = 0;
int typeRegular; int typeRegular = 0;
setSelectedType(int val) { setSelectedType(int val) {
setState(() { setState(() {
@ -53,7 +53,7 @@ class _EntityListCheckboxSearchWidgetState
@override @override
void initState() { void initState() {
items.addAll(widget.masterList); items.addAll(widget.masterList!);
super.initState(); super.initState();
} }
@ -65,7 +65,7 @@ class _EntityListCheckboxSearchWidgetState
child: Column( child: Column(
children: [ children: [
NetworkBaseView( NetworkBaseView(
baseViewModel: widget.model, baseViewModel: widget.model!,
child: Container( child: Container(
height: MediaQuery.of(context).size.height * 0.75, height: MediaQuery.of(context).size.height * 0.75,
child: Center( child: Center(
@ -81,8 +81,8 @@ class _EntityListCheckboxSearchWidgetState
suffixIcon: EvaIcons.search, suffixIcon: EvaIcons.search,
suffixIconColor: Color(0xff2B353E), suffixIconColor: Color(0xff2B353E),
onChanged: (value) { onChanged: (value) {
widget.model.filterSearchResults( widget.model!.filterSearchResults(
value, widget.masterList, items); value, widget.masterList!, items);
}, },
hasBorder: false, hasBorder: false,
), ),
@ -98,17 +98,17 @@ class _EntityListCheckboxSearchWidgetState
title: Row( title: Row(
children: [ children: [
Checkbox( Checkbox(
value: widget.isEntityListSelected( value: widget.isEntityListSelected!(
historyInfo), historyInfo),
activeColor: Color(0xffD02127), activeColor: Color(0xffD02127),
onChanged: (bool newValue) { onChanged: (bool? newValue) {
setState(() { setState(() {
if (widget.isEntityListSelected( if (widget.isEntityListSelected!(
historyInfo)) { historyInfo)) {
widget.removeProcedure( widget.removeProcedure!(
historyInfo); historyInfo);
} else { } else {
widget.addProcedure( widget.addProcedure!(
historyInfo); historyInfo);
} }
}); });
@ -118,7 +118,7 @@ class _EntityListCheckboxSearchWidgetState
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 0), horizontal: 10, vertical: 0),
child: AppText( child: AppText(
Utils.convertToTitleCase( historyInfo.procedureName), Utils.convertToTitleCase( historyInfo.procedureName!),
fontSize: 14.0, fontSize: 14.0,
variant: "bodyText", variant: "bodyText",
bold: true, bold: true,
@ -162,7 +162,7 @@ class _EntityListCheckboxSearchWidgetState
groupValue: selectedType, groupValue: selectedType,
onChanged: (value) { onChanged: (value) {
historyInfo.type = historyInfo.type =
setSelectedType(value) setSelectedType(value!)
.toString(); .toString();
historyInfo.type = historyInfo.type =
@ -181,7 +181,7 @@ class _EntityListCheckboxSearchWidgetState
value: 1, value: 1,
onChanged: (value) { onChanged: (value) {
historyInfo.type = historyInfo.type =
setSelectedType(value) setSelectedType(value!)
.toString(); .toString();
historyInfo.type = historyInfo.type =
@ -216,7 +216,7 @@ class _EntityListCheckboxSearchWidgetState
minLines: 3, minLines: 3,
maxLines: 5, maxLines: 5,
borderWidth: 0.5, borderWidth: 0.5,
borderColor: Colors.grey[500], borderColor: Colors.grey[500]!,
), ),
), ),
DividerWithSpacesAround(), DividerWithSpacesAround(),

@ -9,18 +9,18 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ExpansionProcedure extends StatefulWidget { class ExpansionProcedure extends StatefulWidget {
final ProcedureTempleteDetailsModelList procedureTempleteModel; final ProcedureTempleteDetailsModelList? procedureTempleteModel;
final ProcedureViewModel model; final ProcedureViewModel? model;
final Function(ProcedureTempleteDetailsModel) removeFavProcedure; final Function(ProcedureTempleteDetailsModel)? removeFavProcedure;
final Function(ProcedureTempleteDetailsModel) addFavProcedure; final Function(ProcedureTempleteDetailsModel)? addFavProcedure;
final Function(ProcedureTempleteDetailsModel) selectProcedures; final Function(ProcedureTempleteDetailsModel) ?selectProcedures;
final bool Function(ProcedureTempleteModel) isEntityListSelected; final bool Function(ProcedureTempleteModel)? isEntityListSelected;
final bool Function(ProcedureTempleteDetailsModel) isEntityFavListSelected; final bool Function(ProcedureTempleteDetailsModel)? isEntityFavListSelected;
final bool isProcedure; final bool isProcedure;
final ProcedureTempleteDetailsModel groupProcedures; final ProcedureTempleteDetailsModel? groupProcedures;
const ExpansionProcedure( const ExpansionProcedure(
{Key key, {Key? key,
this.procedureTempleteModel, this.procedureTempleteModel,
this.model, this.model,
this.removeFavProcedure, this.removeFavProcedure,
@ -78,9 +78,9 @@ class _ExpansionProcedureState extends State<ExpansionProcedure> {
child: AppText( child: AppText(
widget.isProcedure == true widget.isProcedure == true
? "Procedures for " + ? "Procedures for " +
widget.procedureTempleteModel.templateName widget.procedureTempleteModel!.templateName!
: "Prescription for " + : "Prescription for " +
widget.procedureTempleteModel.templateName, widget.procedureTempleteModel!.templateName!,
letterSpacing: -0.72, letterSpacing: -0.72,
fontSize: 16.0, fontSize: 16.0,
color: AppGlobal.appTextColor, color: AppGlobal.appTextColor,
@ -118,20 +118,20 @@ class _ExpansionProcedureState extends State<ExpansionProcedure> {
)), )),
duration: Duration(milliseconds: 7000), duration: Duration(milliseconds: 7000),
child: Column( child: Column(
children: widget.procedureTempleteModel.procedureTemplate children: widget.procedureTempleteModel!.procedureTemplate
.map((itemProcedure) { .map((itemProcedure) {
return InkWell( return InkWell(
onTap: () { onTap: () {
if (widget.isProcedure) { if (widget.isProcedure) {
setState(() { setState(() {
if (widget.isEntityFavListSelected(itemProcedure)) { if (widget.isEntityFavListSelected!(itemProcedure)) {
widget.removeFavProcedure(itemProcedure); widget.removeFavProcedure!(itemProcedure);
} else { } else {
widget.addFavProcedure(itemProcedure); widget.addFavProcedure!(itemProcedure);
} }
}); });
} else { } else {
widget.selectProcedures(itemProcedure); widget.selectProcedures!(itemProcedure);
} }
}, },
child: Container( child: Container(
@ -147,18 +147,18 @@ class _ExpansionProcedureState extends State<ExpansionProcedure> {
horizontal: 11), horizontal: 11),
child: widget.isProcedure child: widget.isProcedure
? Checkbox( ? Checkbox(
value: widget.isEntityFavListSelected( value: widget.isEntityFavListSelected!(
itemProcedure), itemProcedure),
activeColor: Color(0xffD02127), activeColor: Color(0xffD02127),
onChanged: (bool newValue) { onChanged: (bool? newValue) {
setState(() { setState(() {
if (widget if (widget
.isEntityFavListSelected( .isEntityFavListSelected!(
itemProcedure)) { itemProcedure)) {
widget.removeFavProcedure( widget.removeFavProcedure!(
itemProcedure); itemProcedure);
} else { } else {
widget.addFavProcedure( widget.addFavProcedure!(
itemProcedure); itemProcedure);
} }
}); });
@ -168,7 +168,7 @@ class _ExpansionProcedureState extends State<ExpansionProcedure> {
groupValue: widget.groupProcedures, groupValue: widget.groupProcedures,
activeColor: Color(0xffD02127), activeColor: Color(0xffD02127),
onChanged: (newValue) { onChanged: (newValue) {
widget.selectProcedures(newValue); widget.selectProcedures!(newValue!);
})), })),
Expanded( Expanded(
child: Padding( child: Padding(
@ -176,7 +176,7 @@ class _ExpansionProcedureState extends State<ExpansionProcedure> {
horizontal: 10, vertical: 0), horizontal: 10, vertical: 0),
child: AppText( child: AppText(
Utils.convertToTitleCase( Utils.convertToTitleCase(
itemProcedure.procedureName), itemProcedure.procedureName!),
fontSize: 14.0, fontSize: 14.0,
variant: "bodyText", variant: "bodyText",
bold: true, bold: true,

@ -47,11 +47,11 @@ class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
builder: (BuildContext context, ProcedureViewModel procedureViewModel, Widget? child) => AppScaffold( builder: (BuildContext context, ProcedureViewModel procedureViewModel, Widget? child) => AppScaffold(
isShowAppBar: false, isShowAppBar: false,
body: Column(children: [ body: Column(children: [
(widget.previousProcedureViewModel.templateList.length != 0) (widget.previousProcedureViewModel!.templateList.length != 0)
? Expanded( ? Expanded(
child: EntityListCheckboxSearchFavProceduresWidget( child: EntityListCheckboxSearchFavProceduresWidget(
isProcedure: !(widget.procedureType == ProcedureType.PRESCRIPTION), isProcedure: !(widget.procedureType == ProcedureType.PRESCRIPTION),
model: widget.previousProcedureViewModel, model: widget.previousProcedureViewModel!,
removeFavProcedure: (item) { removeFavProcedure: (item) {
setState(() { setState(() {
entityList.remove(item); entityList.remove(item);
@ -75,12 +75,12 @@ class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
error: TranslationBase.of(context).youDoNotHaveFavoriteTemplate, error: TranslationBase.of(context).youDoNotHaveFavoriteTemplate,
), ),
]), ]),
bottomSheet: widget.previousProcedureViewModel.templateList.length == 0 bottomSheet: widget.previousProcedureViewModel!.templateList.length == 0
? Container( ? Container(
height: 0, height: 0,
) )
: CustomBottomSheetContainer( : CustomBottomSheetContainer(
label: widget.procedureType.getAddButtonTitle(context) ?? TranslationBase.of(context).addSelectedProcedures, label: widget.procedureType!.getAddButtonTitle(context) ?? TranslationBase.of(context).addSelectedProcedures,
onTap: () async { onTap: () async {
if (widget.procedureType == ProcedureType.PRESCRIPTION) { if (widget.procedureType == ProcedureType.PRESCRIPTION) {
if (groupProcedures == null) { if (groupProcedures == null) {
@ -112,10 +112,10 @@ class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
MaterialPageRoute( MaterialPageRoute(
builder: (context) => ProcedureCheckOutScreen( builder: (context) => ProcedureCheckOutScreen(
items: entityList, items: entityList,
previousProcedureViewModel: widget.previousProcedureViewModel, previousProcedureViewModel: widget.previousProcedureViewModel!,
patient: widget.patient, patient: widget.patient!,
addButtonTitle: widget.procedureType.getAddButtonTitle(context), addButtonTitle: widget.procedureType!.getAddButtonTitle(context),
toolbarTitle: widget.procedureType.getToolbarLabel(context), toolbarTitle: widget.procedureType!.getToolbarLabel(context),
), ),
settings: RouteSettings(name: 'ProcedureCheckOutScreen')), settings: RouteSettings(name: 'ProcedureCheckOutScreen')),
); );

@ -13,25 +13,25 @@ import '../../../config/config.dart';
import '../../../widgets/shared/text_fields/app_text_field_custom_serach.dart'; import '../../../widgets/shared/text_fields/app_text_field_custom_serach.dart';
class EntityListCheckboxSearchFavProceduresWidget extends StatefulWidget { class EntityListCheckboxSearchFavProceduresWidget extends StatefulWidget {
final ProcedureViewModel model; final ProcedureViewModel? model;
final Function addSelectedHistories; final Function? addSelectedHistories;
final Function(ProcedureTempleteModel) removeHistory; final Function(ProcedureTempleteModel)? removeHistory;
final Function(ProcedureTempleteModel) addHistory; final Function(ProcedureTempleteModel)? addHistory;
final Function(ProcedureTempleteModel) addRemarks; final Function(ProcedureTempleteModel)? addRemarks;
final Function(ProcedureTempleteDetailsModel) removeFavProcedure; final Function(ProcedureTempleteDetailsModel)? removeFavProcedure;
final Function(ProcedureTempleteDetailsModel) addFavProcedure; final Function(ProcedureTempleteDetailsModel)? addFavProcedure;
final Function(ProcedureTempleteDetailsModel) selectProcedures; final Function(ProcedureTempleteDetailsModel)? selectProcedures;
final ProcedureTempleteDetailsModel groupProcedures; final ProcedureTempleteDetailsModel? groupProcedures;
final bool Function(ProcedureTempleteModel) isEntityListSelected; final bool Function(ProcedureTempleteModel)? isEntityListSelected;
final bool Function(ProcedureTempleteDetailsModel) isEntityFavListSelected; final bool Function(ProcedureTempleteDetailsModel)? isEntityFavListSelected;
final List<ProcedureTempleteModel> masterList; final List<ProcedureTempleteModel>? masterList;
final bool isProcedure; final bool isProcedure;
EntityListCheckboxSearchFavProceduresWidget( EntityListCheckboxSearchFavProceduresWidget(
{Key key, {Key? key,
this.model, this.model,
this.addSelectedHistories, this.addSelectedHistories,
this.removeHistory, this.removeHistory,
@ -55,8 +55,8 @@ class EntityListCheckboxSearchFavProceduresWidget extends StatefulWidget {
class _EntityListCheckboxSearchFavProceduresWidgetState class _EntityListCheckboxSearchFavProceduresWidgetState
extends State<EntityListCheckboxSearchFavProceduresWidget> { extends State<EntityListCheckboxSearchFavProceduresWidget> {
int selectedType = 0; int selectedType = 0;
int typeUrgent; int typeUrgent = 0;
int typeRegular; int typeRegular = 0;
setSelectedType(int val) { setSelectedType(int val) {
setState(() { setState(() {
@ -81,7 +81,7 @@ class _EntityListCheckboxSearchFavProceduresWidgetState
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SingleChildScrollView( return SingleChildScrollView(
child: NetworkBaseView( child: NetworkBaseView(
baseViewModel: widget.model, baseViewModel: widget.model!,
child: Container( child: Container(
height: MediaQuery.of(context).size.height * 0.90, height: MediaQuery.of(context).size.height * 0.90,
child: Center( child: Center(
@ -94,7 +94,7 @@ class _EntityListCheckboxSearchFavProceduresWidgetState
AppTextFieldCustomSearch( AppTextFieldCustomSearch(
searchController: patientFileInfoController, searchController: patientFileInfoController,
onChangeFun: (value) { onChangeFun: (value) {
widget.model.filterProcedureSearchResults( widget.model!.filterProcedureSearchResults(
value, widget.masterList, items); value, widget.masterList, items);
}, },
marginTop: 5, marginTop: 5,
@ -107,20 +107,20 @@ class _EntityListCheckboxSearchFavProceduresWidgetState
SizedBox( SizedBox(
height: 15, height: 15,
), ),
widget.model.templateList.length != 0 widget.model!.templateList.length != 0
? Column( ? Column(
children: widget.model.templateList.map((historyInfo) { children: widget.model!.templateList.map((historyInfo) {
return ExpansionProcedure( return ExpansionProcedure(
procedureTempleteModel: historyInfo, procedureTempleteModel: historyInfo,
model: widget.model, model: widget.model!,
removeFavProcedure: widget.removeFavProcedure, removeFavProcedure: widget.removeFavProcedure!,
addFavProcedure: widget.addFavProcedure, addFavProcedure: widget.addFavProcedure!,
selectProcedures: widget.selectProcedures, selectProcedures: widget.selectProcedures!,
isEntityListSelected: widget.isEntityListSelected, isEntityListSelected: widget.isEntityListSelected!,
isEntityFavListSelected: isEntityFavListSelected:
widget.isEntityFavListSelected, widget.isEntityFavListSelected!,
isProcedure: widget.isProcedure, isProcedure: widget.isProcedure,
groupProcedures: widget.groupProcedures); groupProcedures: widget.groupProcedures!);
}).toList(), }).toList(),
) )
: Center( : Center(

@ -17,9 +17,9 @@ import 'package:flutter/material.dart';
import '../../../config/config.dart'; import '../../../config/config.dart';
class ProcedureCheckOutScreen extends StatefulWidget { class ProcedureCheckOutScreen extends StatefulWidget {
final List<ProcedureTempleteDetailsModel> items; final List<ProcedureTempleteDetailsModel>? items;
final ProcedureViewModel previousProcedureViewModel; final ProcedureViewModel? previousProcedureViewModel;
final PatiantInformtion patient; final PatiantInformtion? patient;
final String addButtonTitle; final String addButtonTitle;
final String toolbarTitle; final String toolbarTitle;
@ -27,8 +27,8 @@ class ProcedureCheckOutScreen extends StatefulWidget {
{this.items, {this.items,
this.previousProcedureViewModel, this.previousProcedureViewModel,
this.patient, this.patient,
@required this.addButtonTitle, required this.addButtonTitle,
@required this.toolbarTitle}); required this.toolbarTitle});
@override @override
_ProcedureCheckOutScreenState createState() => _ProcedureCheckOutScreenState createState() =>
@ -43,7 +43,8 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<ProcedureViewModel>( return BaseView<ProcedureViewModel>(
builder: (BuildContext context, ProcedureViewModel model, Widget child) => builder:
(BuildContext context, ProcedureViewModel model, Widget? child) =>
AppScaffold( AppScaffold(
backgroundColor: Color(0xffF8F8F8).withOpacity(0.9), backgroundColor: Color(0xffF8F8F8).withOpacity(0.9),
isShowAppBar: true, isShowAppBar: true,
@ -61,13 +62,13 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
), ),
ListView.builder( ListView.builder(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
itemCount: widget.items.length, itemCount: widget.items!.length,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (BuildContext ctxt, int index) { itemBuilder: (BuildContext ctxt, int index) {
final TextEditingController remarksControllerNew = final TextEditingController remarksControllerNew =
TextEditingController( TextEditingController(
text: widget.items[index].remarks); text: widget.items![index].remarks);
return Container( return Container(
margin: EdgeInsets.only(bottom: 15.0), margin: EdgeInsets.only(bottom: 15.0),
@ -82,7 +83,7 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
Expanded( Expanded(
child: AppText( child: AppText(
Utils.convertToTitleCase( Utils.convertToTitleCase(
widget.items[index].procedureName), widget.items![index].procedureName!),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: AppGlobal.appTextColor, color: AppGlobal.appTextColor,
)), )),
@ -116,12 +117,12 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
activeColor: Color(0xFFD02127), activeColor: Color(0xFFD02127),
value: 0, value: 0,
groupValue: widget groupValue: widget
.items[index].selectedType, .items![index].selectedType,
onChanged: (value) { onChanged: (value) {
widget.items[index].selectedType = widget.items![index]
0; .selectedType = 0;
setState(() { setState(() {
widget.items[index].type = widget.items![index].type =
value.toString(); value.toString();
}); });
}, },
@ -134,13 +135,13 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
Radio( Radio(
activeColor: Color(0xFFD02127), activeColor: Color(0xFFD02127),
groupValue: widget groupValue: widget
.items[index].selectedType, .items![index].selectedType,
value: 1, value: 1,
onChanged: (value) { onChanged: (value) {
widget.items[index].selectedType = widget.items![index]
1; .selectedType = 1;
setState(() { setState(() {
widget.items[index].type = widget.items![index].type =
value.toString(); value.toString();
}); });
}, },
@ -166,12 +167,12 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
hintText: TranslationBase.of(context).remarks, hintText: TranslationBase.of(context).remarks,
controller: remarksControllerNew, controller: remarksControllerNew,
onChanged: (value) { onChanged: (value) {
widget.items[index].remarks = value; widget.items![index].remarks = value;
}, },
minLines: 3, minLines: 3,
maxLines: 5, maxLines: 5,
borderWidth: 0.5, borderWidth: 0.5,
borderColor: Colors.grey[500], borderColor: Colors.grey[500]!,
), ),
), ),
SizedBox( SizedBox(
@ -190,6 +191,7 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
), ),
), ),
), ),
///TODO Elham* use our custom bottomsheet ///TODO Elham* use our custom bottomsheet
bottomSheet: Container( bottomSheet: Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier! * 5), margin: EdgeInsets.all(SizeConfig.widthMultiplier! * 5),
@ -203,10 +205,10 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
onPressed: () async { onPressed: () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await widget.previousProcedureViewModel.addProcedures( await widget.previousProcedureViewModel!.addProcedures(
widget.previousProcedureViewModel, widget.previousProcedureViewModel!,
widget.items, widget.items!,
widget.patient, widget.patient!,
remarksController, remarksController,
isLocalBusy: true); isLocalBusy: true);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);

@ -16,16 +16,16 @@ import 'package:provider/provider.dart';
/// TODO Roaa Add translation and make sure it working fine /// TODO Roaa Add translation and make sure it working fine
class ProcedureCard extends StatelessWidget { class ProcedureCard extends StatelessWidget {
final Function onTap; final Function? onTap;
final EntityList entityList; final EntityList? entityList;
final String categoryName; final String? categoryName;
final int categoryID; final int? categoryID;
final PatiantInformtion patient; final PatiantInformtion? patient;
final int doctorID; final int? doctorID;
final bool isInpatient; final bool? isInpatient;
const ProcedureCard({ const ProcedureCard({
Key key, Key? key,
this.onTap, this.onTap,
this.entityList, this.entityList,
this.categoryID, this.categoryID,
@ -60,7 +60,7 @@ class ProcedureCard extends StatelessWidget {
bottomLeft: Radius.circular(10), bottomLeft: Radius.circular(10),
), ),
color: color:
entityList.orderType == 0 ? Colors.black : Colors.red[500], entityList!.orderType == 0 ? Colors.black : Colors.red[500],
), ),
), ),
Expanded( Expanded(
@ -80,10 +80,10 @@ class ProcedureCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
entityList.orderType == 0 entityList!.orderType == 0
? 'Routine' ? 'Routine'
: 'Urgent', : 'Urgent',
color: entityList.orderType == 0 color: entityList!.orderType == 0
? Colors.black ? Colors.black
: AppGlobal.appRedColor, : AppGlobal.appRedColor,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -93,7 +93,7 @@ class ProcedureCard extends StatelessWidget {
), ),
AppText( AppText(
Utils.convertToTitleCase( Utils.convertToTitleCase(
entityList.procedureName), entityList!.procedureName!),
bold: true, bold: true,
fontSize: 14, fontSize: 14,
), ),
@ -110,7 +110,7 @@ class ProcedureCard extends StatelessWidget {
AppText( AppText(
'${AppDateUtils.getDayMonthYearDateFormatted( '${AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils.convertISOStringToDateTime( AppDateUtils.convertISOStringToDateTime(
entityList.createdOn), entityList!.createdOn!),
isMonthShort: true, isMonthShort: true,
isArabic: projectViewModel.isArabic, isArabic: projectViewModel.isArabic,
)}', )}',
@ -119,9 +119,9 @@ class ProcedureCard extends StatelessWidget {
fontSize: 14, fontSize: 14,
), ),
AppText( AppText(
'${AppDateUtils.getHour(AppDateUtils.convertISOStringToDateTime(entityList.createdOn))}', '${AppDateUtils.getHour(AppDateUtils.convertISOStringToDateTime(entityList!.createdOn!))}',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Colors.grey[700], color: Colors.grey[700]!,
fontSize: 14, fontSize: 14,
), ),
], ],
@ -130,7 +130,7 @@ class ProcedureCard extends StatelessWidget {
), ),
CustomRow( CustomRow(
label: TranslationBase.of(context).orderNo + ": ", label: TranslationBase.of(context).orderNo + ": ",
value: entityList.orderNo.toString() ?? "".toString(), value: entityList!.orderNo.toString() ?? "".toString(),
isCopyable: false, isCopyable: false,
), ),
Row( Row(
@ -159,7 +159,7 @@ class ProcedureCard extends StatelessWidget {
width: 30, width: 30,
errorBuilder: (BuildContext context, errorBuilder: (BuildContext context,
Object exception, Object exception,
StackTrace stackTrace) { StackTrace? stackTrace) {
return Text('No Image'); return Text('No Image');
}, },
))), ))),
@ -174,19 +174,20 @@ class ProcedureCard extends StatelessWidget {
children: [ children: [
AppText( AppText(
Utils.convertToTitleCase( Utils.convertToTitleCase(
entityList.doctorName), entityList!.doctorName!),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w800, fontWeight: FontWeight.w800,
fontSize: 1.7 * SizeConfig.textMultiplier, fontSize: 1.7 * SizeConfig.textMultiplier!,
color: Colors.black, color: Colors.black,
), ),
if (entityList.clinicDescription != null) if (entityList!.clinicDescription != null)
AppText( AppText(
Utils.convertToTitleCase( Utils.convertToTitleCase(
entityList.clinicDescription), entityList!.clinicDescription!),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.4 * SizeConfig.textMultiplier, fontSize:
1.4 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
], ],
@ -202,20 +203,20 @@ class ProcedureCard extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: AppText( child: AppText(
entityList.remarks != null entityList!.remarks != null
? Utils.convertToTitleCase( ? Utils.convertToTitleCase(
entityList.remarks.toString()) entityList!.remarks.toString())
: '', : '',
fontSize: 12, fontSize: 12,
), ),
), ),
if ((entityList.categoryID == 2 || if ((entityList!.categoryID == 2 ||
entityList.categoryID == 4) && entityList!.categoryID == 4) &&
doctorID == entityList.doctorID && doctorID == entityList!.doctorID &&
!isInpatient) !isInpatient!)
InkWell( InkWell(
child: Icon(DoctorApp.edit), child: Icon(DoctorApp.edit),
onTap: onTap, onTap: onTap!(),
) )
], ],
), ),

@ -21,17 +21,17 @@ import '../../widgets/shared/errors/error_message.dart';
import 'base_add_procedure_tab_page.dart'; import 'base_add_procedure_tab_page.dart';
class ProcedureScreen extends StatelessWidget { class ProcedureScreen extends StatelessWidget {
int doctorNameP; int? doctorNameP;
void initState() async { void initState() async {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map<String, dynamic> profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
doctorNameP = doctorProfile.doctorID; doctorNameP = doctorProfile.doctorID;
} }
@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;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
String patientType = routeArgs['patientType']; String patientType = routeArgs['patientType'];
bool isFromLiveCare = routeArgs['isFromLiveCare']; bool isFromLiveCare = routeArgs['isFromLiveCare'];
@ -41,10 +41,11 @@ class ProcedureScreen extends StatelessWidget {
mrn: patient.patientId, mrn: patient.patientId,
patientType: patientType, patientType: patientType,
appointmentNo: patient.appointmentNo), appointmentNo: patient.appointmentNo),
builder: (BuildContext context, ProcedureViewModel model, Widget child) => builder:
(BuildContext context, ProcedureViewModel model, Widget? child) =>
AppScaffold( AppScaffold(
isShowAppBar: true, isShowAppBar: true,
backgroundColor: Colors.grey[100], backgroundColor: Colors.grey[100]!,
baseViewModel: model, baseViewModel: model,
appBar: PatientProfileAppBar( appBar: PatientProfileAppBar(
patient, patient,
@ -99,42 +100,44 @@ class ProcedureScreen extends StatelessWidget {
itemBuilder: (BuildContext ctxt, int index) { itemBuilder: (BuildContext ctxt, int index) {
return ProcedureCard( return ProcedureCard(
categoryID: model categoryID: model
.procedureList[0].entityList[index].categoryID, .procedureList[0].entityList![index].categoryID,
entityList: model.procedureList[0].entityList[index], entityList: model.procedureList[0].entityList![index],
onTap: () { onTap: () {
if (model.procedureList[0].entityList[index].categoryID == if (model.procedureList[0].entityList![index]
.categoryID ==
2 || 2 ||
model.procedureList[0].entityList[index].categoryID == 4) model.procedureList[0].entityList![index]
updateProcedureForm(context, .categoryID ==
4)
updateProcedureForm(
context,
model: model, model: model,
patient: patient, patient: patient,
remarks: model.procedureList[0] remarks: model.procedureList[0]
.entityList[index].remarks, .entityList![index].remarks!,
orderType: model.procedureList[0] orderType: model.procedureList[0]
.entityList[index].orderType .entityList![index].orderType
.toString(), .toString(),
orderNo: model.procedureList[0] orderNo: model.procedureList[0]
.entityList[index].orderNo, .entityList![index].orderNo!,
procedureName: model.procedureList[0] procedureName: model.procedureList[0]
.entityList[index].procedureName, .entityList![index].procedureName!,
categoreId: model.procedureList[0] categoreId: model.procedureList[0]
.entityList[index].categoryID .entityList![index].categoryID
.toString(), .toString(),
procedureId: model.procedureList[0] procedureId: model.procedureList[0]
.entityList[index].procedureId, .entityList![index].procedureId!,
limetNo: model.procedureList[0] limetNo: model.procedureList[0]
.entityList[index].lineItemNo, .entityList![index].lineItemNo!,
); );
}, },
patient: patient, patient: patient,
doctorID: model.doctorProfile?.doctorID,
doctorID: model?.doctorProfile?.doctorID,
); );
}), }),
if (model.state == ViewState.ErrorLocal || if (model.state == ViewState.ErrorLocal ||
(model.procedureList.isNotEmpty && (model.procedureList.isNotEmpty &&
model.procedureList[0].entityList.isEmpty)) model.procedureList[0].entityList!.isEmpty))
Center( Center(
child: ErrorMessage( child: ErrorMessage(
error: TranslationBase.of(context).noDataAvailable, error: TranslationBase.of(context).noDataAvailable,

@ -61,7 +61,7 @@ extension procedureType on ProcedureType {
String getCategoryId() { String getCategoryId() {
switch (this) { switch (this) {
case ProcedureType.PROCEDURE: case ProcedureType.PROCEDURE:
return null; return "";
case ProcedureType.LAB_RESULT: case ProcedureType.LAB_RESULT:
return "02"; return "02";
case ProcedureType.RADIOLOGY: case ProcedureType.RADIOLOGY:
@ -69,20 +69,20 @@ extension procedureType on ProcedureType {
case ProcedureType.PRESCRIPTION: case ProcedureType.PRESCRIPTION:
return "55"; return "55";
default: default:
return null; return "";
} }
} }
String getCategoryName() { String getCategoryName() {
switch (this) { switch (this) {
case ProcedureType.PROCEDURE: case ProcedureType.PROCEDURE:
return null; return "";
case ProcedureType.LAB_RESULT: case ProcedureType.LAB_RESULT:
return "Laboratory"; return "Laboratory";
case ProcedureType.RADIOLOGY: case ProcedureType.RADIOLOGY:
return "Radiology"; return "Radiology";
default: default:
return null; return "";
} }
} }
} }

@ -19,15 +19,15 @@ import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
void updateProcedureForm(context, void updateProcedureForm(context,
{String procedureName, {required String procedureName,
int orderNo, required int orderNo,
int limetNo, required int limetNo,
PatiantInformtion patient, required PatiantInformtion patient,
String orderType, required String orderType,
String procedureId, required String procedureId,
String remarks, required String remarks,
ProcedureViewModel model, required ProcedureViewModel model,
String categoreId}) { required String categoreId}) {
TextEditingController remarksController = TextEditingController(); TextEditingController remarksController = TextEditingController();
showModalBottomSheet( showModalBottomSheet(
context: context, context: context,
@ -49,17 +49,16 @@ void updateProcedureForm(context,
} }
class UpdateProcedureWidget extends StatefulWidget { class UpdateProcedureWidget extends StatefulWidget {
final PatiantInformtion patient; final PatiantInformtion? patient;
final ProcedureViewModel previousModel; final ProcedureViewModel? previousModel;
final String procedureName; final String? procedureName;
final String remarks; final String? remarks;
final TextEditingController remarksController; final TextEditingController? remarksController;
final String procedureId; final String? procedureId;
final String categoryId; final String? categoryId;
final int orderNo; final int? orderNo;
final int limetNo; final int? limetNo;
int selectedType; int? selectedType;
UpdateProcedureWidget( UpdateProcedureWidget(
{this.previousModel, {this.previousModel,
@ -70,14 +69,14 @@ class UpdateProcedureWidget extends StatefulWidget {
this.procedureId, this.procedureId,
this.categoryId, this.categoryId,
this.orderNo, this.orderNo,
this.limetNo, this.selectedType}); this.limetNo,
this.selectedType});
@override @override
_UpdateProcedureWidgetState createState() => _UpdateProcedureWidgetState(); _UpdateProcedureWidgetState createState() => _UpdateProcedureWidgetState();
} }
class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> { class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
setSelectedType(int val) { setSelectedType(int val) {
setState(() { setState(() {
widget.selectedType = val; widget.selectedType = val;
@ -86,7 +85,7 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
void initState() { void initState() {
super.initState(); super.initState();
widget.remarksController.text = widget.remarks; widget.remarksController!.text = widget.remarks!;
} }
List<EntityList> entityList = []; List<EntityList> entityList = [];
@ -98,9 +97,9 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
return BaseView<ProcedureViewModel>( return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getCategory(), onModelReady: (model) => model.getCategory(),
builder: builder:
(BuildContext context, ProcedureViewModel _model, Widget child) => (BuildContext context, ProcedureViewModel _model, Widget? child) =>
AppScaffold( AppScaffold(
baseViewModel: widget.previousModel, baseViewModel: widget.previousModel!,
isShowAppBar: true, isShowAppBar: true,
appBar: BottomSheetTitle(title: "Update Procedure"), appBar: BottomSheetTitle(title: "Update Procedure"),
body: SingleChildScrollView( body: SingleChildScrollView(
@ -114,7 +113,7 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
Utils.convertToTitleCase(widget.procedureName), Utils.convertToTitleCase(widget.procedureName!),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
SizedBox( SizedBox(
@ -129,7 +128,7 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
value: 0, value: 0,
groupValue: widget.selectedType, groupValue: widget.selectedType,
onChanged: (value) { onChanged: (value) {
setSelectedType(value); setSelectedType(value!);
}, },
), ),
Text('routine'), Text('routine'),
@ -138,7 +137,7 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
groupValue: widget.selectedType, groupValue: widget.selectedType,
value: 1, value: 1,
onChanged: (value) { onChanged: (value) {
setSelectedType(value); setSelectedType(value!);
}, },
), ),
Text(TranslationBase.of(context).urgent), Text(TranslationBase.of(context).urgent),
@ -156,8 +155,8 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
width: 1.0, color: HexColor("#CCCCCC"))), width: 1.0, color: HexColor("#CCCCCC"))),
child: TextFields( child: TextFields(
fontSize: 15.0, fontSize: 15.0,
controller: widget.remarksController, controller: widget.remarksController!,
hintText: widget.remarksController.text.isEmpty hintText: widget.remarksController!.text.isEmpty
? 'No Remarks Added' ? 'No Remarks Added'
: '', : '',
maxLines: 3, maxLines: 3,
@ -176,36 +175,36 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
bottomSheet: CustomBottomSheetContainer( bottomSheet: CustomBottomSheetContainer(
label: TranslationBase.of(context).updateProcedure, label: TranslationBase.of(context).updateProcedure,
onTap: () => updateProcedure( onTap: () => updateProcedure(
lineItemNo: widget.limetNo, lineItemNo: widget.limetNo!,
orderNo: widget.orderNo, orderNo: widget.orderNo!,
orderType: widget.selectedType.toString(), orderType: widget.selectedType.toString(),
categoryId: widget.categoryId, categoryId: widget.categoryId!,
procedureId: widget.procedureId, procedureId: widget.procedureId!,
entityList: entityList, entityList: entityList,
patient: widget.patient, patient: widget.patient!,
model: widget.previousModel, model: widget.previousModel!,
remarks: widget.remarksController.text), remarks: widget.remarksController!.text),
), ),
), ),
); );
} }
updateProcedure( updateProcedure(
{ProcedureViewModel model, {required ProcedureViewModel model,
String remarks, required String remarks,
int lineItemNo, required int lineItemNo,
int orderNo, required int orderNo,
String newProcedureId, String? newProcedureId,
String newCategoryId, String? newCategoryId,
List<EntityList> entityList, required List<EntityList> entityList,
String orderType, required String orderType,
String procedureId, required String procedureId,
PatiantInformtion patient, required PatiantInformtion patient,
String categoryId}) async { required String categoryId}) async {
UpdateProcedureRequestModel updateProcedureReqModel = UpdateProcedureRequestModel updateProcedureReqModel =
new UpdateProcedureRequestModel(); new UpdateProcedureRequestModel();
List<Controls> controls = []; List<Controls> controls = [];
ProcedureDetail controlsProcedure = new ProcedureDetail(); ProcedureDetail controlsProcedure = ProcedureDetail();
updateProcedureReqModel.appointmentNo = patient.appointmentNo; updateProcedureReqModel.appointmentNo = patient.appointmentNo;
@ -230,17 +229,18 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
} }
updateProcedureReqModel.procedureDetail = controlsProcedure; updateProcedureReqModel.procedureDetail = controlsProcedure;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await widget.previousModel.updateProcedure( await widget.previousModel!.updateProcedure(
updateProcedureRequestModel: updateProcedureReqModel, updateProcedureRequestModel: updateProcedureReqModel,
mrn: patient.patientMRN, isLocalBusy: true); mrn: patient.patientMRN,
isLocalBusy: true);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error); Utils.showErrorToast(model.error);
} else if (model.state == ViewState.Idle) { } else if (model.state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast('procedure has been updated'); DrAppToastMsg.showSuccesToast('procedure has been updated');
await widget.previousModel.getProcedure(mrn: patient.patientMRN, isLocalBusy: true); await widget.previousModel!
.getProcedure(mrn: patient.patientMRN, isLocalBusy: true);
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
} }

@ -88,7 +88,8 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
_scanQrAndGetPatient(BuildContext context, ScanQrViewModel model) async { _scanQrAndGetPatient(BuildContext context, ScanQrViewModel model) async {
var result = (await BarcodeScanner.scan()).rawContent; var result = (await BarcodeScanner.scan()).rawContent;
if (result != "") { if (result != "") {
DoctorProfileModel doctorProfile =await getDoctorProfile(isGetProfile: true); DoctorProfileModel doctorProfile =
await getDoctorProfile(isGetProfile: true);
List<String> listOfParams = result.split(','); List<String> listOfParams = result.split(',');
int patientID = 0; int patientID = 0;
if (listOfParams[1].length != 0) patientID = int.parse(listOfParams[1]); if (listOfParams[1].length != 0) patientID = int.parse(listOfParams[1]);
@ -123,10 +124,9 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
Future<DoctorProfileModel> getDoctorProfile( Future<DoctorProfileModel> getDoctorProfile(
{bool isGetProfile = false}) async { {bool isGetProfile = false}) async {
DoctorProfileModel? doctorProfile;
DoctorProfileModel doctorProfile;
if (isGetProfile) { if (isGetProfile) {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map<String, dynamic>? profile = await sharedPref.getObj(DOCTOR_PROFILE);
if (profile != null) { if (profile != null) {
doctorProfile = DoctorProfileModel.fromJson(profile); doctorProfile = DoctorProfileModel.fromJson(profile);
if (doctorProfile != null) { if (doctorProfile != null) {
@ -135,14 +135,14 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
} }
} }
if (doctorProfile == null) { if (doctorProfile == null) {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map<String, dynamic>? profile = await sharedPref.getObj(DOCTOR_PROFILE);
if (profile != null) { if (profile != null) {
doctorProfile = DoctorProfileModel.fromJson(profile); doctorProfile = DoctorProfileModel.fromJson(profile);
if (doctorProfile != null) { if (doctorProfile != null) {
return doctorProfile; return doctorProfile;
} }
} }
return null; return DoctorProfileModel();
} else { } else {
return doctorProfile; return doctorProfile;
} }

@ -18,7 +18,7 @@ import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class AddRescheduleLeaveScreen extends StatelessWidget { class AddRescheduleLeaveScreen extends StatelessWidget {
ProjectViewModel projectsProvider; ProjectViewModel? projectsProvider;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -62,7 +62,7 @@ class AddRescheduleLeaveScreen extends StatelessWidget {
border: Border( border: Border(
left: BorderSide( left: BorderSide(
color: item.status == 10 color: item.status == 10
? Colors.red[800] ? Colors.red[800]!
: item.status == 2 : item.status == 2
? HexColor('#CC9B14') ? HexColor('#CC9B14')
: item.status == 9 : item.status == 9
@ -92,10 +92,10 @@ class AddRescheduleLeaveScreen extends StatelessWidget {
margin: margin:
EdgeInsets.only(top: 10), EdgeInsets.only(top: 10),
child: AppText( child: AppText(
item.statusDescription, item.statusDescription!,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: item.status == 10 color: item.status == 10
? Colors.red[800] ? Colors.red[800]!
: item.status == 2 : item.status == 2
? HexColor( ? HexColor(
'#CC9B14') '#CC9B14')
@ -112,7 +112,7 @@ class AddRescheduleLeaveScreen extends StatelessWidget {
child: AppText( child: AppText(
AppDateUtils AppDateUtils
.convertStringToDateFormat( .convertStringToDateFormat(
item.createdOn, item.createdOn!,
'yyyy-MM-dd HH:mm'), 'yyyy-MM-dd HH:mm'),
fontWeight: fontWeight:
FontWeight.bold, FontWeight.bold,
@ -148,7 +148,7 @@ class AddRescheduleLeaveScreen extends StatelessWidget {
AppText( AppText(
AppDateUtils AppDateUtils
.convertStringToDateFormat( .convertStringToDateFormat(
item.dateTimeFrom, item.dateTimeFrom!,
'yyyy-MM-dd HH:mm'), 'yyyy-MM-dd HH:mm'),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
) )
@ -171,7 +171,7 @@ class AddRescheduleLeaveScreen extends StatelessWidget {
AppText( AppText(
AppDateUtils AppDateUtils
.convertStringToDateFormat( .convertStringToDateFormat(
item.dateTimeTo, item.dateTimeTo!,
'yyyy-MM-dd HH:mm'), 'yyyy-MM-dd HH:mm'),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
) )
@ -267,7 +267,7 @@ class AddRescheduleLeaveScreen extends StatelessWidget {
//print(obj); //print(obj);
return obj.length > 0 return obj.length > 0
? projectsProvider.isArabic == true ? projectsProvider!.isArabic == true
? obj[0]['nameAr'] ? obj[0]['nameAr']
: obj[0]['nameEn'] : obj[0]['nameEn']
: ""; : "";

@ -1,4 +1,3 @@
import 'package:date_time_picker/date_time_picker.dart';
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
@ -39,8 +38,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
TextEditingController _toDateController = new TextEditingController(); TextEditingController _toDateController = new TextEditingController();
TextEditingController _toDateController2 = new TextEditingController(); TextEditingController _toDateController2 = new TextEditingController();
ProjectViewModel projectsProvider; ProjectViewModel? projectsProvider;
SickLeaveViewModel sickLeaveViewModel; SickLeaveViewModel? sickLeaveViewModel;
Map profile = {}; Map profile = {};
var offTime = '1'; var offTime = '1';
var date; var date;
@ -49,8 +48,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
dynamic fromDate; dynamic fromDate;
dynamic toDate; dynamic toDate;
var clinicID; var clinicID;
String fromTime; String? fromTime;
String toTime; String? toTime;
TextEditingController _controller4 = new TextEditingController(); TextEditingController _controller4 = new TextEditingController();
TextEditingController _controller5 = new TextEditingController(); TextEditingController _controller5 = new TextEditingController();
@ -177,7 +176,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
'description'], 'description'],
fontSize: SizeConfig fontSize: SizeConfig
.textMultiplier * .textMultiplier! *
2.1, 2.1,
// color: // color:
// Colors.grey, // Colors.grey,
@ -188,7 +187,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
}, },
onChanged: (newValue) { onChanged: (newValue) {
setState(() { setState(() {
offTime = newValue; offTime = newValue
as String;
}); });
if (offTime == '1') { if (offTime == '1') {
model2.getReasons(18); model2.getReasons(18);
@ -201,7 +201,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
model2 model2
.getReasons(102); .getReasons(102);
setState(() { setState(() {
offTime = newValue; offTime = newValue
as String;
}); });
} }
}, },
@ -249,8 +250,10 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
.fromDate, .fromDate,
borderColor: Colors.white, borderColor: Colors.white,
prefix: IconButton( prefix: IconButton(
icon: Icon(Icons icon: Icon(
.calendar_today)), Icons.calendar_today),
onPressed: () {},
),
textInputType: textInputType:
TextInputType.number, TextInputType.number,
controller: _toDateController, controller: _toDateController,
@ -285,25 +288,26 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
DateTimePicker( // Need Fix
timeHintText: // DateTimePicker(
TranslationBase.of( // timeHintText:
context) // TranslationBase.of(
.fromTime, // context)
type: DateTimePickerType // .fromTime,
.time, // type: DateTimePickerType
controller: _controller4, // .time,
onChanged: (val) => // controller: _controller4,
fromTime = val, // onChanged: (val) =>
validator: (val) { // fromTime = val,
print(val); // validator: (val) {
// setState( // print(val);
// () => _valueToValidate4 = val); // // setState(
return null; // // () => _valueToValidate4 = val);
}, // return null;
onSaved: (val) => // },
fromTime = val, // onSaved: (val) =>
) // fromTime = val,
// )
], ],
), ),
), ),
@ -325,25 +329,26 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
DateTimePicker( // Need Fix
timeHintText: // DateTimePicker(
TranslationBase.of( // timeHintText:
context) // TranslationBase.of(
.toTime, // context)
type: DateTimePickerType // .toTime,
.time, // type: DateTimePickerType
controller: _controller5, // .time,
onChanged: (val) => // controller: _controller5,
toTime = val, // onChanged: (val) =>
validator: (val) { // toTime = val,
print(val); // validator: (val) {
// setState( // print(val);
// () => _valueToValidate4 = val); // // setState(
return null; // // () => _valueToValidate4 = val);
}, // return null;
onSaved: (val) => // },
toTime = val, // onSaved: (val) =>
) // toTime = val,
// )
], ],
), ),
), ),
@ -375,8 +380,10 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
.fromDate, .fromDate,
borderColor: Colors.white, borderColor: Colors.white,
prefix: IconButton( prefix: IconButton(
icon: Icon(Icons icon: Icon(
.calendar_today)), Icons.calendar_today),
onPressed: () {},
),
textInputType: textInputType:
TextInputType.number, TextInputType.number,
readOnly: true, readOnly: true,
@ -410,14 +417,16 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
children: [ children: [
AppTextFormField( AppTextFormField(
hintText: hintText:
TranslationBase TranslationBase.of(
.of(context) context)
.toDate, .toDate,
readOnly: true, readOnly: true,
borderColor: Colors.white, borderColor: Colors.white,
prefix: IconButton( prefix: IconButton(
icon: Icon(Icons icon: Icon(
.calendar_today)), Icons.calendar_today),
onPressed: () {},
),
textInputType: textInputType:
TextInputType.number, TextInputType.number,
controller: controller:
@ -486,14 +495,14 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
.max, .max,
children: <Widget>[ children: <Widget>[
AppText( AppText(
projectsProvider projectsProvider!
.isArabic .isArabic
? item[ ? item[
'nameAr'] 'nameAr']
: item[ : item[
'nameEn'], 'nameEn'],
fontSize: SizeConfig fontSize: SizeConfig
.textMultiplier * .textMultiplier! *
2.1, 2.1,
// color: // color:
// Colors.grey, // Colors.grey,
@ -514,7 +523,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
value: item['id'] value: item['id']
.toString(), .toString(),
child: Text( child: Text(
projectsProvider projectsProvider!
.isArabic .isArabic
? item['nameAr'] ? item['nameAr']
: item[ : item[
@ -560,8 +569,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
? Expanded( ? Expanded(
// add Expanded to have your dropdown button fill remaining space // add Expanded to have your dropdown button fill remaining space
child: DropdownSearch( child: DropdownSearch(
mode: Mode.BOTTOM_SHEET, dropdownDecoratorProps:
DropDownDecoratorProps(
dropdownSearchDecoration: dropdownSearchDecoration:
InputDecoration( InputDecoration(
contentPadding: contentPadding:
@ -570,34 +579,12 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
border: border:
InputBorder InputBorder
.none), .none),
//maxHeight: 300, ),
items: model2 popupProps: PopupProps
.coveringDoctors .bottomSheet(
.map((item) { showSearchBox:
return projectsProvider true,
.isArabic title: Container(
? item[
'doctorNameN']
: item[
'doctorName'];
}).toList(),
// label: "Doctor List",
onChanged: (item) {
model2.coveringDoctors
.forEach(
(newVal) => {
if (newVal[
'doctorName'] ==
item)
doctorID =
newVal['DoctorID']
});
},
selectedItem:
getSelectedDoctor(
model2),
showSearchBox: true,
popupTitle: Container(
height: 50, height: 50,
decoration: decoration:
BoxDecoration( BoxDecoration(
@ -605,41 +592,89 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
context) context)
.primaryColorDark, .primaryColorDark,
borderRadius: borderRadius:
BorderRadius.only( BorderRadius
topLeft: .only(
Radius.circular( topLeft: Radius
.circular(
20), 20),
topRight: topRight: Radius
Radius.circular( .circular(
20), 20),
), ),
), ),
child: Center( child: Center(
child: Text( child: Text(
'', '',
style: TextStyle( style:
fontSize: 24, TextStyle(
fontSize:
24,
fontWeight: fontWeight:
FontWeight FontWeight
.bold, .bold,
color: color: Colors
Colors.white, .white,
), ),
), ),
), ),
), ),
popupShape: bottomSheetProps:
BottomSheetProps(
shape:
RoundedRectangleBorder( RoundedRectangleBorder(
borderRadius: borderRadius:
BorderRadius.only( BorderRadius
topLeft: .only(
Radius.circular( topLeft: Radius
.circular(
24), 24),
topRight: topRight: Radius
Radius.circular( .circular(
24), 24),
), ),
), ),
)),
// mode: Mode.BOTTOM_SHEET,
//maxHeight: 300,
items: model2
.coveringDoctors
.map((item) {
return projectsProvider!
.isArabic
? item[
'doctorNameN']
: item[
'doctorName'];
}).toList(),
// label: "Doctor List",
onChanged: (item) {
model2.coveringDoctors
.forEach(
(newVal) => {
if (newVal[
'doctorName'] ==
item)
doctorID =
newVal['DoctorID']
});
},
selectedItem:
getSelectedDoctor(
model2),
// showSearchBox: true,
// popupShape:
// RoundedRectangleBorder(
// borderRadius:
// BorderRadius.only(
// topLeft:
// Radius.circular(
// 24),
// topRight:
// Radius.circular(
// 24),
// ),
// ),
), ),
) )
: SizedBox(), : SizedBox(),
@ -648,7 +683,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
], ],
), ),
)), )),
SizedBox(height: SizeConfig.screenHeight * .3), SizedBox(height: SizeConfig.screenHeight! * .3),
Container( Container(
margin: EdgeInsets.all( margin: EdgeInsets.all(
SizeConfig.widthMultiplier! * 5), SizeConfig.widthMultiplier! * 5),
@ -710,13 +745,13 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
//df.format(DateTime.parse(widget.updateData.dateTimeFrom)); //df.format(DateTime.parse(widget.updateData.dateTimeFrom));
this.fromTime = this.fromTime =
df.format(DateTime.parse(widget.updateData.dateTimeFrom)); df.format(DateTime.parse(widget.updateData.dateTimeFrom));
this.fromTime = this.fromTime.substring(0, this.fromTime.length - 3); this.fromTime = this.fromTime!.substring(0, this.fromTime!.length - 3);
this.toTime = df.format(DateTime.parse(widget.updateData.dateTimeTo)); this.toTime = df.format(DateTime.parse(widget.updateData.dateTimeTo));
this.toTime = this.toTime.substring(0, this.toTime.length - 3); this.toTime = this.toTime!.substring(0, this.toTime!.length - 3);
_toDateController2.text = _toDateController2.text =
dateFormat.format(DateTime.parse(widget.updateData.dateTimeTo)); dateFormat.format(DateTime.parse(widget.updateData.dateTimeTo));
_controller5.text = toTime; _controller5.text = toTime!;
_controller4.text = fromTime; _controller4.text = fromTime!;
toDate = _toDateController2.text; toDate = _toDateController2.text;
fromDate = _toDateController.text; fromDate = _toDateController.text;
this.reason = widget.updateData.reasonId.toString(); this.reason = widget.updateData.reasonId.toString();
@ -740,12 +775,12 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
if (offTime == '1') { if (offTime == '1') {
fromDate = df.format(DateTime.parse(dateFormat.format(fromDates) + fromDate = df.format(DateTime.parse(dateFormat.format(fromDates) +
'T' + 'T' +
fromTime + fromTime! +
':' + ':' +
DateTime.now().second.toString())); DateTime.now().second.toString()));
toDate = df.format(DateTime.parse(dateFormat.format(fromDates) + toDate = df.format(DateTime.parse(dateFormat.format(fromDates) +
'T' + 'T' +
toTime + toTime! +
':' + ':' +
DateTime.now().second.toString())); DateTime.now().second.toString()));
} else { } else {
@ -804,12 +839,12 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
if (offTime == '1') { if (offTime == '1') {
fromDate = df.format(DateTime.parse(_toDateController.text)) + fromDate = df.format(DateTime.parse(_toDateController.text)) +
'T' + 'T' +
fromTime + fromTime! +
':' + ':' +
DateTime.now().second.toString(); DateTime.now().second.toString();
toDate = df.format(DateTime.parse(_toDateController2.text)) + toDate = df.format(DateTime.parse(_toDateController2.text)) +
'T' + 'T' +
toTime + toTime! +
':' + ':' +
DateTime.now().second.toString(); DateTime.now().second.toString();
} else { } else {
@ -863,7 +898,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
getSelectedDoctor(model2) { getSelectedDoctor(model2) {
var doctorName; var doctorName;
if (doctorID == null) if (doctorID == null)
return projectsProvider.isArabic return projectsProvider!.isArabic
? model2.coveringDoctors[0]['doctorNameN'] ? model2.coveringDoctors[0]['doctorNameN']
: model2.coveringDoctors[0]['doctorName']; : model2.coveringDoctors[0]['doctorName'];
else { else {

@ -435,7 +435,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)";
@ -452,6 +452,6 @@ class AppDateUtils {
date.day.toString().padLeft(2, '0'); date.day.toString().padLeft(2, '0');
} }
return newDate ?? ''; return newDate;
} }
} }

@ -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,10 @@
extension Extension on Object { extension Extension on Object {
bool isNullOrEmpty() => this == null || this == ''; bool isNullOrEmpty() => this == '' || this == null;
bool isNullEmptyOrFalse() => this == null || this == '' || !this; bool isNullEmptyOrFalse() => this == null || this == '' || this == false;
bool isNullEmptyZeroOrFalse() => bool isNullEmptyZeroOrFalse() =>
this == null || this == '' || !this || this == 0; this == null || this == '' || this == 0 || this == false;
} }
/// 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.

@ -6,7 +6,9 @@ import 'package:permission_handler/permission_handler.dart';
class AppPermissionsUtils { class AppPermissionsUtils {
static requestVideoCallPermission( static requestVideoCallPermission(
{BuildContext context, String type, Function onTapGrant}) async { {required BuildContext context,
String? type,
required Function onTapGrant}) async {
var cameraPermission = Permission.camera; var cameraPermission = Permission.camera;
var microphonePermission = Permission.microphone; var microphonePermission = Permission.microphone;
PermissionStatus permissionCameraStatus = await cameraPermission.status; PermissionStatus permissionCameraStatus = await cameraPermission.status;
@ -15,19 +17,19 @@ class AppPermissionsUtils {
if (permissionCameraStatus.isPermanentlyDenied || if (permissionCameraStatus.isPermanentlyDenied ||
permissionMicrophoneStatus.isPermanentlyDenied) { permissionMicrophoneStatus.isPermanentlyDenied) {
await _showPermissionDialog(context, type, onTapGrant); await _showPermissionDialog(context, type ?? "", onTapGrant);
} else if (!permissionCameraStatus.isGranted || } else if (!permissionCameraStatus.isGranted ||
!permissionMicrophoneStatus.isGranted) { !permissionMicrophoneStatus.isGranted) {
permissionCameraStatus = await cameraPermission.request(); permissionCameraStatus = await cameraPermission.request();
permissionMicrophoneStatus = await microphonePermission.request(); permissionMicrophoneStatus = await microphonePermission.request();
if (permissionCameraStatus.isDenied || if (permissionCameraStatus.isDenied ||
permissionMicrophoneStatus.isDenied) permissionMicrophoneStatus.isDenied)
await _showPermissionDialog(context, type, onTapGrant); await _showPermissionDialog(context, type ?? "", onTapGrant);
else else
onTapGrant(); onTapGrant();
} else if (permissionCameraStatus.isDenied || } else if (permissionCameraStatus.isDenied ||
permissionMicrophoneStatus.isDenied) permissionMicrophoneStatus.isDenied)
await _showPermissionDialog(context, type, onTapGrant); await _showPermissionDialog(context, type ?? "", onTapGrant);
else else
onTapGrant(); onTapGrant();
} }

@ -6,15 +6,13 @@ import '../core/viewModel/project_view_model.dart';
import '../widgets/shared/app_texts_widget.dart'; import '../widgets/shared/app_texts_widget.dart';
class TabUtils { class TabUtils {
static getBoxTabsBoxDecoration( static getBoxTabsBoxDecoration(
{bool isFirst = false, {bool isFirst = false,
bool isMiddle = false, bool isMiddle = false,
bool isLast = false, bool isLast = false,
bool isActive = false, bool isActive = false,
double radius = 6.0, double radius = 6.0,
ProjectViewModel projectViewModel}) { required ProjectViewModel projectViewModel}) {
return BoxDecoration( return BoxDecoration(
color: isActive ? AppGlobal.appRedColor : Color(0xFFEAEAEA), color: isActive ? AppGlobal.appRedColor : Color(0xFFEAEAEA),
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
@ -71,12 +69,12 @@ class TabUtils {
} }
static getTabText({ static getTabText({
String title, required String title,
bool isActive = false, bool isActive = false,
}) { }) {
return AppText( return AppText(
title, title,
fontSize: SizeConfig.textMultiplier * 1.8, fontSize: SizeConfig.textMultiplier! * 1.8,
color: isActive ? Colors.white : AppGlobal.appTextColor, color: isActive ? Colors.white : AppGlobal.appTextColor,
letterSpacing: -0.48, letterSpacing: -0.48,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -88,7 +86,7 @@ class TabUtils {
return screenSize.height * 0.07; return screenSize.height * 0.07;
} }
static getTabCounter({bool isActive: false, int counter}) { static getTabCounter({bool isActive = false, int counter = 0}) {
return Container( return Container(
margin: EdgeInsets.all(4), margin: EdgeInsets.all(4),
width: 15, width: 15,
@ -101,7 +99,7 @@ class TabUtils {
child: FittedBox( child: FittedBox(
child: AppText( child: AppText(
"$counter", "$counter",
fontSize: SizeConfig.textMultiplier * 1.5, fontSize: SizeConfig.textMultiplier! * 1.5,
color: !isActive ? Colors.white : AppGlobal.appRedColor, color: !isActive ? Colors.white : AppGlobal.appRedColor,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),

File diff suppressed because it is too large Load Diff

@ -42,7 +42,7 @@ class Utils {
), ),
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,
@ -53,7 +53,7 @@ class Utils {
}, },
title: TranslationBase.of(context).cancel, title: TranslationBase.of(context).cancel,
fontColor: Colors.white, fontColor: Colors.white,
color: Colors.red[600], color: Colors.red[600]!,
), ),
], ],
), ),
@ -124,7 +124,7 @@ class Utils {
children: items.map((item) { children: items.map((item) {
return Text( return Text(
'${item.facilityName}', '${item.facilityName}',
style: TextStyle(fontSize: SizeConfig.textMultiplier * 2), style: TextStyle(fontSize: SizeConfig.textMultiplier! * 2),
); );
}).toList(), }).toList(),
itemExtent: 25, itemExtent: 25,
@ -226,14 +226,14 @@ class Utils {
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),
@ -295,7 +295,7 @@ class Utils {
return htmlRegex.hasMatch(text); return htmlRegex.hasMatch(text);
} }
static String timeFrom({Duration duration}) { static String timeFrom({required 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));
@ -329,7 +329,7 @@ class Utils {
static String convertToTitleCase(String text) { static String convertToTitleCase(String text) {
if (text == null) { if (text == null) {
return null; return "";
} }
if (text.length <= 1) { if (text.length <= 1) {

@ -16,27 +16,27 @@ class VideoChannel {
kToken, kToken,
callDuration, callDuration,
warningDuration, warningDuration,
int vcId, required int vcId,
String tokenID, required String tokenID,
String generalId, required String generalId,
int doctorId, required int doctorId,
String patientName, required String patientName,
bool isRecording = false, bool isRecording = false,
Function() onCallEnd, required Function() onCallEnd,
Function(SessionStatusModel sessionStatusModel) onCallNotRespond, required Function(SessionStatusModel sessionStatusModel) onCallNotRespond,
Function(String error) onFailure, required Function(String error) onFailure,
VoidCallback onCallConnected, VoidCallback? onCallConnected,
VoidCallback onCallDisconnected}) async { VoidCallback? onCallDisconnected}) async {
onCallConnected = onCallConnected ?? () {}; onCallConnected = onCallConnected ?? () {};
onCallDisconnected = onCallDisconnected ?? () {}; onCallDisconnected = onCallDisconnected ?? () {};
var result; var result;
try { try {
_channel.setMethodCallHandler((call) { _channel.setMethodCallHandler((call) {
if (call.method == 'onCallConnected') { if (call.method == 'onCallConnected') {
onCallConnected(); onCallConnected!();
} }
if (call.method == 'onCallDisconnected') { if (call.method == 'onCallDisconnected') {
onCallDisconnected(); onCallDisconnected!();
} }
return true as dynamic; return true as dynamic;
}); });

@ -7,10 +7,10 @@ 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.height = 20,
this.isSvg = true, this.isSvg = true,
}) : super(key: key); }) : super(key: key);

@ -42,8 +42,8 @@ class SMSOTP {
final focusD2 = FocusNode(); final focusD2 = FocusNode();
final focusD3 = FocusNode(); final focusD3 = FocusNode();
final focusD4 = FocusNode(); final focusD4 = FocusNode();
String errorMsg; String errorMsg = '';
ProjectViewModel projectProvider; late ProjectViewModel projectProvider;
String displayTime = ''; String displayTime = '';
bool isClosed = false; bool isClosed = false;
@ -349,7 +349,7 @@ class SMSOTP {
TextStyle buildTextStyle() { TextStyle buildTextStyle() {
return TextStyle( return TextStyle(
fontSize: SizeConfig.textMultiplier * 2.5, fontSize: SizeConfig.textMultiplier! * 2.5,
); );
} }
@ -358,15 +358,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)),
@ -381,13 +381,12 @@ class SMSOTP {
return ' '; return ' ';
} else if (value.length == 3) { } else if (value.length == 3) {
print(value); print(value);
} else {
return null;
} }
return "";
} }
checkValue() async { checkValue() async {
if (verifyAccountForm.currentState.validate()) { if (verifyAccountForm.currentState!.validate()) {
onSuccess(digit1.text.toString() + onSuccess(digit1.text.toString() +
digit2.text.toString() + digit2.text.toString() +
digit3.text.toString() + digit3.text.toString() +

@ -8,13 +8,13 @@ import 'package:local_auth/local_auth.dart';
import 'package:provider/provider.dart'; 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 Function? onShowMore;
final AuthenticationViewModel authenticationViewModel; final AuthenticationViewModel? authenticationViewModel;
const VerificationMethodsList( const VerificationMethodsList(
{Key key, {Key? key,
this.authMethodType, this.authMethodType,
this.authenticateUser, this.authenticateUser,
this.onShowMore, this.onShowMore,
@ -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; late 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.of(context).verifyWith + label: TranslationBase.of(context).verifyWith +
TranslationBase.of(context).verifyWhatsApp, TranslationBase.of(context).verifyWhatsApp,
); );
@ -47,7 +47,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.of(context).verifyWith + label: TranslationBase.of(context).verifyWith +
TranslationBase.of(context).verifySMS, TranslationBase.of(context).verifySMS,
); );
@ -56,9 +56,9 @@ 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.of(context).verifyWith + label: TranslationBase.of(context).verifyWith +
@ -69,9 +69,9 @@ 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.of(context).verifyWith + label: TranslationBase.of(context).verifyWith +
@ -82,7 +82,7 @@ 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, isSvg: false,
label: TranslationBase.of(context).moreVerification, label: TranslationBase.of(context).moreVerification,
height: 0, height: 0,

@ -1,15 +1,16 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
class BottomSheetContainer extends StatelessWidget { class BottomSheetContainer extends StatelessWidget {
final Function onTap; final Function? onTap;
final String label; final String? label;
final Widget widget; final Widget? widget;
double headerHeight = SizeConfig.heightMultiplier! * 12; double headerHeight = SizeConfig.heightMultiplier! * 12;
BottomSheetContainer({Key key, this.onTap, this.label, this.widget}) : super(key: key); BottomSheetContainer({Key? key, this.onTap, this.label, this.widget})
: super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -27,15 +28,14 @@ class BottomSheetContainer extends StatelessWidget {
children: [ children: [
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
top: headerHeight * (SizeConfig.isWidthLarge ? 0.3 : 0.2), left: SizeConfig.heightMultiplier!*4.5 top: headerHeight * (SizeConfig.isWidthLarge ? 0.3 : 0.2),
), left: SizeConfig.heightMultiplier! * 4.5),
child: Center( child: Center(
child: Row( child: Row(
children: [ children: [
widget, widget!,
], ],
) )),
),
), ),
SizedBox( SizedBox(
height: 5, height: 5,
@ -44,4 +44,10 @@ class BottomSheetContainer extends StatelessWidget {
), ),
); );
} }
@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
super.debugFillProperties(properties);
properties.add(DiagnosticsProperty<Function>('onTap', onTap));
}
} }

@ -11,7 +11,7 @@ class CustomBottomSheetContainer extends StatelessWidget {
double headerHeight = SizeConfig.heightMultiplier! * 12; double headerHeight = SizeConfig.heightMultiplier! * 12;
CustomBottomSheetContainer({Key key, this.onTap, this.label}) : super(key: key); CustomBottomSheetContainer({Key? key, required this.onTap, required this.label}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -36,7 +36,7 @@ class CustomBottomSheetContainer extends StatelessWidget {
child: AppButton( child: AppButton(
title: label, title: label,
color: AppGlobal.appGreenColor, color: AppGlobal.appGreenColor,
onPressed: onTap, onPressed: onTap(),
), ),
), ),
), ),

@ -48,7 +48,7 @@ class _DashboardItemTextsState extends State<DashboardItemIconText> {
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Icon( child: Icon(
widget.icon, widget.icon,
size: SizeConfig.textMultiplier * 2.8, size: SizeConfig.textMultiplier! * 2.8,
color: widget.iconColor, color: widget.iconColor,
), ),
)), )),

@ -26,7 +26,7 @@ class DashboardItemTexts extends StatefulWidget {
} }
class _DashboardItemTextsState extends State<DashboardItemTexts> { class _DashboardItemTextsState extends State<DashboardItemTexts> {
ProjectViewModel projectsProvider; late ProjectViewModel projectsProvider;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -1,8 +1,8 @@
import 'package:flutter_charts/flutter_charts.dart' as charts; import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class GaugeChart extends StatelessWidget { class GaugeChart extends StatelessWidget {
final List<charts.ChartData> seriesList; final List<charts.Series> seriesList;
final bool animate; final bool animate;
GaugeChart(this.seriesList, {this.animate = false}); GaugeChart(this.seriesList, {this.animate = false});
@ -49,7 +49,7 @@ class GaugeChart extends StatelessWidget {
class GaugeSegment { class GaugeSegment {
final String segment; final String segment;
final int size; final int size;
final charts. color; final color;
GaugeSegment(this.segment, this.size, this.color); GaugeSegment(this.segment, this.size, this.color);
} }

@ -19,12 +19,12 @@ class GetOutPatientStack extends StatelessWidget {
? 20 ? 20
: 17); : 17);
value.summaryoptions value.summaryoptions
.sort((Summaryoptions a, Summaryoptions b) => b.value - a.value); .sort((Summaryoptions a, Summaryoptions b) => b.value! - a.value!);
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( list.add(getStack(
result, value.summaryoptions.first.value, context, barHeight)) result, value.summaryoptions.first.value, context, barHeight))
@ -92,7 +92,7 @@ class GetOutPatientStack extends StatelessWidget {
begin: Alignment.topLeft, begin: Alignment.topLeft,
end: Alignment(0.0, 1.0), end: Alignment(0.0, 1.0),
// 10% of the width, so there are ten blinds. // 10% of the width, so there are ten blinds.
colors: <Color>[Color(0x8FF5F6FA), Colors.red[100]], colors: <Color>[Color(0x8FF5F6FA), Colors.red[100]!],
// red to yellow // red to yellow
tileMode: TileMode.mirror, // repeats the gradient over the canvas tileMode: TileMode.mirror, // repeats the gradient over the canvas
), ),
@ -126,7 +126,7 @@ class GetOutPatientStack extends StatelessWidget {
child: Row( child: Row(
children: [ children: [
AppText( AppText(
value.kPIParameter, value.kPIParameter!,
fontSize: fontSize:
SizeConfig.getTextMultiplierBasedOnWidth() * 2.5, SizeConfig.getTextMultiplierBasedOnWidth() * 2.5,
textAlign: TextAlign.center, textAlign: TextAlign.center,

@ -7,7 +7,7 @@ class RowCounts extends StatelessWidget {
final name; final name;
final int count; final int count;
final Color c; final Color c;
final double height; final double? height;
RowCounts(this.name, this.count, this.c, {this.height}); RowCounts(this.name, this.count, this.c, {this.height});

@ -14,27 +14,27 @@ import 'package:flutter/material.dart';
/// [child] child of the widget /// [child] child of the widget
/// [decoration] decoration of the widget /// [decoration] decoration of the widget
class CustomItem extends StatelessWidget { class CustomItem extends StatelessWidget {
final IconData startIcon; final IconData? startIcon;
final double startIconSize; final double startIconSize;
final Color startIconColor; final Color? startIconColor;
final IconData endIcon; final IconData endIcon;
final double endIconSize; final double endIconSize;
final Color endIconColor; final Color? endIconColor;
final bool disabled; final bool disabled;
final Function onTap; final Function? onTap;
final EdgeInsets padding; final EdgeInsets? padding;
final Widget child; final Widget child;
final BoxDecoration decoration; final BoxDecoration? decoration;
CustomItem( CustomItem(
{Key key, {Key? key,
this.startIcon, this.startIcon,
this.disabled: false, this.disabled = false,
this.onTap, this.onTap,
this.startIconColor, this.startIconColor,
this.endIcon = EvaIcons.chevronRight, this.endIcon = EvaIcons.chevronRight,
this.padding, this.padding,
this.child, required this.child,
this.endIconColor, this.endIconColor,
this.endIconSize = 20, this.endIconSize = 20,
this.decoration, this.decoration,
@ -49,11 +49,11 @@ class CustomItem extends StatelessWidget {
decoration: decoration != null ? decoration : BoxDecoration(), decoration: decoration != null ? decoration : BoxDecoration(),
child: InkWell( child: InkWell(
onTap: () { onTap: () {
if (onTap != null) onTap(); if (onTap != null) onTap!();
}, },
child: Padding( child: Padding(
padding: padding != null padding: padding != null
? padding ? padding!
: const EdgeInsets.symmetric(horizontal: 24.0, vertical: 16.0), : const EdgeInsets.symmetric(horizontal: 24.0, vertical: 16.0),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
@ -68,7 +68,7 @@ class CustomItem extends StatelessWidget {
), ),
if (startIcon != null) SizedBox(width: 18.0), if (startIcon != null) SizedBox(width: 18.0),
Expanded( Expanded(
child: child, child: child!,
flex: 10, flex: 10,
), ),
endIcon == null endIcon == null

@ -15,15 +15,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

@ -9,7 +9,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();
@ -71,7 +71,7 @@ class _AskPermissionDialogState extends State<AskPermissionDialog> {
), ),
AppButton( AppButton(
fontColor: Theme.of(context).backgroundColor, fontColor: Theme.of(context).backgroundColor,
color: Colors.red[700], color: Colors.red[700]!,
title: "Turn On Camera, Microphone", title: "Turn On Camera, Microphone",
onPressed: () async { onPressed: () async {
openAppSettings().then((value) { openAppSettings().then((value) {

@ -9,7 +9,7 @@ import 'package:hexcolor/hexcolor.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();
@ -30,7 +30,7 @@ class _LabResultWidgetState extends State<LabResultWidget> {
children: <Widget>[ children: <Widget>[
AppText( AppText(
TranslationBase.of(context).generalResult, TranslationBase.of(context).generalResult,
fontSize: 2.5 * SizeConfig.textMultiplier, fontSize: 2.5 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
InkWell( InkWell(
@ -135,7 +135,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,
@ -146,7 +146,7 @@ class _LabResultWidgetState extends State<LabResultWidget> {
child: Center( child: Center(
child: AppText( child: AppText(
'${result.resultValue}', '${result.resultValue}',
color: Colors.grey[800]), color: Colors.grey[800]!),
), ),
height: 60), height: 60),
), ),
@ -155,7 +155,7 @@ class _LabResultWidgetState extends State<LabResultWidget> {
child: Center( child: Center(
child: AppText( child: AppText(
'${result.referenceRange}', '${result.referenceRange}',
color: Colors.grey[800]), color: Colors.grey[800]!),
), ),
height: 60), height: 60),
), ),

@ -13,13 +13,13 @@ import 'package:flutter/material.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
class MyReferralPatientWidget extends StatefulWidget { class MyReferralPatientWidget extends StatefulWidget {
final MyReferralPatientModel myReferralPatientModel; final MyReferralPatientModel? myReferralPatientModel;
final ReferralPatientViewModel model; final ReferralPatientViewModel? model;
final bool isExpand; final bool? isExpand;
final Function expandClick; final Function? expandClick;
MyReferralPatientWidget( MyReferralPatientWidget(
{Key key, {Key? key,
this.myReferralPatientModel, this.myReferralPatientModel,
this.model, this.model,
this.isExpand, this.isExpand,
@ -33,13 +33,13 @@ 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; String error = '';
TextEditingController answerController; TextEditingController answerController = TextEditingController();
@override @override
void initState() { void initState() {
answerController = new TextEditingController( answerController = new TextEditingController(
text: widget.myReferralPatientModel.referredDoctorRemarks ?? ''); text: widget.myReferralPatientModel!.referredDoctorRemarks ?? '');
super.initState(); super.initState();
} }
@ -79,8 +79,8 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 4, horizontal: 4), vertical: 4, horizontal: 4),
child: AppText( child: AppText(
'${widget.myReferralPatientModel.priorityDescription}', '${widget.myReferralPatientModel!.priorityDescription}',
fontSize: 1.7 * SizeConfig.textMultiplier, fontSize: 1.7 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
textAlign: TextAlign.start, textAlign: TextAlign.start,
color: Colors.white, color: Colors.white,
@ -90,8 +90,8 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
height: 10, height: 10,
), ),
AppText( AppText(
'${widget.myReferralPatientModel.firstName} ${widget.myReferralPatientModel.middleName} ${widget.myReferralPatientModel.lastName}', '${widget.myReferralPatientModel!.firstName} ${widget.myReferralPatientModel!.middleName} ${widget.myReferralPatientModel!.lastName}',
fontSize: 2 * SizeConfig.textMultiplier, fontSize: 2 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
textAlign: TextAlign.start, textAlign: TextAlign.start,
color: Colors.black, color: Colors.black,
@ -103,7 +103,7 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
children: [ children: [
AppText( AppText(
TranslationBase.of(context).fileNo, TranslationBase.of(context).fileNo,
fontSize: 1.7 * SizeConfig.textMultiplier, fontSize: 1.7 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
textAlign: TextAlign.start, textAlign: TextAlign.start,
color: Colors.black, color: Colors.black,
@ -112,8 +112,8 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
width: 20, width: 20,
), ),
AppText( AppText(
'${widget.myReferralPatientModel.referralDoctor}', '${widget.myReferralPatientModel!.referralDoctor!}',
fontSize: 1.7 * SizeConfig.textMultiplier, fontSize: 1.7 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
textAlign: TextAlign.start, textAlign: TextAlign.start,
color: Colors.black, color: Colors.black,
@ -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,
@ -155,7 +155,7 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
endIndent: 0, endIndent: 0,
), ),
Container( Container(
height: 1.8 * SizeConfig.textMultiplier * 6, height: 1.8 * SizeConfig.textMultiplier! * 6,
padding: padding:
EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0), EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0),
child: Expanded( child: Expanded(
@ -171,7 +171,7 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
SizedBox( SizedBox(
child: AppText( child: AppText(
TranslationBase.of(context).referralDoctor, TranslationBase.of(context).referralDoctor,
fontSize: 1.9 * SizeConfig.textMultiplier, fontSize: 1.9 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
textAlign: TextAlign.start, textAlign: TextAlign.start,
color: Colors.black, color: Colors.black,
@ -182,8 +182,8 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
), ),
SizedBox( SizedBox(
child: AppText( child: AppText(
'${widget.myReferralPatientModel.referringDoctorName}', '${widget.myReferralPatientModel!.referringDoctorName}',
fontSize: 1.7 * SizeConfig.textMultiplier, fontSize: 1.7 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
textAlign: TextAlign.start, textAlign: TextAlign.start,
color: Colors.black, color: Colors.black,
@ -214,7 +214,7 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
SizedBox( SizedBox(
child: AppText( child: AppText(
TranslationBase.of(context).referringClinic, TranslationBase.of(context).referringClinic,
fontSize: 1.9 * SizeConfig.textMultiplier, fontSize: 1.9 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
textAlign: TextAlign.start, textAlign: TextAlign.start,
color: Colors.black, color: Colors.black,
@ -225,8 +225,8 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
), ),
SizedBox( SizedBox(
child: AppText( child: AppText(
'${widget.myReferralPatientModel.referringClinicDescription}', '${widget.myReferralPatientModel!.referringClinicDescription}',
fontSize: 1.7 * SizeConfig.textMultiplier, fontSize: 1.7 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
textAlign: TextAlign.start, textAlign: TextAlign.start,
color: Colors.black, color: Colors.black,
@ -253,7 +253,7 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
height: 10, height: 10,
), ),
Container( Container(
height: 1.8 * SizeConfig.textMultiplier * 6, height: 1.8 * SizeConfig.textMultiplier! * 6,
padding: padding:
EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0), EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0),
child: Expanded( child: Expanded(
@ -269,7 +269,7 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
SizedBox( SizedBox(
child: AppText( child: AppText(
TranslationBase.of(context).frequency, TranslationBase.of(context).frequency,
fontSize: 1.9 * SizeConfig.textMultiplier, fontSize: 1.9 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
textAlign: TextAlign.start, textAlign: TextAlign.start,
color: Colors.black, color: Colors.black,
@ -280,8 +280,8 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
), ),
SizedBox( SizedBox(
child: AppText( child: AppText(
'${widget.myReferralPatientModel.frequencyDescription}', '${widget.myReferralPatientModel!.frequencyDescription}',
fontSize: 1.7 * SizeConfig.textMultiplier, fontSize: 1.7 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
textAlign: TextAlign.start, textAlign: TextAlign.start,
color: Colors.black, color: Colors.black,
@ -312,7 +312,7 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
SizedBox( SizedBox(
child: AppText( child: AppText(
TranslationBase.of(context).maxResponseTime, TranslationBase.of(context).maxResponseTime,
fontSize: 1.9 * SizeConfig.textMultiplier, fontSize: 1.9 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
textAlign: TextAlign.start, textAlign: TextAlign.start,
color: Colors.black, color: Colors.black,
@ -323,8 +323,8 @@ 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,
color: Colors.black, color: Colors.black,
@ -367,7 +367,7 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
child: AppText( child: AppText(
TranslationBase.of(context) TranslationBase.of(context)
.clinicDetailsandRemarks, .clinicDetailsandRemarks,
fontSize: 1.9 * SizeConfig.textMultiplier, fontSize: 1.9 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
textAlign: TextAlign.start, textAlign: TextAlign.start,
color: Colors.black, color: Colors.black,
@ -378,8 +378,8 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
), ),
SizedBox( SizedBox(
child: AppText( child: AppText(
'${widget.myReferralPatientModel.referringDoctorRemarks}', '${widget.myReferralPatientModel!.referringDoctorRemarks}',
fontSize: 1.7 * SizeConfig.textMultiplier, fontSize: 1.7 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
textAlign: TextAlign.start, textAlign: TextAlign.start,
color: Colors.black, color: Colors.black,
@ -434,11 +434,11 @@ 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(),
widget.myReferralPatientModel); widget.myReferralPatientModel!);
DrAppToastMsg.showSuccesToast( DrAppToastMsg.showSuccesToast(
TranslationBase.of(context).replySuccessfully); TranslationBase.of(context).replySuccessfully);
} catch (e) { } catch (e) {
@ -446,13 +446,13 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
} }
} }
}, },
loading: widget.model.state == ViewState.BusyLocal, loading: widget.model!.state == ViewState.BusyLocal,
), ),
) )
], ],
), ),
), ),
isExpand: widget.isExpand, isExpand: widget.isExpand!,
), ),
], ],
), ),

@ -14,13 +14,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 = Utils.getWorkingHours( List<WorkingHours> workingHours = Utils.getWorkingHours(
workingHoursTable.workingHours, workingHoursTable.workingHours!,
); );
return Container( return Container(
color: HexColor("#EFEFEF"), color: HexColor("#EFEFEF"),
@ -30,7 +30,6 @@ class MyScheduleWidget extends StatelessWidget {
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox( SizedBox(
height: 10, height: 10,
@ -40,8 +39,9 @@ class MyScheduleWidget extends StatelessWidget {
child: AppText( child: AppText(
projectViewModel.isArabic projectViewModel.isArabic
? AppDateUtils.getWeekDayArabic( ? AppDateUtils.getWeekDayArabic(
workingHoursTable.date.weekday) workingHoursTable.date!.weekday)
: AppDateUtils.getWeekDay(workingHoursTable.date.weekday), : AppDateUtils.getWeekDay(
workingHoursTable.date!.weekday),
fontSize: MediaQuery.of(context).size.width * 0.032, fontSize: MediaQuery.of(context).size.width * 0.032,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
@ -52,7 +52,7 @@ class MyScheduleWidget extends StatelessWidget {
Padding( Padding(
padding: const EdgeInsets.only(left: 19), padding: const EdgeInsets.only(left: 19),
child: AppText( child: 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: MediaQuery.of(context).size.width * 0.051, fontSize: MediaQuery.of(context).size.width * 0.051,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -71,17 +71,17 @@ class MyScheduleWidget extends StatelessWidget {
marginLeft: 8, marginLeft: 8,
marginSymmetric: 7, marginSymmetric: 7,
hasBorder: false, hasBorder: false,
bgColor: AppDateUtils.isToday(workingHoursTable.date) bgColor: AppDateUtils.isToday(workingHoursTable.date!)
? AppGlobal.appGreenColor ? AppGlobal.appGreenColor
: Colors.transparent, : Colors.transparent,
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.5 * SizeConfig.textMultiplier, fontSize: 1.5 * SizeConfig.textMultiplier!,
fontFamily: 'Poppins', fontFamily: 'Poppins',
color: AppGlobal.appGreenColor, color: AppGlobal.appGreenColor,
), ),
@ -99,12 +99,14 @@ class MyScheduleWidget extends StatelessWidget {
), ),
if (workingHoursTable.clinicName != null) if (workingHoursTable.clinicName != null)
Container( Container(
width: MediaQuery.of(context).size.width * 0.65, width:
MediaQuery.of(context).size.width * 0.65,
child: AppText( child: AppText(
Utils Utils.convertToTitleCase(
.convertToTitleCase(
workingHoursTable.clinicName ?? ""), workingHoursTable.clinicName ?? ""),
fontSize: MediaQuery.of(context).size.width*0.04, fontSize:
MediaQuery.of(context).size.width *
0.04,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
letterSpacing: -0.64, letterSpacing: -0.64,
color: AppGlobal.scheduleTextColor, color: AppGlobal.scheduleTextColor,
@ -114,7 +116,8 @@ class MyScheduleWidget extends StatelessWidget {
Container( Container(
child: AppText( child: AppText(
'${work.from} - ${work.to}', '${work.from} - ${work.to}',
fontSize: MediaQuery.of(context).size.width*0.03, fontSize:
MediaQuery.of(context).size.width * 0.03,
fontWeight: FontWeight.w300, fontWeight: FontWeight.w300,
letterSpacing: -0.4, letterSpacing: -0.4,
), ),
@ -125,7 +128,8 @@ class MyScheduleWidget extends StatelessWidget {
if (workingHoursTable.projectName != null) if (workingHoursTable.projectName != null)
AppText( AppText(
workingHoursTable.projectName ?? "", workingHoursTable.projectName ?? "",
fontSize: MediaQuery.of(context).size.width*0.04, fontSize:
MediaQuery.of(context).size.width * 0.04,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
letterSpacing: -0.64, letterSpacing: -0.64,
color: AppGlobal.scheduleTextColor, color: AppGlobal.scheduleTextColor,

@ -22,12 +22,14 @@ class MedicineItemWidget extends StatefulWidget {
final String price; final String price;
MedicineItemWidget( MedicineItemWidget(
{@required this.label, {required this.label,
this.backgroundColor = Colors.white, this.backgroundColor = Colors.white,
this.showBorder = true, this.showBorder = true,
this.borderColor = Colors.white, this.borderColor = Colors.white,
this.url, this.url = '',
this.showArrow = true, this.showPrice = false, this.price}); this.showArrow = true,
this.showPrice = false,
this.price = "0"});
@override @override
_MedicineItemWidgetState createState() => _MedicineItemWidgetState(); _MedicineItemWidgetState createState() => _MedicineItemWidgetState();
@ -55,7 +57,7 @@ class _MedicineItemWidgetState extends State<MedicineItemWidget> {
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: (BuildContext context, Object exception, errorBuilder: (BuildContext context, Object exception,
StackTrace stackTrace) { StackTrace? stackTrace) {
return Text(''); return Text('');
}, },
)), )),
@ -91,8 +93,7 @@ class _MedicineItemWidgetState extends State<MedicineItemWidget> {
), ),
), ),
), ),
if(widget.showArrow) if (widget.showArrow) Icon(EvaIcons.arrowForward)
Icon(EvaIcons.arrowForward)
], ],
), ),
), ),

@ -7,11 +7,11 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class ClinicList extends StatelessWidget { class ClinicList extends StatelessWidget {
ProjectViewModel projectsProvider; ProjectViewModel? projectsProvider;
final int clinicId; final int? clinicId;
final Function(int value) onClinicChange; final Function(int value)? onClinicChange;
ClinicList({Key key, this.clinicId, this.onClinicChange}) : super(key: key); ClinicList({Key? key, this.clinicId, this.onClinicChange}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -19,7 +19,7 @@ class ClinicList extends StatelessWidget {
projectsProvider = Provider.of(context); projectsProvider = Provider.of(context);
return Container( return Container(
child: projectsProvider.doctorClinicsList.length > 0 child: projectsProvider!.doctorClinicsList.length > 0
? FractionallySizedBox( ? FractionallySizedBox(
widthFactor: 0.9, widthFactor: 0.9,
child: Column( child: Column(
@ -33,18 +33,18 @@ class ClinicList extends StatelessWidget {
iconEnabledColor: Colors.black, iconEnabledColor: Colors.black,
isExpanded: true, isExpanded: true,
value: clinicId == null value: clinicId == null
? projectsProvider.doctorClinicsList[0].clinicID ? projectsProvider!.doctorClinicsList[0].clinicID
: clinicId, : clinicId,
iconSize: 25, iconSize: 25,
elevation: 16, elevation: 16,
selectedItemBuilder: (BuildContext context) { selectedItemBuilder: (BuildContext context) {
return projectsProvider.doctorClinicsList.map((item) { return projectsProvider!.doctorClinicsList.map((item) {
return Row( return Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
AppText( AppText(
item.clinicName, item.clinicName!,
fontSize: SizeConfig.textMultiplier * 2.1, fontSize: SizeConfig.textMultiplier! * 2.1,
color: Colors.black, color: Colors.black,
), ),
], ],
@ -52,12 +52,12 @@ class ClinicList extends StatelessWidget {
}).toList(); }).toList();
}, },
onChanged: (newValue) { onChanged: (newValue) {
onClinicChange(newValue); onClinicChange!(newValue!);
}, },
items: projectsProvider.doctorClinicsList.map((item) { items: projectsProvider!.doctorClinicsList.map((item) {
return DropdownMenuItem( return DropdownMenuItem(
child: Text( child: Text(
item.clinicName, item.clinicName!,
textAlign: TextAlign.end, textAlign: TextAlign.end,
), ),
value: item.clinicID, value: item.clinicID,

@ -8,24 +8,24 @@ import 'package:flutter/material.dart';
import '../../utils/utils.dart'; import '../../utils/utils.dart';
class PatientReferralItemWidget extends StatelessWidget { class PatientReferralItemWidget extends StatelessWidget {
final String referralStatus; final String? referralStatus;
final int referralStatusCode; final int? referralStatusCode;
final String patientName; final String? patientName;
final int patientGender; final int? patientGender;
final String referredDate; final String? referredDate;
final String referredTime; final String? referredTime;
final String patientID; final String? patientID;
final isSameBranch; final isSameBranch;
final bool isReferral; final bool isReferral;
final bool isReferralClinic; final bool isReferralClinic;
final String referralClinic; final String? referralClinic;
final String remark; final String? remark;
final String nationality; final String? nationality;
final String nationalityFlag; final String? nationalityFlag;
final String doctorAvatar; final String? doctorAvatar;
final String referralDoctorName; final String? referralDoctorName;
final String clinicDescription; final String? clinicDescription;
final Widget infoIcon; final Widget? infoIcon;
PatientReferralItemWidget( PatientReferralItemWidget(
{this.referralStatus, {this.referralStatus,
@ -36,7 +36,7 @@ class PatientReferralItemWidget extends StatelessWidget {
this.referredTime, this.referredTime,
this.patientID, this.patientID,
this.isSameBranch, this.isSameBranch,
this.isReferral, this.isReferral = false,
this.remark, this.remark,
this.nationality, this.nationality,
this.nationalityFlag, this.nationalityFlag,
@ -49,7 +49,6 @@ class PatientReferralItemWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
margin: EdgeInsets.only(left: 16.0, right: 16.0, top: 0.0), margin: EdgeInsets.only(left: 16.0, right: 16.0, top: 0.0),
child: Column( child: Column(
@ -64,8 +63,8 @@ class PatientReferralItemWidget extends StatelessWidget {
: referralStatusCode == 46 : referralStatusCode == 46
? AppGlobal.appGreenColor ? AppGlobal.appGreenColor
: referralStatusCode == 4 : referralStatusCode == 4
? Colors.red[700] ? Colors.red[700]!
: Colors.red[900], : Colors.red[900]!,
hasBorder: false, hasBorder: false,
widget: Container( widget: Container(
// padding: EdgeInsets.only(left: 20, right: 0, bottom: 0), // padding: EdgeInsets.only(left: 20, right: 0, bottom: 0),
@ -77,7 +76,7 @@ class PatientReferralItemWidget extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
AppText( AppText(
referralStatus != null ? referralStatus : "", referralStatus != null ? referralStatus! : "",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 12.0, fontSize: 12.0,
letterSpacing: -0.48, letterSpacing: -0.48,
@ -89,8 +88,8 @@ class PatientReferralItemWidget extends StatelessWidget {
: referralStatusCode == 46 : referralStatusCode == 46
? AppGlobal.appGreenColor ? AppGlobal.appGreenColor
: referralStatusCode == 4 : referralStatusCode == 4
? Colors.red[700] ? Colors.red[700]!
: Colors.red[900], : Colors.red[900]!,
), ),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
@ -149,7 +148,7 @@ class PatientReferralItemWidget extends StatelessWidget {
children: [ children: [
CustomRow( CustomRow(
label: TranslationBase.of(context).fileNumber, label: TranslationBase.of(context).fileNumber,
value: patientID, value: patientID!,
), ),
CustomRow( CustomRow(
label: isSameBranch label: isSameBranch
@ -160,7 +159,9 @@ class PatientReferralItemWidget extends StatelessWidget {
? TranslationBase.of(context).sameBranch ? TranslationBase.of(context).sameBranch
: TranslationBase.of(context) : TranslationBase.of(context)
.otherBranch .otherBranch
: " " + Utils.convertToTitleCase(referralClinic ?? ""), : " " +
Utils.convertToTitleCase(
referralClinic ?? ""),
), ),
], ],
), ),
@ -170,7 +171,7 @@ class PatientReferralItemWidget extends StatelessWidget {
child: Row( child: Row(
children: [ children: [
AppText( AppText(
nationality != null ? nationality : "", nationality != null ? nationality! : "",
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontSize: 10.0, fontSize: 10.0,
@ -180,16 +181,15 @@ class PatientReferralItemWidget extends StatelessWidget {
? ClipRRect( ? ClipRRect(
borderRadius: BorderRadius.circular(20.0), borderRadius: BorderRadius.circular(20.0),
child: Image.network( child: Image.network(
nationalityFlag, nationalityFlag!,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: (BuildContext context, errorBuilder: (BuildContext context,
Object exception, Object exception,
StackTrace stackTrace) { StackTrace? stackTrace) {
return Text(''); return Text('');
}, },
) ))
)
: SizedBox() : SizedBox()
], ],
), ),
@ -224,12 +224,12 @@ class PatientReferralItemWidget extends StatelessWidget {
? ClipRRect( ? ClipRRect(
borderRadius: BorderRadius.circular(20.0), borderRadius: BorderRadius.circular(20.0),
child: Image.network( child: Image.network(
doctorAvatar, doctorAvatar!,
height: 28, height: 28,
width: 28, width: 28,
errorBuilder: (BuildContext context, errorBuilder: (BuildContext context,
Object exception, Object exception,
StackTrace stackTrace) { StackTrace? stackTrace) {
return Text('No Image'); return Text('No Image');
}, },
)) ))
@ -246,13 +246,14 @@ class PatientReferralItemWidget extends StatelessWidget {
Expanded( Expanded(
flex: 4, flex: 4,
child: Container( child: Container(
margin: EdgeInsets.only( margin:
left: 10, top: 17, bottom: 0), EdgeInsets.only(left: 10, top: 17, bottom: 0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
Utils.convertToTitleCase(referralDoctorName ?? ""), Utils.convertToTitleCase(
referralDoctorName ?? ""),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 14.0, fontSize: 14.0,
@ -261,8 +262,8 @@ class PatientReferralItemWidget extends StatelessWidget {
), ),
if (clinicDescription != null) if (clinicDescription != null)
AppText( AppText(
Utils.convertToTitleCase(clinicDescription ?? "") Utils.convertToTitleCase(
, clinicDescription ?? ""),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 10.0, fontSize: 10.0,

@ -17,8 +17,8 @@ import 'package:provider/provider.dart';
import 'ShowTimer.dart'; import 'ShowTimer.dart';
class PatientCard extends StatelessWidget { class PatientCard extends StatelessWidget {
final PatiantInformtion patientInfo; final PatiantInformtion? patientInfo;
final Function onTap; final Function? onTap;
final String patientType; final String patientType;
final String arrivalType; final String arrivalType;
final bool isInpatient; final bool isInpatient;
@ -27,12 +27,12 @@ class PatientCard extends StatelessWidget {
final bool isFromLiveCare; final bool isFromLiveCare;
PatientCard( PatientCard(
{Key key, {Key? key,
this.patientInfo, this.patientInfo,
this.onTap, this.onTap,
this.patientType, this.patientType = '',
this.arrivalType, this.arrivalType = '',
this.isInpatient, this.isInpatient = false,
this.isMyPatient = false, this.isMyPatient = false,
this.isFromSearch = false, this.isFromSearch = false,
this.isFromLiveCare = false}) this.isFromLiveCare = false})
@ -41,16 +41,16 @@ class PatientCard extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
String nationalityName = patientInfo.nationalityName != null String nationalityName = patientInfo!.nationalityName != null
? patientInfo.nationalityName.trim() ? patientInfo!.nationalityName!.trim()
: patientInfo.nationality != null : patientInfo!.nationality != null
? patientInfo.nationality.trim() ? patientInfo!.nationality!.trim()
: patientInfo.nationalityId != null : patientInfo!.nationalityId != null
? patientInfo.nationalityId ? patientInfo!.nationalityId!
: ""; : "";
return Container( return Container(
width: SizeConfig.screenWidth * 0.9, width: SizeConfig.screenWidth! * 0.9,
margin: EdgeInsets.all(6), margin: EdgeInsets.all(6),
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: projectViewModel.isArabic ? 5 : 0, left: projectViewModel.isArabic ? 5 : 0,
@ -67,14 +67,14 @@ class PatientCard extends StatelessWidget {
? Colors.white ? Colors.white
: (isMyPatient && !isFromSearch) : (isMyPatient && !isFromSearch)
? AppGlobal.appGreenColor ? AppGlobal.appGreenColor
: patientInfo.patientStatusType == 43 : patientInfo!.patientStatusType == 43
? AppGlobal.appGreenColor ? AppGlobal.appGreenColor
: isMyPatient : isMyPatient
? AppGlobal.appGreenColor ? AppGlobal.appGreenColor
: isInpatient : isInpatient
? Colors.white ? Colors.white
: !isFromSearch : !isFromSearch
? Colors.red[800] ? Colors.red[800]!
: Colors.white, : Colors.white,
widget: Container( widget: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
@ -95,7 +95,7 @@ class PatientCard extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
patientInfo.patientStatusType == 43 patientInfo!.patientStatusType == 43
? Row( ? Row(
children: [ children: [
PatientStatus( PatientStatus(
@ -117,23 +117,23 @@ class PatientCard extends StatelessWidget {
width: 8, width: 8,
), ),
PatientStatus( PatientStatus(
label: patientInfo.status == 2 label: patientInfo!.status == 2
? 'Confirmed' ? 'Confirmed'
: 'Booked', : 'Booked',
color: patientInfo.status == 2 color: patientInfo!.status == 2
? AppGlobal.appGreenColor ? AppGlobal.appGreenColor
: Colors.grey, : Colors.grey,
), ),
], ],
) )
: patientInfo.patientStatusType == 42 : patientInfo!.patientStatusType == 42
? Row( ? Row(
children: [ children: [
PatientStatus( PatientStatus(
label: label:
TranslationBase.of(context) TranslationBase.of(context)
.notArrived, .notArrived,
color: Colors.red[800], color: Colors.red[800]!,
), ),
SizedBox( SizedBox(
width: 8, width: 8,
@ -149,10 +149,10 @@ class PatientCard extends StatelessWidget {
width: 8, width: 8,
), ),
PatientStatus( PatientStatus(
label: patientInfo.status == 2 label: patientInfo!.status == 2
? 'Confirmed' ? 'Confirmed'
: 'Booked', : 'Booked',
color: patientInfo.status == 2 color: patientInfo!.status == 2
? AppGlobal.appGreenColor ? AppGlobal.appGreenColor
: Colors.grey, : Colors.grey,
) )
@ -160,7 +160,8 @@ class PatientCard extends StatelessWidget {
) )
: !isFromSearch && : !isFromSearch &&
!isFromLiveCare && !isFromLiveCare &&
patientInfo.patientStatusType == patientInfo!
.patientStatusType ==
null null
? Row( ? Row(
children: [ children: [
@ -185,11 +186,11 @@ class PatientCard extends StatelessWidget {
), ),
PatientStatus( PatientStatus(
label: label:
patientInfo.status == 2 patientInfo!.status == 2
? 'Booked' ? 'Booked'
: 'Confirmed', : 'Confirmed',
color: color:
patientInfo.status == 2 patientInfo!.status == 2
? Colors.grey ? Colors.grey
: AppGlobal : AppGlobal
.appGreenColor, .appGreenColor,
@ -199,32 +200,32 @@ class PatientCard extends StatelessWidget {
: SizedBox(), : SizedBox(),
this.arrivalType == '1' this.arrivalType == '1'
? AppText( ? AppText(
patientInfo.startTime != null patientInfo!.startTime != null
? patientInfo.startTime ? patientInfo!.startTime!
: patientInfo.startTimes, : patientInfo!.startTimes!,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
) )
: patientInfo.arrivedOn != null : patientInfo!.arrivedOn != null
? Container( ? Container(
padding: EdgeInsets.only(right: 9), padding: EdgeInsets.only(right: 9),
child: AppText( child: AppText(
"${AppDateUtils.getStartTime(patientInfo.startTime)}", "${AppDateUtils.getStartTime(patientInfo!.startTime!)}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 11, fontSize: 11,
letterSpacing: -0.64, letterSpacing: -0.64,
), ),
) )
: (patientInfo.appointmentDate != : (patientInfo!.appointmentDate !=
null && null &&
patientInfo patientInfo!.appointmentDate!
.appointmentDate.isNotEmpty) .isNotEmpty)
? Container( ? Container(
padding: padding:
EdgeInsets.only(right: 9), EdgeInsets.only(right: 9),
child: AppText( child: AppText(
" ${AppDateUtils.getStartTime(patientInfo.startTime)}", " ${AppDateUtils.getStartTime(patientInfo!.startTime!)}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 11, fontSize: 11,
@ -261,12 +262,12 @@ class PatientCard extends StatelessWidget {
AppText( AppText(
isFromLiveCare isFromLiveCare
? Utils.capitalize( ? Utils.capitalize(
patientInfo.fullName) patientInfo!.fullName)
: (Utils.capitalize( : (Utils.capitalize(
patientInfo.firstName) + patientInfo!.firstName) +
" " + " " +
Utils.capitalize( Utils.capitalize(
patientInfo.lastName)), patientInfo!.lastName)),
fontSize: 16, fontSize: 16,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -274,7 +275,7 @@ class PatientCard extends StatelessWidget {
letterSpacing: -0.64, letterSpacing: -0.64,
textOverflow: TextOverflow.ellipsis, textOverflow: TextOverflow.ellipsis,
), ),
if (patientInfo.gender == 1) if (patientInfo!.gender == 1)
Container( Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: 4, vertical: 2), horizontal: 4, vertical: 2),
@ -290,7 +291,7 @@ class PatientCard extends StatelessWidget {
), ),
if (isFromLiveCare) if (isFromLiveCare)
ShowTimer( ShowTimer(
patientInfo: patientInfo, patientInfo: patientInfo!,
), ),
]), ]),
), ),
@ -313,8 +314,8 @@ class PatientCard extends StatelessWidget {
), ),
), ),
), ),
patientInfo.nationality != null || patientInfo!.nationality != null ||
patientInfo.nationalityId != null patientInfo!.nationalityId != null
? Container( ? Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
right: 7, top: 5), right: 7, top: 5),
@ -322,11 +323,11 @@ class PatientCard extends StatelessWidget {
borderRadius: borderRadius:
BorderRadius.circular(20.0), BorderRadius.circular(20.0),
child: CachedNetworkImage( child: CachedNetworkImage(
imageUrl: patientInfo imageUrl: patientInfo!
.nationalityFlagURL != .nationalityFlagURL !=
null null
? patientInfo ? patientInfo!
.nationalityFlagURL .nationalityFlagURL!
: '', : '',
height: 16, height: 16,
width: 22, width: 22,
@ -357,7 +358,7 @@ class PatientCard extends StatelessWidget {
height: 60, height: 60,
//TODO Elham* create widget for this to make it use every where //TODO Elham* create widget for this to make it use every where
child: SvgPicture.asset( child: SvgPicture.asset(
patientInfo.gender == 1 patientInfo!.gender == 1
? 'assets/images/svgs/male avatar.svg' ? 'assets/images/svgs/male avatar.svg'
: 'assets/images/svgs/female avatar.svg', : 'assets/images/svgs/female avatar.svg',
fit: BoxFit.cover, fit: BoxFit.cover,
@ -380,16 +381,17 @@ class PatientCard extends StatelessWidget {
CustomRow( CustomRow(
label: TranslationBase.of(context) label: TranslationBase.of(context)
.fileNumber, .fileNumber,
value: patientInfo.patientId.toString(), value:
patientInfo!.patientId.toString(),
), ),
CustomRow( CustomRow(
label: TranslationBase.of(context).age + label: TranslationBase.of(context).age +
" : ", " : ",
value: value:
"${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}", "${AppDateUtils.getAgeByBirthday(patientInfo!.dateofBirth!, context, isServerFormat: !isFromLiveCare)}",
), ),
patientInfo.arrivedOn != null patientInfo!.arrivedOn != null
? Column( ? Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.end, CrossAxisAlignment.end,
@ -401,7 +403,7 @@ class PatientCard extends StatelessWidget {
// .getDayMonthYearDateFormatted( // .getDayMonthYearDateFormatted(
// AppDateUtils // AppDateUtils
// .convertStringToDate( // .convertStringToDate(
// patientInfo.arrivedOn, // patientInfo!.arrivedOn,
// ), // ),
// isMonthShort: true, // isMonthShort: true,
// ), // ),
@ -420,16 +422,16 @@ class PatientCard extends StatelessWidget {
.getDayMonthYearDateFormatted( .getDayMonthYearDateFormatted(
AppDateUtils AppDateUtils
.convertStringToDate( .convertStringToDate(
patientInfo.arrivedOn, patientInfo!.arrivedOn!,
), ),
isMonthShort: true, isMonthShort: true,
), ),
), ),
], ],
) )
: (patientInfo.appointmentDate != : (patientInfo!.appointmentDate !=
null && null &&
patientInfo.appointmentDate patientInfo!.appointmentDate!
.isNotEmpty) .isNotEmpty)
? Column( ? Column(
crossAxisAlignment: crossAxisAlignment:
@ -443,8 +445,8 @@ class PatientCard extends StatelessWidget {
.appointmentDate + .appointmentDate +
" : ", " : ",
value: "${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate( value: "${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(
patientInfo patientInfo!
.appointmentDate, .appointmentDate!,
), isMonthShort: true)}", ), isMonthShort: true)}",
), ),
], ],
@ -454,38 +456,38 @@ class PatientCard extends StatelessWidget {
if (isInpatient) if (isInpatient)
CustomRow( CustomRow(
label: label:
patientInfo.admissionDate == null patientInfo!.admissionDate == null
? "" ? ""
: TranslationBase.of(context) : TranslationBase.of(context)
.admissionDate + .admissionDate +
" : ", " : ",
value: patientInfo.admissionDate == value: patientInfo!.admissionDate ==
null null
? "" ? ""
: "${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate.toString()), isMonthShort: true)}", : "${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(patientInfo!.admissionDate.toString()), isMonthShort: true)}",
), ),
if (patientInfo.admissionDate != null) if (patientInfo!.admissionDate != null)
CustomRow( CustomRow(
label: TranslationBase.of(context) label: TranslationBase.of(context)
.numOfDays + .numOfDays +
" : ", " : ",
value: value:
"${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}", "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo!.admissionDate!)).inDays + 1}",
), ),
if (patientInfo.admissionDate != null) if (patientInfo!.admissionDate != null)
CustomRow( CustomRow(
label: TranslationBase.of(context) label: TranslationBase.of(context)
.clinicName + .clinicName +
" : ", " : ",
value: value:
"${patientInfo.clinicDescription}", "${patientInfo!.clinicDescription}",
), ),
if (patientInfo.admissionDate != null) if (patientInfo!.admissionDate != null)
CustomRow( CustomRow(
label: TranslationBase.of(context) label: TranslationBase.of(context)
.roomNo + .roomNo +
" : ", " : ",
value: "${patientInfo.roomId}", value: "${patientInfo!.roomId}",
), ),
if (isFromLiveCare) if (isFromLiveCare)
Column( Column(
@ -494,7 +496,7 @@ class PatientCard extends StatelessWidget {
label: TranslationBase.of(context) label: TranslationBase.of(context)
.clinic + .clinic +
" : ", " : ",
value: patientInfo.clinicName, value: patientInfo!.clinicName!,
), ),
], ],
), ),
@ -534,11 +536,12 @@ class PatientCard extends StatelessWidget {
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 9, right: 9, bottom: 9), left: 9, right: 9, bottom: 9),
child: SvgPicture.asset( child: SvgPicture.asset(
patientInfo.appointmentType == patientInfo!.appointmentType ==
'Regular' && 'Regular' &&
patientInfo.visitTypeId == 100 patientInfo!.visitTypeId ==
100
? 'assets/images/svgs/profile_screen/livecare.svg' ? 'assets/images/svgs/profile_screen/livecare.svg'
: patientInfo.appointmentType == : patientInfo!.appointmentType ==
'Walkin' 'Walkin'
? 'assets/images/svgs/profile_screen/walkin.svg' ? 'assets/images/svgs/profile_screen/walkin.svg'
: 'assets/images/svgs/profile_screen/booked.svg', : 'assets/images/svgs/profile_screen/booked.svg',
@ -564,7 +567,7 @@ class PatientCard extends StatelessWidget {
: SizedBox() : SizedBox()
], ],
), ),
onTap: onTap, onTap: onTap!(),
)), )),
)); ));
} }
@ -572,12 +575,12 @@ class PatientCard extends StatelessWidget {
class PatientStatus extends StatelessWidget { class PatientStatus extends StatelessWidget {
PatientStatus({ PatientStatus({
Key key, Key? key,
this.label, required this.label,
this.color, this.color,
}) : super(key: key); }) : super(key: key);
final String label; final String label;
final Color color; final Color? color;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -7,8 +7,8 @@ class ShowTimer extends StatefulWidget {
final PatiantInformtion patientInfo; final PatiantInformtion patientInfo;
const ShowTimer({ const ShowTimer({
Key key, Key? key,
this.patientInfo, required this.patientInfo,
}) : super(key: key); }) : super(key: key);
@override @override
@ -48,7 +48,7 @@ class _ShowTimerState extends State<ShowTimer> {
generateShowTimerString() { generateShowTimerString() {
DateTime now = DateTime.now(); DateTime now = DateTime.now();
DateTime liveCareDate = DateTime.parse(widget.patientInfo.arrivalTime); DateTime liveCareDate = DateTime.parse(widget.patientInfo.arrivalTime!);
String timer = AppDateUtils.differenceBetweenDateAndCurrent( String timer = AppDateUtils.differenceBetweenDateAndCurrent(
liveCareDate, context, liveCareDate, context,
isShowSecond: true, isShowDays: false); isShowSecond: true, isShowDays: false);

@ -3,10 +3,10 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ServiceTitle extends StatefulWidget { class ServiceTitle extends StatefulWidget {
final String title; final String? title;
final String subTitle; final String? subTitle;
const ServiceTitle({Key key, this.title, this.subTitle}) : super(key: key); const ServiceTitle({Key? key, this.title, this.subTitle}) : super(key: key);
@override @override
_ServiceTitleState createState() => _ServiceTitleState(); _ServiceTitleState createState() => _ServiceTitleState();
@ -21,7 +21,7 @@ class _ServiceTitleState extends State<ServiceTitle> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
widget.title, widget.title!,
color: Color(0xff2E303A), color: Color(0xff2E303A),
fontSize: 12.0, fontSize: 12.0,
letterSpacing: -0.72, letterSpacing: -0.72,
@ -29,7 +29,7 @@ class _ServiceTitleState extends State<ServiceTitle> {
fontHeight: 1.0, fontHeight: 1.0,
), ),
AppText( AppText(
widget.subTitle, widget.subTitle!,
color: Color(0xff2E303A), color: Color(0xff2E303A),
fontSize: 24, fontSize: 24,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,

@ -11,29 +11,29 @@ import 'package:provider/provider.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
class PatientProfileButton extends StatelessWidget { class PatientProfileButton extends StatelessWidget {
final String nameLine1; final String? nameLine1;
final String nameLine2; final String? nameLine2;
final String icon; final String? icon;
final dynamic route; final dynamic route;
final PatiantInformtion patient; final PatiantInformtion? patient;
final String patientType; final String? patientType;
String arrivalType; String? arrivalType;
final bool isInPatient; final bool isInPatient;
String from; String? from;
String to; String? to;
final String url = "assets/images/"; final String url = "assets/images/";
final bool isDisable; final bool isDisable;
final bool isLoading; final bool isLoading;
final Function onTap; final Function? onTap;
final bool isDischargedPatient; final bool isDischargedPatient;
final bool isSelectInpatient; final bool isSelectInpatient;
final bool isDartIcon; final bool isDartIcon;
final IconData dartIcon; final IconData? dartIcon;
final bool isFromLiveCare; final bool isFromLiveCare;
final Color color; final Color? color;
PatientProfileButton({ PatientProfileButton({
Key key, Key? key,
this.patient, this.patient,
this.patientType, this.patientType,
this.arrivalType, this.arrivalType,
@ -65,8 +65,8 @@ class PatientProfileButton extends StatelessWidget {
child: InkWell( child: InkWell(
onTap: isDisable onTap: isDisable
? null ? null
: onTap != null : onTap!() != null
? onTap ? onTap!()
: () { : () {
navigator(context, this.route); navigator(context, this.route);
}, },
@ -86,7 +86,7 @@ class PatientProfileButton extends StatelessWidget {
color: color ?? Color(0xFF333C45), color: color ?? Color(0xFF333C45),
) )
: new SvgPicture.asset( : new SvgPicture.asset(
icon, icon!,
width: 30, width: 30,
height: 30, height: 30,
), ),
@ -102,20 +102,20 @@ class PatientProfileButton extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
!projectsProvider.isArabic ? this.nameLine1 : nameLine2, !projectsProvider.isArabic ? this.nameLine1! : nameLine2!,
color: color ?? AppGlobal.appTextColor, color: color ?? AppGlobal.appTextColor,
letterSpacing: -0.33, letterSpacing: -0.33,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
textAlign: TextAlign.left, textAlign: TextAlign.left,
fontSize: SizeConfig.textMultiplier * 1.30, fontSize: SizeConfig.textMultiplier! * 1.30,
), ),
AppText( AppText(
!projectsProvider.isArabic ? this.nameLine2 : nameLine1, !projectsProvider.isArabic ? this.nameLine2! : nameLine1!,
color: color ?? Color(0xFF2B353E), color: color ?? Color(0xFF2B353E),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
textAlign: TextAlign.left, textAlign: TextAlign.left,
fontHeight: 1.4, fontHeight: 1.4,
fontSize: SizeConfig.textMultiplier * 1.30, fontSize: SizeConfig.textMultiplier! * 1.30,
), ),
if (isLoading) DrAppCircularProgressIndeicator() if (isLoading) DrAppCircularProgressIndeicator()
], ],

@ -13,7 +13,7 @@ import '../../shared/rounded_container_widget.dart';
*@desc: Profile General Info Widget class *@desc: Profile General Info Widget class
*/ */
class ProfileGeneralInfoWidget extends StatelessWidget { class ProfileGeneralInfoWidget extends StatelessWidget {
ProfileGeneralInfoWidget({Key key, this.patient}) : super(key: key); ProfileGeneralInfoWidget({Key? key, required this.patient}) : super(key: key);
PatiantInformtion patient; PatiantInformtion patient;
@ -38,8 +38,8 @@ class ProfileGeneralInfoWidget extends StatelessWidget {
), ),
], ],
), ),
width: SizeConfig.screenWidth * 0.70, width: SizeConfig.screenWidth! * 0.70,
height: SizeConfig.screenHeight * 0.25, height: SizeConfig.screenHeight! * 0.25,
); );
} }
} }

@ -1,11 +1,12 @@
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/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class AddNewOrder extends StatelessWidget { class AddNewOrder extends StatelessWidget {
const AddNewOrder({ const AddNewOrder({
Key key, Key? key,
this.onTap, required this.onTap,
this.label, required this.label,
}) : super(key: key); }) : super(key: key);
final Function onTap; final Function onTap;
@ -14,7 +15,7 @@ class AddNewOrder extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return InkWell( return InkWell(
onTap: onTap, onTap: onTap(),
child: Container( child: Container(
width: double.maxFinite, width: double.maxFinite,
height: MediaQuery.of(context).size.height * 0.18, height: MediaQuery.of(context).size.height * 0.18,
@ -59,4 +60,11 @@ class AddNewOrder extends StatelessWidget {
), ),
); );
} }
@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
super.debugFillProperties(properties);
properties.add(DiagnosticsProperty<Function>('onTap', onTap));
properties.add(DiagnosticsProperty<Function>('onTap', onTap));
}
} }

@ -7,7 +7,7 @@ class HeaderRow extends StatelessWidget {
final String value; final String value;
final bool isExpanded; final bool isExpanded;
const HeaderRow({Key key, this.label, this.value, this.isExpanded = false}) : super(key: key); const HeaderRow({Key? key, required this.label, required this.value, this.isExpanded = false}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -14,7 +14,7 @@ import 'package:url_launcher/url_launcher.dart';
import '../large_avatar.dart'; import '../large_avatar.dart';
import 'header_row.dart'; import 'header_row.dart';
class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { class PatientProfileAppBar extends StatelessWidget {
final PatiantInformtion patient; final PatiantInformtion patient;
final double height; final double height;
final bool isInpatient; final bool isInpatient;
@ -23,7 +23,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
final String doctorName; final String doctorName;
final String branch; final String branch;
final DateTime appointmentDate; final DateTime? appointmentDate;
final String profileUrl; final String profileUrl;
final String invoiceNO; final String invoiceNO;
final String orderNo; final String orderNo;
@ -34,24 +34,24 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
final String clinic; final String clinic;
final bool isAppointmentHeader; final bool isAppointmentHeader;
final bool isFromLabResult; final bool isFromLabResult;
final VoidCallback onPressed; final VoidCallback? onPressed;
PatientProfileAppBar(this.patient, PatientProfileAppBar(this.patient,
{this.height = 0.0, {this.height = 0.0,
this.isInpatient = false, this.isInpatient = false,
this.isDischargedPatient = false, this.isDischargedPatient = false,
this.isFromLiveCare = false, this.isFromLiveCare = false,
this.doctorName, this.doctorName = '',
this.branch, this.branch = '',
this.appointmentDate, this.appointmentDate,
this.profileUrl, this.profileUrl = '',
this.invoiceNO, this.invoiceNO = '',
this.orderNo, this.orderNo = '',
this.isPrescriptions = false, this.isPrescriptions = false,
this.clinic, this.clinic = '',
this.isMedicalFile = false, this.isMedicalFile = false,
this.episode, this.episode = '',
this.visitDate, this.visitDate = '',
this.isAppointmentHeader = false, this.isAppointmentHeader = false,
this.isFromLabResult = false, this.isFromLabResult = false,
this.onPressed}); this.onPressed});
@ -62,9 +62,9 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
int gender = 1; int gender = 1;
if (patient.patientDetails != null) { if (patient.patientDetails != null) {
gender = patient.patientDetails.gender; gender = patient.patientDetails!.gender!;
} else { } else {
gender = patient.gender; gender = patient.gender!;
} }
return Container( return Container(
@ -89,7 +89,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
icon: Icon(Icons.arrow_back_ios), icon: Icon(Icons.arrow_back_ios),
color: Color(0xFF2B353E), //Colors.black, color: Color(0xFF2B353E), //Colors.black,
onPressed: () { onPressed: () {
if (onPressed != null) onPressed(); if (onPressed != null) onPressed!();
Navigator.pop(context); Navigator.pop(context);
}, },
), ),
@ -100,8 +100,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
" " + " " +
Utils.capitalize(patient.lastName)) Utils.capitalize(patient.lastName))
: Utils.capitalize(patient.fullName ?? : Utils.capitalize(patient.fullName ??
patient.patientDetails.fullName), patient.patientDetails!.fullName),
fontSize: SizeConfig.textMultiplier * 1.8, fontSize: SizeConfig.textMultiplier! * 1.8,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
color: Color(0xFF2B353E), color: Color(0xFF2B353E),
@ -121,7 +121,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
margin: EdgeInsets.symmetric(horizontal: 4), margin: EdgeInsets.symmetric(horizontal: 4),
child: InkWell( child: InkWell(
onTap: () { onTap: () {
launch("tel://" + patient.mobileNumber); launch("tel://" + patient.mobileNumber!);
}, },
child: Icon( child: Icon(
Icons.phone, Icons.phone,
@ -170,7 +170,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
) )
: AppText( : AppText(
TranslationBase.of(context).notArrived, TranslationBase.of(context).notArrived,
color: Colors.red[800], color: Colors.red[800]!,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig fontSize: SizeConfig
@ -180,7 +180,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
patient.startTime != null patient.startTime != null
? AppText( ? AppText(
patient.startTime != null patient.startTime != null
? patient.startTime ? patient.startTime!
: '', : '',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: SizeConfig fontSize: SizeConfig
@ -235,12 +235,12 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
? ClipRRect( ? ClipRRect(
borderRadius: BorderRadius.circular(20.0), borderRadius: BorderRadius.circular(20.0),
child: Image.network( child: Image.network(
patient.nationalityFlagURL, patient.nationalityFlagURL!,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: (BuildContext context, errorBuilder: (BuildContext context,
Object exception, Object exception,
StackTrace stackTrace) { StackTrace? stackTrace) {
return Text('No Image'); return Text('No Image');
}, },
)) ))
@ -253,31 +253,31 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
HeaderRow( HeaderRow(
label: TranslationBase.of(context).age + " : ", label: TranslationBase.of(context).age + " : ",
value: value:
"${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails!.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}",
), ),
if (patient.appointmentDate != null && if (patient.appointmentDate != null &&
patient.appointmentDate.isNotEmpty && patient.appointmentDate!.isNotEmpty &&
!isFromLabResult) !isFromLabResult)
HeaderRow( HeaderRow(
label: label:
TranslationBase.of(context).appointmentDate + " : ", TranslationBase.of(context).appointmentDate + " : ",
value: AppDateUtils.getDayMonthYearDateFormatted( value: AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils.convertStringToDate( AppDateUtils.convertStringToDate(
patient.appointmentDate)), patient.appointmentDate!)),
), ),
if (isFromLabResult) if (isFromLabResult)
HeaderRow( HeaderRow(
label: "Result Date: ", label: "Result Date: ",
value: value:
'${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate!, isArabic: projectViewModel.isArabic)}',
), ),
// if(isInpatient) // if(isInpatient)
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if (patient.admissionDate != null && if (patient.admissionDate != null &&
patient.admissionDate.isNotEmpty) patient.admissionDate!.isNotEmpty)
HeaderRow( HeaderRow(
label: patient.admissionDate == null label: patient.admissionDate == null
? "" ? ""
@ -292,8 +292,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
label: "${TranslationBase.of(context).numOfDays}: ", label: "${TranslationBase.of(context).numOfDays}: ",
value: isDischargedPatient && value: isDischargedPatient &&
patient.dischargeDate != null patient.dischargeDate != null
? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}" ? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate!)).inDays + 1}"
: "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate!)).inDays + 1}",
) )
], ],
), ),
@ -316,8 +316,9 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border( border: Border(
bottom: bottom:
BorderSide(color: Colors.grey[400], width: 2.5), BorderSide(color: Colors.grey[400]!, width: 2.5),
left: BorderSide(color: Colors.grey[400], width: 2.5), left:
BorderSide(color: Colors.grey[400]!, width: 2.5),
)), )),
), ),
Expanded( Expanded(
@ -395,7 +396,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
? 'Result Date:' ? 'Result Date:'
: 'Prescriptions Date ', : 'Prescriptions Date ',
value: value:
'${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate!, isArabic: projectViewModel.isArabic)}',
), ),
]), ]),
), ),

@ -15,8 +15,7 @@ import 'package:url_launcher/url_launcher.dart';
import 'header_row.dart'; import 'header_row.dart';
class PatientProfileHeaderNewDesignAppBar extends StatelessWidget class PatientProfileHeaderNewDesignAppBar extends StatelessWidget {
with PreferredSizeWidget {
final PatiantInformtion patient; final PatiantInformtion patient;
final String patientType; final String patientType;
final String arrivalType; final String arrivalType;
@ -25,7 +24,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
final bool isDischargedPatient; final bool isDischargedPatient;
final bool isFromLiveCare; final bool isFromLiveCare;
final Stream<String> videoCallDurationStream; final Stream<String>? videoCallDurationStream;
PatientProfileHeaderNewDesignAppBar( PatientProfileHeaderNewDesignAppBar(
this.patient, this.patientType, this.arrivalType, this.patient, this.patientType, this.arrivalType,
@ -39,9 +38,9 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
Widget build(BuildContext context) { Widget build(BuildContext context) {
int gender = 1; int gender = 1;
if (patient.patientDetails != null) { if (patient.patientDetails != null) {
gender = patient.patientDetails.gender; gender = patient.patientDetails!.gender!;
} else { } else {
gender = patient.gender; gender = patient.gender!;
} }
return Container( return Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
@ -77,8 +76,8 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
" " + " " +
Utils.capitalize(patient.lastName)) Utils.capitalize(patient.lastName))
: Utils.capitalize(patient.fullName ?? : Utils.capitalize(patient.fullName ??
patient.patientDetails.fullName), patient.patientDetails!.fullName),
fontSize: SizeConfig.textMultiplier * 1.8, fontSize: SizeConfig.textMultiplier! * 1.8,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
), ),
@ -100,7 +99,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
eventCategory: "Patient Profile Header", eventCategory: "Patient Profile Header",
eventAction: "Call Patient", eventAction: "Call Patient",
); );
launch("tel://" + patient.mobileNumber); launch("tel://" + patient.mobileNumber!);
}, },
child: Icon( child: Icon(
Icons.phone, Icons.phone,
@ -122,7 +121,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
padding: padding:
EdgeInsets.symmetric(vertical: 2, horizontal: 10), EdgeInsets.symmetric(vertical: 2, horizontal: 10),
child: Text( child: Text(
snapshot.data, snapshot.data!,
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
), ),
), ),
@ -170,7 +169,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
) )
: AppText( : AppText(
TranslationBase.of(context).notArrived, TranslationBase.of(context).notArrived,
color: Colors.red[800], color: Colors.red[800]!,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 12, fontSize: 12,
@ -178,7 +177,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
arrivalType == '1' || patient.arrivedOn == null arrivalType == '1' || patient.arrivedOn == null
? AppText( ? AppText(
patient.startTime != null patient.startTime != null
? patient.startTime ? patient.startTime!
: '', : '',
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -187,7 +186,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
patient.arrivedOn != null patient.arrivedOn != null
? AppDateUtils ? AppDateUtils
.convertStringToDateFormat( .convertStringToDateFormat(
patient.arrivedOn, patient.arrivedOn!,
'MM-dd-yyyy HH:mm') 'MM-dd-yyyy HH:mm')
: '', : '',
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -219,7 +218,8 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
child: AppText( child: AppText(
patient.startTime ?? "", patient.startTime ?? "",
color: Colors.white, color: Colors.white,
fontSize: 1.5 * SizeConfig.textMultiplier, fontSize:
1.5 * SizeConfig.textMultiplier!,
textAlign: TextAlign.center, textAlign: TextAlign.center,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
@ -232,7 +232,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
child: AppText( child: AppText(
convertDateFormat2( convertDateFormat2(
patient.appointmentDate ?? ''), patient.appointmentDate ?? ''),
fontSize: 1.5 * SizeConfig.textMultiplier, fontSize: 1.5 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), ),
@ -274,12 +274,12 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
? ClipRRect( ? ClipRRect(
borderRadius: BorderRadius.circular(20.0), borderRadius: BorderRadius.circular(20.0),
child: Image.network( child: Image.network(
patient.nationalityFlagURL, patient.nationalityFlagURL!,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: (BuildContext context, errorBuilder: (BuildContext context,
Object exception, Object exception,
StackTrace stackTrace) { StackTrace? stackTrace) {
return Text(''); return Text('');
}, },
)) ))
@ -292,7 +292,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
HeaderRow( HeaderRow(
label: TranslationBase.of(context).age + " : ", label: TranslationBase.of(context).age + " : ",
value: value:
"${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails!.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}",
), ),
if (isInpatient) if (isInpatient)
Column( Column(
@ -312,8 +312,8 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
"${TranslationBase.of(context).numOfDays}: ", "${TranslationBase.of(context).numOfDays}: ",
value: isDischargedPatient && value: isDischargedPatient &&
patient.dischargeDate != null patient.dischargeDate != null
? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}" ? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate!)).inDays + 1}"
: "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate!)).inDays + 1}",
) )
], ],
) )
@ -328,7 +328,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
} }
convertDateFormat2(String str) { convertDateFormat2(String str) {
String newDate; String newDate = '';
const start = "/Date("; const start = "/Date(";
if (str.isNotEmpty) { if (str.isNotEmpty) {
const end = "+0300)"; const end = "+0300)";

@ -5,31 +5,31 @@ import 'package:flutter/material.dart';
class LargeAvatar extends StatelessWidget { class LargeAvatar extends StatelessWidget {
LargeAvatar( LargeAvatar(
{Key key, {Key? key,
this.name, required this.name,
this.url, this.url,
this.disableProfileView: false, this.disableProfileView = false,
this.radius = 60.0, this.radius = 60.0,
this.width = 90, this.width = 90,
this.height = 90}) this.height = 90})
: super(key: key); : super(key: key);
final String name; final String name;
final String url; final String? url;
final bool disableProfileView; final bool disableProfileView;
final double radius; final double radius;
final double width; final double width;
final double height; final double height;
Widget _getAvatar() { Widget _getAvatar() {
if (url != null && url.isNotEmpty && Uri.parse(url).isAbsolute) { if (url != null && url!.isNotEmpty && Uri.parse(url!).isAbsolute) {
return CircleAvatar( return CircleAvatar(
radius: SizeConfig.imageSizeMultiplier * 12, radius: SizeConfig.imageSizeMultiplier! * 12,
// radius: (52) // radius: (52)
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(50), borderRadius: BorderRadius.circular(50),
child: Image.network( child: Image.network(
url, url!,
fit: BoxFit.fill, fit: BoxFit.fill,
width: 700, width: 700,
), ),
@ -69,8 +69,8 @@ class LargeAvatar extends StatelessWidget {
begin: Alignment(-1, -1), begin: Alignment(-1, -1),
end: Alignment(1, 1), end: Alignment(1, 1),
colors: [ colors: [
Colors.grey[100], Colors.grey[100]!,
Colors.grey[800], Colors.grey[800]!,
]), ]),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(

@ -15,7 +15,7 @@ class PrescriptionInPatientWidget extends StatelessWidget {
final List<PrescriptionReportForInPatient> prescriptionReportForInPatientList; final List<PrescriptionReportForInPatient> prescriptionReportForInPatientList;
PrescriptionInPatientWidget( PrescriptionInPatientWidget(
{Key key, this.prescriptionReportForInPatientList}); {Key? key, required this.prescriptionReportForInPatientList});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -80,7 +80,7 @@ class PrescriptionInPatientWidget extends StatelessWidget {
LargeAvatar( LargeAvatar(
name: name:
prescriptionReportForInPatientList[index] prescriptionReportForInPatientList[index]
.createdByName, .createdByName!,
radius: 10, radius: 10,
width: 70, width: 70,
), ),
@ -95,7 +95,7 @@ class PrescriptionInPatientWidget extends StatelessWidget {
AppText( AppText(
'${prescriptionReportForInPatientList[index].createdByName}', '${prescriptionReportForInPatientList[index].createdByName}',
fontSize: fontSize:
2.5 * SizeConfig.textMultiplier, 2.5 * SizeConfig.textMultiplier!,
), ),
SizedBox( SizedBox(
height: 8, height: 8,
@ -103,7 +103,7 @@ class PrescriptionInPatientWidget extends StatelessWidget {
AppText( AppText(
'${prescriptionReportForInPatientList[index].itemDescription}', '${prescriptionReportForInPatientList[index].itemDescription}',
fontSize: fontSize:
2.5 * SizeConfig.textMultiplier, 2.5 * SizeConfig.textMultiplier!,
color: color:
Theme.of(context).primaryColor), Theme.of(context).primaryColor),
SizedBox( SizedBox(

@ -14,7 +14,7 @@ import 'large_avatar.dart';
class PrescriptionOutPatientWidget extends StatelessWidget { class PrescriptionOutPatientWidget extends StatelessWidget {
final List<PrescriptionResModel> patientPrescriptionsList; final List<PrescriptionResModel> patientPrescriptionsList;
PrescriptionOutPatientWidget({Key key, this.patientPrescriptionsList}); PrescriptionOutPatientWidget({Key? key, required this.patientPrescriptionsList});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -85,7 +85,7 @@ class PrescriptionOutPatientWidget extends StatelessWidget {
url: patientPrescriptionsList[index] url: patientPrescriptionsList[index]
.doctorImageURL, .doctorImageURL,
name: patientPrescriptionsList[index] name: patientPrescriptionsList[index]
.doctorName, .doctorName!,
radius: 10, radius: 10,
width: 70, width: 70,
), ),
@ -100,7 +100,7 @@ class PrescriptionOutPatientWidget extends StatelessWidget {
AppText( AppText(
'${patientPrescriptionsList[index].name}', '${patientPrescriptionsList[index].name}',
fontSize: fontSize:
2.5 * SizeConfig.textMultiplier, 2.5 * SizeConfig.textMultiplier!,
), ),
SizedBox( SizedBox(
height: 8, height: 8,
@ -108,7 +108,7 @@ class PrescriptionOutPatientWidget extends StatelessWidget {
AppText( AppText(
'${patientPrescriptionsList[index].clinicDescription}', '${patientPrescriptionsList[index].clinicDescription}',
fontSize: fontSize:
2.5 * SizeConfig.textMultiplier, 2.5 * SizeConfig.textMultiplier!,
color: color:
Theme.of(context).primaryColor), Theme.of(context).primaryColor),
SizedBox( SizedBox(

@ -36,7 +36,7 @@ class ProfileWelcomeWidget extends StatelessWidget {
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
child: CachedNetworkImage( child: CachedNetworkImage(
imageUrl: imageUrl:
authenticationViewModel.doctorProfile.doctorImageURL, authenticationViewModel.doctorProfile!.doctorImageURL!,
fit: BoxFit.fill, fit: BoxFit.fill,
width: 75, width: 75,
height: 75, height: 75,

@ -1,3 +1,4 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
@ -15,7 +16,7 @@ class ProfileGeneralInfoContentWidget extends StatelessWidget {
String title; String title;
String info; String info;
ProfileGeneralInfoContentWidget({this.title, this.info}); ProfileGeneralInfoContentWidget({required this.title, required this.info});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -29,17 +30,22 @@ class ProfileGeneralInfoContentWidget extends StatelessWidget {
), ),
AppText( AppText(
title, title,
fontSize: SizeConfig.textMultiplier * 3, fontSize: SizeConfig.textMultiplier! * 3,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: HexColor('#58434F'), color: HexColor('#58434F'),
), ),
AppText( AppText(
info, info,
color: HexColor('#707070'), color: HexColor('#707070'),
fontSize: SizeConfig.textMultiplier * 2, fontSize: SizeConfig.textMultiplier! * 2,
) )
], ],
), ),
); );
} }
@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
super.debugFillProperties(properties);
properties.add(StringProperty('title', title));
}
} }

@ -8,21 +8,21 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ProfileMedicalInfoWidget extends StatelessWidget { class ProfileMedicalInfoWidget extends StatelessWidget {
final String from; final String? from;
final String to; final String? to;
final PatiantInformtion patient; final PatiantInformtion? patient;
final String patientType; final String? patientType;
final String arrivalType; final String? arrivalType;
final bool isInpatient; final bool isInpatient;
ProfileMedicalInfoWidget( ProfileMedicalInfoWidget(
{Key key, {Key? key,
this.patient, this.patient,
this.patientType, this.patientType,
this.arrivalType, this.arrivalType,
this.from, this.from,
this.to, this.to,
this.isInpatient}); this.isInpatient = false});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -83,7 +83,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
isInPatient: isInpatient, isInPatient: isInpatient!,
route: RADIOLOGY_PATIENT, route: RADIOLOGY_PATIENT,
nameLine1: TranslationBase.of(context).radiology, nameLine1: TranslationBase.of(context).radiology,
nameLine2: TranslationBase.of(context).service, nameLine2: TranslationBase.of(context).service,
@ -136,36 +136,36 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
nameLine1: TranslationBase.of(context).patientSick, nameLine1: TranslationBase.of(context).patientSick,
nameLine2: TranslationBase.of(context).leave, nameLine2: TranslationBase.of(context).leave,
icon: 'assets/images/svgs/profile_screen/patient sick leave.svg'), icon: 'assets/images/svgs/profile_screen/patient sick leave.svg'),
if (patient.appointmentNo != null && patient.appointmentNo != 0) if (patient!.appointmentNo != null && patient!.appointmentNo != 0)
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: PATIENT_UCAF_REQUEST, route: PATIENT_UCAF_REQUEST,
isDisable: patient.patientStatusType != 43 ? true : false, isDisable: patient!.patientStatusType != 43 ? true : false,
nameLine1: TranslationBase.of(context).patient, nameLine1: TranslationBase.of(context).patient,
nameLine2: TranslationBase.of(context).ucaf, nameLine2: TranslationBase.of(context).ucaf,
icon: 'patient/ucaf.png'), icon: 'patient/ucaf.png'),
if (patient.appointmentNo != null && patient.appointmentNo != 0) if (patient!.appointmentNo != null && patient!.appointmentNo != 0)
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: REFER_PATIENT_TO_DOCTOR, route: REFER_PATIENT_TO_DOCTOR,
isDisable: patient.patientStatusType != 43 ? true : false, isDisable: patient!.patientStatusType != 43 ? true : false,
nameLine1: TranslationBase.of(context).referral, nameLine1: TranslationBase.of(context).referral,
nameLine2: TranslationBase.of(context).patient, nameLine2: TranslationBase.of(context).patient,
icon: 'patient/refer_patient.png'), icon: 'patient/refer_patient.png'),
if (patient.appointmentNo != null && patient.appointmentNo != 0) if (patient!.appointmentNo != null && patient!.appointmentNo != 0)
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: PATIENT_ADMISSION_REQUEST, route: PATIENT_ADMISSION_REQUEST,
isDisable: patient.patientStatusType != 43 ? true : false, isDisable: patient!.patientStatusType != 43 ? true : false,
nameLine1: TranslationBase.of(context).admission, nameLine1: TranslationBase.of(context).admission,
nameLine2: TranslationBase.of(context).request, nameLine2: TranslationBase.of(context).request,
icon: 'patient/admission_req.png'), icon: 'patient/admission_req.png'),

@ -8,22 +8,22 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { class ProfileMedicalInfoWidgetInPatient extends StatelessWidget {
final String from; final String? from;
final String to; final String? to;
final PatiantInformtion patient; final PatiantInformtion? patient;
final String patientType; final String? patientType;
final String arrivalType; final String? arrivalType;
final bool isInpatient; final bool isInpatient;
final bool isDischargedPatient; final bool isDischargedPatient;
ProfileMedicalInfoWidgetInPatient( ProfileMedicalInfoWidgetInPatient(
{Key key, {Key? key,
this.patient, this.patient,
this.patientType, this.patientType,
this.arrivalType, this.arrivalType,
this.from, this.from,
this.to, this.to,
this.isInpatient, this.isInpatient = false,
this.isDischargedPatient = false}); this.isDischargedPatient = false});
@override @override

@ -7,29 +7,37 @@ import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ProfileMedicalInfoWidgetSearch extends StatelessWidget { class ProfileMedicalInfoWidgetSearch extends StatefulWidget {
final String from; final String? from;
final String to; final String? to;
final PatiantInformtion patient; final PatiantInformtion? patient;
final String patientType; final String? patientType;
final String arrivalType; final String? arrivalType;
final bool isInpatient; final bool isInpatient;
final bool isDischargedPatient; final bool isDischargedPatient;
ProfileMedicalInfoWidgetSearch( ProfileMedicalInfoWidgetSearch(
{Key key, {Key? key,
this.patient, this.patient,
this.patientType, this.patientType,
this.arrivalType, this.arrivalType,
this.from, this.from,
this.to, this.to,
this.isInpatient, this.isInpatient = false,
this.isDischargedPatient}); this.isDischargedPatient = false});
TabController _tabController; @override
State<ProfileMedicalInfoWidgetSearch> createState() =>
_ProfileMedicalInfoWidgetSearchState();
}
class _ProfileMedicalInfoWidgetSearchState
extends State<ProfileMedicalInfoWidgetSearch>
with SingleTickerProviderStateMixin {
late TabController _tabController;
void initState() { void initState() {
_tabController = TabController(length: 2); _tabController = TabController(length: 2, vsync: this);
} }
void dispose() { void dispose() {
@ -42,7 +50,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
onModelReady: (model) async {}, onModelReady: (model) async {},
builder: (_, model, w) => DefaultTabController( builder: (_, model, w) => DefaultTabController(
length: 2, length: 2,
initialIndex: isInpatient ? 0 : 1, initialIndex: widget.isInpatient ? 0 : 1,
child: SizedBox( child: SizedBox(
height: MediaQuery.of(context).size.height * 1.0, height: MediaQuery.of(context).size.height * 1.0,
width: double.infinity, width: double.infinity,
@ -56,22 +64,22 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
crossAxisCount: 3, crossAxisCount: 3,
children: [ children: [
PatientProfileButton( PatientProfileButton(
key: key, key: widget.key,
patient: patient, patient: widget.patient,
patientType: patientType, patientType: widget.patientType,
arrivalType: arrivalType, arrivalType: widget.arrivalType,
from: from, from: widget.from,
to: to, to: widget.to,
nameLine1: TranslationBase.of(context).vital, nameLine1: TranslationBase.of(context).vital,
nameLine2: TranslationBase.of(context).signs, nameLine2: TranslationBase.of(context).signs,
route: VITAL_SIGN_DETAILS, route: VITAL_SIGN_DETAILS,
icon: 'assets/images/svgs/profile_screen/vital signs.svg'), icon: 'assets/images/svgs/profile_screen/vital signs.svg'),
// if (selectedPatientType != 7) // if (selectedPatientType != 7)
PatientProfileButton( PatientProfileButton(
key: key, key: widget.key,
patient: patient, patient: widget.patient,
patientType: patientType, patientType: widget.patientType,
arrivalType: arrivalType, arrivalType: widget.arrivalType,
route: HEALTH_SUMMARY, route: HEALTH_SUMMARY,
nameLine1: "Health", nameLine1: "Health",
//TranslationBase.of(context).medicalReport, //TranslationBase.of(context).medicalReport,
@ -80,40 +88,40 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
icon: icon:
'assets/images/svgs/profile_screen/health summary.svg'), 'assets/images/svgs/profile_screen/health summary.svg'),
PatientProfileButton( PatientProfileButton(
key: key, key: widget.key,
patient: patient, patient: widget.patient,
patientType: patientType, patientType: widget.patientType,
arrivalType: arrivalType, arrivalType: widget.arrivalType,
route: LAB_RESULT, route: LAB_RESULT,
nameLine1: TranslationBase.of(context).lab, nameLine1: TranslationBase.of(context).lab,
nameLine2: TranslationBase.of(context).result, nameLine2: TranslationBase.of(context).result,
icon: 'assets/images/svgs/profile_screen/lab results.svg'), icon: 'assets/images/svgs/profile_screen/lab results.svg'),
// if (int.parse(patientType) == 7 || int.parse(patientType) == 6) // if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton( PatientProfileButton(
key: key, key: widget.key,
patient: patient, patient: widget.patient,
patientType: patientType, patientType: widget.patientType,
arrivalType: arrivalType, arrivalType: widget.arrivalType,
isInPatient: isInpatient, isInPatient: widget.isInpatient,
route: RADIOLOGY_PATIENT, route: RADIOLOGY_PATIENT,
nameLine1: TranslationBase.of(context).radiology, nameLine1: TranslationBase.of(context).radiology,
nameLine2: TranslationBase.of(context).service, nameLine2: TranslationBase.of(context).service,
icon: icon:
'assets/images/svgs/profile_screen/health summary.svg'), 'assets/images/svgs/profile_screen/health summary.svg'),
PatientProfileButton( PatientProfileButton(
key: key, key: widget.key,
patient: patient, patient: widget.patient,
patientType: patientType, patientType: widget.patientType,
arrivalType: arrivalType, arrivalType: widget.arrivalType,
route: PATIENT_ECG, route: PATIENT_ECG,
nameLine1: TranslationBase.of(context).patient, nameLine1: TranslationBase.of(context).patient,
nameLine2: "ECG", nameLine2: "ECG",
icon: 'assets/images/svgs/profile_screen/ECG.svg'), icon: 'assets/images/svgs/profile_screen/ECG.svg'),
PatientProfileButton( PatientProfileButton(
key: key, key: widget.key,
patient: patient, patient: widget.patient,
patientType: patientType, patientType: widget.patientType,
arrivalType: arrivalType, arrivalType: widget.arrivalType,
route: ORDER_PRESCRIPTION_OLD, route: ORDER_PRESCRIPTION_OLD,
nameLine1: TranslationBase.of(context).orders, nameLine1: TranslationBase.of(context).orders,
nameLine2: TranslationBase.of(context).prescription, nameLine2: TranslationBase.of(context).prescription,
@ -121,10 +129,10 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
'assets/images/svgs/profile_screen/order prescription.svg'), 'assets/images/svgs/profile_screen/order prescription.svg'),
// if (int.parse(patientType) == 7 || int.parse(patientType) == 6) // if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton( PatientProfileButton(
key: key, key: widget.key,
patient: patient, patient: widget.patient,
patientType: patientType, patientType: widget.patientType,
arrivalType: arrivalType, arrivalType: widget.arrivalType,
route: ORDER_PROCEDURE, route: ORDER_PROCEDURE,
nameLine1: TranslationBase.of(context).orders, nameLine1: TranslationBase.of(context).orders,
nameLine2: TranslationBase.of(context).procedures, nameLine2: TranslationBase.of(context).procedures,
@ -132,10 +140,10 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
'assets/images/svgs/profile_screen/Order Procedures.svg'), 'assets/images/svgs/profile_screen/Order Procedures.svg'),
//if (int.parse(patientType) == 7 || int.parse(patientType) == 6) //if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton( PatientProfileButton(
key: key, key: widget.key,
patient: patient, patient: widget.patient,
patientType: patientType, patientType: widget.patientType,
arrivalType: arrivalType, arrivalType: widget.arrivalType,
route: PATIENT_INSURANCE_APPROVALS_NEW, route: PATIENT_INSURANCE_APPROVALS_NEW,
nameLine1: TranslationBase.of(context).insurance, nameLine1: TranslationBase.of(context).insurance,
nameLine2: TranslationBase.of(context).service, nameLine2: TranslationBase.of(context).service,
@ -143,67 +151,76 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
'assets/images/svgs/profile_screen/insurance approval.svg'), 'assets/images/svgs/profile_screen/insurance approval.svg'),
// if (int.parse(patientType) == 7 || int.parse(patientType) == 6) // if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton( PatientProfileButton(
key: key, key: widget.key,
patient: patient, patient: widget.patient,
patientType: patientType, patientType: widget.patientType,
arrivalType: arrivalType, arrivalType: widget.arrivalType,
route: ADD_SICKLEAVE, route: ADD_SICKLEAVE,
nameLine1: TranslationBase.of(context).patientSick, nameLine1: TranslationBase.of(context).patientSick,
nameLine2: TranslationBase.of(context).leave, nameLine2: TranslationBase.of(context).leave,
icon: icon:
'assets/images/svgs/profile_screen/patient sick leave.svg'), 'assets/images/svgs/profile_screen/patient sick leave.svg'),
if (patient.appointmentNo != null && patient.appointmentNo != 0) if (widget.patient!.appointmentNo != null &&
widget.patient!.appointmentNo != 0)
PatientProfileButton( PatientProfileButton(
key: key, key: widget.key,
patient: patient, patient: widget.patient,
patientType: patientType, patientType: widget.patientType,
arrivalType: arrivalType, arrivalType: widget.arrivalType,
route: PATIENT_UCAF_REQUEST, route: PATIENT_UCAF_REQUEST,
isDisable: patient.patientStatusType != 43 ? true : false, isDisable: widget.patient!.patientStatusType != 43
? true
: false,
nameLine1: TranslationBase.of(context).patient, nameLine1: TranslationBase.of(context).patient,
nameLine2: TranslationBase.of(context).ucaf, nameLine2: TranslationBase.of(context).ucaf,
icon: 'assets/images/svgs/profile_screen/UCAF.svg'), icon: 'assets/images/svgs/profile_screen/UCAF.svg'),
if (patient.appointmentNo != null && patient.appointmentNo != 0) if (widget.patient!.appointmentNo != null &&
widget.patient!.appointmentNo != 0)
PatientProfileButton( PatientProfileButton(
key: key, key: widget.key,
patient: patient, patient: widget.patient,
patientType: patientType, patientType: widget.patientType,
arrivalType: arrivalType, arrivalType: widget.arrivalType,
route: REFER_PATIENT_TO_DOCTOR, route: REFER_PATIENT_TO_DOCTOR,
isDisable: patient.patientStatusType != 43 ? true : false, isDisable: widget.patient!.patientStatusType != 43
? true
: false,
nameLine1: TranslationBase.of(context).referral, nameLine1: TranslationBase.of(context).referral,
nameLine2: TranslationBase.of(context).patient, nameLine2: TranslationBase.of(context).patient,
icon: icon:
'assets/images/svgs/profile_screen/refer patient.svg'), 'assets/images/svgs/profile_screen/refer patient.svg'),
if (patient.appointmentNo != null && patient.appointmentNo != 0) if (widget.patient!.appointmentNo != null &&
widget.patient!.appointmentNo != 0)
PatientProfileButton( PatientProfileButton(
key: key, key: widget.key,
patient: patient, patient: widget.patient,
patientType: patientType, patientType: widget.patientType,
arrivalType: arrivalType, arrivalType: widget.arrivalType,
route: PATIENT_ADMISSION_REQUEST, route: PATIENT_ADMISSION_REQUEST,
isDisable: patient.patientStatusType != 43 ? true : false, isDisable: widget.patient!.patientStatusType != 43
? true
: false,
nameLine1: TranslationBase.of(context).admission, nameLine1: TranslationBase.of(context).admission,
nameLine2: TranslationBase.of(context).request, nameLine2: TranslationBase.of(context).request,
icon: icon:
'assets/images/svgs/profile_screen/admission req.svg'), 'assets/images/svgs/profile_screen/admission req.svg'),
if (isInpatient) if (widget.isInpatient)
PatientProfileButton( PatientProfileButton(
key: key, key: widget.key,
patient: patient, patient: widget.patient,
patientType: patientType, patientType: widget.patientType,
arrivalType: arrivalType, arrivalType: widget.arrivalType,
route: PROGRESS_NOTE, route: PROGRESS_NOTE,
nameLine1: TranslationBase.of(context).progress, nameLine1: TranslationBase.of(context).progress,
nameLine2: TranslationBase.of(context).note, nameLine2: TranslationBase.of(context).note,
icon: icon:
'assets/images/svgs/profile_screen/Progress notes.svg'), 'assets/images/svgs/profile_screen/Progress notes.svg'),
if (isInpatient) if (widget.isInpatient)
PatientProfileButton( PatientProfileButton(
key: key, key: widget.key,
patient: patient, patient: widget.patient,
patientType: patientType, patientType: widget.patientType,
arrivalType: arrivalType, arrivalType: widget.arrivalType,
route: ORDER_NOTE, route: ORDER_NOTE,
nameLine1: "Order", nameLine1: "Order",
//"Text", //"Text",

@ -6,13 +6,13 @@ import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
class VitalSignDetailsWidget extends StatefulWidget { class VitalSignDetailsWidget extends StatefulWidget {
final List<VitalSignResModel> vitalList; final List<VitalSignResModel>? vitalList;
final String title1; final String? title1;
final String title2; final String? title2;
final String viewKey; final String? viewKey;
VitalSignDetailsWidget( VitalSignDetailsWidget(
{Key key, this.vitalList, this.title1, this.title2, this.viewKey}); {Key? key, this.vitalList, this.title1, this.title2, this.viewKey});
@override @override
_VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState();
@ -36,7 +36,7 @@ class _VitalSignDetailsWidgetState extends State<VitalSignDetailsWidget> {
children: <Widget>[ children: <Widget>[
Table( Table(
border: TableBorder.symmetric( border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]), inside: BorderSide(width: 2.0, color: Colors.grey[300]!),
), ),
children: fullData(), children: fullData(),
), ),
@ -59,7 +59,7 @@ class _VitalSignDetailsWidgetState extends State<VitalSignDetailsWidget> {
), ),
child: Center( child: Center(
child: AppText( child: AppText(
widget.title1, widget.title1!,
color: Colors.white, color: Colors.white,
), ),
), ),
@ -75,12 +75,12 @@ class _VitalSignDetailsWidgetState extends State<VitalSignDetailsWidget> {
), ),
), ),
child: Center( child: Center(
child: AppText(widget.title2, color: Colors.white), child: AppText(widget.title2!, color: Colors.white),
), ),
height: 60), height: 60),
) )
])); ]));
widget.vitalList.forEach((vital) { widget.vitalList!.forEach((vital) {
tableRow.add(TableRow(children: [ tableRow.add(TableRow(children: [
Container( Container(
child: Container( child: Container(
@ -88,7 +88,7 @@ class _VitalSignDetailsWidgetState extends State<VitalSignDetailsWidget> {
color: Colors.white, color: Colors.white,
child: Center( child: Center(
child: AppText( child: AppText(
'${AppDateUtils.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${AppDateUtils.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ', '${AppDateUtils.getWeekDay(vital.vitalSignDate!.weekday)}, ${vital.vitalSignDate!.day} ${AppDateUtils.getMonth(vital.vitalSignDate!.month)}, ${vital.vitalSignDate!.year} ',
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
), ),

@ -24,7 +24,7 @@ class AppDrawer extends StatefulWidget {
class _AppDrawerState extends State<AppDrawer> { class _AppDrawerState extends State<AppDrawer> {
Utils helpers = new Utils(); Utils helpers = new Utils();
ProjectViewModel projectsProvider; late ProjectViewModel projectsProvider;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -90,7 +90,7 @@ class _AppDrawerState extends State<AppDrawer> {
TranslationBase.of(context).dr + TranslationBase.of(context).dr +
capitalizeOnlyFirstLater( capitalizeOnlyFirstLater(
authenticationViewModel authenticationViewModel
.doctorProfile.doctorName .doctorProfile!.doctorName!
.replaceAll("DR.", "") .replaceAll("DR.", "")
.toLowerCase()), .toLowerCase()),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
@ -104,7 +104,7 @@ class _AppDrawerState extends State<AppDrawer> {
padding: EdgeInsets.only(top: 0), padding: EdgeInsets.only(top: 0),
child: AppText( child: AppText(
authenticationViewModel authenticationViewModel
.doctorProfile?.clinicDescription, .doctorProfile!.clinicDescription!,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontSize: 16, fontSize: 16,
@ -128,7 +128,8 @@ class _AppDrawerState extends State<AppDrawer> {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => AddRescheduleLeaveScreen(), builder: (context) =>
AddRescheduleLeaveScreen(),
settings: RouteSettings( settings: RouteSettings(
name: 'AddRescheduleLeaveScreen') name: 'AddRescheduleLeaveScreen')
// MyReferredPatient(), // MyReferredPatient(),

@ -1,12 +1,13 @@
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:expandable/expandable.dart'; import 'package:expandable/expandable.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class AppExpandableNotifier extends StatelessWidget { class AppExpandableNotifier extends StatelessWidget {
final Widget headerWid; final Widget headerWid;
final Widget bodyWid; final Widget bodyWid;
AppExpandableNotifier({this.headerWid, this.bodyWid}); AppExpandableNotifier({required this.headerWid, required this.bodyWid});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -55,4 +56,9 @@ class AppExpandableNotifier extends StatelessWidget {
initialExpanded: true, initialExpanded: true,
); );
} }
@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
super.debugFillProperties(properties);
properties.add(DiagnosticsProperty<Widget>('headerWid', headerWid));
}
} }

@ -3,10 +3,11 @@ import 'package:flutter/material.dart';
import 'loader/gif_loader_container.dart'; import 'loader/gif_loader_container.dart';
class AppLoaderWidget extends StatefulWidget { class AppLoaderWidget extends StatefulWidget {
AppLoaderWidget({Key key, this.title, this.containerColor}) : super(key: key); AppLoaderWidget({Key? key, this.title, this.containerColor})
: super(key: key);
final String title; final String? title;
final Color containerColor; final Color? containerColor;
@override @override
_AppLoaderWidgetState createState() => new _AppLoaderWidgetState(); _AppLoaderWidgetState createState() => new _AppLoaderWidgetState();

@ -12,16 +12,16 @@ import 'network_base_view.dart';
class AppScaffold extends StatelessWidget { class AppScaffold extends StatelessWidget {
final String appBarTitle; final String appBarTitle;
final Widget body; final Widget? body;
final bool isLoading; final bool isLoading;
final bool isShowAppBar; final bool isShowAppBar;
final BaseViewModel baseViewModel; final BaseViewModel? baseViewModel;
final Widget bottomSheet; final Widget? bottomSheet;
final Color backgroundColor; final Color? backgroundColor;
final Widget appBar; final Widget? appBar;
final Widget drawer; final Widget? drawer;
final Widget bottomNavigationBar; final Widget? bottomNavigationBar;
final String subtitle; final String? subtitle;
final bool isHomeIcon; final bool isHomeIcon;
final bool extendBody; final bool extendBody;
@ -49,29 +49,28 @@ class AppScaffold extends StatelessWidget {
FocusScope.of(context).requestFocus(new FocusNode()); FocusScope.of(context).requestFocus(new FocusNode());
}, },
child: Scaffold( child: Scaffold(
backgroundColor: backgroundColor ?? Theme.of(context).scaffoldBackgroundColor backgroundColor:
, backgroundColor ?? Theme.of(context).scaffoldBackgroundColor,
drawer: drawer, drawer: drawer,
extendBody: extendBody, extendBody: extendBody,
bottomNavigationBar: bottomNavigationBar, bottomNavigationBar: bottomNavigationBar,
appBar: isShowAppBar appBar: isShowAppBar && appBar != null
? appBar ?? ? appBar as PreferredSizeWidget
AppBar( : AppBar(
elevation: 0, elevation: 0,
backgroundColor: Colors.white, backgroundColor: Colors.white,
//HexColor('#515B5D'), //HexColor('#515B5D'),
textTheme: TextTheme( titleTextStyle: TextStyle(
headline6: TextStyle(
color: Colors.black87, color: Colors.black87,
fontSize: 16.8, fontSize: 16.8,
)), ),
title: Column( title: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text(appBarTitle.toUpperCase()), Text(appBarTitle.toUpperCase()),
if (subtitle != null) if (subtitle != null)
Text( Text(
subtitle, subtitle!,
style: TextStyle(fontSize: 12, color: Colors.red), style: TextStyle(fontSize: 12, color: Colors.red),
), ),
], ],
@ -94,17 +93,16 @@ class AppScaffold extends StatelessWidget {
) )
: SizedBox() : SizedBox()
], ],
) ),
: null,
bottomSheet: bottomSheet, bottomSheet: bottomSheet,
body: projectProvider.isInternetConnection body: projectProvider.isInternetConnection
? baseViewModel != null ? baseViewModel != null
? NetworkBaseView( ? NetworkBaseView(
baseViewModel: baseViewModel, baseViewModel: baseViewModel!,
child: body, child: body!,
) )
: Stack( : Stack(
children: <Widget>[body, buildAppLoaderWidget(isLoading)]) children: <Widget>[body!, buildAppLoaderWidget(isLoading)])
: Center( : Center(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,

@ -5,31 +5,31 @@ import 'package:hexcolor/hexcolor.dart';
class AppText extends StatefulWidget { class AppText extends StatefulWidget {
final String text; final String text;
final String variant; final String? variant;
final Color color; final Color color;
final FontWeight fontWeight; final FontWeight? fontWeight;
final double fontSize; final double? fontSize;
final double fontHeight; final double? fontHeight;
final String fontFamily; final String fontFamily;
final int maxLength; final int maxLength;
final bool italic; final bool italic;
final double margin; final double? margin;
final double marginTop; final double marginTop;
final double marginRight; final double marginRight;
final double marginBottom; final double marginBottom;
final double marginLeft; final double marginLeft;
final double letterSpacing; final double? letterSpacing;
final TextAlign textAlign; final TextAlign? textAlign;
final bool bold; final bool bold;
final bool regular; final bool regular;
final bool medium; final bool medium;
final int maxLines; final int? maxLines;
final bool readMore; final bool readMore;
final String style; final String? style;
final bool allowExpand; final bool allowExpand;
final bool visibility; final bool visibility;
final TextOverflow textOverflow; final TextOverflow? textOverflow;
final TextDecoration textDecoration; final TextDecoration? textDecoration;
final bool isCopyable; final bool isCopyable;
AppText( AppText(
@ -48,9 +48,9 @@ class AppText extends StatefulWidget {
this.marginBottom = 0, this.marginBottom = 0,
this.marginLeft = 0, this.marginLeft = 0,
this.textAlign, this.textAlign,
this.bold, this.bold = false,
this.regular, this.regular = false,
this.medium, this.medium = false,
this.maxLines, this.maxLines,
this.readMore = false, this.readMore = false,
this.style, this.style,
@ -98,7 +98,7 @@ class _AppTextState extends State<AppText> {
return GestureDetector( return GestureDetector(
child: Container( child: Container(
margin: widget.margin != null margin: widget.margin != null
? EdgeInsets.all(widget.margin) ? EdgeInsets.all(widget.margin!)
: EdgeInsets.only( : EdgeInsets.only(
top: widget.marginTop, top: widget.marginTop,
right: widget.marginRight, right: widget.marginRight,
@ -142,7 +142,7 @@ class _AppTextState extends State<AppText> {
}); });
}, },
child: Text(hidden ? "Read More" : "Read less", child: Text(hidden ? "Read More" : "Read less",
style: _getFontStyle().copyWith( style: _getFontStyle()!.copyWith(
color: HexColor('#FF0000'), color: HexColor('#FF0000'),
fontWeight: FontWeight.w800, fontWeight: FontWeight.w800,
fontFamily: "Poppins", fontFamily: "Poppins",
@ -165,7 +165,9 @@ class _AppTextState extends State<AppText> {
if (widget.isCopyable) { if (widget.isCopyable) {
return Theme( return Theme(
data: ThemeData( data: ThemeData(
textSelectionColor: Colors.lightBlueAccent, textSelectionTheme: TextSelectionThemeData(
selectionColor: Colors.lightBlueAccent,
),
), ),
child: Container( child: Container(
child: SelectableText( child: SelectableText(
@ -184,7 +186,7 @@ class _AppTextState extends State<AppText> {
// : null, // : null,
maxLines: widget.maxLines ?? null, maxLines: widget.maxLines ?? null,
style: widget.style != null style: widget.style != null
? _getFontStyle().copyWith( ? _getFontStyle()!.copyWith(
fontStyle: widget.italic ? FontStyle.italic : null, fontStyle: widget.italic ? FontStyle.italic : null,
color: widget.color, color: widget.color,
fontWeight: widget.fontWeight ?? _getFontWeight(), fontWeight: widget.fontWeight ?? _getFontWeight(),
@ -214,13 +216,13 @@ class _AppTextState extends State<AppText> {
: text.length)), : text.length)),
textAlign: widget.textAlign, textAlign: widget.textAlign,
overflow: widget.maxLines != null overflow: widget.maxLines != null
? ((widget.maxLines > 1) ? ((widget.maxLines! > 1)
? TextOverflow.fade ? TextOverflow.fade
: TextOverflow.ellipsis) : TextOverflow.ellipsis)
: null, : null,
maxLines: widget.maxLines ?? null, maxLines: widget.maxLines ?? null,
style: widget.style != null style: widget.style != null
? _getFontStyle().copyWith( ? _getFontStyle()!.copyWith(
fontStyle: widget.italic ? FontStyle.italic : null, fontStyle: widget.italic ? FontStyle.italic : null,
color: widget.color, color: widget.color,
fontWeight: widget.fontWeight ?? _getFontWeight(), fontWeight: widget.fontWeight ?? _getFontWeight(),
@ -239,30 +241,30 @@ class _AppTextState extends State<AppText> {
} }
} }
TextStyle _getFontStyle() { TextStyle? _getFontStyle() {
switch (widget.style) { switch (widget.style) {
case "headline2": case "headline2":
return Theme.of(context).textTheme.headline2; return Theme.of(context).textTheme.displayMedium;
case "headline3": case "headline3":
return Theme.of(context).textTheme.headline3; return Theme.of(context).textTheme.displaySmall;
case "headline4": case "headline4":
return Theme.of(context).textTheme.headline4; return Theme.of(context).textTheme.headlineMedium;
case "headline5": case "headline5":
return Theme.of(context).textTheme.headline5; return Theme.of(context).textTheme.headlineSmall;
case "headline6": case "headline6":
return Theme.of(context).textTheme.headline6; return Theme.of(context).textTheme.titleLarge;
case "bodyText2": case "bodyText2":
return Theme.of(context).textTheme.bodyText2; return Theme.of(context).textTheme.bodyMedium;
case "bodyText_15": case "bodyText_15":
return Theme.of(context).textTheme.bodyText2.copyWith(fontSize: 15.0); return Theme.of(context).textTheme.bodyMedium!.copyWith(fontSize: 15.0);
case "bodyText1": case "bodyText1":
return Theme.of(context).textTheme.bodyText1; return Theme.of(context).textTheme.bodyLarge;
case "caption": case "caption":
return Theme.of(context).textTheme.caption; return Theme.of(context).textTheme.bodySmall;
case "overline": case "overline":
return Theme.of(context).textTheme.overline; return Theme.of(context).textTheme.labelSmall;
case "button": case "button":
return Theme.of(context).textTheme.button; return Theme.of(context).textTheme.labelLarge;
default: default:
return TextStyle(); return TextStyle();
} }
@ -301,7 +303,7 @@ class _AppTextState extends State<AppText> {
case "date": case "date":
return 24.0; return 24.0;
default: default:
return SizeConfig.textMultiplier * 2; return SizeConfig.textMultiplier! * 2;
} }
} }
@ -347,7 +349,7 @@ class _AppTextState extends State<AppText> {
return FontWeight.w500; return FontWeight.w500;
} }
} else { } else {
return null; return FontWeight.normal;
} }
} }
} }

@ -12,7 +12,8 @@ class BottomNavBar extends StatefulWidget {
DashboardViewModel dashboardViewModel = DashboardViewModel(); DashboardViewModel dashboardViewModel = DashboardViewModel();
BottomNavBar({Key key, this.changeIndex, this.index}) : super(key: key); BottomNavBar({Key? key, required this.changeIndex, required this.index})
: super(key: key);
@override @override
_BottomNavBarState createState() => _BottomNavBarState(); _BottomNavBarState createState() => _BottomNavBarState();

@ -6,16 +6,17 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:badges/badges.dart' as badge;
class BottomNavigationItem extends StatelessWidget { class BottomNavigationItem extends StatelessWidget {
final IconData icon; final IconData? icon;
final IconData activeIcon; final IconData? activeIcon;
final ValueChanged<int> changeIndex; final ValueChanged<int>? changeIndex;
final int index; final int? index;
final int currentIndex; final int? currentIndex;
final String name; final String? name;
final DashboardViewModel dashboardViewModel; final DashboardViewModel? dashboardViewModel;
final String svgPath; final String? svgPath;
BottomNavigationItem( BottomNavigationItem(
{this.icon, {this.icon,
@ -37,7 +38,7 @@ class BottomNavigationItem extends StatelessWidget {
child: InkWell( child: InkWell(
highlightColor: Colors.transparent, highlightColor: Colors.transparent,
splashColor: Colors.transparent, splashColor: Colors.transparent,
onTap: () => changeIndex(currentIndex), onTap: () => changeIndex!(currentIndex!),
child: Stack( child: Stack(
alignment: AlignmentDirectional.center, alignment: AlignmentDirectional.center,
children: [ children: [
@ -58,7 +59,7 @@ class BottomNavigationItem extends StatelessWidget {
), ),
Container( Container(
child: SvgPicture.asset( child: SvgPicture.asset(
svgPath, svgPath!,
width: SizeConfig.widthMultiplier! * (10), width: SizeConfig.widthMultiplier! * (10),
height: SizeConfig.getHeightMultiplier( height: SizeConfig.getHeightMultiplier(
height: SizeConfig.heightMultiplier! * height: SizeConfig.heightMultiplier! *
@ -86,20 +87,23 @@ class BottomNavigationItem extends StatelessWidget {
], ],
), ),
if (currentIndex == 3 && if (currentIndex == 3 &&
dashboardViewModel.notRepliedCount != 0) dashboardViewModel!.notRepliedCount != 0)
Positioned( Positioned(
right: 18.0, right: 18.0,
bottom: 40.0, bottom: 40.0,
child: Badge( child: badge.Badge(
toAnimate: false, badgeAnimation:
badge.BadgeAnimation.fade(toAnimate: false),
position: BadgePosition.topEnd(), position: BadgePosition.topEnd(),
badgeStyle: badge.BadgeStyle(
shape: BadgeShape.circle, shape: BadgeShape.circle,
badgeColor: Colors.red[800], badgeColor: Colors.red[800]!,
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
),
badgeContent: Container( badgeContent: Container(
// padding: EdgeInsets.all(2.0), // padding: EdgeInsets.all(2.0),
child: AppText( child: AppText(
dashboardViewModel.notRepliedCount.toString(), dashboardViewModel!.notRepliedCount.toString(),
color: Colors.white, color: Colors.white,
fontSize: 12.0), fontSize: 12.0),
), ),

@ -10,9 +10,9 @@ import '../app_texts_widget.dart';
class AppButton extends StatefulWidget { class AppButton extends StatefulWidget {
final GestureTapCallback onPressed; final GestureTapCallback onPressed;
final String title; final String title;
final IconData iconData; final IconData? iconData;
final Widget icon; final Widget? icon;
final Color color; final Color? color;
double fontSize; double fontSize;
final double padding; final double padding;
final Color fontColor; final Color fontColor;
@ -27,12 +27,12 @@ class AppButton extends StatefulWidget {
final double height; final double height;
AppButton({ AppButton({
@required this.onPressed, required this.onPressed,
this.title, this.title = '',
this.iconData, this.iconData,
this.icon, this.icon,
this.color, this.color,
this.fontSize, this.fontSize = 15,
this.padding = 8, this.padding = 8,
this.loading = false, this.loading = false,
this.disabled = false, this.disabled = false,
@ -42,8 +42,8 @@ class AppButton extends StatefulWidget {
this.hPadding = 0, this.hPadding = 0,
this.radius = 8.0, this.radius = 8.0,
this.hasBorder = false, this.hasBorder = false,
this.borderColor, this.borderColor = Colors.white,
this.height, this.height = 5,
}); });
_AppButtonState createState() => _AppButtonState(); _AppButtonState createState() => _AppButtonState();
@ -54,12 +54,21 @@ class _AppButtonState extends State<AppButton> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (widget.fontSize == null) { if (widget.fontSize == null) {
widget.fontSize = SizeConfig.getHeightMultiplier() * widget.fontSize = SizeConfig.getHeightMultiplier() *
(SizeConfig.isHeightVeryShort ? 2.1 :SizeConfig.isHeightShort?1.8: 1.7); (SizeConfig.isHeightVeryShort
? 2.1
: SizeConfig.isHeightShort
? 1.8
: 1.7);
} }
return Container( return Container(
// height: MediaQuery.of(context).size.height * 0.075, // height: MediaQuery.of(context).size.height * 0.075,
height: widget.height?? SizeConfig.heightMultiplier! * height: widget.height ??
(SizeConfig.isHeightVeryShort ? 6 :SizeConfig.isHeightShort?5.5: 5), SizeConfig.heightMultiplier! *
(SizeConfig.isHeightVeryShort
? 6
: SizeConfig.isHeightShort
? 5.5
: 5),
child: IgnorePointer( child: IgnorePointer(
ignoring: widget.loading || widget.disabled, ignoring: widget.loading || widget.disabled,
child: RawMaterialButton( child: RawMaterialButton(
@ -103,7 +112,7 @@ class _AppButtonState extends State<AppButton> {
child: CircularProgressIndicator( child: CircularProgressIndicator(
backgroundColor: Colors.white, backgroundColor: Colors.white,
valueColor: AlwaysStoppedAnimation<Color>( valueColor: AlwaysStoppedAnimation<Color>(
Colors.grey[300], Colors.grey[300]!,
), ),
), ),
), ),

@ -5,9 +5,9 @@ import 'app_buttons_widget.dart';
class ButtonBottomSheet extends StatelessWidget { class ButtonBottomSheet extends StatelessWidget {
final GestureTapCallback onPressed; final GestureTapCallback onPressed;
final String title; final String title;
final IconData iconData; final IconData? iconData;
final Widget icon; final Widget? icon;
final Color color; final Color? color;
final double fontSize; final double fontSize;
final double padding; final double padding;
final Color fontColor; final Color fontColor;
@ -21,8 +21,8 @@ class ButtonBottomSheet extends StatelessWidget {
final double hPadding; final double hPadding;
ButtonBottomSheet({ ButtonBottomSheet({
@required this.onPressed, required this.onPressed,
this.title, this.title = '',
this.iconData, this.iconData,
this.icon, this.icon,
this.color, this.color,
@ -36,7 +36,7 @@ class ButtonBottomSheet extends StatelessWidget {
this.hPadding = 0, this.hPadding = 0,
this.radius = 8.0, this.radius = 8.0,
this.hasBorder = false, this.hasBorder = false,
this.borderColor, this.borderColor = Colors.white,
}); });
@override @override

@ -12,7 +12,7 @@ import 'package:hexcolor/hexcolor.dart';
class CardWithBgWidgetNew extends StatelessWidget { class CardWithBgWidgetNew extends StatelessWidget {
final Widget widget; final Widget widget;
CardWithBgWidgetNew({@required this.widget}); CardWithBgWidgetNew({required this.widget});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -5,14 +5,14 @@ import 'package:provider/provider.dart';
class CardWithBgWidget extends StatelessWidget { class CardWithBgWidget extends StatelessWidget {
final Widget widget; final Widget widget;
final Color bgColor; final Color? bgColor;
final bool hasBorder; final bool hasBorder;
final double padding; final double padding;
final double marginLeft; final double marginLeft;
final double marginSymmetric; final double marginSymmetric;
CardWithBgWidget( CardWithBgWidget(
{@required this.widget, {required this.widget,
this.bgColor, this.bgColor,
this.hasBorder = true, this.hasBorder = true,
this.padding = 15.0, this.padding = 15.0,

@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
class ShowImageDialog extends StatelessWidget { class ShowImageDialog extends StatelessWidget {
final String imageUrl; final String imageUrl;
const ShowImageDialog({Key key, this.imageUrl}) : super(key: key); const ShowImageDialog({Key? key, required this.imageUrl}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -16,14 +16,14 @@ class ListSelectDialog extends StatefulWidget {
final String hintSearchText; final String hintSearchText;
ListSelectDialog({ ListSelectDialog({
@required this.list, required this.list,
@required this.attributeName, required this.attributeName,
@required this.attributeValueId, required this.attributeValueId,
@required this.okText, required this.okText,
@required this.okFunction, required this.okFunction,
this.searchWidget, this.searchWidget = const SizedBox(),
this.usingSearch = false, this.usingSearch = false,
this.hintSearchText, this.hintSearchText = '',
}); });
@override @override
@ -46,12 +46,12 @@ class _ListSelectDialogState extends State<ListSelectDialog> {
} }
showAlertDialog(BuildContext context) { showAlertDialog(BuildContext context) {
Widget cancelButton = FlatButton( Widget cancelButton = ElevatedButton(
child: Text(TranslationBase.of(context).cancel), child: Text(TranslationBase.of(context).cancel),
onPressed: () { onPressed: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
}); });
Widget continueButton = FlatButton( Widget continueButton = ElevatedButton(
child: Text(this.widget.okText), child: Text(this.widget.okText),
onPressed: () { onPressed: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
@ -80,7 +80,7 @@ class _ListSelectDialogState extends State<ListSelectDialog> {
decoration: Utils.textFieldSelectorDecoration( decoration: Utils.textFieldSelectorDecoration(
widget.hintSearchText ?? widget.hintSearchText ??
TranslationBase.of(context).search, TranslationBase.of(context).search,
null, "",
false, false,
suffixIcon: Icon( suffixIcon: Icon(
Icons.search, Icons.search,
@ -97,8 +97,11 @@ class _ListSelectDialogState extends State<ListSelectDialog> {
children: [ children: [
...items ...items
.map((item) => RadioListTile( .map((item) => RadioListTile(
title: Text("${Utils.convertToTitleCase(item[widget.attributeName].toString())}"), title: Text(
groupValue: Utils.convertToTitleCase(widget.selectedValue[widget.attributeValueId].toString()), "${Utils.convertToTitleCase(item[widget.attributeName].toString())}"),
groupValue: Utils.convertToTitleCase(widget
.selectedValue[widget.attributeValueId]
.toString()),
value: item[widget.attributeValueId].toString(), value: item[widget.attributeValueId].toString(),
activeColor: AppGlobal.appRedColor, activeColor: AppGlobal.appRedColor,
selected: item[widget.attributeValueId] selected: item[widget.attributeValueId]

@ -12,13 +12,13 @@ class MasterKeyDailog extends StatefulWidget {
final List<MasterKeyModel> list; final List<MasterKeyModel> list;
final okText; final okText;
final Function(MasterKeyModel) okFunction; final Function(MasterKeyModel) okFunction;
MasterKeyModel selectedValue; MasterKeyModel? selectedValue;
final bool isICD; final bool isICD;
MasterKeyDailog( MasterKeyDailog(
{@required this.list, {required this.list,
@required this.okText, required this.okText,
@required this.okFunction, required this.okFunction,
this.selectedValue, this.selectedValue,
this.isICD = false}); this.isICD = false});
@ -41,7 +41,7 @@ class _MasterKeyDailogState extends State<MasterKeyDailog> {
showAlertDialog(BuildContext context, ProjectViewModel projectViewModel) { showAlertDialog(BuildContext context, ProjectViewModel projectViewModel) {
// set up the buttons // set up the buttons
Widget cancelButton = FlatButton( Widget cancelButton = ElevatedButton(
child: AppText( child: AppText(
TranslationBase.of(context).cancel, TranslationBase.of(context).cancel,
color: Colors.grey, color: Colors.grey,
@ -51,7 +51,7 @@ class _MasterKeyDailogState extends State<MasterKeyDailog> {
onPressed: () { onPressed: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
}); });
Widget continueButton = FlatButton( Widget continueButton = ElevatedButton(
child: AppText( child: AppText(
this.widget.okText, this.widget.okText,
color: Colors.grey, color: Colors.grey,
@ -59,7 +59,7 @@ class _MasterKeyDailogState extends State<MasterKeyDailog> {
(SizeConfig.isWidthLarge ? 3.5 : 5), (SizeConfig.isWidthLarge ? 3.5 : 5),
), ),
onPressed: () { onPressed: () {
this.widget.okFunction(widget.selectedValue); this.widget.okFunction(widget.selectedValue!);
Navigator.of(context).pop(); Navigator.of(context).pop();
}); });
// set up the AlertDialog // set up the AlertDialog
@ -87,17 +87,17 @@ class _MasterKeyDailogState extends State<MasterKeyDailog> {
(widget.isICD ? '/${item.code}' : ''), (widget.isICD ? '/${item.code}' : ''),
), ),
groupValue: widget.isICD groupValue: widget.isICD
? widget.selectedValue.code.toString() ? widget.selectedValue!.code.toString()
: widget.selectedValue.id.toString(), : widget.selectedValue!.id.toString(),
value: widget.isICD value: widget.isICD
? widget.selectedValue.code.toString() ? widget.selectedValue!.code.toString()
: item.id.toString(), : item.id.toString(),
activeColor: Colors.blue.shade700, activeColor: Colors.blue.shade700,
selected: widget.isICD selected: widget.isICD
? item.code.toString() == ? item.code.toString() ==
widget.selectedValue.code.toString() widget.selectedValue!.code.toString()
: item.id.toString() == : item.id.toString() ==
widget.selectedValue.id.toString(), widget.selectedValue!.id.toString(),
onChanged: (val) { onChanged: (val) {
setState(() { setState(() {
widget.selectedValue = item; widget.selectedValue = item;

@ -1,3 +1,5 @@
import 'dart:html';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -10,11 +12,11 @@ class ListSelectDialog extends StatefulWidget {
dynamic selectedValue; dynamic selectedValue;
ListSelectDialog( ListSelectDialog(
{@required this.list, {required this.list,
@required this.attributeName, required this.attributeName,
@required this.attributeValueId, required this.attributeValueId,
@required this.okText, required this.okText,
@required this.okFunction}); required this.okFunction});
@override @override
_ListSelectDialogState createState() => _ListSelectDialogState(); _ListSelectDialogState createState() => _ListSelectDialogState();
@ -34,12 +36,12 @@ class _ListSelectDialogState extends State<ListSelectDialog> {
showAlertDialog(BuildContext context) { showAlertDialog(BuildContext context) {
// set up the buttons // set up the buttons
Widget cancelButton = FlatButton( Widget cancelButton = ElevatedButton(
child: Text(TranslationBase.of(context).cancel), child: Text(TranslationBase.of(context).cancel),
onPressed: () { onPressed: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
}); });
Widget continueButton = FlatButton( Widget continueButton = ElevatedButton(
child: Text(this.widget.okText), child: Text(this.widget.okText),
onPressed: () { onPressed: () {
this.widget.okFunction(widget.selectedValue); this.widget.okFunction(widget.selectedValue);

@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
class DividerWithSpacesAround extends StatelessWidget { class DividerWithSpacesAround extends StatelessWidget {
DividerWithSpacesAround({ DividerWithSpacesAround({
Key key, Key? key,
this.height = 0, this.height = 0,
}); });

@ -12,15 +12,15 @@ import 'package:provider/provider.dart';
import '../../config/size_config.dart'; import '../../config/size_config.dart';
class DoctorCard extends StatelessWidget { class DoctorCard extends StatelessWidget {
final String doctorName; final String? doctorName;
final String branch; final String? branch;
final DateTime appointmentDate; final DateTime? appointmentDate;
final String profileUrl; final String? profileUrl;
final String invoiceNO; final String? invoiceNO;
final String orderNo; final String? orderNo;
final Function onTap; final Function? onTap;
final bool isPrescriptions; final bool isPrescriptions;
final String clinic; final String? clinic;
final bool isShowEye; final bool isShowEye;
final bool isShowTime; final bool isShowTime;
final bool isNoMargin; final bool isNoMargin;
@ -56,7 +56,7 @@ class DoctorCard extends StatelessWidget {
child: Padding( child: Padding(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
child: InkWell( child: InkWell(
onTap: (isShowEye) ? onTap : null, onTap: (isShowEye) ? onTap!() : null,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
@ -73,16 +73,16 @@ class DoctorCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
AppText( AppText(
'${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate!, isArabic: projectViewModel.isArabic)}',
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 14, fontSize: 14,
), ),
if (!isPrescriptions && isShowTime) if (!isPrescriptions && isShowTime)
AppText( AppText(
'${AppDateUtils.getHour(appointmentDate)}', '${AppDateUtils.getHour(appointmentDate!)}',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Colors.grey[700], color: Colors.grey[700]!,
fontSize: 14, fontSize: 14,
), ),
], ],
@ -95,7 +95,7 @@ class DoctorCard extends StatelessWidget {
children: <Widget>[ children: <Widget>[
Container( Container(
child: LargeAvatar( child: LargeAvatar(
name: doctorName, name: doctorName!,
url: profileUrl, url: profileUrl,
), ),
width: 55, width: 55,
@ -114,14 +114,14 @@ class DoctorCard extends StatelessWidget {
if (orderNo != null && !isPrescriptions) if (orderNo != null && !isPrescriptions)
CustomRow( CustomRow(
label: TranslationBase.of(context).orderNo , label: TranslationBase.of(context).orderNo ,
value: orderNo, value: orderNo!,
valueSize: 13, valueSize: 13,
labelSize: 13, labelSize: 13,
), ),
if (invoiceNO != null && !isPrescriptions) if (invoiceNO != null && !isPrescriptions)
CustomRow( CustomRow(
label: TranslationBase.of(context).invoiceNo , label: TranslationBase.of(context).invoiceNo ,
value: invoiceNO, value: invoiceNO!,
valueSize: 13, valueSize: 13,
labelSize: 13, labelSize: 13,
), ),
@ -130,7 +130,7 @@ class DoctorCard extends StatelessWidget {
label: TranslationBase.of(context).clinic + label: TranslationBase.of(context).clinic +
": ", ": ",
value: clinic, value: clinic!,
valueSize: 13, valueSize: 13,
labelSize: 13, labelSize: 13,
), ),
@ -138,7 +138,7 @@ class DoctorCard extends StatelessWidget {
CustomRow( CustomRow(
label: TranslationBase.of(context).branch + label: TranslationBase.of(context).branch +
": ", ": ",
value: branch, value: branch!,
valueSize: 13, valueSize: 13,
labelSize: 13, labelSize: 13,
), ),

@ -12,18 +12,18 @@ import 'package:provider/provider.dart';
import '../../config/config.dart'; import '../../config/config.dart';
class DoctorCardInsurance extends StatelessWidget { class DoctorCardInsurance extends StatelessWidget {
final String doctorName; final String? doctorName;
final String approvalNo; final String? approvalNo;
final DateTime appointmentDate; final DateTime? appointmentDate;
final String profileUrl; final String? profileUrl;
final String invoiceNO; final String? invoiceNO;
final String orderNo; final String? orderNo;
final Function onTap; final Function? onTap;
final bool isInsurance; final bool isInsurance;
final String clinic; final String? clinic;
final String approvalStatus; final String? approvalStatus;
final String patientOut; final String? patientOut;
final String branch2; final String? branch2;
DoctorCardInsurance( DoctorCardInsurance(
{this.doctorName, {this.doctorName,
@ -75,7 +75,7 @@ class DoctorCardInsurance extends StatelessWidget {
left: projectViewModel.isArabic ? 0 : 15, left: projectViewModel.isArabic ? 0 : 15,
right: projectViewModel.isArabic ? 15 : 0), right: projectViewModel.isArabic ? 15 : 0),
child: InkWell( child: InkWell(
onTap: onTap, onTap: onTap!(),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
@ -119,7 +119,7 @@ class DoctorCardInsurance extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: AppText( child: AppText(
doctorName, doctorName!,
fontSize: 16.0, fontSize: 16.0,
letterSpacing: -0.64, letterSpacing: -0.64,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -131,7 +131,7 @@ class DoctorCardInsurance extends StatelessWidget {
children: <Widget>[ children: <Widget>[
Container( Container(
child: LargeAvatar( child: LargeAvatar(
name: doctorName, name: doctorName!,
url: profileUrl, url: profileUrl,
), ),
width: 55, width: 55,
@ -147,33 +147,33 @@ class DoctorCardInsurance extends StatelessWidget {
if (orderNo != null && !isInsurance) if (orderNo != null && !isInsurance)
CustomRow( CustomRow(
label: 'Invoice:', label: 'Invoice:',
value: invoiceNO, value: invoiceNO!,
), ),
if (invoiceNO != null && !isInsurance) if (invoiceNO != null && !isInsurance)
CustomRow( CustomRow(
label: 'Invoice:', label: 'Invoice:',
value: invoiceNO, value: invoiceNO!,
), ),
if (isInsurance) if (isInsurance)
CustomRow( CustomRow(
label: label:
TranslationBase.of(context).clinic + TranslationBase.of(context).clinic +
": ", ": ",
value: clinic, value: clinic!,
), ),
if (branch2 != null) if (branch2 != null)
CustomRow( CustomRow(
label: label:
TranslationBase.of(context).branch + TranslationBase.of(context).branch +
": ", ": ",
value: branch2, value: branch2!,
), ),
if (approvalNo != null) if (approvalNo != null)
CustomRow( CustomRow(
label: TranslationBase.of(context) label: TranslationBase.of(context)
.approvalNo + .approvalNo +
": ", ": ",
value: approvalNo, value: approvalNo!,
), ),
]), ]),
), ),

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

@ -8,9 +8,9 @@ import '../shared/app_texts_widget.dart';
class DrawerItem extends StatefulWidget { class DrawerItem extends StatefulWidget {
final String title; final String title;
final String subTitle; final String subTitle;
final IconData icon; final IconData? icon;
final Color color; final Color? color;
final String assetLink; final String? assetLink;
DrawerItem(this.title, DrawerItem(this.title,
{this.icon, this.color, this.subTitle = '', this.assetLink}); {this.icon, this.color, this.subTitle = '', this.assetLink});
@ -31,13 +31,13 @@ class _DrawerItemState extends State<DrawerItem> {
Container( Container(
height: 20, height: 20,
width: 20, width: 20,
child: Image.asset(widget.assetLink), child: Image.asset(widget.assetLink!),
), ),
if (widget.assetLink == null) if (widget.assetLink == null)
Icon( Icon(
widget.icon, widget.icon,
color: widget.color ?? Colors.black87, color: widget.color ?? Colors.black87,
size: SizeConfig.imageSizeMultiplier * 5, size: SizeConfig.imageSizeMultiplier! * 5,
), ),
Expanded( Expanded(
child: Column( child: Column(

@ -5,8 +5,8 @@ import '../app_texts_widget.dart';
class ErrorMessage extends StatelessWidget { class ErrorMessage extends StatelessWidget {
const ErrorMessage({ const ErrorMessage({
Key key, Key? key,
@required this.error, required this.error,
}) : super(key: key); }) : super(key: key);
final String error; final String error;

@ -2,15 +2,15 @@ import 'package:expandable/expandable.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class HeaderBodyExpandableNotifier extends StatefulWidget { class HeaderBodyExpandableNotifier extends StatefulWidget {
final Widget headerWidget; final Widget? headerWidget;
final Widget bodyWidget; final Widget? bodyWidget;
final Widget collapsed; final Widget? collapsed;
final bool isExpand; final bool isExpand;
bool expandFlag = false; bool expandFlag = false;
var controller = new ExpandableController(); var controller = new ExpandableController();
HeaderBodyExpandableNotifier( HeaderBodyExpandableNotifier(
{this.headerWidget, this.bodyWidget, this.collapsed, this.isExpand}); {this.headerWidget, this.bodyWidget, this.collapsed, this.isExpand = false});
@override @override
_HeaderBodyExpandableNotifierState createState() => _HeaderBodyExpandableNotifierState createState() =>
@ -50,7 +50,7 @@ class _HeaderBodyExpandableNotifierState
), ),
// header: widget.headerWidget, // header: widget.headerWidget,
collapsed: Container(), collapsed: Container(),
expanded: widget.bodyWidget, expanded: widget.bodyWidget!,
builder: (_, collapsed, expanded) { builder: (_, collapsed, expanded) {
return Padding( return Padding(
padding: EdgeInsets.only(left: 0, right: 0, bottom: 0), padding: EdgeInsets.only(left: 0, right: 0, bottom: 0),

@ -1,5 +1,5 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter_gifimage/flutter_gifimage.dart'; import 'package:flutter_gif/flutter_gif.dart';
class GifLoaderContainer extends StatefulWidget { class GifLoaderContainer extends StatefulWidget {
@override @override
@ -8,11 +8,11 @@ class GifLoaderContainer extends StatefulWidget {
class _GifLoaderContainerState extends State<GifLoaderContainer> class _GifLoaderContainerState extends State<GifLoaderContainer>
with TickerProviderStateMixin { with TickerProviderStateMixin {
GifController controller1; late FlutterGifController controller1;
@override @override
void initState() { void initState() {
controller1 = GifController(vsync: this); controller1 = FlutterGifController(vsync: this);
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
controller1.repeat( controller1.repeat(

@ -13,17 +13,17 @@ import 'app_texts_widget.dart';
import 'text_fields/app-textfield-custom.dart'; import 'text_fields/app-textfield-custom.dart';
class MasterKeyCheckboxSearchWidget extends StatefulWidget { class MasterKeyCheckboxSearchWidget extends StatefulWidget {
final SOAPViewModel model; final SOAPViewModel? model;
final Function addSelectedHistories; final Function? addSelectedHistories;
final Function(MasterKeyModel) removeHistory; final Function(MasterKeyModel)? removeHistory;
final Function(MasterKeyModel) addHistory; final Function(MasterKeyModel)? addHistory;
final bool Function(MasterKeyModel) isServiceSelected; final bool Function(MasterKeyModel)? isServiceSelected;
final List<MasterKeyModel> masterList; final List<MasterKeyModel>? masterList;
final String buttonName; final String? buttonName;
final String hintSearchText; final String? hintSearchText;
MasterKeyCheckboxSearchWidget( MasterKeyCheckboxSearchWidget(
{Key key, {Key? key,
this.model, this.model,
this.addSelectedHistories, this.addSelectedHistories,
this.removeHistory, this.removeHistory,
@ -46,7 +46,7 @@ class _MasterKeyCheckboxSearchWidgetState
@override @override
void initState() { void initState() {
items.addAll(widget.masterList); items.addAll(widget.masterList!);
super.initState(); super.initState();
} }
@ -89,7 +89,9 @@ class _MasterKeyCheckboxSearchWidgetState
icon: Icon( icon: Icon(
Icons.search, Icons.search,
color: Colors.black, color: Colors.black,
)), ),
onPressed: () {},
),
), ),
// SizedBox(height: 15,), // SizedBox(height: 15,),
@ -103,10 +105,11 @@ class _MasterKeyCheckboxSearchWidgetState
InkWell( InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
if (widget.isServiceSelected(historyInfo)) { if (widget
widget.removeHistory(historyInfo); .isServiceSelected!(historyInfo)) {
widget.removeHistory!(historyInfo);
} else { } else {
widget.addHistory(historyInfo); widget.addHistory!(historyInfo);
} }
}); });
}, },
@ -114,15 +117,16 @@ class _MasterKeyCheckboxSearchWidgetState
children: [ children: [
Checkbox( Checkbox(
value: widget value: widget
.isServiceSelected(historyInfo), .isServiceSelected!(historyInfo),
activeColor: Colors.red[800], activeColor: Colors.red[800],
onChanged: (bool newValue) { onChanged: (bool? newValue) {
setState(() { setState(() {
if (widget.isServiceSelected( if (widget.isServiceSelected!(
historyInfo)) { historyInfo)) {
widget.removeHistory(historyInfo); widget
.removeHistory!(historyInfo);
} else { } else {
widget.addHistory(historyInfo); widget.addHistory!(historyInfo);
} }
}); });
}), }),
@ -130,9 +134,9 @@ class _MasterKeyCheckboxSearchWidgetState
child: AppText( child: AppText(
projectViewModel.isArabic projectViewModel.isArabic
? historyInfo.nameAr != "" ? historyInfo.nameAr != ""
? historyInfo.nameAr ? historyInfo.nameAr!
: historyInfo.nameEn : historyInfo.nameEn!
: historyInfo.nameEn, : historyInfo.nameEn!,
color: Color(0xFF575757), color: Color(0xFF575757),
fontSize: SizeConfig fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() * .getTextMultiplierBasedOnWidth() *
@ -164,12 +168,12 @@ class _MasterKeyCheckboxSearchWidgetState
void filterSearchResults(String query) { void filterSearchResults(String query) {
List<MasterKeyModel> dummySearchList = []; List<MasterKeyModel> dummySearchList = [];
dummySearchList.addAll(widget.masterList); dummySearchList.addAll(widget.masterList!);
if (query.isNotEmpty) { if (query.isNotEmpty) {
List<MasterKeyModel> dummyListData = []; List<MasterKeyModel> dummyListData = [];
dummySearchList.forEach((item) { dummySearchList.forEach((item) {
if (item.nameAr.toLowerCase().contains(query.toLowerCase()) || if (item.nameAr!.toLowerCase().contains(query.toLowerCase()) ||
item.nameEn.toLowerCase().contains(query.toLowerCase())) { item.nameEn!.toLowerCase().contains(query.toLowerCase())) {
dummyListData.add(item); dummyListData.add(item);
} }
}); });
@ -181,7 +185,7 @@ class _MasterKeyCheckboxSearchWidgetState
} else { } else {
setState(() { setState(() {
items.clear(); items.clear();
items.addAll(widget.masterList); items.addAll(widget.masterList!);
}); });
} }
} }

@ -10,7 +10,7 @@ class NetworkBaseView extends StatelessWidget {
final BaseViewModel baseViewModel; final BaseViewModel baseViewModel;
final Widget child; final Widget child;
NetworkBaseView({Key key, this.baseViewModel, this.child}); NetworkBaseView({Key? key, required this.baseViewModel, required this.child});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -32,7 +32,7 @@ class NetworkBaseView extends StatelessWidget {
break; break;
case ViewState.Error: case ViewState.Error:
return ErrorMessage( return ErrorMessage(
error: baseViewModel.error, error: baseViewModel.error!,
); );
break; break;
} }

@ -10,13 +10,13 @@ import 'package:flutter/material.dart';
*@desc: Profile Image Widget class *@desc: Profile Image Widget class
*/ */
class ProfileImageWidget extends StatelessWidget { class ProfileImageWidget extends StatelessWidget {
String url; String? url;
String name; String? name;
String des; String? des;
double height; double? height;
double width; double? width;
Color color; Color? color;
double fontsize; double? fontsize;
ProfileImageWidget( ProfileImageWidget(
{this.url, {this.url,
@ -36,12 +36,12 @@ class ProfileImageWidget extends StatelessWidget {
height: height, height: height,
width: width, width: width,
child: CircleAvatar( child: CircleAvatar(
radius: SizeConfig.imageSizeMultiplier * 12, radius: SizeConfig.imageSizeMultiplier! * 12,
// radius: (52) // radius: (52)
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(50), borderRadius: BorderRadius.circular(50),
child: Image.network( child: Image.network(
url, url!,
fit: BoxFit.fill, fit: BoxFit.fill,
width: 700, width: 700,
), ),
@ -56,19 +56,19 @@ class ProfileImageWidget extends StatelessWidget {
name == null name == null
? SizedBox() ? SizedBox()
: AppText( : AppText(
name, name!,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: fontsize == null fontSize: fontsize == null
? SizeConfig.textMultiplier * 3.5 ? SizeConfig.textMultiplier! * 3.5
: fontsize, : fontsize,
color: color, color: color!,
), ),
des == null des == null
? SizedBox() ? SizedBox()
: AppText( : AppText(
des, des!,
fontSize: fontsize == null fontSize: fontsize == null
? SizeConfig.textMultiplier * 2.5 ? SizeConfig.textMultiplier! * 2.5
: fontsize, : fontsize,
) )
], ],

@ -5,7 +5,7 @@ class RoundedContainer extends StatefulWidget {
final double height; final double height;
final double raduis; final double raduis;
final Color backgroundColor; final Color backgroundColor;
final EdgeInsets margin; final EdgeInsets? margin;
final double elevation; final double elevation;
final bool showBorder; final bool showBorder;
final Color borderColor; final Color borderColor;
@ -21,9 +21,9 @@ class RoundedContainer extends StatefulWidget {
final double borderWidth; final double borderWidth;
RoundedContainer( RoundedContainer(
{@required this.child, {required this.child,
this.width, this.width = 0,
this.height, this.height = 0,
this.raduis = 10, this.raduis = 10,
this.backgroundColor = Colors.white, this.backgroundColor = Colors.white,
this.margin, this.margin,

@ -15,7 +15,7 @@ class SpeechToText {
static stt.SpeechToText speech = stt.SpeechToText(); static stt.SpeechToText speech = stt.SpeechToText();
SpeechToText({ SpeechToText({
@required this.context, required this.context,
}); });
showAlertDialog(BuildContext context) { showAlertDialog(BuildContext context) {
@ -44,7 +44,7 @@ typedef Disposer = void Function();
class MyStatefulBuilder extends StatefulWidget { class MyStatefulBuilder extends StatefulWidget {
const MyStatefulBuilder({ const MyStatefulBuilder({
// @required this.builder, // @required this.builder,
@required this.dispose, required this.dispose,
}); });
//final StatefulWidgetBuilder builder; //final StatefulWidgetBuilder builder;
@ -57,7 +57,7 @@ class MyStatefulBuilder extends StatefulWidget {
class _MyStatefulBuilderState extends State<MyStatefulBuilder> { class _MyStatefulBuilderState extends State<MyStatefulBuilder> {
var event = RobotProvider(); var event = RobotProvider();
var searchText; var searchText;
static StreamSubscription<dynamic> streamSubscription; late StreamSubscription<dynamic> streamSubscription;
static var isClosed = false; static var isClosed = false;
@override @override
@ -136,7 +136,7 @@ class _MyStatefulBuilderState extends State<MyStatefulBuilder> {
child: InkWell( child: InkWell(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all(color: Colors.grey[300])), border: Border.all(color: Colors.grey[300]!)),
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: AppText( child: AppText(
'Try Again', 'Try Again',

@ -40,11 +40,11 @@ final _mobileFormatter = NumberTextInputFormatter();
class TextFields extends StatefulWidget { class TextFields extends StatefulWidget {
TextFields({ TextFields({
Key key, Key? key,
this.type, this.type,
this.hintText, this.hintText,
this.suffixIcon, this.suffixIcon,
this.autoFocus, this.autoFocus = false,
this.onChanged, this.onChanged,
this.initialValue, this.initialValue,
this.minLines, this.minLines,
@ -64,7 +64,7 @@ class TextFields extends StatefulWidget {
this.borderOnlyError = false, this.borderOnlyError = false,
this.onSaved, this.onSaved,
this.onSuffixTap, this.onSuffixTap,
this.readOnly: false, this.readOnly = false,
this.maxLength, this.maxLength,
this.prefixIcon, this.prefixIcon,
this.bare = false, this.bare = false,
@ -83,26 +83,26 @@ class TextFields extends StatefulWidget {
this.borderWidth = 1, this.borderWidth = 1,
}) : super(key: key); }) : super(key: key);
final String hintText; final String? hintText;
final String initialValue; final String? initialValue;
final String type; final String? type;
final bool autoFocus; final bool autoFocus;
final IconData suffixIcon; final IconData? suffixIcon;
final Color suffixIconColor; final Color? suffixIconColor;
final Icon prefixIcon; final Icon? prefixIcon;
final VoidCallback onTap; final VoidCallback? onTap;
final Function onTapTextFields; final Function? onTapTextFields;
final TextEditingController controller; final TextEditingController? controller;
final TextInputType keyboardType; final TextInputType? keyboardType;
final FormFieldValidator validator; final FormFieldValidator? validator;
final Function onSaved; final Function? onSaved;
final Function onSuffixTap; final Function? onSuffixTap;
final Function onChanged; final Function? onChanged;
final Function onSubmit; final Function? onSubmit;
final bool readOnly; final bool readOnly;
final int maxLength; final int? maxLength;
final int minLines; final int? minLines;
final int maxLines; final int? maxLines;
final bool maxLengthEnforced; final bool maxLengthEnforced;
final bool bare; final bool bare;
final TextInputAction inputAction; final TextInputAction inputAction;
@ -110,16 +110,16 @@ class TextFields extends StatefulWidget {
final FontWeight fontWeight; final FontWeight fontWeight;
final bool keepPadding; final bool keepPadding;
final TextCapitalization textCapitalization; final TextCapitalization textCapitalization;
final List<TextInputFormatter> inputFormatters; final List<TextInputFormatter>? inputFormatters;
final bool autoValidate; final bool autoValidate;
final EdgeInsets padding; final EdgeInsets? padding;
final bool focus; final bool focus;
final bool borderOnlyError; final bool borderOnlyError;
final Color hintColor; final Color? hintColor;
final Color fillColor; final Color? fillColor;
final bool hasBorder; final bool hasBorder;
final bool showLabelText; final bool showLabelText;
Color borderColor; Color? borderColor;
final double borderRadius; final double borderRadius;
final double borderWidth; final double borderWidth;
bool hasLabelText; bool hasLabelText;
@ -184,14 +184,14 @@ class _TextFieldsState extends State<TextFields> {
default: default:
if (widget.suffixIcon != null) if (widget.suffixIcon != null)
return InkWell( return InkWell(
onTap: widget.onSuffixTap, onTap: widget.onSuffixTap!(),
child: Icon(widget.suffixIcon, child: Icon(widget.suffixIcon,
size: 22.0, size: 22.0,
color: widget.suffixIconColor != null color: widget.suffixIconColor != null
? widget.suffixIconColor ? widget.suffixIconColor
: Colors.grey[500])); : Colors.grey[500]));
else else
return null; return SizedBox();
} }
} }
@ -224,14 +224,14 @@ class _TextFieldsState extends State<TextFields> {
child: Column( child: Column(
children: [ children: [
TextFormField( TextFormField(
onTap: widget.onTapTextFields, onTap: widget.onTapTextFields!(),
keyboardAppearance: Theme.of(context).brightness, keyboardAppearance: Theme.of(context).brightness,
scrollPhysics: BouncingScrollPhysics(), scrollPhysics: BouncingScrollPhysics(),
// autovalidate: widget.autoValidate, // autovalidate: widget.autoValidate,
textCapitalization: widget.textCapitalization, textCapitalization: widget.textCapitalization,
onFieldSubmitted: widget.inputAction == TextInputAction.next onFieldSubmitted: widget.inputAction == TextInputAction.next
? (widget.onSubmit != null ? (widget.onSubmit != null
? widget.onSubmit ? widget.onSubmit!()
: (val) { : (val) {
_focusNode.nextFocus(); _focusNode.nextFocus();
}) })
@ -239,7 +239,7 @@ class _TextFieldsState extends State<TextFields> {
textInputAction: widget.inputAction, textInputAction: widget.inputAction,
minLines: widget.minLines ?? 1, minLines: widget.minLines ?? 1,
maxLines: widget.maxLines ?? 1, maxLines: widget.maxLines ?? 1,
maxLengthEnforced: widget.maxLengthEnforced, // maxLengthEnforcement: widget.maxLengthEnforced,
initialValue: widget.initialValue, initialValue: widget.initialValue,
onChanged: (value) { onChanged: (value) {
if (widget.showLabelText) { if (widget.showLabelText) {
@ -253,7 +253,7 @@ class _TextFieldsState extends State<TextFields> {
}); });
} }
} }
if (widget.onChanged != null) widget.onChanged(value); if (widget.onChanged != null) widget.onChanged!(value);
}, },
focusNode: _focusNode, focusNode: _focusNode,
maxLength: widget.maxLength ?? null, maxLength: widget.maxLength ?? null,
@ -263,8 +263,8 @@ class _TextFieldsState extends State<TextFields> {
obscureText: widget.type == "password" && !view ? true : false, obscureText: widget.type == "password" && !view ? true : false,
autofocus: widget.autoFocus ?? false, autofocus: widget.autoFocus ?? false,
validator: widget.validator, validator: widget.validator,
onSaved: widget.onSaved, onSaved: widget.onSaved!(),
style: Theme.of(context).textTheme.bodyText1.copyWith( style: Theme.of(context).textTheme.bodyLarge!.copyWith(
fontSize: widget.fontSize, fontWeight: widget.fontWeight), fontSize: widget.fontSize, fontWeight: widget.fontWeight),
inputFormatters: widget.keyboardType == TextInputType.phone inputFormatters: widget.keyboardType == TextInputType.phone
? <TextInputFormatter>[ ? <TextInputFormatter>[
@ -328,7 +328,7 @@ class _TextFieldsState extends State<TextFields> {
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: widget.hasBorder borderSide: widget.hasBorder
? BorderSide( ? BorderSide(
color: widget.borderColor, width: widget.borderWidth) color: widget.borderColor!, width: widget.borderWidth)
: BorderSide(color: Colors.transparent, width: 0), : BorderSide(color: Colors.transparent, width: 0),
borderRadius: widget.hasBorder borderRadius: widget.hasBorder
? BorderRadius.circular( ? BorderRadius.circular(
@ -338,7 +338,7 @@ class _TextFieldsState extends State<TextFields> {
disabledBorder: OutlineInputBorder( disabledBorder: OutlineInputBorder(
borderSide: widget.hasBorder borderSide: widget.hasBorder
? BorderSide( ? BorderSide(
color: widget.borderColor, width: widget.borderWidth) color: widget.borderColor!, width: widget.borderWidth)
: BorderSide(color: Colors.transparent, width: 0), : BorderSide(color: Colors.transparent, width: 0),
borderRadius: widget.hasBorder borderRadius: widget.hasBorder
? BorderRadius.circular( ? BorderRadius.circular(
@ -347,7 +347,7 @@ class _TextFieldsState extends State<TextFields> {
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: widget.hasBorder borderSide: widget.hasBorder
? BorderSide( ? BorderSide(
color: widget.borderColor, width: widget.borderWidth) color: widget.borderColor!, width: widget.borderWidth)
: BorderSide(color: Colors.transparent, width: 0), : BorderSide(color: Colors.transparent, width: 0),
borderRadius: widget.hasBorder borderRadius: widget.hasBorder
? BorderRadius.circular( ? BorderRadius.circular(

@ -11,23 +11,23 @@ import '../app_texts_widget.dart';
class AppTextFieldCustom extends StatefulWidget { class AppTextFieldCustom extends StatefulWidget {
final double height; final double height;
final Function onClick; final Function? onClick;
final String hintText; final String? hintText;
final TextEditingController controller; final TextEditingController? controller;
final bool isTextFieldHasSuffix; final bool isTextFieldHasSuffix;
final bool hasBorder; final bool hasBorder;
final String dropDownText; final String? dropDownText;
final IconButton suffixIcon; final IconButton? suffixIcon;
final Color dropDownColor; final Color? dropDownColor;
final bool enabled; final bool enabled;
final TextInputType inputType; final TextInputType? inputType;
final int minLines; final int minLines;
final int maxLines; final int maxLines;
final List<TextInputFormatter> inputFormatters; final List<TextInputFormatter>? inputFormatters;
final Function(String) onChanged; final Function(String)? onChanged;
final Function onFieldSubmitted; final Function? onFieldSubmitted;
final String validationError; final String? validationError;
final bool isPrscription; final bool isPrscription;
final bool isSecure; final bool isSecure;
final bool focus; final bool focus;
@ -92,9 +92,7 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
TextInputType localKeyboardType = widget.inputType ?? TextInputType localKeyboardType = widget.inputType ??
(widget.maxLines == 1 (widget.maxLines == 1 ? TextInputType.text : TextInputType.multiline);
? TextInputType.text
: TextInputType.multiline);
return Column( return Column(
children: [ children: [
@ -113,7 +111,7 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
padding: padding:
EdgeInsets.only(top: 4.0, bottom: 0.0, left: 8.0, right: 8.0), EdgeInsets.only(top: 4.0, bottom: 0.0, left: 8.0, right: 8.0),
child: InkWell( child: InkWell(
onTap: widget.onClick ?? null, onTap: widget.onClick!() ?? null,
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
@ -128,13 +126,10 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
AppText( AppText(
widget.hintText, widget.hintText!,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontSize: widget.isPrscription == false fontSize: widget.isPrscription == false ? 11.0 : 0,
? 11.0
: 0,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.44, letterSpacing: -0.44,
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -149,13 +144,18 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
focusNode: FocusNode(), focusNode: FocusNode(),
autofocus: false, autofocus: false,
onKey: (rawKeyEvent) { onKey: (rawKeyEvent) {
final isFormSkippedEnterEvent = rawKeyEvent is RawKeyDownEvent && final isFormSkippedEnterEvent =
rawKeyEvent.isKeyPressed(LogicalKeyboardKey.enter); rawKeyEvent is RawKeyDownEvent &&
rawKeyEvent.isKeyPressed(
LogicalKeyboardKey.enter);
final needToInsertNewLine = isFormSkippedEnterEvent && final needToInsertNewLine =
localKeyboardType == TextInputType.multiline; isFormSkippedEnterEvent &&
localKeyboardType ==
TextInputType.multiline;
if (needToInsertNewLine) { if (needToInsertNewLine) {
TextEditingControllerHelper.insertText(widget.controller, '\n'); TextEditingControllerHelper.insertText(
widget.controller!, '\n');
} }
}, },
child: TextFormField( child: TextFormField(
@ -166,9 +166,10 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
textAlignVertical: TextAlignVertical.top, textAlignVertical: TextAlignVertical.top,
decoration: TextFieldsUtils decoration: TextFieldsUtils
.textFieldSelectorDecoration( .textFieldSelectorDecoration(
widget.hintText, null, true), widget.hintText!, "", true),
style: TextStyle( style: TextStyle(
fontSize: SizeConfig.textMultiplier * 1.7, fontSize:
SizeConfig.textMultiplier! * 1.7,
fontFamily: 'Poppins', fontFamily: 'Poppins',
color: Color(0xFF575757), color: Color(0xFF575757),
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
@ -186,18 +187,19 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
onChanged: (value) { onChanged: (value) {
setState(() {}); setState(() {});
if (widget.onChanged != null) { if (widget.onChanged != null) {
widget.onChanged(value); widget.onChanged!(value);
} }
}, },
onFieldSubmitted: widget.onFieldSubmitted, onFieldSubmitted:
widget.onFieldSubmitted!(),
obscureText: widget.isSecure), obscureText: widget.isSecure),
), ),
) )
: AppText( : AppText(
Utils.convertToTitleCase(widget.dropDownText), Utils.convertToTitleCase(widget.dropDownText!),
fontFamily: 'Poppins', fontFamily: 'Poppins',
color: Color(0xFF575757), color: Color(0xFF575757),
fontSize: SizeConfig.textMultiplier * 1.7, fontSize: SizeConfig.textMultiplier! * 1.7,
), ),
], ],
), ),
@ -208,7 +210,7 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
? Container( ? Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
bottom: widget.isSearchTextField bottom: widget.isSearchTextField
? (widget.controller.text.isEmpty || ? (widget.controller!.text.isEmpty ||
widget.controller == null) widget.controller == null)
? 10 ? 10
: 25 : 25
@ -228,8 +230,9 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
), ),
), ),
), ),
if (widget.validationError != null && widget.validationError.isNotEmpty) if (widget.validationError != null &&
TextFieldsError(error: widget.validationError), widget.validationError!.isNotEmpty)
TextFieldsError(error: widget.validationError!),
], ],
); );
} }

@ -8,7 +8,7 @@ import 'app-textfield-custom.dart';
class AppTextFieldCustomSearch extends StatelessWidget { class AppTextFieldCustomSearch extends StatelessWidget {
const AppTextFieldCustomSearch({ const AppTextFieldCustomSearch({
Key key, Key? key,
this.onChangeFun, this.onChangeFun,
this.positionedChild, this.positionedChild,
this.marginTop, this.marginTop,
@ -18,30 +18,30 @@ class AppTextFieldCustomSearch extends StatelessWidget {
this.inputFormatters, this.inputFormatters,
this.searchController, this.searchController,
this.onFieldSubmitted, this.onFieldSubmitted,
this.hintText, this.height, this.hintText,
this.height,
}); });
final TextEditingController searchController; final TextEditingController? searchController;
final Function onChangeFun; final Function? onChangeFun;
final Function onFieldSubmitted; final Function? onFieldSubmitted;
final Widget positionedChild; final Widget? positionedChild;
final IconButton suffixIcon; final IconButton? suffixIcon;
final double marginTop; final double? marginTop;
final String validationError; final String? validationError;
final String hintText; final String? hintText;
final TextInputType inputType;
final List<TextInputFormatter> inputFormatters;
final double height;
final TextInputType? inputType;
final List<TextInputFormatter>? inputFormatters;
final double? height;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return Container( return Container(
margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: marginTop), margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: marginTop!),
child: Stack( child: Stack(
children: [ children: [
AppTextFieldCustom( AppTextFieldCustom(
@ -60,13 +60,13 @@ class AppTextFieldCustomSearch extends StatelessWidget {
onPressed: () {}, onPressed: () {},
), ),
controller: searchController, controller: searchController,
onChanged: onChangeFun, onChanged: onChangeFun!(),
onFieldSubmitted: onFieldSubmitted, onFieldSubmitted: onFieldSubmitted,
validationError: validationError), validationError: validationError),
if (positionedChild != null) if (positionedChild != null)
projectViewModel.isArabic projectViewModel.isArabic
? Positioned(left: 35, top: 5, child: positionedChild) ? Positioned(left: 35, top: 5, child: positionedChild!)
: Positioned(right: 35, top: 5, child: positionedChild) : Positioned(right: 35, top: 5, child: positionedChild!)
], ],
), ),
); );

@ -6,22 +6,22 @@ import 'package:hexcolor/hexcolor.dart';
class AppTextFormField extends FormField<String> { class AppTextFormField extends FormField<String> {
AppTextFormField( AppTextFormField(
{FormFieldSetter<String> onSaved, {FormFieldSetter<String>? onSaved,
String inputFormatter, String? inputFormatter,
FormFieldValidator<String> validator, FormFieldValidator<String>? validator,
ValueChanged<String> onChanged, ValueChanged<String>? onChanged,
GestureTapCallback onTap, GestureTapCallback? onTap,
bool obscureText = false, bool obscureText = false,
TextEditingController controller, TextEditingController? controller,
bool autovalidate = true, bool autovalidate = true,
TextInputType textInputType, TextInputType? textInputType,
String hintText, String? hintText,
FocusNode focusNode, FocusNode? focusNode,
TextInputAction textInputAction = TextInputAction.done, TextInputAction textInputAction = TextInputAction.done,
ValueChanged<String> onFieldSubmitted, ValueChanged<String>? onFieldSubmitted,
IconButton prefix, IconButton? prefix,
String labelText, String? labelText,
IconData suffixIcon, IconData? suffixIcon,
bool readOnly = false, bool readOnly = false,
borderColor}) borderColor})
: super( : super(
@ -53,13 +53,13 @@ class AppTextFormField extends FormField<String> {
hintText: hintText, hintText: hintText,
suffixIcon: prefix, suffixIcon: prefix,
hintStyle: TextStyle( hintStyle: TextStyle(
fontSize: SizeConfig.textMultiplier * 1.8, fontSize: SizeConfig.textMultiplier! * 1.8,
), ),
contentPadding: contentPadding:
EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0),
labelText: labelText, labelText: labelText,
labelStyle: TextStyle( labelStyle: TextStyle(
fontSize: SizeConfig.textMultiplier * 1.7, fontSize: SizeConfig.textMultiplier! * 1.7,
), ),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(6)), borderRadius: BorderRadius.all(Radius.circular(6)),
@ -83,7 +83,7 @@ class AppTextFormField extends FormField<String> {
), ),
state.hasError state.hasError
? Text( ? Text(
state.errorText, state.errorText!,
style: TextStyle(color: Colors.red), style: TextStyle(color: Colors.red),
) )
: Container() : Container()

@ -8,9 +8,9 @@ class CustomAutoCompleteTextField extends StatelessWidget {
final Widget child; final Widget child;
const CustomAutoCompleteTextField({ const CustomAutoCompleteTextField({
Key key, Key? key,
this.isShowError, required this.isShowError,
this.child, required this.child,
}) : super(key: key); }) : super(key: key);
@override @override

@ -8,17 +8,17 @@ import 'package:flutter/material.dart';
class CountryTextField extends StatefulWidget { class CountryTextField extends StatefulWidget {
final dynamic element; final dynamic element;
final String elementError; final String elementError;
final List<dynamic> elementList; final List<dynamic>? elementList;
final String keyName; final String? keyName;
final String keyId; final String? keyId;
final String hintText; final String? hintText;
final double width; final double? width;
final Function(dynamic) okFunction; final Function(dynamic)? okFunction;
CountryTextField( CountryTextField(
{Key key, {Key? key,
@required this.element, required this.element,
@required this.elementError, required this.elementError,
this.width, this.width,
this.elementList, this.elementList,
this.keyName, this.keyName,
@ -41,14 +41,14 @@ class _CountryTextfieldState extends State<CountryTextField> {
? () { ? () {
Utils.hideKeyboard(context); Utils.hideKeyboard(context);
ListSelectDialog dialog = ListSelectDialog( ListSelectDialog dialog = ListSelectDialog(
list: widget.elementList, list: widget.elementList!,
attributeName: '${widget.keyName}', attributeName: '${widget.keyName}',
attributeValueId: widget.elementList.length == 1 attributeValueId: widget.elementList!.length == 1
? widget.elementList[0]['${widget.keyId}'] ? widget.elementList![0]['${widget.keyId}']
: '${widget.keyId}', : '${widget.keyId}',
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) => okFunction: (selectedValue) =>
widget.okFunction(selectedValue), widget.okFunction!(selectedValue),
); );
showDialog( showDialog(
barrierDismissible: false, barrierDismissible: false,
@ -61,14 +61,14 @@ class _CountryTextfieldState extends State<CountryTextField> {
: null, : null,
child: AppTextFieldCustom( child: AppTextFieldCustom(
hintText: widget.hintText, hintText: widget.hintText,
dropDownText: widget.elementList.length == 1 dropDownText: widget.elementList!.length == 1
? widget.elementList[0]['${widget.keyName}'] ? widget.elementList![0]['${widget.keyName}']
: widget.element != null : widget.element != null
? widget.element['${widget.keyName}'] ? widget.element['${widget.keyName}']
: null, : null,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
validationError: validationError:
widget.elementList.length != 1 ? widget.elementError : null, widget.elementList!.length != 1 ? widget.elementError : null,
enabled: false, enabled: false,
), ),
), ),

@ -14,13 +14,13 @@ import '../speech-text-popup.dart';
class HtmlRichEditor extends StatefulWidget { class HtmlRichEditor extends StatefulWidget {
final String hint; final String hint;
final String initialText; final String? initialText;
final double height; final double height;
final BoxDecoration decoration; final BoxDecoration? decoration;
final bool darkMode; final bool darkMode;
final bool showBottomToolbar; final bool showBottomToolbar;
final List<Toolbar> toolbar; final List<Toolbar>? toolbar;
final HtmlEditorController controller; final HtmlEditorController? controller;
HtmlRichEditor({ HtmlRichEditor({
key, key,
@ -39,7 +39,7 @@ class HtmlRichEditor extends StatefulWidget {
} }
class _HtmlRichEditorState extends State<HtmlRichEditor> { class _HtmlRichEditorState extends State<HtmlRichEditor> {
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
stt.SpeechToText speech = stt.SpeechToText(); stt.SpeechToText speech = stt.SpeechToText();
var recognizedWord; var recognizedWord;
var event = RobotProvider(); var event = RobotProvider();
@ -64,7 +64,7 @@ class _HtmlRichEditorState extends State<HtmlRichEditor> {
return Stack( return Stack(
children: [ children: [
HtmlEditor( HtmlEditor(
controller: widget.controller, controller: widget.controller!,
htmlToolbarOptions: HtmlToolbarOptions(defaultToolbarButtons: [ htmlToolbarOptions: HtmlToolbarOptions(defaultToolbarButtons: [
StyleButtons(), StyleButtons(),
FontSettingButtons(), FontSettingButtons(),
@ -88,7 +88,7 @@ class _HtmlRichEditorState extends State<HtmlRichEditor> {
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(30.0), Radius.circular(30.0),
), ),
border: Border.all(color: Colors.grey[200], width: 0.5), border: Border.all(color: Colors.grey[200]!, width: 0.5),
), ),
)), )),
Positioned( Positioned(
@ -146,12 +146,12 @@ class _HtmlRichEditorState extends State<HtmlRichEditor> {
void resultListener(result) async { void resultListener(result) async {
recognizedWord = result.recognizedWords; recognizedWord = result.recognizedWords;
event.setValue({"searchText": recognizedWord}); event.setValue({"searchText": recognizedWord});
String txt = await widget.controller.getText(); String txt = await widget.controller!.getText();
if (result.finalResult == true) { if (result.finalResult == true) {
setState(() { setState(() {
SpeechToText.closeAlertDialog(context); SpeechToText.closeAlertDialog(context);
speech.stop(); speech.stop();
widget.controller.setText(txt + recognizedWord); widget.controller!.setText(txt + recognizedWord);
}); });
} else { } else {
print(result.finalResult); print(result.finalResult);

@ -6,8 +6,8 @@ import '../app_texts_widget.dart';
class TextFieldsError extends StatelessWidget { class TextFieldsError extends StatelessWidget {
const TextFieldsError({ const TextFieldsError({
Key key, Key? key,
@required this.error, required this.error,
}) : super(key: key); }) : super(key: key);
final String error; final String error;
@ -30,7 +30,7 @@ class TextFieldsError extends StatelessWidget {
child: AppText( child: AppText(
error, error,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.7, fontSize: SizeConfig.textMultiplier! * 1.7,
color: Colors.red.shade700, color: Colors.red.shade700,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),

@ -17,7 +17,7 @@ class TextFieldsUtils {
static InputDecoration textFieldSelectorDecoration( static InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown, String hintText, String selectedText, bool isDropDown,
{IconData suffixIcon, Color dropDownColor}) { {IconData? suffixIcon, Color? dropDownColor}) {
return InputDecoration( return InputDecoration(
isDense: true, isDense: true,
contentPadding: EdgeInsets.symmetric(horizontal: 0, vertical: 0), contentPadding: EdgeInsets.symmetric(horizontal: 0, vertical: 0),

@ -5,16 +5,16 @@ import '../app_texts_widget.dart';
class CustomRow extends StatelessWidget { class CustomRow extends StatelessWidget {
const CustomRow({ const CustomRow({
Key key, Key? key,
this.label, this.label = '',
this.value, this.value = '',
this.labelSize, this.labelSize = 0,
this.valueSize, this.valueSize = 0,
this.width, this.width = 0,
this.isCopyable = true, this.isCopyable = true,
this.isExpanded = true, this.isExpanded = true,
this.labelColor, this.labelColor = Colors.white,
this.valueColor, this.valueColor = Colors.white,
}) : super(key: key); }) : super(key: key);
final String label; final String label;

@ -35,8 +35,8 @@ class AnchoredOverlay extends StatelessWidget {
AnchoredOverlay({ AnchoredOverlay({
key, key,
this.showOverlay = false, this.showOverlay = false,
this.overlayBuilder, required this.overlayBuilder,
this.child, required this.child,
}) : super(key: key); }) : super(key: key);
@override @override
@ -90,8 +90,8 @@ class OverlayBuilder extends StatefulWidget {
OverlayBuilder({ OverlayBuilder({
key, key,
this.showOverlay = false, this.showOverlay = false,
this.overlayBuilder, required this.overlayBuilder,
this.child, required this.child,
}) : super(key: key); }) : super(key: key);
@override @override
@ -99,7 +99,7 @@ class OverlayBuilder extends StatefulWidget {
} }
class _OverlayBuilderState extends State<OverlayBuilder> { class _OverlayBuilderState extends State<OverlayBuilder> {
OverlayEntry _overlayEntry; late OverlayEntry _overlayEntry;
@override @override
void initState() { void initState() {
@ -157,7 +157,9 @@ class _OverlayBuilderState extends State<OverlayBuilder> {
void hideOverlay() { void hideOverlay() {
if (_overlayEntry != null) { if (_overlayEntry != null) {
_overlayEntry.remove(); _overlayEntry.remove();
_overlayEntry = null; _overlayEntry = OverlayEntry(builder: (context) {
return SizedBox();
});
} }
} }

@ -1,75 +1,103 @@
/* /*
* Copyright © 2020, Simform Solutions * Copyright (c) 2021 Simform Solutions
* All rights reserved. *
* https://github.com/simformsolutions/flutter_showcaseview * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/ */
/*
Customized By: Ibrahim Albitar
*/
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class GetPosition { class GetPosition {
final GlobalKey key; final GlobalKey? key;
final EdgeInsets padding;
final double? screenWidth;
final double? screenHeight;
GetPosition({this.key}); GetPosition({
this.key,
this.padding = EdgeInsets.zero,
this.screenWidth,
this.screenHeight,
});
Rect getRect() { Rect getRect() {
RenderBox box = key.currentContext.findRenderObject(); final box = key!.currentContext!.findRenderObject() as RenderBox;
final topLeft = box.size.topLeft(box.localToGlobal(const Offset(0.0, 0.0))); var boxOffset = box.localToGlobal(const Offset(0.0, 0.0));
final bottomRight = if (boxOffset.dx.isNaN || boxOffset.dy.isNaN) {
box.size.bottomRight(box.localToGlobal(const Offset(0.0, 0.0))); return const Rect.fromLTRB(0, 0, 0, 0);
}
final topLeft = box.size.topLeft(boxOffset);
final bottomRight = box.size.bottomRight(boxOffset);
Rect rect = Rect.fromLTRB( final rect = Rect.fromLTRB(
topLeft.dx, topLeft.dx - padding.left < 0 ? 0 : topLeft.dx - padding.left,
topLeft.dy, topLeft.dy - padding.top < 0 ? 0 : topLeft.dy - padding.top,
bottomRight.dx, bottomRight.dx + padding.right > screenWidth!
bottomRight.dy, ? screenWidth!
: bottomRight.dx + padding.right,
bottomRight.dy + padding.bottom > screenHeight!
? screenHeight!
: bottomRight.dy + padding.bottom,
); );
return rect; return rect;
} }
///Get the bottom position of the widget ///Get the bottom position of the widget
double getBottom() { double getBottom() {
RenderBox box = key.currentContext.findRenderObject(); final box = key!.currentContext!.findRenderObject() as RenderBox;
final bottomRight = final boxOffset = box.localToGlobal(const Offset(0.0, 0.0));
box.size.bottomRight(box.localToGlobal(const Offset(0.0, 0.0))); if (boxOffset.dy.isNaN) return padding.bottom;
return bottomRight.dy; final bottomRight = box.size.bottomRight(boxOffset);
return bottomRight.dy + padding.bottom;
} }
///Get the top position of the widget ///Get the top position of the widget
double getTop() { double getTop() {
RenderBox box = key.currentContext.findRenderObject(); final box = key!.currentContext!.findRenderObject() as RenderBox;
final topLeft = box.size.topLeft(box.localToGlobal(const Offset(0.0, 0.0))); final boxOffset = box.localToGlobal(const Offset(0.0, 0.0));
return topLeft.dy; if (boxOffset.dy.isNaN) return 0 - padding.top;
final topLeft = box.size.topLeft(boxOffset);
return topLeft.dy - padding.top;
} }
///Get the left position of the widget ///Get the left position of the widget
double getLeft() { double getLeft() {
RenderBox box = key.currentContext.findRenderObject(); final box = key!.currentContext!.findRenderObject() as RenderBox;
final topLeft = box.size.topLeft(box.localToGlobal(const Offset(0.0, 0.0))); final boxOffset = box.localToGlobal(const Offset(0.0, 0.0));
return topLeft.dx; if (boxOffset.dx.isNaN) return 0 - padding.left;
final topLeft = box.size.topLeft(boxOffset);
return topLeft.dx - padding.left;
} }
///Get the right position of the widget ///Get the right position of the widget
double getRight() { double getRight() {
RenderBox box = key.currentContext.findRenderObject(); final box = key!.currentContext!.findRenderObject() as RenderBox;
final boxOffset = box.localToGlobal(const Offset(0.0, 0.0));
if (boxOffset.dx.isNaN) return padding.right;
final bottomRight = final bottomRight =
box.size.bottomRight(box.localToGlobal(const Offset(0.0, 0.0))); box.size.bottomRight(box.localToGlobal(const Offset(0.0, 0.0)));
return bottomRight.dx; return bottomRight.dx + padding.right;
} }
double getHeight() { double getHeight() => getBottom() - getTop();
return getBottom() - getTop();
}
double getWidth() { double getWidth() => getRight() - getLeft();
return getRight() - getLeft();
}
double getCenter() { double getCenter() => (getLeft() + getRight()) / 2;
return (getLeft() + getRight()) / 2;
}
} }

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save