import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';

class RequestFragment extends StatefulWidget {
  @override
  State<RequestFragment> createState() => _RequestFragmentState();
}

class _RequestFragmentState extends State<RequestFragment> {
  bool isOpened = false;

  @override
  Widget build(BuildContext context) {
    return Container(
      width: double.infinity,
      height: double.infinity,
      child: Column(
        children: [
          Container(
            width: double.infinity,
            decoration: BoxDecoration(
              color: Colors.white,
              borderRadius: BorderRadius.circular(15),
              boxShadow: [
                BoxShadow(
                  color: const Color(0xff000000).withOpacity(.05),
                  blurRadius: 26,
                  offset: const Offset(0, -3),
                ),
              ],
            ),
            margin: EdgeInsets.all(21),
            padding: EdgeInsets.only(top: 21, bottom: 21, right: 16, left: 16),
            child: Column(
              children: [
                Row(
                  children: [
                    Expanded(
                      child: "Hardware Mobility 161 Messenger".toText16(),
                    ),
                    Icon(Icons.keyboard_arrow_down_rounded),
                  ],
                ),
                Column(
                  children: [
                    12.height,
                    showItem("Code:", "3188000067"),
                    showItem("Quantity:", "1"),
                    showItem("Line Status:", "Pending Approval"),
                    showItem("Transection Type:", "Move Order Issue:"),
                    showItem("Organization Code:", "SWD"),
                    showItem("From Subinventory:", "SWD_MSPS"),
                    showItem("To Subinventory:", "SWD_MSPS"),
                    showItem("Ship To Location :",
                        "SWD 11206-E.R. (Emergency Room)"),
                    showItem("Unit:", "Each"),
                    showItem("Date Required:", "12/23/2019 4:54:04 PM"),
                    showItem("Status Date:", "12/23/2019 4:54:04 PM"),
                    showItem("Operation Unit:", "Sehat Al Sewedi"),
                    showItem("Organization:", "Sehat Al Sewedi"),
                    showItem("From Locator:", "-"),
                    showItem("To Locator :", "-"),
                  ],
                ),
              ],
            ),
          ),
        ],
      ),
    );
  }

  Widget showItem(String title, String value) {
    return Padding(
      padding: const EdgeInsets.only(top: 2, bottom: 2),
      child: Row(
        children: [
          title.toText12(isBold: true),
          6.width,
          title.toText12(isBold: false, color: MyColors.normalTextColor),
        ],
      ),
    );
  }
}
