import 'package:elektronika/app/core/themes/theme.dart';

import 'controller.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class PasswordVisibilityWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return GetBuilder<VisibilityController>(
      init: VisibilityController(),
      builder: (vc) => InkWell(
        onTap: vc.onVisibilityChange,
        child: Container(
          transform: Matrix4.translationValues(-10.0, 5.0, 0.0),
          padding: const EdgeInsets.all(8),
          child: Icon(
            vc.obscureText.value ? Icons.visibility_off_outlined : Icons.visibility_outlined,
            size: 22.sp,
            color: ThemeColor.mainColor,
          ),
        ),
      ),
    );
  }
}
