import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter/src/widgets/placeholder.dart';
import 'package:google_fonts/google_fonts.dart';

class GradePricing extends StatefulWidget {
  const GradePricing({super.key, required this.imgFile});
  final File imgFile;

  @override
  State<GradePricing> createState() => _GradePricingState();
}

class _GradePricingState extends State<GradePricing> {
  @override
  Widget build(BuildContext context) {
    var width = MediaQuery.of(context).size.width;
    var height = MediaQuery.of(context).size.height;
    return Scaffold(
      backgroundColor: Colors.grey.shade900,
      appBar: AppBar(
        backgroundColor: Colors.black,
        title: Text(
          "Grade Pricing",
          style: GoogleFonts.roboto(
            color: Colors.white,
            fontWeight: FontWeight.bold,
          ),
        ),
        leading: GestureDetector(
          onTap: () {
            Navigator.of(context).pop();
          },
          child: Icon(
            Icons.arrow_back,
            color: Colors.white,
          ),
        ),
      ),
      body: Container(
          padding: EdgeInsets.symmetric(
            horizontal: 20,
          ),
          child: SingleChildScrollView(
              child: Column(
            children: [
              Card(
                elevation: 10,
                shape: RoundedRectangleBorder(
                  borderRadius: BorderRadius.circular(15.0),
                ),
                color: Colors.white,
                child: Container(
                  width: width,
                  padding: EdgeInsets.symmetric(
                    vertical: height / 40,
                    horizontal: width / 20,
                  ),
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      Image.file(
                        widget.imgFile,
                        height: height / 4,
                        width: width,
                        fit: BoxFit.cover,
                      ),
                      SizedBox(
                        height: 20,
                      ),
                      Row(
                        children: [
                          Text(
                            "Grade:",
                            softWrap: true,
                            style: GoogleFonts.roboto(
                              fontWeight: FontWeight.bold,
                              fontSize: width / 19,
                            ),
                          ),
                          Text(
                            " Alba",
                            softWrap: true,
                            style: GoogleFonts.roboto(
                              fontSize: width / 19,
                            ),
                          ),
                        ],
                      ),
                      Row(
                        children: [
                          Text(
                            "Required minimum length:",
                            softWrap: true,
                            style: GoogleFonts.roboto(
                              fontWeight: FontWeight.bold,
                              fontSize: width / 19,
                            ),
                          ),
                          Text(
                            " 15cm",
                            softWrap: true,
                            style: GoogleFonts.roboto(
                              fontSize: width / 19,
                            ),
                          ),
                        ],
                      ),
                      SizedBox(
                        height: 30,
                      ),
                      Row(
                        children: [
                          Text(
                            "Predicted earning/kg:",
                            softWrap: true,
                            style: GoogleFonts.roboto(
                              fontWeight: FontWeight.bold,
                              fontSize: width / 19,
                            ),
                          ),
                        ],
                      ),
                      Text(
                        "\$70 ≈ LKR ${70 * 311}",
                        softWrap: true,
                        style: GoogleFonts.roboto(
                          fontSize: width / 19,
                        ),
                      ),
                    ],
                  ),
                ),
              ),
            ],
          ))),
    );
  }
}
