import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/models/dashboard/menu_entries.dart';
import 'package:mohem_flutter_app/models/dashboard/menus.dart';
import 'package:mohem_flutter_app/provider/eit_provider_model.dart';
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
import 'package:mohem_flutter_app/ui/landing/widget/missing_swipe.dart';
import 'package:mohem_flutter_app/widgets/app_bar_widget.dart';
import 'package:provider/provider.dart';

class AddEITScreen extends StatelessWidget {
  late GetMenuEntriesList getMenu;
  late EITProviderModel data;

  @override
  Widget build(BuildContext context) {
    getMenu = ModalRoute.of(context)!.settings.arguments as GetMenuEntriesList;

    data = Provider.of<EITProviderModel>(context, listen: false);
    data.getEITList(getMenu.functionName.toString());
    return DefaultTabController(
        length: 2,
        child: Scaffold(
          backgroundColor: Colors.white,
          appBar: AppBarWidget(context, title: getMenu.prompt.toString()),
          //AppBar(

          // title: getMenu.prompt.toString(),
          //  ),
          body: Container(
              width: double.infinity,
              height: double.infinity,
              child: Column(children: [
                Container(
                  decoration: BoxDecoration(
                    borderRadius: BorderRadius.only(bottomLeft: Radius.circular(20), bottomRight: Radius.circular(20)),
                    gradient: LinearGradient(transform: GradientRotation(.46), begin: Alignment.topRight, end: Alignment.bottomRight, colors: [
                      MyColors.gradiantEndColor,
                      MyColors.gradiantStartColor,
                    ]),
                  ),
                  clipBehavior: Clip.antiAlias,
                  child: TabBar(
                    indicatorColor: Colors.white,
                    labelColor: Colors.white,
                    tabs: [
                      Tab(
                        text: LocaleKeys.missingSwipes.tr(),
                      ),
                      Tab(
                        text: LocaleKeys.swipeRequest.tr(),
                      ),
                    ],
                  ),
                ),
                Expanded(
                  child: TabBarView(
                    children: [MissingSwipe(), Container()],
                  ),
                )
              ])),
        ));
  }
}
