Null Safety

update_flutter_3.16.0_voipcall
Aamir Muhammad 2 years ago
parent 7e92348cb5
commit 307a11c36f

@ -7,7 +7,6 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_field_custom_serach.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
@ -22,9 +21,9 @@ class InPatientListPage extends StatefulWidget {
final bool isAllClinic;
final bool showBottomSheet;
final String? selectedClinicName;
final Function onChangeValue;
final Function? onChangeValue;
InPatientListPage({this.isMyInPatient = false, this.patientSearchViewModel, this.selectedClinicName, required this.onChangeValue, this.isAllClinic = false, this.showBottomSheet = false});
InPatientListPage({this.isMyInPatient = false, this.patientSearchViewModel, this.selectedClinicName, this.onChangeValue, this.isAllClinic = false, this.showBottomSheet = false});
@override
_InPatientListPageState createState() => _InPatientListPageState();
@ -65,7 +64,7 @@ class _InPatientListPageState extends State<InPatientListPage> {
groupValue: widget.isAllClinic ? 1 : 2,
onChanged: (value) {
setState(() {
widget.onChangeValue(isAllClinic: true, showBottomSheet: false, selectedClinicName: null);
widget.onChangeValue!(isAllClinic: true, showBottomSheet: false, selectedClinicName: null);
widget.patientSearchViewModel!.setDefaultInPatientList();
});
@ -79,7 +78,7 @@ class _InPatientListPageState extends State<InPatientListPage> {
],
),
onTap: () {
widget.onChangeValue(isAllClinic: true, showBottomSheet: false, selectedClinicName: null);
widget.onChangeValue!(isAllClinic: true, showBottomSheet: false, selectedClinicName: null);
widget.patientSearchViewModel!.setDefaultInPatientList();
},
@ -88,7 +87,7 @@ class _InPatientListPageState extends State<InPatientListPage> {
InkWell(
onTap: () {
if (widget.patientSearchViewModel!.InpatientClinicList.length > 0) {
widget.onChangeValue(isAllClinic: false, showBottomSheet: true, selectedClinicName: widget.selectedClinicName);
widget.onChangeValue!(isAllClinic: false, showBottomSheet: true, selectedClinicName: widget.selectedClinicName);
}
},
child: Row(
@ -98,7 +97,7 @@ class _InPatientListPageState extends State<InPatientListPage> {
groupValue: widget.isAllClinic ? 1 : 2,
onChanged: (value) {
if (widget.patientSearchViewModel!.InpatientClinicList.length > 0) {
widget.onChangeValue(isAllClinic: false, showBottomSheet: true, selectedClinicName: widget.selectedClinicName);
widget.onChangeValue!(isAllClinic: false, showBottomSheet: true, selectedClinicName: widget.selectedClinicName);
}
},
activeColor: Colors.red,
@ -135,7 +134,8 @@ class _InPatientListPageState extends State<InPatientListPage> {
isSortDes = !isSortDes;
GifLoaderDialogUtils.hideDialog(context);
},
), onFieldSubmitted: (){},
),
onFieldSubmitted: () {},
),
widget.patientSearchViewModel!.state == ViewState.Idle
? (widget.isMyInPatient && widget.patientSearchViewModel!.myIinPatientList.length > 0)
@ -171,7 +171,7 @@ class _InPatientListPageState extends State<InPatientListPage> {
children: [
InkWell(
onTap: () {
widget.onChangeValue(isAllClinic: widget.isAllClinic, showBottomSheet: false, selectedClinicName: widget.selectedClinicName);
widget.onChangeValue!(isAllClinic: widget.isAllClinic, showBottomSheet: false, selectedClinicName: widget.selectedClinicName);
},
child: Icon(DoctorApp.close_1, size: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5, color: Color(0xFF2B353E)))
],
@ -198,7 +198,7 @@ class _InPatientListPageState extends State<InPatientListPage> {
itemBuilder: (context, index) {
return InkWell(
onTap: () {
widget.onChangeValue(isAllClinic: false, showBottomSheet: false, selectedClinicName: widget.patientSearchViewModel!.InpatientClinicList[index]);
widget.onChangeValue!(isAllClinic: false, showBottomSheet: false, selectedClinicName: widget.patientSearchViewModel!.InpatientClinicList[index]);
widget.patientSearchViewModel!.filterByClinic(clinicName: widget.patientSearchViewModel!.InpatientClinicList[index]);
},
@ -209,7 +209,7 @@ class _InPatientListPageState extends State<InPatientListPage> {
groupValue: widget.selectedClinicName,
onChanged: (value) {
setState(() {
widget.onChangeValue(isAllClinic: false, showBottomSheet: false, selectedClinicName: widget.patientSearchViewModel!.InpatientClinicList[index]);
widget.onChangeValue!(isAllClinic: false, showBottomSheet: false, selectedClinicName: widget.patientSearchViewModel!.InpatientClinicList[index]);
widget.patientSearchViewModel!.filterByClinic(clinicName: value!);
});
},

@ -191,16 +191,41 @@ class _InPatientScreenState extends State<InPatientScreen> with SingleTickerProv
});
}
Widget tabWidget(Size screenSize, bool isActive, String title, {int counter = -1, bool isFirst = false, bool isMiddle = false, bool isLast = false, BuildContext? context}) {
Widget tabWidget(
Size screenSize,
bool isActive,
String title, {
int counter = -1,
bool isFirst = false,
bool isMiddle = false,
bool isLast = false,
BuildContext? context,
}) {
ProjectViewModel projectsProvider = Provider.of<ProjectViewModel>(context!);
return Center(
child: Container(
height: TabUtils.getTabHeight(context!),
decoration: TabUtils.getBoxTabsBoxDecoration(isActive: isActive, isFirst: isFirst, isMiddle: isMiddle, isLast: isLast, projectViewModel: projectsProvider),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [TabUtils.getTabText(title: title, isActive: isActive), if (counter != -1) TabUtils.getTabCounter(isActive: isActive, counter: counter)],
return Container(
color: Colors.yellow,
child: Center(
child: Container(
height: TabUtils.getTabHeight(context),
decoration: TabUtils.getBoxTabsBoxDecoration(
isActive: isActive,
isFirst: isFirst,
isMiddle: isMiddle,
isLast: isLast,
projectViewModel: projectsProvider,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
TabUtils.getTabText(title: title, isActive: isActive),
if (counter != -1)
TabUtils.getTabCounter(
isActive: isActive,
counter: counter,
),
],
),
),
),
);

@ -163,14 +163,15 @@ class _AppTextState extends State<AppText> {
style: widget.style != null
? _getFontStyle()!.copyWith(
fontStyle: widget.italic ? FontStyle.italic : FontStyle.normal,
fontSize: widget.fontSize ?? _getFontSize(),
// fontSize: widget.fontSize ?? _getFontSize(),
fontSize: widget.fontSize != 0.0 ? widget.fontSize : _getFontSize(),
color: widget.color,
fontWeight: widget.fontWeight ?? _getFontWeight(),
height: widget.fontHeight)
: TextStyle(
fontStyle: widget.italic ? FontStyle.italic : null,
color: widget.color != null ? widget.color : Color(0xff2E303A),
fontSize: widget.fontSize ?? _getFontSize(),
color: widget.color != null ? widget.color : Color(0xff7588e7),
fontSize: widget.fontSize != 0.0 ? widget.fontSize : _getFontSize(),
letterSpacing: widget.letterSpacing ?? (widget.variant == "overline" ? 1.5 : null),
fontWeight: widget.fontWeight ?? _getFontWeight(),
fontFamily: widget.fontFamily ?? 'Poppins',
@ -189,14 +190,14 @@ class _AppTextState extends State<AppText> {
? _getFontStyle()!.copyWith(
fontStyle: widget.italic ? FontStyle.italic : FontStyle.normal,
color: widget.color,
fontSize: widget.fontSize ?? _getFontSize(),
fontSize: widget.fontSize != 0.0 ? widget.fontSize : _getFontSize(),
fontWeight: widget.fontWeight ?? _getFontWeight(),
height: widget.fontHeight,
)
: TextStyle(
fontStyle: widget.italic ? FontStyle.italic : FontStyle.normal,
color: widget.color != null ? widget.color : Colors.black,
fontSize: widget.fontSize ?? _getFontSize(),
fontSize: widget.fontSize != 0.0 ? widget.fontSize : _getFontSize(),
letterSpacing: widget.letterSpacing ?? (widget.variant == "overline" ? 1.5 : null),
fontWeight: widget.fontWeight ?? _getFontWeight(),
fontFamily: widget.fontFamily ?? 'Poppins',
@ -231,7 +232,7 @@ class _AppTextState extends State<AppText> {
case "button":
return Theme.of(context).textTheme.button;
default:
return TextStyle();
return TextStyle(fontSize: 5);
}
}

Loading…
Cancel
Save