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.
77 lines
2.2 KiB
Dart
77 lines
2.2 KiB
Dart
4 years ago
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||
|
import 'package:flutter/material.dart';
|
||
|
|
||
|
class BottomNavPharmacyItem extends StatelessWidget {
|
||
|
final String title;
|
||
|
final IconData icon;
|
||
|
|
||
|
final ValueChanged<int> changeIndex;
|
||
|
final int index;
|
||
|
final int currentIndex;
|
||
|
final Function onTap;
|
||
|
|
||
|
final IconData activeIcon;
|
||
|
BottomNavPharmacyItem(
|
||
|
{this.icon,
|
||
|
this.changeIndex,
|
||
|
this.index,
|
||
|
this.currentIndex,
|
||
|
this.activeIcon,
|
||
|
this.title,
|
||
|
this.onTap});
|
||
|
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
return Expanded(
|
||
|
child: SizedBox(
|
||
|
// height: 72.0,
|
||
|
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: 15,
|
||
|
),
|
||
|
currentIndex == index
|
||
|
? Divider(
|
||
|
color: Color(0xff5AB145),
|
||
|
thickness: 3.5,
|
||
|
)
|
||
|
: Divider(
|
||
|
thickness: 0,
|
||
|
),
|
||
|
Container(
|
||
|
child: Icon(currentIndex == index ? activeIcon : icon,
|
||
|
color: currentIndex == index
|
||
|
? Theme.of(context).primaryColor
|
||
|
: Theme.of(context).primaryColor,
|
||
|
size: 22.0),
|
||
|
),
|
||
|
SizedBox(
|
||
|
height: 11,
|
||
|
),
|
||
|
|
||
|
// Added TextAlign Property
|
||
|
Texts(
|
||
|
title,
|
||
|
textAlign: TextAlign.center,
|
||
|
color: currentIndex == index
|
||
|
? Theme.of(context).primaryColor
|
||
|
: Theme.of(context).primaryColor,
|
||
|
fontSize: 11,
|
||
|
),
|
||
|
],
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
);
|
||
|
}
|
||
|
}
|