tablet navigation bar fixed
This commit is contained in:
@@ -0,0 +1,98 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:tm_app/core/constants/assets.dart';
|
||||
import 'package:tm_app/core/constants/strings.dart';
|
||||
import 'package:tm_app/core/theme/colors.dart';
|
||||
import 'package:tm_app/core/utils/size_config.dart';
|
||||
|
||||
class TabletNavigationWidget extends StatelessWidget {
|
||||
const TabletNavigationWidget({
|
||||
required this.currentIndex,
|
||||
required this.onTabChanged,
|
||||
super.key,
|
||||
});
|
||||
|
||||
final int currentIndex;
|
||||
final ValueChanged<int> onTabChanged;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
width: 200.0.w(),
|
||||
height: double.infinity,
|
||||
color: AppColors.backgroundColor,
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: 48.0.h()),
|
||||
_navigationItem(
|
||||
context: context,
|
||||
text: AppStrings.home,
|
||||
isActive: currentIndex == 0,
|
||||
onTap: () => onTabChanged(0),
|
||||
iconPath: AssetsManager.home,
|
||||
activeIconPath: AssetsManager.homeActive,
|
||||
),
|
||||
_navigationItem(
|
||||
context: context,
|
||||
text: AppStrings.tendersTitle,
|
||||
isActive: currentIndex == 1,
|
||||
onTap: () => onTabChanged(1),
|
||||
iconPath: AssetsManager.tenders,
|
||||
activeIconPath: AssetsManager.tendersActive,
|
||||
),
|
||||
_navigationItem(
|
||||
context: context,
|
||||
text: AppStrings.profile,
|
||||
isActive: currentIndex == 2,
|
||||
onTap: () => onTabChanged(2),
|
||||
iconPath: AssetsManager.profile,
|
||||
activeIconPath: AssetsManager.profileActive,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _navigationItem({
|
||||
required BuildContext context,
|
||||
required String text,
|
||||
required bool isActive,
|
||||
required VoidCallback onTap,
|
||||
required String iconPath,
|
||||
required String activeIconPath,
|
||||
}) {
|
||||
return InkWell(
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
width: 200.0.w(),
|
||||
height: 64.0.h(),
|
||||
decoration: BoxDecoration(color: AppColors.backgroundColor),
|
||||
child: Padding(
|
||||
padding: EdgeInsetsDirectional.only(start: 24.0.w()),
|
||||
child: Row(
|
||||
children: [
|
||||
SvgPicture.asset(isActive ? activeIconPath : iconPath),
|
||||
SizedBox(width: 12.0.w()),
|
||||
Text(
|
||||
text,
|
||||
style: TextStyle(
|
||||
fontSize: 14.0.sp(),
|
||||
fontWeight: isActive ? FontWeight.w600 : FontWeight.w400,
|
||||
color: isActive ? AppColors.primaryColor : AppColors.grey60,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
Container(
|
||||
width: 4.0.w(),
|
||||
height: 64.0.h(),
|
||||
decoration: BoxDecoration(
|
||||
color: isActive ? AppColors.primaryColor : Colors.transparent,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user