diff --git a/assets/images/svg/insurance.svg b/assets/images/svg/insurance.svg
new file mode 100644
index 0000000..c8d3c38
--- /dev/null
+++ b/assets/images/svg/insurance.svg
@@ -0,0 +1,4 @@
+
diff --git a/assets/images/svg/more.svg b/assets/images/svg/more.svg
new file mode 100644
index 0000000..4dbe5fd
--- /dev/null
+++ b/assets/images/svg/more.svg
@@ -0,0 +1,4 @@
+
diff --git a/assets/images/svg/requests.svg b/assets/images/svg/requests.svg
new file mode 100644
index 0000000..7d90098
--- /dev/null
+++ b/assets/images/svg/requests.svg
@@ -0,0 +1,5 @@
+
diff --git a/lib/core/app_assets.dart b/lib/core/app_assets.dart
index 7d32262..b071112 100644
--- a/lib/core/app_assets.dart
+++ b/lib/core/app_assets.dart
@@ -68,6 +68,9 @@ class AppAssets {
static const String doctor_calendar_icon = '$svgBasePath/doctor_calendar_icon.svg';
static const String prescription_remarks_icon = '$svgBasePath/prescription_remarks_icon.svg';
static const String prescription_reminder_icon = '$svgBasePath/prescription_reminder_icon.svg';
+ static const String insurance = '$svgBasePath/insurance.svg';
+ static const String requests = '$svgBasePath/requests.svg';
+ static const String more = '$svgBasePath/more.svg';
//bottom navigation//
diff --git a/lib/presentation/home/landing_page.dart b/lib/presentation/home/landing_page.dart
index 6594f85..301e8bb 100644
--- a/lib/presentation/home/landing_page.dart
+++ b/lib/presentation/home/landing_page.dart
@@ -117,8 +117,6 @@ class _LandingPageState extends State {
),
),
SizedBox(height: 12.h),
- CustomTabBar(),
- SizedBox(height: 12.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
diff --git a/lib/presentation/medical_file/medical_file_page.dart b/lib/presentation/medical_file/medical_file_page.dart
index 7fa4fe9..703e0b7 100644
--- a/lib/presentation/medical_file/medical_file_page.dart
+++ b/lib/presentation/medical_file/medical_file_page.dart
@@ -8,6 +8,7 @@ import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/medical_file/widgets/medical_file_card.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
+import 'package:hmg_patient_app_new/widgets/custom_tab_bar.dart';
import 'package:hmg_patient_app_new/widgets/input_widget.dart';
class MedicalFilePage extends StatelessWidget {
@@ -161,6 +162,18 @@ class MedicalFilePage extends StatelessWidget {
),
),
SizedBox(height: 16.h),
+ CustomTabBar(
+ activeTextColor: Color(0xffED1C2B),
+ activeBackgroundColor: Color(0xffED1C2B).withValues(alpha: .1),
+ tabs: [
+ CustomTabBarModel(AppAssets.myFilesBottom, "General"),
+ CustomTabBarModel(AppAssets.insurance, "Insurance"),
+ CustomTabBarModel(AppAssets.requests, "Requests"),
+ CustomTabBarModel(AppAssets.more, "More"),
+ ],
+ onTabChange: (index) {},
+ ),
+ SizedBox(height: 16.h),
//Insurance Tab Data
Container(
// height: 150.h,
diff --git a/lib/widgets/custom_tab_bar.dart b/lib/widgets/custom_tab_bar.dart
index ae0e6f6..b6c8ef3 100644
--- a/lib/widgets/custom_tab_bar.dart
+++ b/lib/widgets/custom_tab_bar.dart
@@ -18,13 +18,13 @@ class CustomTabBar extends StatefulWidget {
final List tabs;
final Color activeTextColor;
final Color activeBackgroundColor;
- final Color? inActiveTextColor;
+ final Color inActiveTextColor;
final Color inActiveBackgroundColor;
final Function(int)? onTabChange;
CustomTabBar(
{Key? key,
- this.tabs = const [],
+ required this.tabs,
this.activeTextColor = const Color(0xff2E3039),
this.inActiveTextColor = const Color(0xff898A8D),
this.activeBackgroundColor = const Color(0x142E3039),
@@ -39,7 +39,6 @@ class CustomTabBar extends StatefulWidget {
}
class _CustomTabBarState extends State {
- List tabs = [];
int selectedIndex = 0;
@override
@@ -58,29 +57,21 @@ class _CustomTabBarState extends State {
@override
Widget build(BuildContext context) {
- tabs = [
- CustomTabBarModel(null, "By Visit"),
- CustomTabBarModel(null, "By Test"),
- CustomTabBarModel(null, "By Value"),
- CustomTabBarModel(AppAssets.myFilesBottom, "By Value"),
- CustomTabBarModel(null, "By Value"),
- ];
-
late Widget parentWidget;
- if (tabs.length > 3) {
+ if (widget.tabs.length > 3) {
parentWidget = ListView.separated(
scrollDirection: Axis.horizontal,
padding: EdgeInsets.zero,
physics: const BouncingScrollPhysics(),
- itemBuilder: (cxt, index) => myTab(tabs[index], index),
+ itemBuilder: (cxt, index) => myTab(widget.tabs[index], index),
separatorBuilder: (cxt, index) => 4.width,
- itemCount: tabs.length,
+ itemCount: widget.tabs.length,
);
} else {
parentWidget = Row(
spacing: 4,
- children: [for (int i = 0; i < tabs.length; i++) myTab(tabs[i], i).expanded],
+ children: [for (int i = 0; i < widget.tabs.length; i++) myTab(widget.tabs[i], i).expanded],
);
}
@@ -108,8 +99,9 @@ class _CustomTabBarState extends State {
mainAxisSize: MainAxisSize.min,
spacing: 4,
children: [
- if (tabBar.image != null) Utils.buildSvgWithAssets(icon: tabBar.image!, height: 18, width: 18, iconColor: isSelected ? Color(0xff2E3039) : Color(0xff898A8D)),
- tabBar.title.toText16(weight: isSelected ? FontWeight.w600 : FontWeight.w500, color: isSelected ? Color(0xff2E3039) : Color(0xff898A8D), letterSpacing: isSelected ? -0.3 : -0.1),
+ if (tabBar.image != null) Utils.buildSvgWithAssets(icon: tabBar.image!, height: 18, width: 18, iconColor: isSelected ? widget.activeTextColor : widget.inActiveTextColor),
+ tabBar.title
+ .toText16(weight: isSelected ? FontWeight.w600 : FontWeight.w500, color: isSelected ? widget.activeTextColor : widget.inActiveTextColor, letterSpacing: isSelected ? -0.3 : -0.1),
],
)).onPress(() {
setState(() {