import 'package:e_commerce_training/res/R.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class SettingWidget extends StatelessWidget {
  final String? image;
  final String? title;
  final Color? color;
  final bool? isShowLogin;
  final VoidCallback? callback;

  const SettingWidget(
      {Key? key,
      this.image,
      this.title,
      this.color,
      this.isShowLogin,
      this.callback})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Visibility(
      visible: isShowLogin == true,
      child: InkWell(
        onTap: callback,
        child: Column(
          children: [
            Container(
              padding: EdgeInsets.symmetric(vertical: 12, horizontal: 15),
              color: R.color.white,
              child: Row(
                children: [
                  Image.asset(
                    image!,
                    height: 30.h,
                    width: 30.h,
                    color: color,
                  ),
                  SizedBox(
                    width: 15,
                  ),
                  Expanded(
                    child: Text(
                      title ?? "",
                      style: TextStyle(
                        fontSize: 16.sp,
                        color: R.color.black,
                      ),
                    ),
                  ),
                  Icon(
                    Icons.navigate_next_outlined,
                    color: R.color.black.withOpacity(0.5),
                    size: 20.h,
                  )
                ],
              ),
            ),
            SizedBox(
              height: 1,
            )
          ],
        ),
      ),
    );
  }
}
