import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart';

class LogoWidget extends StatelessWidget {
  const LogoWidget({
    super.key,
    this.title,
    this.height,
    this.width,
    this.vecPath,
    this.svgPath,
    this.imagePath,
    this.titleStyle,
  });

  final String? title;
  final String? vecPath;
  final String? svgPath;
  final String? imagePath;
  final num? width;
  final num? height;
  final TextStyle? titleStyle;

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Row(),
        buildLogo(),
        SizedBox(height: 8.h),
        Text(
          title ?? 'سامانه رصدیار',
          style:titleStyle?? AppFonts.yekan16.copyWith(color: AppColor.darkGreyNormal),
        ),
      ],
    );
  }

  Widget buildLogo() {
    if (vecPath != null) {
      return SvgGenImage.vec(vecPath!).svg(width: width?.w ?? 120.w, height: height?.h ?? 120.h);
    } else if (svgPath != null) {
      return SvgGenImage(vecPath!).svg(width: width?.w ?? 120.w, height: height?.h ?? 120.h);
    } else if (imagePath != null) {
      return AssetGenImage(imagePath!).image(width: width?.w ?? 120.w, height: height?.h ?? 120.h);
    } else {
      return Assets.images.innerSplash.image(width: 120.w, height: 120.h);
    }
  }
}
