import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/config/routes.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';
import 'package:mohem_flutter_app/ui/my_attendance/dynamic_screens/dynamic_listview_screen.dart';
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      appBar: AppBarWidget(
        context,
        title: LocaleKeys.myAttendance.tr(),
      ),
      body: SizedBox(
          width: double.infinity,
          height: double.infinity,
          child: ListView(
            children: [
              itemView(
                "assets/images/pdf.svg",
                LocaleKeys.missingSwipes.tr(),
              ).onPress(() {
                Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.missingSwipes.tr(), "HMG_OTL_MISSING_SWIPE_EIT_SS"));

              }),
              12.height,
              itemView(
                "assets/images/pdf.svg",
                LocaleKeys.workFromHome.tr(),
              ).onPress(() {
                Navigator.pushNamed(context, AppRoutes.dynamicScreen, arguments: DynamicListViewParams(LocaleKeys.workFromHome.tr(), "HMG_OTL_WFH_EIT_SS"));
              }),
              12.height,
              itemView(
                "assets/images/pdf.svg",
                LocaleKeys.workOnBreak.tr(),
              ),
            ],
          ).paddingAll(21)),
    );
  }

  Widget itemView(String icon, String title) {
    return Row(
      children: [
        (title).toText16().expanded,
        12.width,
        SvgPicture.asset(
          "assets/images/arrow_next.svg",
          color: MyColors.darkIconColor,
        )
      ],
    ).objectContainerView();
  }
}
