import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/app_state/app_state.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';

class BusinessCardDialog extends StatelessWidget {
  const BusinessCardDialog({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return RotatedBox(
      quarterTurns: 1,
      child: AspectRatio(
        aspectRatio: 3.5 / 2,
        child: Column(
          mainAxisSize: MainAxisSize.min,
          crossAxisAlignment: CrossAxisAlignment.start,
          mainAxisAlignment: MainAxisAlignment.start,
          children: [
            Row(
              crossAxisAlignment: CrossAxisAlignment.start,
              mainAxisAlignment: MainAxisAlignment.start,
              children: [
                Expanded(
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    mainAxisAlignment: MainAxisAlignment.start,
                    children: [
                      Image.asset(
                        "assets/images/logos/bn_cloud_soloution.jpg",
                        width: 94,
                        height: 91.15,
                      ).paddingOnly(top: 4),
                    ],
                  ),
                ),
                Image.memory(
                  Utils.getPostBytes(AppState().memberInformationList!.businessCardQR ?? ""),
                  width: 129,
                  height: 129,
                ),
              ],
            ).paddingOnly(top: 26, left: 8.5),
            Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              mainAxisAlignment: MainAxisAlignment.start,
              children: [
                (AppState().memberInformationList!.eMPLOYEENAME ?? "").toText23(isBold: true).paddingOnly(top: 15),
                (AppState().memberInformationList!.getPositionName() ?? "").toText17(
                  color: MyColors.grey57Color,
                ),
                30.height,
                // (AppState().memberInformationList!.eMPLOYEENUMBER ?? "").toText13(),
                Row(
                  children: [
                    const Icon(Icons.email, size: 17.5, color: MyColors.grey3AColor).paddingOnly(right: 11.5),
                    ("${LocaleKeys.email.tr()}: ").toText18(color: MyColors.grey57Color),
                    (AppState().memberInformationList!.eMPLOYEEEMAILADDRESS ?? "").toText18(),
                  ],
                ),
                Row(
                  children: [
                    const Icon(Icons.call, size: 17.5, color: MyColors.grey3AColor).paddingOnly(right: 11.5),
                    ("${LocaleKeys.mobile.tr()}: ").toText18(color: MyColors.grey57Color),
                    (AppState().memberInformationList!.mobileNumberWithZipCode ?? "").toText18(),
                  ],
                ),
                //  1.height,
                // (AppState().memberInformationList!.jOBNAME ?? "").toText13(),
              ],
            ),
          ],
        ).paddingOnly(right: 13, left: 32, bottom: 28),
      ),
    );
  }
}
