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

69 lines
2.3 KiB
Dart

import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class BottomNavigationItem extends StatelessWidget {
final IconData icon;
final IconData activeIcon;
final ValueChanged<int> changeIndex;
final int index;
final int currentIndex;
final String name;
BottomNavigationItem(
{this.icon,
this.activeIcon,
this.changeIndex,
this.index,
this.currentIndex,
this.name});
@override
Widget build(BuildContext context) {
return Expanded(
child: SizedBox(
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightShort ? 10 : 8),
child: Material(
type: MaterialType.transparency,
child: InkWell(
highlightColor: Colors.transparent,
splashColor: Colors.transparent,
onTap: () => changeIndex(currentIndex),
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SizedBox(height: SizeConfig.getHeightMultiplier(height:SizeConfig.heightMultiplier *
(SizeConfig.isHeightShort ? 12 : 9) ) * 10,),
Container(
child: Icon(currentIndex == index ? activeIcon : icon,
color: currentIndex == index
? Color(0xFF333C45)
: Theme.of(context).dividerColor,
size: SizeConfig.getHeightMultiplier(height:SizeConfig.heightMultiplier *
(SizeConfig.isHeightShort ? 10 : 8) ) * 40,),
),
SizedBox(height: SizeConfig.getHeightMultiplier(height:SizeConfig.heightMultiplier *
(SizeConfig.isHeightShort ? 10 : 8) ) * 0.5,),
Expanded(
child: Text(
name,
style: TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4,
color: currentIndex == index
? Theme.of(context).primaryColor
: Theme.of(context).dividerColor,
),
),
),
],
),
),
),
),
);
}
}