73 lines
1.9 KiB
Dart
73 lines
1.9 KiB
Dart
|
|
import 'package:enaklo_pos/core/components/spaces.dart';
|
||
|
|
import 'package:enaklo_pos/core/constants/colors.dart';
|
||
|
|
import 'package:flutter/material.dart';
|
||
|
|
|
||
|
|
class SettingTile extends StatelessWidget {
|
||
|
|
final int index;
|
||
|
|
final int currentIndex;
|
||
|
|
final String title;
|
||
|
|
final String subtitle;
|
||
|
|
final IconData icon;
|
||
|
|
final Function() onTap;
|
||
|
|
|
||
|
|
const SettingTile({
|
||
|
|
super.key,
|
||
|
|
required this.title,
|
||
|
|
required this.subtitle,
|
||
|
|
required this.icon,
|
||
|
|
required this.onTap,
|
||
|
|
required this.index,
|
||
|
|
required this.currentIndex,
|
||
|
|
});
|
||
|
|
|
||
|
|
@override
|
||
|
|
Widget build(BuildContext context) {
|
||
|
|
return GestureDetector(
|
||
|
|
onTap: onTap,
|
||
|
|
child: Container(
|
||
|
|
padding: const EdgeInsets.all(12.0),
|
||
|
|
decoration: BoxDecoration(
|
||
|
|
border: Border(
|
||
|
|
right: BorderSide(
|
||
|
|
color: currentIndex == index
|
||
|
|
? AppColors.primary
|
||
|
|
: Colors.transparent,
|
||
|
|
width: 4.0,
|
||
|
|
),
|
||
|
|
),
|
||
|
|
),
|
||
|
|
child: Row(
|
||
|
|
children: [
|
||
|
|
Icon(
|
||
|
|
icon,
|
||
|
|
size: 24.0,
|
||
|
|
color: currentIndex == index ? AppColors.primary : AppColors.grey,
|
||
|
|
),
|
||
|
|
const SpaceWidth(12),
|
||
|
|
Expanded(
|
||
|
|
child: Column(
|
||
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||
|
|
children: [
|
||
|
|
Text(
|
||
|
|
title,
|
||
|
|
style: const TextStyle(
|
||
|
|
fontSize: 16.0,
|
||
|
|
fontWeight: FontWeight.bold,
|
||
|
|
),
|
||
|
|
),
|
||
|
|
const SizedBox(height: 4.0),
|
||
|
|
Text(
|
||
|
|
subtitle,
|
||
|
|
style:
|
||
|
|
const TextStyle(fontSize: 14.0, color: AppColors.grey),
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
),
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|