import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/ui/app_bar.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/ui/work_list/missing_swipe/fragments/actions_fragment.dart';
import 'package:mohem_flutter_app/ui/work_list/missing_swipe/fragments/attachments_fragment.dart';
import 'package:mohem_flutter_app/ui/work_list/missing_swipe/fragments/info_fragments.dart';
import 'package:mohem_flutter_app/ui/work_list/missing_swipe/fragments/request_fragment.dart';
import 'package:mohem_flutter_app/widgets/button/default_button.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';

class MissingSwipeScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return DefaultTabController(
      length: 4,
      child: Scaffold(
        appBar: appBar(context, title: "Missing Swipe Request"),
        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: "Request",
                    ),
                    Tab(
                      text: "Actions",
                    ),
                    Tab(
                      text: "Attachments",
                    ),
                    Tab(
                      text: "Info.",
                    ),
                  ],
                ),
              ),
              Expanded(
                child: TabBarView(
                  children: [
                    RequestFragment(),
                    ActionsFragment(),
                    AttachmentsFragment(),
                    InfoFragment(),
                  ],
                ),
              ),
              Container(
                width: double.infinity,
                height: 60,
                padding: EdgeInsets.only(left: 21, right: 21),
                child: Row(
                  children: [
                    Expanded(
                      child: DefaultButton(
                        "Reject",
                        () {},
                        colors: [
                          Color(0xffEB8C90),
                          Color(0xffDE6C70),
                        ],
                      ),
                    ),
                    12.width,
                    Expanded(
                      child: DefaultButton(
                        "Approve",
                        () {},
                        colors: [
                          Color(0xff32D892),
                          Color(0xff1AB170),
                        ],
                      ),
                    ),
                  ],
                ),
              )
            ],
          ),
        ),
      ),
    );
  }
}
