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/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.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_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:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
@ -22,9 +21,9 @@ class InPatientListPage extends StatefulWidget {
final bool isAllClinic; final bool isAllClinic;
final bool showBottomSheet; final bool showBottomSheet;
final String? selectedClinicName; 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 @override
_InPatientListPageState createState() => _InPatientListPageState(); _InPatientListPageState createState() => _InPatientListPageState();
@ -65,7 +64,7 @@ class _InPatientListPageState extends State<InPatientListPage> {
groupValue: widget.isAllClinic ? 1 : 2, groupValue: widget.isAllClinic ? 1 : 2,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
widget.onChangeValue(isAllClinic: true, showBottomSheet: false, selectedClinicName: null); widget.onChangeValue!(isAllClinic: true, showBottomSheet: false, selectedClinicName: null);
widget.patientSearchViewModel!.setDefaultInPatientList(); widget.patientSearchViewModel!.setDefaultInPatientList();
}); });
@ -79,7 +78,7 @@ class _InPatientListPageState extends State<InPatientListPage> {
], ],
), ),
onTap: () { onTap: () {
widget.onChangeValue(isAllClinic: true, showBottomSheet: false, selectedClinicName: null); widget.onChangeValue!(isAllClinic: true, showBottomSheet: false, selectedClinicName: null);
widget.patientSearchViewModel!.setDefaultInPatientList(); widget.patientSearchViewModel!.setDefaultInPatientList();
}, },
@ -88,7 +87,7 @@ class _InPatientListPageState extends State<InPatientListPage> {
InkWell( InkWell(
onTap: () { onTap: () {
if (widget.patientSearchViewModel!.InpatientClinicList.length > 0) { 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( child: Row(
@ -98,7 +97,7 @@ class _InPatientListPageState extends State<InPatientListPage> {
groupValue: widget.isAllClinic ? 1 : 2, groupValue: widget.isAllClinic ? 1 : 2,
onChanged: (value) { onChanged: (value) {
if (widget.patientSearchViewModel!.InpatientClinicList.length > 0) { 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, activeColor: Colors.red,
@ -135,7 +134,8 @@ class _InPatientListPageState extends State<InPatientListPage> {
isSortDes = !isSortDes; isSortDes = !isSortDes;
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
}, },
), onFieldSubmitted: (){}, ),
onFieldSubmitted: () {},
), ),
widget.patientSearchViewModel!.state == ViewState.Idle widget.patientSearchViewModel!.state == ViewState.Idle
? (widget.isMyInPatient && widget.patientSearchViewModel!.myIinPatientList.length > 0) ? (widget.isMyInPatient && widget.patientSearchViewModel!.myIinPatientList.length > 0)
@ -171,7 +171,7 @@ class _InPatientListPageState extends State<InPatientListPage> {
children: [ children: [
InkWell( InkWell(
onTap: () { 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))) 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) { itemBuilder: (context, index) {
return InkWell( return InkWell(
onTap: () { 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]); widget.patientSearchViewModel!.filterByClinic(clinicName: widget.patientSearchViewModel!.InpatientClinicList[index]);
}, },
@ -209,7 +209,7 @@ class _InPatientListPageState extends State<InPatientListPage> {
groupValue: widget.selectedClinicName, groupValue: widget.selectedClinicName,
onChanged: (value) { onChanged: (value) {
setState(() { 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!); 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!); ProjectViewModel projectsProvider = Provider.of<ProjectViewModel>(context!);
return Center( return Container(
child: Container( color: Colors.yellow,
height: TabUtils.getTabHeight(context!), child: Center(
decoration: TabUtils.getBoxTabsBoxDecoration(isActive: isActive, isFirst: isFirst, isMiddle: isMiddle, isLast: isLast, projectViewModel: projectsProvider), child: Container(
child: Row( height: TabUtils.getTabHeight(context),
mainAxisAlignment: MainAxisAlignment.center, decoration: TabUtils.getBoxTabsBoxDecoration(
children: [TabUtils.getTabText(title: title, isActive: isActive), if (counter != -1) TabUtils.getTabCounter(isActive: isActive, counter: counter)], 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 style: widget.style != null
? _getFontStyle()!.copyWith( ? _getFontStyle()!.copyWith(
fontStyle: widget.italic ? FontStyle.italic : FontStyle.normal, 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, color: widget.color,
fontWeight: widget.fontWeight ?? _getFontWeight(), fontWeight: widget.fontWeight ?? _getFontWeight(),
height: widget.fontHeight) height: widget.fontHeight)
: TextStyle( : TextStyle(
fontStyle: widget.italic ? FontStyle.italic : null, fontStyle: widget.italic ? FontStyle.italic : null,
color: widget.color != null ? widget.color : Color(0xff2E303A), color: widget.color != null ? widget.color : Color(0xff7588e7),
fontSize: widget.fontSize ?? _getFontSize(), fontSize: widget.fontSize != 0.0 ? widget.fontSize : _getFontSize(),
letterSpacing: widget.letterSpacing ?? (widget.variant == "overline" ? 1.5 : null), letterSpacing: widget.letterSpacing ?? (widget.variant == "overline" ? 1.5 : null),
fontWeight: widget.fontWeight ?? _getFontWeight(), fontWeight: widget.fontWeight ?? _getFontWeight(),
fontFamily: widget.fontFamily ?? 'Poppins', fontFamily: widget.fontFamily ?? 'Poppins',
@ -189,14 +190,14 @@ class _AppTextState extends State<AppText> {
? _getFontStyle()!.copyWith( ? _getFontStyle()!.copyWith(
fontStyle: widget.italic ? FontStyle.italic : FontStyle.normal, fontStyle: widget.italic ? FontStyle.italic : FontStyle.normal,
color: widget.color, color: widget.color,
fontSize: widget.fontSize ?? _getFontSize(), fontSize: widget.fontSize != 0.0 ? widget.fontSize : _getFontSize(),
fontWeight: widget.fontWeight ?? _getFontWeight(), fontWeight: widget.fontWeight ?? _getFontWeight(),
height: widget.fontHeight, height: widget.fontHeight,
) )
: TextStyle( : TextStyle(
fontStyle: widget.italic ? FontStyle.italic : FontStyle.normal, fontStyle: widget.italic ? FontStyle.italic : FontStyle.normal,
color: widget.color != null ? widget.color : Colors.black, 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), letterSpacing: widget.letterSpacing ?? (widget.variant == "overline" ? 1.5 : null),
fontWeight: widget.fontWeight ?? _getFontWeight(), fontWeight: widget.fontWeight ?? _getFontWeight(),
fontFamily: widget.fontFamily ?? 'Poppins', fontFamily: widget.fontFamily ?? 'Poppins',
@ -231,7 +232,7 @@ class _AppTextState extends State<AppText> {
case "button": case "button":
return Theme.of(context).textTheme.button; return Theme.of(context).textTheme.button;
default: default:
return TextStyle(); return TextStyle(fontSize: 5);
} }
} }

Loading…
Cancel
Save