1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- import 'package:flutter/material.dart';
- import 'package:flutter_clock/model/constants.dart';
- class SideMenuItem extends StatelessWidget {
- const SideMenuItem({
- Key? key,
- required this.isActive,
- this.isHover = false,
- required this.itemCount,
- this.showBorder = true,
- required this.iconSrc,
- required this.title,
- required this.press,
- }) : super(key: key);
- final bool isActive, isHover, showBorder;
- final int itemCount;
- final String iconSrc, title;
- final VoidCallback press;
- @override
- Widget build(BuildContext context) {
- return Padding(
- padding: const EdgeInsets.only(top: kDefaultPadding),
- child: InkWell(
- onTap: press,
- child: Row(
- children: [
- SizedBox(width: kDefaultPadding / 4),
- Expanded(
- child: Container(
- padding: EdgeInsets.only(bottom: 15, right: 5),
- decoration: showBorder
- ? BoxDecoration(
- border: Border(
- bottom: BorderSide(color: Color(0xFFDFE2EF)),
- ),
- )
- : null,
- child: Row(
- children: [
- SizedBox(width: kDefaultPadding * 0.75),
- Text(
- title,
- style: Theme.of(context).textTheme.button?.copyWith(
- color:
- (isActive || isHover) ? kTextColor : kGrayColor,
- ),
- ),
- ],
- ),
- ),
- ),
- ],
- ),
- ),
- );
- }
- }
|