Null fixes after merge from 3.13

dev_v3.13.6_BLE_Faiz
Aamir.Muhammad 5 months ago
parent 8441a0ef00
commit 29c2fd067e

@ -1,7 +1,7 @@
class GetDentalInstructionsResponseModel { class GetDentalInstructionsResponseModel {
List<Data> data; List<Data>? data;
dynamic message; dynamic message;
int status; int? status;
GetDentalInstructionsResponseModel({this.data, this.message, this.status}); GetDentalInstructionsResponseModel({this.data, this.message, this.status});
@ -9,7 +9,7 @@ class GetDentalInstructionsResponseModel {
if (json['Data'] != null) { if (json['Data'] != null) {
data = <Data>[]; data = <Data>[];
json['Data'].forEach((v) { json['Data'].forEach((v) {
data.add(new Data.fromJson(v)); data!.add(new Data.fromJson(v));
}); });
} }
message = json['message']; message = json['message'];
@ -19,7 +19,7 @@ class GetDentalInstructionsResponseModel {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.data != null) { if (this.data != null) {
data['Data'] = this.data.map((v) => v.toJson()).toList(); data['Data'] = this.data!.map((v) => v.toJson()).toList();
} }
data['message'] = this.message; data['message'] = this.message;
data['status'] = this.status; data['status'] = this.status;
@ -28,15 +28,15 @@ class GetDentalInstructionsResponseModel {
} }
class Data { class Data {
String createdOn; String? createdOn;
String mobileNo; String? mobileNo;
int patientId; int? patientId;
int procedureId; int? procedureId;
int projectId; int? projectId;
String setupId; String? setupId;
String smsContent; String? smsContent;
int sourceReferenceNo; int? sourceReferenceNo;
String sourceType; String? sourceType;
Data( Data(
{this.createdOn, {this.createdOn,

@ -16,7 +16,7 @@ class DentalInstructionsPage extends StatefulWidget {
} }
class _DentalInstructionsPageState extends State<DentalInstructionsPage> { class _DentalInstructionsPageState extends State<DentalInstructionsPage> {
GetDentalInstructionsResponseModel getDentalInstructionsResponseModel; GetDentalInstructionsResponseModel? getDentalInstructionsResponseModel;
@override @override
void initState() { void initState() {
@ -41,15 +41,15 @@ class _DentalInstructionsPageState extends State<DentalInstructionsPage> {
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
child: Column( child: Column(
children: [ children: [
getDentalInstructionsResponseModel != null && getDentalInstructionsResponseModel.data.isNotEmpty getDentalInstructionsResponseModel != null && getDentalInstructionsResponseModel!.data!.isNotEmpty
? ListView.builder( ? ListView.builder(
itemCount: getDentalInstructionsResponseModel.data.length, itemCount: getDentalInstructionsResponseModel!.data!.length,
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return Padding( return Padding(
padding: EdgeInsets.only(top: 16.0, bottom: 16.0), padding: EdgeInsets.only(top: 16.0, bottom: 16.0),
child: Text( child: Text(
getDentalInstructionsResponseModel.data[index].smsContent, getDentalInstructionsResponseModel!.data![index].smsContent!,
style: TextStyle( style: TextStyle(
fontSize: 14.0, fontSize: 14.0,
letterSpacing: -0.56, letterSpacing: -0.56,

@ -33,14 +33,14 @@ class _MedicalProfilePageState extends State<MedicalProfilePageNew> {
ProjectViewModel? projectViewModel; ProjectViewModel? projectViewModel;
List<HospitalsModel> projectsList = []; List<HospitalsModel> projectsList = [];
HospitalsModel _selectedHospital; HospitalsModel? _selectedHospital;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
var appoCountProvider = Provider.of<ToDoCountProviderModel>(context); var appoCountProvider = Provider.of<ToDoCountProviderModel>(context);
List<Widget> myMedicalList = List<Widget> myMedicalList =
Utils.myMedicalList(projectViewModel: projectViewModel, context: context, count: appoCountProvider.count, isLogin: projectViewModel.isLogin, onWeCareClick: openWeCareProjectSelection); Utils.myMedicalList(projectViewModel: projectViewModel!, context: context, count: appoCountProvider.count, isLogin: projectViewModel!.isLogin, onWeCareClick: openWeCareProjectSelection);
return BaseView<MedicalViewModel>( return BaseView<MedicalViewModel>(
onModelReady: (model) => model.getAppointmentHistory(isForTimeLine: true), onModelReady: (model) => model.getAppointmentHistory(isForTimeLine: true),
builder: (_, model, widget1) => AppScaffold( builder: (_, model, widget1) => AppScaffold(
@ -113,7 +113,7 @@ class _MedicalProfilePageState extends State<MedicalProfilePageNew> {
openWeCareProjectSelection() { openWeCareProjectSelection() {
int _selectedHospitalIndex = -1; int _selectedHospitalIndex = -1;
int languageID = projectViewModel.isArabic ? 1 : 2; int languageID = projectViewModel!.isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
List<HospitalsModel> projectsListLocal = []; List<HospitalsModel> projectsListLocal = [];
@ -127,7 +127,7 @@ class _MedicalProfilePageState extends State<MedicalProfilePageNew> {
}); });
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
List<RadioSelectionDialogModel> list = [ List<RadioSelectionDialogModel> list = [
for (int i = 0; i < projectsList.length; i++) RadioSelectionDialogModel(projectsList[i].name + ' ${projectsList[i].distanceInKilometers} ' + TranslationBase.of(context).km, i), for (int i = 0; i < projectsList.length; i++) RadioSelectionDialogModel(projectsList[i].name! + ' ${projectsList[i].distanceInKilometers} ' + TranslationBase.of(context).km, i),
]; ];
showDialog( showDialog(
context: context, context: context,
@ -139,7 +139,7 @@ class _MedicalProfilePageState extends State<MedicalProfilePageNew> {
onValueSelected: (index) { onValueSelected: (index) {
_selectedHospitalIndex = index; _selectedHospitalIndex = index;
_selectedHospital = projectsList[index]; _selectedHospital = projectsList[index];
openWeCareURL(_selectedHospital.iD); openWeCareURL(_selectedHospital!.iD);
// setState(() {}); // setState(() {});
}, },
), ),

@ -222,11 +222,11 @@ class Utils {
return RegExp(r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+").hasMatch(email); return RegExp(r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+").hasMatch(email);
} }
static List<Widget> myMedicalList({ProjectViewModel projectViewModel, BuildContext context, bool isLogin, count, Function onWeCareClick}) { static List<Widget> myMedicalList({ProjectViewModel? projectViewModel, BuildContext? context, bool? isLogin, count, Function? onWeCareClick}) {
List<Widget> medical = []; List<Widget> medical = [];
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel!.havePrivilege(5) ? Navigator.push(context!, FadePage(page: MyAppointments())) : null, onTap: () => projectViewModel.havePrivilege(5) ? Navigator.push(context, FadePage(page: MyAppointments())) : null,
child: isLogin! child: isLogin!
? Stack(children: [ ? Stack(children: [
Container( Container(
@ -235,12 +235,12 @@ class Utils {
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context!).myAppointments, title: TranslationBase.of(context!).myAppointments,
imagePath: 'appointment_list.svg', imagePath: 'appointment_list.svg',
subTitle: TranslationBase.of(context!).myAppointmentsList, subTitle: TranslationBase.of(context).myAppointmentsList,
hasBadge: true, hasBadge: true,
isEnable: projectViewModel!.havePrivilege(5)), isEnable: projectViewModel!.havePrivilege(5)),
), ),
projectViewModel.isArabic projectViewModel.isArabic
? !projectViewModel.user!.isFamily ? !projectViewModel.user.isFamily
? Positioned( ? Positioned(
left: 8, left: 8,
top: 4, top: 4,
@ -384,7 +384,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => onWeCareClick(), onTap: () => onWeCareClick!(),
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).wecare, title: TranslationBase.of(context).wecare,
imagePath: 'assets/images/new-design/virtual_tour_icon.png', imagePath: 'assets/images/new-design/virtual_tour_icon.png',

@ -17,7 +17,7 @@ class RadioSelectionDialog extends StatefulWidget {
final bool? isShowSearch; final bool? isShowSearch;
final String? buttonText; final String? buttonText;
const RadioSelectionDialog({Key key, this.onValueSelected, this.listData, this.selectedIndex, this.isScrollable = false, this.isShowSearch = false, this.buttonText = ""}) : super(key: key); const RadioSelectionDialog({Key? key, this.onValueSelected, this.listData, this.selectedIndex, this.isScrollable = false, this.isShowSearch = false, this.buttonText = ""}) : super(key: key);
@override @override
State createState() => new RadioSelectionDialogState(); State createState() => new RadioSelectionDialogState();
@ -165,7 +165,7 @@ class RadioSelectionDialogState extends State<RadioSelectionDialog> {
children: [ children: [
Expanded( Expanded(
child: DefaultButton( child: DefaultButton(
widget.buttonText.isNotEmpty ? widget.buttonText : TranslationBase.of(context).save, widget.buttonText!.isNotEmpty ? widget.buttonText! : TranslationBase.of(context).save,
() { () {
Navigator.pop(context); Navigator.pop(context);
widget.onValueSelected!(selectedIndex); widget.onValueSelected!(selectedIndex);

@ -156,8 +156,8 @@ class _AppDrawerState extends State<AppDrawer> {
), ),
), ),
mHeight(20.0), mHeight(20.0),
(user != null && projectProvider.isLogin) (user != null && projectProvider!.isLogin)
? Image.network("https://api.qrserver.com/v1/create-qr-code/?size=250x250&data=${user.patientID.toString()}", fit: BoxFit.fill, height: 73.5, width: 73.5) ? Image.network("https://api.qrserver.com/v1/create-qr-code/?size=250x250&data=${user!.patientID.toString()}", fit: BoxFit.fill, height: 73.5, width: 73.5)
: Container(), : Container(),
], ],
), ),

Loading…
Cancel
Save