You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
doctor_app_flutter/lib/widgets/shared/bottom_navigation_item.dart

121 lines
4.2 KiB
Dart

import 'package:badges/badges.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart';
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:provider/provider.dart';
import '../../locator.dart';
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;
4 years ago
String svgPath;
BottomNavigationItem(
{this.icon,
this.activeIcon,
4 years ago
required this.changeIndex,
this.index,
4 years ago
required this.currentIndex,
this.name,
this.dashboardViewModel,
4 years ago
required this.svgPath});
@override
Widget build(BuildContext context) {
return Expanded(
child: SizedBox(
height: 70.0,
child: Material(
type: MaterialType.transparency,
child: InkWell(
highlightColor: Colors.transparent,
splashColor: Colors.transparent,
onTap: () => changeIndex(currentIndex),
child: Stack(
alignment: AlignmentDirectional.center,
children: [
if (currentIndex == index)
Positioned(
top: 0,
child: Container(
color: AppGlobal.appRedColor,
width: 100,
height: 3,
)),
Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SizedBox(
height: 15,
),
Container(
child: SvgPicture.asset(
svgPath,
width: SizeConfig.widthMultiplier * (10),
height: SizeConfig.getHeightMultiplier(
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort
? 10
: SizeConfig.isHeightShort
? 8.5
: 7)) *
40,
),
),
SizedBox(
height: 8,
),
Expanded(
child: AppText(name ?? "",
textAlign: TextAlign.center,
fontSize:
4 years ago
SizeConfig.getTextMultiplierBasedOnWidth() * 2.5,
letterSpacing: -0.24,
color: AppGlobal.appTextColor,
fontWeight: FontWeight.w600) //#989898,
),
],
),
if (currentIndex == 3 &&
4 years ago
dashboardViewModel?.notRepliedCount != 0)
Positioned(
right: 18.0,
bottom: 40.0,
child: Badge(
toAnimate: false,
position: BadgePosition.topEnd(),
shape: BadgeShape.circle,
Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into dev_v2.8  Conflicts:  ios/Runner.xcodeproj/project.pbxproj  ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme  lib/core/viewModel/PatientRegistrationViewModel.dart  lib/core/viewModel/project_view_model.dart  lib/models/SOAP/selected_items/my_selected_history.dart  lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart  lib/screens/home/home_screen.dart  lib/screens/live_care/end_call_screen.dart  lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart  lib/screens/patients/In_patient/InPatientHeader.dart  lib/screens/patients/In_patient/in_patient_screen.dart  lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart  lib/screens/patients/profile/UCAF/UCAF-input-screen.dart  lib/screens/patients/profile/UCAF/page-stepper-widget.dart  lib/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart  lib/screens/patients/profile/discharge_summary/discharge_Summary_widget.dart  lib/screens/patients/profile/lab_result/LineChartCurved.dart  lib/screens/patients/profile/lab_result/LineChartCurvedLabHistory.dart  lib/screens/patients/profile/operation_report/operation_report.dart  lib/screens/patients/profile/operation_report/update_operation_report.dart  lib/screens/patients/profile/pending_orders/pending_orders_screen.dart  lib/screens/patients/profile/profile_screen/patient_profile_screen.dart  lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart  lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart  lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart  lib/screens/patients/profile/referral/my-referral-detail-screen.dart  lib/screens/patients/profile/referral/refer-patient-screen.dart  lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart  lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart  lib/screens/patients/profile/soap_update/plan/update_plan_page.dart  lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart  lib/screens/patients/profile/soap_update/shared_soap_widgets/steper/steps_widget.dart  lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart  lib/screens/patients/profile/soap_update/subjective/allergies/allergies_item.dart  lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart  lib/screens/patients/profile/soap_update/subjective/history/update_history_widget.dart  lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart  lib/screens/patients/profile/vital_sign/LineChartCurved.dart  lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart  lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart  lib/screens/patients/register_patient/CustomEditableText.dart  lib/screens/patients/register_patient/RegisterConfirmationPatientPage.dart  lib/screens/patients/register_patient/RegisterSearchPatientPage.dart  lib/screens/prescription/add_prescription_form.dart  lib/screens/prescription/prescription_text_filed.dart  lib/screens/reschedule-leaves/reschedule_leave.dart  lib/util/dr_app_toast_msg.dart  lib/widgets/patients/patient_card/PatientCard.dart  lib/widgets/patients/profile/patient-profile-app-bar.dart  lib/widgets/patients/profile/profile_medical_info_widget_search.dart  lib/widgets/shared/TextFields.dart  lib/widgets/shared/bottom_navigation_item.dart  lib/widgets/shared/text_fields/app-textfield-custom.dart  lib/widgets/shared/text_fields/app_text_field_custom_serach.dart  lib/widgets/shared/text_fields/new_text_Field.dart  pubspec.yaml
4 years ago
badgeColor: Colors.red[800]!,
borderRadius: BorderRadius.circular(8),
badgeContent: Container(
// padding: EdgeInsets.all(2.0),
child: AppText(
4 years ago
dashboardViewModel?.notRepliedCount.toString(),
color: Colors.white,
fontSize: 12.0),
),
),
),
],
),
),
),
),
);
}
}