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/material.dart';
import 'package:provider/provider.dart';
import './config/size_config.dart';
import './routes.dart';
import 'config/config.dart';
@ -16,6 +15,7 @@ import 'core/service/AnalyticsService.dart';
import 'core/service/NavigationService.dart';
import 'core/viewModel/authentication_view_model.dart';
import 'locator.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
@ -52,7 +52,7 @@ class MyApp extends StatelessWidget {
showSemanticsDebugger: false,
title: 'Doctors App',
locale: projectProvider.appLocal,
localizationsDelegates: [
localizationsDelegates: [
TranslationBaseDelegate(),
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,

@ -1,7 +1,7 @@
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
class PatientSearchHeader extends StatelessWidget {
class PatientSearchHeader extends StatelessWidget {
final String? title;
const PatientSearchHeader({Key? key, this.title}) : super(key: key);

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

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

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

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

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

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

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

@ -16,16 +16,16 @@ import 'package:provider/provider.dart';
/// TODO Roaa Add translation and make sure it working fine
class ProcedureCard extends StatelessWidget {
final Function onTap;
final EntityList entityList;
final String categoryName;
final int categoryID;
final PatiantInformtion patient;
final int doctorID;
final bool isInpatient;
final Function? onTap;
final EntityList? entityList;
final String? categoryName;
final int? categoryID;
final PatiantInformtion? patient;
final int? doctorID;
final bool? isInpatient;
const ProcedureCard({
Key key,
Key? key,
this.onTap,
this.entityList,
this.categoryID,
@ -60,7 +60,7 @@ class ProcedureCard extends StatelessWidget {
bottomLeft: Radius.circular(10),
),
color:
entityList.orderType == 0 ? Colors.black : Colors.red[500],
entityList!.orderType == 0 ? Colors.black : Colors.red[500],
),
),
Expanded(
@ -80,10 +80,10 @@ class ProcedureCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
entityList.orderType == 0
entityList!.orderType == 0
? 'Routine'
: 'Urgent',
color: entityList.orderType == 0
color: entityList!.orderType == 0
? Colors.black
: AppGlobal.appRedColor,
fontWeight: FontWeight.w600,
@ -93,7 +93,7 @@ class ProcedureCard extends StatelessWidget {
),
AppText(
Utils.convertToTitleCase(
entityList.procedureName),
entityList!.procedureName!),
bold: true,
fontSize: 14,
),
@ -110,7 +110,7 @@ class ProcedureCard extends StatelessWidget {
AppText(
'${AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils.convertISOStringToDateTime(
entityList.createdOn),
entityList!.createdOn!),
isMonthShort: true,
isArabic: projectViewModel.isArabic,
)}',
@ -119,9 +119,9 @@ class ProcedureCard extends StatelessWidget {
fontSize: 14,
),
AppText(
'${AppDateUtils.getHour(AppDateUtils.convertISOStringToDateTime(entityList.createdOn))}',
'${AppDateUtils.getHour(AppDateUtils.convertISOStringToDateTime(entityList!.createdOn!))}',
fontWeight: FontWeight.w600,
color: Colors.grey[700],
color: Colors.grey[700]!,
fontSize: 14,
),
],
@ -130,7 +130,7 @@ class ProcedureCard extends StatelessWidget {
),
CustomRow(
label: TranslationBase.of(context).orderNo + ": ",
value: entityList.orderNo.toString() ?? "".toString(),
value: entityList!.orderNo.toString() ?? "".toString(),
isCopyable: false,
),
Row(
@ -159,7 +159,7 @@ class ProcedureCard extends StatelessWidget {
width: 30,
errorBuilder: (BuildContext context,
Object exception,
StackTrace stackTrace) {
StackTrace? stackTrace) {
return Text('No Image');
},
))),
@ -174,19 +174,20 @@ class ProcedureCard extends StatelessWidget {
children: [
AppText(
Utils.convertToTitleCase(
entityList.doctorName),
entityList!.doctorName!),
fontFamily: 'Poppins',
fontWeight: FontWeight.w800,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontSize: 1.7 * SizeConfig.textMultiplier!,
color: Colors.black,
),
if (entityList.clinicDescription != null)
if (entityList!.clinicDescription != null)
AppText(
Utils.convertToTitleCase(
entityList.clinicDescription),
entityList!.clinicDescription!),
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.4 * SizeConfig.textMultiplier,
fontSize:
1.4 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
],
@ -202,20 +203,20 @@ class ProcedureCard extends StatelessWidget {
children: [
Expanded(
child: AppText(
entityList.remarks != null
entityList!.remarks != null
? Utils.convertToTitleCase(
entityList.remarks.toString())
entityList!.remarks.toString())
: '',
fontSize: 12,
),
),
if ((entityList.categoryID == 2 ||
entityList.categoryID == 4) &&
doctorID == entityList.doctorID &&
!isInpatient)
if ((entityList!.categoryID == 2 ||
entityList!.categoryID == 4) &&
doctorID == entityList!.doctorID &&
!isInpatient!)
InkWell(
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';
class ProcedureScreen extends StatelessWidget {
int doctorNameP;
int? doctorNameP;
void initState() async {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
Map<String, dynamic> profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
doctorNameP = doctorProfile.doctorID;
}
@override
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String patientType = routeArgs['patientType'];
bool isFromLiveCare = routeArgs['isFromLiveCare'];
@ -41,10 +41,11 @@ class ProcedureScreen extends StatelessWidget {
mrn: patient.patientId,
patientType: patientType,
appointmentNo: patient.appointmentNo),
builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
AppScaffold(
builder:
(BuildContext context, ProcedureViewModel model, Widget? child) =>
AppScaffold(
isShowAppBar: true,
backgroundColor: Colors.grey[100],
backgroundColor: Colors.grey[100]!,
baseViewModel: model,
appBar: PatientProfileAppBar(
patient,
@ -99,42 +100,44 @@ class ProcedureScreen extends StatelessWidget {
itemBuilder: (BuildContext ctxt, int index) {
return ProcedureCard(
categoryID: model
.procedureList[0].entityList[index].categoryID,
entityList: model.procedureList[0].entityList[index],
.procedureList[0].entityList![index].categoryID,
entityList: model.procedureList[0].entityList![index],
onTap: () {
if (model.procedureList[0].entityList[index].categoryID ==
if (model.procedureList[0].entityList![index]
.categoryID ==
2 ||
model.procedureList[0].entityList[index].categoryID == 4)
updateProcedureForm(context,
model: model,
patient: patient,
remarks: model.procedureList[0]
.entityList[index].remarks,
orderType: model.procedureList[0]
.entityList[index].orderType
.toString(),
orderNo: model.procedureList[0]
.entityList[index].orderNo,
procedureName: model.procedureList[0]
.entityList[index].procedureName,
categoreId: model.procedureList[0]
.entityList[index].categoryID
.toString(),
procedureId: model.procedureList[0]
.entityList[index].procedureId,
limetNo: model.procedureList[0]
.entityList[index].lineItemNo,
model.procedureList[0].entityList![index]
.categoryID ==
4)
updateProcedureForm(
context,
model: model,
patient: patient,
remarks: model.procedureList[0]
.entityList![index].remarks!,
orderType: model.procedureList[0]
.entityList![index].orderType
.toString(),
orderNo: model.procedureList[0]
.entityList![index].orderNo!,
procedureName: model.procedureList[0]
.entityList![index].procedureName!,
categoreId: model.procedureList[0]
.entityList![index].categoryID
.toString(),
procedureId: model.procedureList[0]
.entityList![index].procedureId!,
limetNo: model.procedureList[0]
.entityList![index].lineItemNo!,
);
},
patient: patient,
doctorID: model?.doctorProfile?.doctorID,
doctorID: model.doctorProfile?.doctorID,
);
}),
if (model.state == ViewState.ErrorLocal ||
(model.procedureList.isNotEmpty &&
model.procedureList[0].entityList.isEmpty))
model.procedureList[0].entityList!.isEmpty))
Center(
child: ErrorMessage(
error: TranslationBase.of(context).noDataAvailable,

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

@ -19,15 +19,15 @@ import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
void updateProcedureForm(context,
{String procedureName,
int orderNo,
int limetNo,
PatiantInformtion patient,
String orderType,
String procedureId,
String remarks,
ProcedureViewModel model,
String categoreId}) {
{required String procedureName,
required int orderNo,
required int limetNo,
required PatiantInformtion patient,
required String orderType,
required String procedureId,
required String remarks,
required ProcedureViewModel model,
required String categoreId}) {
TextEditingController remarksController = TextEditingController();
showModalBottomSheet(
context: context,
@ -49,17 +49,16 @@ void updateProcedureForm(context,
}
class UpdateProcedureWidget extends StatefulWidget {
final PatiantInformtion patient;
final ProcedureViewModel previousModel;
final String procedureName;
final String remarks;
final TextEditingController remarksController;
final String procedureId;
final String categoryId;
final int orderNo;
final int limetNo;
int selectedType;
final PatiantInformtion? patient;
final ProcedureViewModel? previousModel;
final String? procedureName;
final String? remarks;
final TextEditingController? remarksController;
final String? procedureId;
final String? categoryId;
final int? orderNo;
final int? limetNo;
int? selectedType;
UpdateProcedureWidget(
{this.previousModel,
@ -70,14 +69,14 @@ class UpdateProcedureWidget extends StatefulWidget {
this.procedureId,
this.categoryId,
this.orderNo,
this.limetNo, this.selectedType});
this.limetNo,
this.selectedType});
@override
_UpdateProcedureWidgetState createState() => _UpdateProcedureWidgetState();
}
class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
setSelectedType(int val) {
setState(() {
widget.selectedType = val;
@ -86,7 +85,7 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
void initState() {
super.initState();
widget.remarksController.text = widget.remarks;
widget.remarksController!.text = widget.remarks!;
}
List<EntityList> entityList = [];
@ -98,114 +97,114 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getCategory(),
builder:
(BuildContext context, ProcedureViewModel _model, Widget child) =>
AppScaffold(
baseViewModel: widget.previousModel,
isShowAppBar: true,
appBar: BottomSheetTitle(title: "Update Procedure"),
body: SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height * 0.9,
child: Form(
child: Padding(
padding:
(BuildContext context, ProcedureViewModel _model, Widget? child) =>
AppScaffold(
baseViewModel: widget.previousModel!,
isShowAppBar: true,
appBar: BottomSheetTitle(title: "Update Procedure"),
body: SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height * 0.9,
child: Form(
child: Padding(
padding:
EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
Utils.convertToTitleCase(widget.procedureName),
fontWeight: FontWeight.w700,
),
SizedBox(
height: 30.0,
),
Container(
child: Row(
children: [
AppText(TranslationBase.of(context).orderType),
Radio(
activeColor: AppGlobal.appRedColor,
value: 0,
groupValue: widget.selectedType,
onChanged: (value) {
setSelectedType(value);
},
),
Text('routine'),
Radio(
activeColor: AppGlobal.appRedColor,
groupValue: widget.selectedType,
value: 1,
onChanged: (value) {
setSelectedType(value);
},
),
Text(TranslationBase.of(context).urgent),
],
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
Utils.convertToTitleCase(widget.procedureName!),
fontWeight: FontWeight.w700,
),
SizedBox(
height: 30.0,
),
Container(
child: Row(
children: [
AppText(TranslationBase.of(context).orderType),
Radio(
activeColor: AppGlobal.appRedColor,
value: 0,
groupValue: widget.selectedType,
onChanged: (value) {
setSelectedType(value!);
},
),
),
SizedBox(
height: 12.0,
),
Container(
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
child: TextFields(
fontSize: 15.0,
controller: widget.remarksController,
hintText: widget.remarksController.text.isEmpty
? 'No Remarks Added'
: '',
maxLines: 3,
minLines: 2,
onChanged: (value) {},
Text('routine'),
Radio(
activeColor: AppGlobal.appRedColor,
groupValue: widget.selectedType,
value: 1,
onChanged: (value) {
setSelectedType(value!);
},
),
),
SizedBox(
height: 70.0,
),
],
Text(TranslationBase.of(context).urgent),
],
),
),
),
)),
),
bottomSheet: CustomBottomSheetContainer(
label: TranslationBase.of(context).updateProcedure,
onTap: () => updateProcedure(
lineItemNo: widget.limetNo,
orderNo: widget.orderNo,
orderType: widget.selectedType.toString(),
categoryId: widget.categoryId,
procedureId: widget.procedureId,
entityList: entityList,
patient: widget.patient,
model: widget.previousModel,
remarks: widget.remarksController.text),
),
),
SizedBox(
height: 12.0,
),
Container(
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
child: TextFields(
fontSize: 15.0,
controller: widget.remarksController!,
hintText: widget.remarksController!.text.isEmpty
? 'No Remarks Added'
: '',
maxLines: 3,
minLines: 2,
onChanged: (value) {},
),
),
SizedBox(
height: 70.0,
),
],
),
),
)),
),
bottomSheet: CustomBottomSheetContainer(
label: TranslationBase.of(context).updateProcedure,
onTap: () => updateProcedure(
lineItemNo: widget.limetNo!,
orderNo: widget.orderNo!,
orderType: widget.selectedType.toString(),
categoryId: widget.categoryId!,
procedureId: widget.procedureId!,
entityList: entityList,
patient: widget.patient!,
model: widget.previousModel!,
remarks: widget.remarksController!.text),
),
),
);
}
updateProcedure(
{ProcedureViewModel model,
String remarks,
int lineItemNo,
int orderNo,
String newProcedureId,
String newCategoryId,
List<EntityList> entityList,
String orderType,
String procedureId,
PatiantInformtion patient,
String categoryId}) async {
{required ProcedureViewModel model,
required String remarks,
required int lineItemNo,
required int orderNo,
String? newProcedureId,
String? newCategoryId,
required List<EntityList> entityList,
required String orderType,
required String procedureId,
required PatiantInformtion patient,
required String categoryId}) async {
UpdateProcedureRequestModel updateProcedureReqModel =
new UpdateProcedureRequestModel();
List<Controls> controls = [];
ProcedureDetail controlsProcedure = new ProcedureDetail();
ProcedureDetail controlsProcedure = ProcedureDetail();
updateProcedureReqModel.appointmentNo = patient.appointmentNo;
@ -230,17 +229,18 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
}
updateProcedureReqModel.procedureDetail = controlsProcedure;
GifLoaderDialogUtils.showMyDialog(context);
await widget.previousModel.updateProcedure(
await widget.previousModel!.updateProcedure(
updateProcedureRequestModel: updateProcedureReqModel,
mrn: patient.patientMRN, isLocalBusy: true);
mrn: patient.patientMRN,
isLocalBusy: true);
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
} else if (model.state == ViewState.Idle) {
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();
}
GifLoaderDialogUtils.hideDialog(context);
}

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

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

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

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

@ -1,10 +1,10 @@
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() =>
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.

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

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

File diff suppressed because it is too large Load Diff

@ -42,7 +42,7 @@ class Utils {
),
actions: [
AppButton(
onPressed: okFunction,
onPressed: okFunction(),
title: TranslationBase.of(context).noteConfirm,
fontColor: Colors.white,
color: AppGlobal.appGreenColor,
@ -53,7 +53,7 @@ class Utils {
},
title: TranslationBase.of(context).cancel,
fontColor: Colors.white,
color: Colors.red[600],
color: Colors.red[600]!,
),
],
),
@ -124,7 +124,7 @@ class Utils {
children: items.map((item) {
return Text(
'${item.facilityName}',
style: TextStyle(fontSize: SizeConfig.textMultiplier * 2),
style: TextStyle(fontSize: SizeConfig.textMultiplier! * 2),
);
}).toList(),
itemExtent: 25,
@ -226,14 +226,14 @@ class Utils {
static String parseHtmlString(String htmlString) {
final document = parse(htmlString);
final String parsedString = parse(document.body.text).documentElement.text;
final String parsedString = parse(document.body!.text).documentElement!.text;
return parsedString;
}
static InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown,
{Icon suffixIcon, Color dropDownColor}) {
{Icon? suffixIcon, Color? dropDownColor}) {
return InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
@ -295,7 +295,7 @@ class Utils {
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 twoDigitMinutes = twoDigits(duration.inMinutes.remainder(60));
String twoDigitSeconds = twoDigits(duration.inSeconds.remainder(60));
@ -329,7 +329,7 @@ class Utils {
static String convertToTitleCase(String text) {
if (text == null) {
return null;
return "";
}
if (text.length <= 1) {

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

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

@ -42,8 +42,8 @@ class SMSOTP {
final focusD2 = FocusNode();
final focusD3 = FocusNode();
final focusD4 = FocusNode();
String errorMsg;
ProjectViewModel projectProvider;
String errorMsg = '';
late ProjectViewModel projectProvider;
String displayTime = '';
bool isClosed = false;
@ -349,7 +349,7 @@ class SMSOTP {
TextStyle buildTextStyle() {
return TextStyle(
fontSize: SizeConfig.textMultiplier * 2.5,
fontSize: SizeConfig.textMultiplier! * 2.5,
);
}
@ -358,15 +358,15 @@ class SMSOTP {
counterText: " ",
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10)),
borderSide: BorderSide(color: Colors.grey[300]),
borderSide: BorderSide(color: Colors.grey[300]!),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Colors.grey[300]),
borderSide: BorderSide(color: Colors.grey[300]!),
),
errorBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Colors.grey[300]),
borderSide: BorderSide(color: Colors.grey[300]!),
),
focusedErrorBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
@ -381,13 +381,12 @@ class SMSOTP {
return ' ';
} else if (value.length == 3) {
print(value);
} else {
return null;
}
return "";
}
checkValue() async {
if (verifyAccountForm.currentState.validate()) {
if (verifyAccountForm.currentState!.validate()) {
onSuccess(digit1.text.toString() +
digit2.text.toString() +
digit3.text.toString() +

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

@ -1,15 +1,16 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class BottomSheetContainer extends StatelessWidget {
final Function onTap;
final String label;
final Widget widget;
final Function? onTap;
final String? label;
final Widget? widget;
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
Widget build(BuildContext context) {
@ -27,15 +28,14 @@ class BottomSheetContainer extends StatelessWidget {
children: [
Container(
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: Row(
children: [
widget,
],
)
),
child: Row(
children: [
widget!,
],
)),
),
SizedBox(
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;
CustomBottomSheetContainer({Key key, this.onTap, this.label}) : super(key: key);
CustomBottomSheetContainer({Key? key, required this.onTap, required this.label}) : super(key: key);
@override
Widget build(BuildContext context) {
@ -36,7 +36,7 @@ class CustomBottomSheetContainer extends StatelessWidget {
child: AppButton(
title: label,
color: AppGlobal.appGreenColor,
onPressed: onTap,
onPressed: onTap(),
),
),
),

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

@ -26,7 +26,7 @@ class DashboardItemTexts extends StatefulWidget {
}
class _DashboardItemTextsState extends State<DashboardItemTexts> {
ProjectViewModel projectsProvider;
late ProjectViewModel projectsProvider;
@override
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';
class GaugeChart extends StatelessWidget {
final List<charts.ChartData> seriesList;
final List<charts.Series> seriesList;
final bool animate;
GaugeChart(this.seriesList, {this.animate = false});
@ -49,7 +49,7 @@ class GaugeChart extends StatelessWidget {
class GaugeSegment {
final String segment;
final int size;
final charts. color;
final color;
GaugeSegment(this.segment, this.size, this.color);
}

@ -19,12 +19,12 @@ class GetOutPatientStack extends StatelessWidget {
? 20
: 17);
value.summaryoptions
.sort((Summaryoptions a, Summaryoptions b) => b.value - a.value);
.sort((Summaryoptions a, Summaryoptions b) => b.value! - a.value!);
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) => {
list.add(getStack(
result, value.summaryoptions.first.value, context, barHeight))
@ -92,7 +92,7 @@ class GetOutPatientStack extends StatelessWidget {
begin: Alignment.topLeft,
end: Alignment(0.0, 1.0),
// 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
tileMode: TileMode.mirror, // repeats the gradient over the canvas
),
@ -126,7 +126,7 @@ class GetOutPatientStack extends StatelessWidget {
child: Row(
children: [
AppText(
value.kPIParameter,
value.kPIParameter!,
fontSize:
SizeConfig.getTextMultiplierBasedOnWidth() * 2.5,
textAlign: TextAlign.center,

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

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

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

@ -9,7 +9,7 @@ class AskPermissionDialog extends StatefulWidget {
final String type;
final Function onTapGrant;
AskPermissionDialog({this.type, this.onTapGrant});
AskPermissionDialog({required this.type, required this.onTapGrant});
@override
_AskPermissionDialogState createState() => _AskPermissionDialogState();
@ -71,7 +71,7 @@ class _AskPermissionDialogState extends State<AskPermissionDialog> {
),
AppButton(
fontColor: Theme.of(context).backgroundColor,
color: Colors.red[700],
color: Colors.red[700]!,
title: "Turn On Camera, Microphone",
onPressed: () async {
openAppSettings().then((value) {

@ -9,7 +9,7 @@ import 'package:hexcolor/hexcolor.dart';
class LabResultWidget extends StatefulWidget {
final List<LabResult> labResult;
LabResultWidget({Key key, this.labResult});
LabResultWidget({Key? key, required this.labResult});
@override
_LabResultWidgetState createState() => _LabResultWidgetState();
@ -30,7 +30,7 @@ class _LabResultWidgetState extends State<LabResultWidget> {
children: <Widget>[
AppText(
TranslationBase.of(context).generalResult,
fontSize: 2.5 * SizeConfig.textMultiplier,
fontSize: 2.5 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.bold,
),
InkWell(
@ -135,7 +135,7 @@ class _LabResultWidgetState extends State<LabResultWidget> {
child: Center(
child: AppText(
'${result.description}',
color: Colors.grey[800],
color: Colors.grey[800]!,
),
),
height: 60,
@ -146,7 +146,7 @@ class _LabResultWidgetState extends State<LabResultWidget> {
child: Center(
child: AppText(
'${result.resultValue}',
color: Colors.grey[800]),
color: Colors.grey[800]!),
),
height: 60),
),
@ -155,7 +155,7 @@ class _LabResultWidgetState extends State<LabResultWidget> {
child: Center(
child: AppText(
'${result.referenceRange}',
color: Colors.grey[800]),
color: Colors.grey[800]!),
),
height: 60),
),

@ -13,13 +13,13 @@ import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
class MyReferralPatientWidget extends StatefulWidget {
final MyReferralPatientModel myReferralPatientModel;
final ReferralPatientViewModel model;
final bool isExpand;
final Function expandClick;
final MyReferralPatientModel? myReferralPatientModel;
final ReferralPatientViewModel? model;
final bool? isExpand;
final Function? expandClick;
MyReferralPatientWidget(
{Key key,
{Key? key,
this.myReferralPatientModel,
this.model,
this.isExpand,
@ -33,13 +33,13 @@ class MyReferralPatientWidget extends StatefulWidget {
class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
bool _isLoading = false;
final _formKey = GlobalKey<FormState>();
String error;
TextEditingController answerController;
String error = '';
TextEditingController answerController = TextEditingController();
@override
void initState() {
answerController = new TextEditingController(
text: widget.myReferralPatientModel.referredDoctorRemarks ?? '');
text: widget.myReferralPatientModel!.referredDoctorRemarks ?? '');
super.initState();
}
@ -79,8 +79,8 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
padding: EdgeInsets.symmetric(
vertical: 4, horizontal: 4),
child: AppText(
'${widget.myReferralPatientModel.priorityDescription}',
fontSize: 1.7 * SizeConfig.textMultiplier,
'${widget.myReferralPatientModel!.priorityDescription}',
fontSize: 1.7 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
color: Colors.white,
@ -90,8 +90,8 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
height: 10,
),
AppText(
'${widget.myReferralPatientModel.firstName} ${widget.myReferralPatientModel.middleName} ${widget.myReferralPatientModel.lastName}',
fontSize: 2 * SizeConfig.textMultiplier,
'${widget.myReferralPatientModel!.firstName} ${widget.myReferralPatientModel!.middleName} ${widget.myReferralPatientModel!.lastName}',
fontSize: 2 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
color: Colors.black,
@ -103,7 +103,7 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
children: [
AppText(
TranslationBase.of(context).fileNo,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontSize: 1.7 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
color: Colors.black,
@ -112,8 +112,8 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
width: 20,
),
AppText(
'${widget.myReferralPatientModel.referralDoctor}',
fontSize: 1.7 * SizeConfig.textMultiplier,
'${widget.myReferralPatientModel!.referralDoctor!}',
fontSize: 1.7 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.normal,
textAlign: TextAlign.start,
color: Colors.black,
@ -127,7 +127,7 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
margin:
EdgeInsets.symmetric(horizontal: 8, vertical: 8),
child: InkWell(
onTap: widget.expandClick,
onTap: widget.expandClick!(),
child: Image.asset(
"assets/images/ic_circle_arrow.png",
width: 25,
@ -155,7 +155,7 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
endIndent: 0,
),
Container(
height: 1.8 * SizeConfig.textMultiplier * 6,
height: 1.8 * SizeConfig.textMultiplier! * 6,
padding:
EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0),
child: Expanded(
@ -171,7 +171,7 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
SizedBox(
child: AppText(
TranslationBase.of(context).referralDoctor,
fontSize: 1.9 * SizeConfig.textMultiplier,
fontSize: 1.9 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
color: Colors.black,
@ -182,8 +182,8 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
),
SizedBox(
child: AppText(
'${widget.myReferralPatientModel.referringDoctorName}',
fontSize: 1.7 * SizeConfig.textMultiplier,
'${widget.myReferralPatientModel!.referringDoctorName}',
fontSize: 1.7 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.normal,
textAlign: TextAlign.start,
color: Colors.black,
@ -214,7 +214,7 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
SizedBox(
child: AppText(
TranslationBase.of(context).referringClinic,
fontSize: 1.9 * SizeConfig.textMultiplier,
fontSize: 1.9 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
color: Colors.black,
@ -225,8 +225,8 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
),
SizedBox(
child: AppText(
'${widget.myReferralPatientModel.referringClinicDescription}',
fontSize: 1.7 * SizeConfig.textMultiplier,
'${widget.myReferralPatientModel!.referringClinicDescription}',
fontSize: 1.7 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.normal,
textAlign: TextAlign.start,
color: Colors.black,
@ -253,7 +253,7 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
height: 10,
),
Container(
height: 1.8 * SizeConfig.textMultiplier * 6,
height: 1.8 * SizeConfig.textMultiplier! * 6,
padding:
EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0),
child: Expanded(
@ -269,7 +269,7 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
SizedBox(
child: AppText(
TranslationBase.of(context).frequency,
fontSize: 1.9 * SizeConfig.textMultiplier,
fontSize: 1.9 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
color: Colors.black,
@ -280,8 +280,8 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
),
SizedBox(
child: AppText(
'${widget.myReferralPatientModel.frequencyDescription}',
fontSize: 1.7 * SizeConfig.textMultiplier,
'${widget.myReferralPatientModel!.frequencyDescription}',
fontSize: 1.7 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.normal,
textAlign: TextAlign.start,
color: Colors.black,
@ -312,7 +312,7 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
SizedBox(
child: AppText(
TranslationBase.of(context).maxResponseTime,
fontSize: 1.9 * SizeConfig.textMultiplier,
fontSize: 1.9 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
color: Colors.black,
@ -323,8 +323,8 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
),
SizedBox(
child: AppText(
'${DateFormat('dd/MM/yyyy').format(widget.myReferralPatientModel.mAXResponseTime)}',
fontSize: 1.7 * SizeConfig.textMultiplier,
'${DateFormat('dd/MM/yyyy').format(widget.myReferralPatientModel!.mAXResponseTime!)}',
fontSize: 1.7 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.normal,
textAlign: TextAlign.start,
color: Colors.black,
@ -367,7 +367,7 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
child: AppText(
TranslationBase.of(context)
.clinicDetailsandRemarks,
fontSize: 1.9 * SizeConfig.textMultiplier,
fontSize: 1.9 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
color: Colors.black,
@ -378,8 +378,8 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
),
SizedBox(
child: AppText(
'${widget.myReferralPatientModel.referringDoctorRemarks}',
fontSize: 1.7 * SizeConfig.textMultiplier,
'${widget.myReferralPatientModel!.referringDoctorRemarks}',
fontSize: 1.7 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.normal,
textAlign: TextAlign.start,
color: Colors.black,
@ -434,11 +434,11 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
title: TranslationBase.of(context).replay,
onPressed: () async {
final form = _formKey.currentState;
if (form.validate()) {
if (form!.validate()) {
try {
await widget.model.replay(
await widget.model!.replay(
answerController.text.toString(),
widget.myReferralPatientModel);
widget.myReferralPatientModel!);
DrAppToastMsg.showSuccesToast(
TranslationBase.of(context).replySuccessfully);
} 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 {
final ListDoctorWorkingHoursTable workingHoursTable;
MyScheduleWidget({Key key, this.workingHoursTable});
MyScheduleWidget({Key? key, required this.workingHoursTable});
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
List<WorkingHours> workingHours = Utils.getWorkingHours(
workingHoursTable.workingHours,
workingHoursTable.workingHours!,
);
return Container(
color: HexColor("#EFEFEF"),
@ -30,7 +30,6 @@ class MyScheduleWidget extends StatelessWidget {
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 10,
@ -40,9 +39,10 @@ class MyScheduleWidget extends StatelessWidget {
child: AppText(
projectViewModel.isArabic
? AppDateUtils.getWeekDayArabic(
workingHoursTable.date.weekday)
: AppDateUtils.getWeekDay(workingHoursTable.date.weekday),
fontSize: MediaQuery.of(context).size.width*0.032,
workingHoursTable.date!.weekday)
: AppDateUtils.getWeekDay(
workingHoursTable.date!.weekday),
fontSize: MediaQuery.of(context).size.width * 0.032,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
letterSpacing: -0.52,
@ -52,8 +52,8 @@ class MyScheduleWidget extends StatelessWidget {
Padding(
padding: const EdgeInsets.only(left: 19),
child: AppText(
' ${workingHoursTable.date.day} ${(AppDateUtils.getMonth(workingHoursTable.date.month).toString().substring(0, 3))}',
fontSize: MediaQuery.of(context).size.width*0.051,
' ${workingHoursTable.date!.day} ${(AppDateUtils.getMonth(workingHoursTable.date!.month).toString().substring(0, 3))}',
fontSize: MediaQuery.of(context).size.width * 0.051,
fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
letterSpacing: -0.72,
@ -64,24 +64,24 @@ class MyScheduleWidget extends StatelessWidget {
),
),
Container(
width: MediaQuery.of(context).size.width * 0.70,
width: MediaQuery.of(context).size.width * 0.70,
// height: MediaQuery.of(context).size.height * 0.16,
child: CardWithBgWidget(
padding: 12,
marginLeft: 8,
marginSymmetric: 7,
hasBorder: false,
bgColor: AppDateUtils.isToday(workingHoursTable.date)
bgColor: AppDateUtils.isToday(workingHoursTable.date!)
? AppGlobal.appGreenColor
: Colors.transparent,
widget: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
if (AppDateUtils.isToday(workingHoursTable.date))
if (AppDateUtils.isToday(workingHoursTable.date!))
AppText(
"Today",
fontSize: 1.5 * SizeConfig.textMultiplier,
fontSize: 1.5 * SizeConfig.textMultiplier!,
fontFamily: 'Poppins',
color: AppGlobal.appGreenColor,
),
@ -99,22 +99,25 @@ class MyScheduleWidget extends StatelessWidget {
),
if (workingHoursTable.clinicName != null)
Container(
width: MediaQuery.of(context).size.width * 0.65,
width:
MediaQuery.of(context).size.width * 0.65,
child: AppText(
Utils
.convertToTitleCase(
workingHoursTable.clinicName ?? ""),
fontSize: MediaQuery.of(context).size.width*0.04,
fontWeight: FontWeight.w700,
Utils.convertToTitleCase(
workingHoursTable.clinicName ?? ""),
fontSize:
MediaQuery.of(context).size.width *
0.04,
fontWeight: FontWeight.w700,
letterSpacing: -0.64,
color: AppGlobal.scheduleTextColor,
),
),
// AppText(
// AppText(
Container(
child: AppText(
'${work.from} - ${work.to}',
fontSize: MediaQuery.of(context).size.width*0.03,
fontSize:
MediaQuery.of(context).size.width * 0.03,
fontWeight: FontWeight.w300,
letterSpacing: -0.4,
),
@ -125,7 +128,8 @@ class MyScheduleWidget extends StatelessWidget {
if (workingHoursTable.projectName != null)
AppText(
workingHoursTable.projectName ?? "",
fontSize: MediaQuery.of(context).size.width*0.04,
fontSize:
MediaQuery.of(context).size.width * 0.04,
fontWeight: FontWeight.w700,
letterSpacing: -0.64,
color: AppGlobal.scheduleTextColor,

@ -22,12 +22,14 @@ class MedicineItemWidget extends StatefulWidget {
final String price;
MedicineItemWidget(
{@required this.label,
{required this.label,
this.backgroundColor = Colors.white,
this.showBorder = true,
this.borderColor = Colors.white,
this.url,
this.showArrow = true, this.showPrice = false, this.price});
this.url = '',
this.showArrow = true,
this.showPrice = false,
this.price = "0"});
@override
_MedicineItemWidgetState createState() => _MedicineItemWidgetState();
@ -55,7 +57,7 @@ class _MedicineItemWidgetState extends State<MedicineItemWidget> {
height: 25,
width: 30,
errorBuilder: (BuildContext context, Object exception,
StackTrace stackTrace) {
StackTrace? stackTrace) {
return Text('');
},
)),
@ -66,7 +68,7 @@ class _MedicineItemWidgetState extends State<MedicineItemWidget> {
child: Align(
alignment: Alignment.centerLeft,
child: Column(
crossAxisAlignment:CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
Utils.convertToTitleCase(widget.label ?? ''),
@ -76,23 +78,22 @@ class _MedicineItemWidgetState extends State<MedicineItemWidget> {
fontWeight: FontWeight.w600,
letterSpacing: -0.33,
),
if(widget.showPrice)
AppText(
Utils.convertToTitleCase(widget.price ?? ''),
fontHeight: 1.4,
color: AppGlobal.appTextColor,
textAlign: TextAlign.start,
fontWeight: FontWeight.w600,
letterSpacing: -0.33,
),
if (widget.showPrice)
AppText(
Utils.convertToTitleCase(widget.price ?? ''),
fontHeight: 1.4,
color: AppGlobal.appTextColor,
textAlign: TextAlign.start,
fontWeight: FontWeight.w600,
letterSpacing: -0.33,
),
],
),
),
),
),
),
if(widget.showArrow)
Icon(EvaIcons.arrowForward)
if (widget.showArrow) Icon(EvaIcons.arrowForward)
],
),
),

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

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

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

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

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

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

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

@ -1,11 +1,12 @@
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
class AddNewOrder extends StatelessWidget {
const AddNewOrder({
Key key,
this.onTap,
this.label,
Key? key,
required this.onTap,
required this.label,
}) : super(key: key);
final Function onTap;
@ -14,7 +15,7 @@ class AddNewOrder extends StatelessWidget {
@override
Widget build(BuildContext context) {
return InkWell(
onTap: onTap,
onTap: onTap(),
child: Container(
width: double.maxFinite,
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 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
Widget build(BuildContext context) {

@ -14,7 +14,7 @@ import 'package:url_launcher/url_launcher.dart';
import '../large_avatar.dart';
import 'header_row.dart';
class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
class PatientProfileAppBar extends StatelessWidget {
final PatiantInformtion patient;
final double height;
final bool isInpatient;
@ -23,7 +23,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
final String doctorName;
final String branch;
final DateTime appointmentDate;
final DateTime? appointmentDate;
final String profileUrl;
final String invoiceNO;
final String orderNo;
@ -34,27 +34,27 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
final String clinic;
final bool isAppointmentHeader;
final bool isFromLabResult;
final VoidCallback onPressed;
final VoidCallback? onPressed;
PatientProfileAppBar(this.patient,
{this.height = 0.0,
this.isInpatient = false,
this.isDischargedPatient = false,
this.isFromLiveCare = false,
this.doctorName,
this.branch,
this.doctorName = '',
this.branch = '',
this.appointmentDate,
this.profileUrl,
this.invoiceNO,
this.orderNo,
this.profileUrl = '',
this.invoiceNO = '',
this.orderNo = '',
this.isPrescriptions = false,
this.clinic,
this.clinic = '',
this.isMedicalFile = false,
this.episode,
this.visitDate,
this.episode = '',
this.visitDate = '',
this.isAppointmentHeader = false,
this.isFromLabResult = false,
this.onPressed});
this.onPressed});
@override
Widget build(BuildContext context) {
@ -62,9 +62,9 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
int gender = 1;
if (patient.patientDetails != null) {
gender = patient.patientDetails.gender;
gender = patient.patientDetails!.gender!;
} else {
gender = patient.gender;
gender = patient.gender!;
}
return Container(
@ -89,7 +89,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
icon: Icon(Icons.arrow_back_ios),
color: Color(0xFF2B353E), //Colors.black,
onPressed: () {
if (onPressed != null) onPressed();
if (onPressed != null) onPressed!();
Navigator.pop(context);
},
),
@ -100,8 +100,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
" " +
Utils.capitalize(patient.lastName))
: Utils.capitalize(patient.fullName ??
patient.patientDetails.fullName),
fontSize: SizeConfig.textMultiplier * 1.8,
patient.patientDetails!.fullName),
fontSize: SizeConfig.textMultiplier! * 1.8,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
color: Color(0xFF2B353E),
@ -121,7 +121,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
margin: EdgeInsets.symmetric(horizontal: 4),
child: InkWell(
onTap: () {
launch("tel://" + patient.mobileNumber);
launch("tel://" + patient.mobileNumber!);
},
child: Icon(
Icons.phone,
@ -170,7 +170,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
)
: AppText(
TranslationBase.of(context).notArrived,
color: Colors.red[800],
color: Colors.red[800]!,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: SizeConfig
@ -180,7 +180,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
patient.startTime != null
? AppText(
patient.startTime != null
? patient.startTime
? patient.startTime!
: '',
fontWeight: FontWeight.w700,
fontSize: SizeConfig
@ -235,12 +235,12 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
? ClipRRect(
borderRadius: BorderRadius.circular(20.0),
child: Image.network(
patient.nationalityFlagURL,
patient.nationalityFlagURL!,
height: 25,
width: 30,
errorBuilder: (BuildContext context,
Object exception,
StackTrace stackTrace) {
StackTrace? stackTrace) {
return Text('No Image');
},
))
@ -253,31 +253,31 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
HeaderRow(
label: TranslationBase.of(context).age + " : ",
value:
"${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}",
"${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails!.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}",
),
if (patient.appointmentDate != null &&
patient.appointmentDate.isNotEmpty &&
patient.appointmentDate!.isNotEmpty &&
!isFromLabResult)
HeaderRow(
label:
TranslationBase.of(context).appointmentDate + " : ",
value: AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils.convertStringToDate(
patient.appointmentDate)),
patient.appointmentDate!)),
),
if (isFromLabResult)
HeaderRow(
label: "Result Date: ",
value:
'${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}',
'${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate!, isArabic: projectViewModel.isArabic)}',
),
// if(isInpatient)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (patient.admissionDate != null &&
patient.admissionDate.isNotEmpty)
patient.admissionDate!.isNotEmpty)
HeaderRow(
label: patient.admissionDate == null
? ""
@ -292,8 +292,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
label: "${TranslationBase.of(context).numOfDays}: ",
value: isDischargedPatient &&
patient.dischargeDate != null
? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}"
: "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}",
? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate!)).inDays + 1}"
: "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate!)).inDays + 1}",
)
],
),
@ -316,8 +316,9 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
shape: BoxShape.rectangle,
border: Border(
bottom:
BorderSide(color: Colors.grey[400], width: 2.5),
left: 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),
)),
),
Expanded(
@ -395,7 +396,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
? 'Result Date:'
: 'Prescriptions Date ',
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';
class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
with PreferredSizeWidget {
class PatientProfileHeaderNewDesignAppBar extends StatelessWidget {
final PatiantInformtion patient;
final String patientType;
final String arrivalType;
@ -25,7 +24,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
final bool isDischargedPatient;
final bool isFromLiveCare;
final Stream<String> videoCallDurationStream;
final Stream<String>? videoCallDurationStream;
PatientProfileHeaderNewDesignAppBar(
this.patient, this.patientType, this.arrivalType,
@ -39,9 +38,9 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
Widget build(BuildContext context) {
int gender = 1;
if (patient.patientDetails != null) {
gender = patient.patientDetails.gender;
gender = patient.patientDetails!.gender!;
} else {
gender = patient.gender;
gender = patient.gender!;
}
return Container(
padding: EdgeInsets.only(
@ -77,8 +76,8 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
" " +
Utils.capitalize(patient.lastName))
: Utils.capitalize(patient.fullName ??
patient.patientDetails.fullName),
fontSize: SizeConfig.textMultiplier * 1.8,
patient.patientDetails!.fullName),
fontSize: SizeConfig.textMultiplier! * 1.8,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
),
@ -100,7 +99,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
eventCategory: "Patient Profile Header",
eventAction: "Call Patient",
);
launch("tel://" + patient.mobileNumber);
launch("tel://" + patient.mobileNumber!);
},
child: Icon(
Icons.phone,
@ -122,7 +121,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
padding:
EdgeInsets.symmetric(vertical: 2, horizontal: 10),
child: Text(
snapshot.data,
snapshot.data!,
style: TextStyle(color: Colors.white),
),
),
@ -170,7 +169,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
)
: AppText(
TranslationBase.of(context).notArrived,
color: Colors.red[800],
color: Colors.red[800]!,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 12,
@ -178,7 +177,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
arrivalType == '1' || patient.arrivedOn == null
? AppText(
patient.startTime != null
? patient.startTime
? patient.startTime!
: '',
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
@ -187,7 +186,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
patient.arrivedOn != null
? AppDateUtils
.convertStringToDateFormat(
patient.arrivedOn,
patient.arrivedOn!,
'MM-dd-yyyy HH:mm')
: '',
fontFamily: 'Poppins',
@ -219,7 +218,8 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
child: AppText(
patient.startTime ?? "",
color: Colors.white,
fontSize: 1.5 * SizeConfig.textMultiplier,
fontSize:
1.5 * SizeConfig.textMultiplier!,
textAlign: TextAlign.center,
fontWeight: FontWeight.bold,
),
@ -232,7 +232,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
child: AppText(
convertDateFormat2(
patient.appointmentDate ?? ''),
fontSize: 1.5 * SizeConfig.textMultiplier,
fontSize: 1.5 * SizeConfig.textMultiplier!,
fontWeight: FontWeight.bold,
),
),
@ -274,12 +274,12 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
? ClipRRect(
borderRadius: BorderRadius.circular(20.0),
child: Image.network(
patient.nationalityFlagURL,
patient.nationalityFlagURL!,
height: 25,
width: 30,
errorBuilder: (BuildContext context,
Object exception,
StackTrace stackTrace) {
StackTrace? stackTrace) {
return Text('');
},
))
@ -292,7 +292,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
HeaderRow(
label: TranslationBase.of(context).age + " : ",
value:
"${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}",
"${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails!.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}",
),
if (isInpatient)
Column(
@ -312,8 +312,8 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
"${TranslationBase.of(context).numOfDays}: ",
value: isDischargedPatient &&
patient.dischargeDate != null
? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}"
: "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}",
? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate!)).inDays + 1}"
: "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate!)).inDays + 1}",
)
],
)
@ -328,7 +328,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
}
convertDateFormat2(String str) {
String newDate;
String newDate = '';
const start = "/Date(";
if (str.isNotEmpty) {
const end = "+0300)";

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

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

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

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

@ -1,3 +1,4 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
@ -15,7 +16,7 @@ class ProfileGeneralInfoContentWidget extends StatelessWidget {
String title;
String info;
ProfileGeneralInfoContentWidget({this.title, this.info});
ProfileGeneralInfoContentWidget({required this.title, required this.info});
@override
Widget build(BuildContext context) {
@ -29,17 +30,22 @@ class ProfileGeneralInfoContentWidget extends StatelessWidget {
),
AppText(
title,
fontSize: SizeConfig.textMultiplier * 3,
fontSize: SizeConfig.textMultiplier! * 3,
fontWeight: FontWeight.w700,
color: HexColor('#58434F'),
),
AppText(
info,
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';
class ProfileMedicalInfoWidget extends StatelessWidget {
final String from;
final String to;
final PatiantInformtion patient;
final String patientType;
final String arrivalType;
final String? from;
final String? to;
final PatiantInformtion? patient;
final String? patientType;
final String? arrivalType;
final bool isInpatient;
ProfileMedicalInfoWidget(
{Key key,
{Key? key,
this.patient,
this.patientType,
this.arrivalType,
this.from,
this.to,
this.isInpatient});
this.isInpatient = false});
@override
Widget build(BuildContext context) {
@ -83,7 +83,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
isInPatient: isInpatient,
isInPatient: isInpatient!,
route: RADIOLOGY_PATIENT,
nameLine1: TranslationBase.of(context).radiology,
nameLine2: TranslationBase.of(context).service,
@ -136,36 +136,36 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
nameLine1: TranslationBase.of(context).patientSick,
nameLine2: TranslationBase.of(context).leave,
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(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PATIENT_UCAF_REQUEST,
isDisable: patient.patientStatusType != 43 ? true : false,
isDisable: patient!.patientStatusType != 43 ? true : false,
nameLine1: TranslationBase.of(context).patient,
nameLine2: TranslationBase.of(context).ucaf,
icon: 'patient/ucaf.png'),
if (patient.appointmentNo != null && patient.appointmentNo != 0)
if (patient!.appointmentNo != null && patient!.appointmentNo != 0)
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: REFER_PATIENT_TO_DOCTOR,
isDisable: patient.patientStatusType != 43 ? true : false,
isDisable: patient!.patientStatusType != 43 ? true : false,
nameLine1: TranslationBase.of(context).referral,
nameLine2: TranslationBase.of(context).patient,
icon: 'patient/refer_patient.png'),
if (patient.appointmentNo != null && patient.appointmentNo != 0)
if (patient!.appointmentNo != null && patient!.appointmentNo != 0)
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PATIENT_ADMISSION_REQUEST,
isDisable: patient.patientStatusType != 43 ? true : false,
isDisable: patient!.patientStatusType != 43 ? true : false,
nameLine1: TranslationBase.of(context).admission,
nameLine2: TranslationBase.of(context).request,
icon: 'patient/admission_req.png'),

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

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

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

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

@ -1,12 +1,13 @@
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:expandable/expandable.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
class AppExpandableNotifier extends StatelessWidget {
final Widget headerWid;
final Widget bodyWid;
AppExpandableNotifier({this.headerWid, this.bodyWid});
AppExpandableNotifier({required this.headerWid, required this.bodyWid});
@override
Widget build(BuildContext context) {
@ -55,4 +56,9 @@ class AppExpandableNotifier extends StatelessWidget {
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';
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 Color containerColor;
final String? title;
final Color? containerColor;
@override
_AppLoaderWidgetState createState() => new _AppLoaderWidgetState();

@ -12,16 +12,16 @@ import 'network_base_view.dart';
class AppScaffold extends StatelessWidget {
final String appBarTitle;
final Widget body;
final Widget? body;
final bool isLoading;
final bool isShowAppBar;
final BaseViewModel baseViewModel;
final Widget bottomSheet;
final Color backgroundColor;
final Widget appBar;
final Widget drawer;
final Widget bottomNavigationBar;
final String subtitle;
final BaseViewModel? baseViewModel;
final Widget? bottomSheet;
final Color? backgroundColor;
final Widget? appBar;
final Widget? drawer;
final Widget? bottomNavigationBar;
final String? subtitle;
final bool isHomeIcon;
final bool extendBody;
@ -49,62 +49,60 @@ class AppScaffold extends StatelessWidget {
FocusScope.of(context).requestFocus(new FocusNode());
},
child: Scaffold(
backgroundColor: backgroundColor ?? Theme.of(context).scaffoldBackgroundColor
,
backgroundColor:
backgroundColor ?? Theme.of(context).scaffoldBackgroundColor,
drawer: drawer,
extendBody: extendBody,
bottomNavigationBar: bottomNavigationBar,
appBar: isShowAppBar
? appBar ??
AppBar(
elevation: 0,
backgroundColor: Colors.white,
//HexColor('#515B5D'),
textTheme: TextTheme(
headline6: TextStyle(
color: Colors.black87,
fontSize: 16.8,
)),
title: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(appBarTitle.toUpperCase()),
if (subtitle != null)
Text(
subtitle,
style: TextStyle(fontSize: 12, color: Colors.red),
),
],
),
leading: Builder(builder: (BuildContext context) {
return IconButton(
icon: Icon(Icons.arrow_back_ios),
color: Colors.black, //Colors.black,
onPressed: () => Navigator.pop(context),
);
}),
centerTitle: true,
actions: <Widget>[
isHomeIcon
? IconButton(
icon: Icon(DoctorApp.home_icon_active),
color: Colors.black, //Colors.black,
onPressed: () => Navigator.pushNamedAndRemoveUntil(
context, HOME, (r) => false),
)
: SizedBox()
appBar: isShowAppBar && appBar != null
? appBar as PreferredSizeWidget
: AppBar(
elevation: 0,
backgroundColor: Colors.white,
//HexColor('#515B5D'),
titleTextStyle: TextStyle(
color: Colors.black87,
fontSize: 16.8,
),
title: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(appBarTitle.toUpperCase()),
if (subtitle != null)
Text(
subtitle!,
style: TextStyle(fontSize: 12, color: Colors.red),
),
],
)
: null,
),
leading: Builder(builder: (BuildContext context) {
return IconButton(
icon: Icon(Icons.arrow_back_ios),
color: Colors.black, //Colors.black,
onPressed: () => Navigator.pop(context),
);
}),
centerTitle: true,
actions: <Widget>[
isHomeIcon
? IconButton(
icon: Icon(DoctorApp.home_icon_active),
color: Colors.black, //Colors.black,
onPressed: () => Navigator.pushNamedAndRemoveUntil(
context, HOME, (r) => false),
)
: SizedBox()
],
),
bottomSheet: bottomSheet,
body: projectProvider.isInternetConnection
? baseViewModel != null
? NetworkBaseView(
baseViewModel: baseViewModel,
child: body,
baseViewModel: baseViewModel!,
child: body!,
)
: Stack(
children: <Widget>[body, buildAppLoaderWidget(isLoading)])
children: <Widget>[body!, buildAppLoaderWidget(isLoading)])
: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -8,7 +8,7 @@ import 'app-textfield-custom.dart';
class AppTextFieldCustomSearch extends StatelessWidget {
const AppTextFieldCustomSearch({
Key key,
Key? key,
this.onChangeFun,
this.positionedChild,
this.marginTop,
@ -18,34 +18,34 @@ class AppTextFieldCustomSearch extends StatelessWidget {
this.inputFormatters,
this.searchController,
this.onFieldSubmitted,
this.hintText, this.height,
this.hintText,
this.height,
});
final TextEditingController searchController;
final TextEditingController? searchController;
final Function onChangeFun;
final Function onFieldSubmitted;
final Function? onChangeFun;
final Function? onFieldSubmitted;
final Widget positionedChild;
final IconButton suffixIcon;
final double marginTop;
final String validationError;
final String hintText;
final TextInputType inputType;
final List<TextInputFormatter> inputFormatters;
final double height;
final Widget? positionedChild;
final IconButton? suffixIcon;
final double? marginTop;
final String? validationError;
final String? hintText;
final TextInputType? inputType;
final List<TextInputFormatter>? inputFormatters;
final double? height;
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Container(
margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: marginTop),
margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: marginTop!),
child: Stack(
children: [
AppTextFieldCustom(
height: height??0,
height: height ?? 0,
hintText:
hintText ?? TranslationBase.of(context).searchPatientName,
isTextFieldHasSuffix: true,
@ -60,13 +60,13 @@ class AppTextFieldCustomSearch extends StatelessWidget {
onPressed: () {},
),
controller: searchController,
onChanged: onChangeFun,
onChanged: onChangeFun!(),
onFieldSubmitted: onFieldSubmitted,
validationError: validationError),
if (positionedChild != null)
projectViewModel.isArabic
? Positioned(left: 35, top: 5, child: positionedChild)
: Positioned(right: 35, top: 5, child: positionedChild)
? Positioned(left: 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> {
AppTextFormField(
{FormFieldSetter<String> onSaved,
String inputFormatter,
FormFieldValidator<String> validator,
ValueChanged<String> onChanged,
GestureTapCallback onTap,
{FormFieldSetter<String>? onSaved,
String? inputFormatter,
FormFieldValidator<String>? validator,
ValueChanged<String>? onChanged,
GestureTapCallback? onTap,
bool obscureText = false,
TextEditingController controller,
TextEditingController? controller,
bool autovalidate = true,
TextInputType textInputType,
String hintText,
FocusNode focusNode,
TextInputType? textInputType,
String? hintText,
FocusNode? focusNode,
TextInputAction textInputAction = TextInputAction.done,
ValueChanged<String> onFieldSubmitted,
IconButton prefix,
String labelText,
IconData suffixIcon,
ValueChanged<String>? onFieldSubmitted,
IconButton? prefix,
String? labelText,
IconData? suffixIcon,
bool readOnly = false,
borderColor})
: super(
@ -53,13 +53,13 @@ class AppTextFormField extends FormField<String> {
hintText: hintText,
suffixIcon: prefix,
hintStyle: TextStyle(
fontSize: SizeConfig.textMultiplier * 1.8,
fontSize: SizeConfig.textMultiplier! * 1.8,
),
contentPadding:
EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0),
labelText: labelText,
labelStyle: TextStyle(
fontSize: SizeConfig.textMultiplier * 1.7,
fontSize: SizeConfig.textMultiplier! * 1.7,
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(6)),
@ -83,7 +83,7 @@ class AppTextFormField extends FormField<String> {
),
state.hasError
? Text(
state.errorText,
state.errorText!,
style: TextStyle(color: Colors.red),
)
: Container()

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

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

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

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

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

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

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

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

Loading…
Cancel
Save