some changes navigation in web and response changes
This commit is contained in:
@@ -1,10 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:go_router/go_router.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 DesktopShellPage extends StatelessWidget {
|
||||
const DesktopShellPage({
|
||||
@@ -18,91 +13,6 @@ class DesktopShellPage extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: Column(
|
||||
children: [_navigationBar(context), Expanded(child: navigationShell)],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Container _navigationBar(BuildContext context) {
|
||||
return Container(
|
||||
height: 64,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.backgroundColor,
|
||||
border: Border(bottom: BorderSide(color: AppColors.grey30)),
|
||||
),
|
||||
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(width: 40),
|
||||
SvgPicture.asset(AssetsManager.logoSmall),
|
||||
Spacer(),
|
||||
_bottomNavigationItem(
|
||||
context: context,
|
||||
text: AppStrings.home,
|
||||
isActive: navigationShell.currentIndex == 0,
|
||||
onTap: () => onTap(0),
|
||||
iconPath: AssetsManager.home,
|
||||
activeIconPath: AssetsManager.homeActive,
|
||||
),
|
||||
SizedBox(width: 24),
|
||||
_bottomNavigationItem(
|
||||
context: context,
|
||||
text: AppStrings.tendersTitle,
|
||||
isActive: navigationShell.currentIndex == 1,
|
||||
onTap: () => onTap(1),
|
||||
iconPath: AssetsManager.tenders,
|
||||
activeIconPath: AssetsManager.tendersActive,
|
||||
),
|
||||
SizedBox(width: 24),
|
||||
_bottomNavigationItem(
|
||||
context: context,
|
||||
text: AppStrings.profile,
|
||||
isActive: navigationShell.currentIndex == 2,
|
||||
onTap: () => onTap(2),
|
||||
iconPath: AssetsManager.profile,
|
||||
activeIconPath: AssetsManager.profileActive,
|
||||
),
|
||||
Spacer(),
|
||||
SizedBox(width: 68),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _bottomNavigationItem({
|
||||
required BuildContext context,
|
||||
required String text,
|
||||
required bool isActive,
|
||||
required VoidCallback onTap,
|
||||
required String iconPath,
|
||||
required String activeIconPath,
|
||||
}) {
|
||||
return InkWell(
|
||||
onTap: onTap,
|
||||
child: SizedBox(
|
||||
width: 100.0,
|
||||
height: 64,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SvgPicture.asset(isActive ? activeIconPath : iconPath),
|
||||
SizedBox(width: 8),
|
||||
Text(
|
||||
text,
|
||||
style: TextStyle(
|
||||
fontSize: 12.0.sp(),
|
||||
fontWeight: FontWeight.w400,
|
||||
color: isActive ? AppColors.primaryColor : AppColors.grey60,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
return Scaffold(body: navigationShell);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user