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

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

@ -33,14 +33,14 @@ class _MedicalProfilePageState extends State<MedicalProfilePageNew> {
ProjectViewModel? projectViewModel;
List<HospitalsModel> projectsList = [];
HospitalsModel _selectedHospital;
HospitalsModel? _selectedHospital;
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
var appoCountProvider = Provider.of<ToDoCountProviderModel>(context);
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>(
onModelReady: (model) => model.getAppointmentHistory(isForTimeLine: true),
builder: (_, model, widget1) => AppScaffold(
@ -113,7 +113,7 @@ class _MedicalProfilePageState extends State<MedicalProfilePageNew> {
openWeCareProjectSelection() {
int _selectedHospitalIndex = -1;
int languageID = projectViewModel.isArabic ? 1 : 2;
int languageID = projectViewModel!.isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context);
ClinicListService service = new ClinicListService();
List<HospitalsModel> projectsListLocal = [];
@ -127,7 +127,7 @@ class _MedicalProfilePageState extends State<MedicalProfilePageNew> {
});
GifLoaderDialogUtils.hideDialog(context);
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(
context: context,
@ -139,7 +139,7 @@ class _MedicalProfilePageState extends State<MedicalProfilePageNew> {
onValueSelected: (index) {
_selectedHospitalIndex = index;
_selectedHospital = projectsList[index];
openWeCareURL(_selectedHospital.iD);
openWeCareURL(_selectedHospital!.iD);
// 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);
}
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 = [];
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!
? Stack(children: [
Container(
@ -235,12 +235,12 @@ class Utils {
child: MedicalProfileItem(
title: TranslationBase.of(context!).myAppointments,
imagePath: 'appointment_list.svg',
subTitle: TranslationBase.of(context!).myAppointmentsList,
subTitle: TranslationBase.of(context).myAppointmentsList,
hasBadge: true,
isEnable: projectViewModel!.havePrivilege(5)),
),
projectViewModel.isArabic
? !projectViewModel.user!.isFamily
? !projectViewModel.user.isFamily
? Positioned(
left: 8,
top: 4,
@ -384,7 +384,7 @@ class Utils {
));
medical.add(InkWell(
onTap: () => onWeCareClick(),
onTap: () => onWeCareClick!(),
child: MedicalProfileItem(
title: TranslationBase.of(context).wecare,
imagePath: 'assets/images/new-design/virtual_tour_icon.png',

@ -17,7 +17,7 @@ class RadioSelectionDialog extends StatefulWidget {
final bool? isShowSearch;
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
State createState() => new RadioSelectionDialogState();
@ -165,7 +165,7 @@ class RadioSelectionDialogState extends State<RadioSelectionDialog> {
children: [
Expanded(
child: DefaultButton(
widget.buttonText.isNotEmpty ? widget.buttonText : TranslationBase.of(context).save,
widget.buttonText!.isNotEmpty ? widget.buttonText! : TranslationBase.of(context).save,
() {
Navigator.pop(context);
widget.onValueSelected!(selectedIndex);

@ -156,8 +156,8 @@ class _AppDrawerState extends State<AppDrawer> {
),
),
mHeight(20.0),
(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)
(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)
: Container(),
],
),

Loading…
Cancel
Save