import 'package:flutter/material.dart';
import 'package:satu/shared/app_colors.dart';

class SettingItem extends StatelessWidget {
  const SettingItem({
    required this.title,
    Key? key,
    this.onPress,
    this.subTitle,
  }) : super(key: key);

  final String title;
  final String? subTitle;

  final Function()? onPress;

  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: const BoxDecoration(color: whiteColor),
      child: Material(
        color: Colors.transparent,
        child: InkWell(
          onTap: onPress,
          child: Padding(
            padding:
            const EdgeInsets.symmetric(horizontal: 15.0, vertical: 10.0),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Text(
                  title,
                  style: const TextStyle(fontSize: 12, color: textColor),
                ),
                if( subTitle !=null )
                Text(
                  subTitle ?? '',
                  style: const TextStyle(
                    fontSize: 10,
                    color: placeholderColor,
                  ),
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}
