import 'package:flutter/material.dart';
import 'package:flutter_font_icons/flutter_font_icons.dart';
import 'package:tacban/assets/theme/colors.dart';
import 'package:tacban/src/shared/widgets/back_button.dart';
import 'package:tacban/src/shared/widgets/buttons/simple_button.dart';
import 'package:tacban/src/shared/widgets/inputs/simple_input.dart';

class RelatorioScreen extends StatefulWidget {
  static String path = '/relatorioscreen';
  const RelatorioScreen({super.key});

  @override
  State<RelatorioScreen> createState() => _RelatorioScreenState();
}

class _RelatorioScreenState extends State<RelatorioScreen> with TickerProviderStateMixin {
  final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
  final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
  TabController? _tabMenuController;

  @override
  void initState() {
    _tabMenuController = TabController(initialIndex: 0, length: 3, vsync: this);
    _tabMenuController!.addListener(() {
      if (_tabMenuController!.indexIsChanging) {
        setState(() {
        });
      }
    });
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    Radius radius = const Radius.circular(30);
    return Scaffold(
      key: _scaffoldKey,
      extendBodyBehindAppBar: true,
      appBar: const PreferredSize(
        preferredSize: Size.fromHeight(0),
        child: SizedBox(), 
      ),
      body: Container(
        decoration: BoxDecoration(
          // color: Theme.of(context).primaryColor,
          image: const DecorationImage(
            image: AssetImage('lib/assets/images/bg_header.png'),
            fit: BoxFit.cover,
          )
        ),
        child: DefaultTabController(
          length: 2,
          child: Column(
            children: [
              const SizedBox(height: 40),
              SafeArea(
                bottom: false,
                child: SizedBox(
                  child: Padding(
                    padding: const EdgeInsets.only(left: 20, right: 20, top: 20, bottom: 20),
                    child: Row(
                      children: [
                        const BackButtonWidget(),
                        const SizedBox(width: 10),
                        Expanded(
                          child: SizedBox(
                            width: double.infinity,
                            child: Text(
                              "Relatório final",
                              textAlign: TextAlign.start,
                              style: Theme.of(context).textTheme.bodySmall?.copyWith(
                                fontWeight: FontWeight.bold,
                                color: AppColorLight.primaryColor,
                                fontSize: 20
                              )
                            )
                          )
                        )
                      ]
                    )
                  )
                )
              ),
              ClipRRect(
                borderRadius: BorderRadius.only(
                  topLeft: radius,
                  topRight: radius
                ),
                child: Center(
                  child: Container(
                    padding: const EdgeInsets.symmetric(horizontal: 20),
                    decoration: BoxDecoration(
                      color: Theme.of(context).scaffoldBackgroundColor
                    ),
                    child: Form(
                      key: _formKey,
                      child: Column(
                        mainAxisSize: MainAxisSize.max,
                        children: [
                          const SizedBox(height: 5),
                          Container(
                            height: 20,
                          ),
                        ]
                      )
                    )
                  ),
                )
              ),
              Expanded(
                child: Container(
                  color: Theme.of(context).scaffoldBackgroundColor,
                  child: Container(
                    padding: const EdgeInsets.symmetric(vertical: 10),
                    child: Center(
                      child: SizedBox(
                        child: Image.asset(
                          'lib/assets/images/final_report.png',
                          fit: BoxFit.fill
                        )
                      )
                    ),
                    // child: SingleChildScrollView(
                    //   child: Column(
                    //     mainAxisAlignment: MainAxisAlignment.start,
                    //     // crossAxisAlignment: CrossAxisAlignment.start,
                    //     children: [
                    //       Container(
                    //         width: 150,
                    //         height: 150,
                    //         decoration: BoxDecoration(
                    //           border: Border.all(width: 1, color: AppColorLight.primaryColor),
                    //           borderRadius: BorderRadius.circular(10)
                    //         ),
                    //         child: Icon(Feather.image, size: 50, color: AppColorLight.secondaryColor),
                    //       ),
                    //       const SizedBox(height: 20),
                    //       SimpleInput(
                    //         hintText: '',
                    //         title: 'Nome completo',
                    //         controller: null,
                    //         validator: true,
                    //       ),
                    //       const SizedBox(height: 20),
                    //       SimpleInput(
                    //         title: 'Email',
                    //         hintText: 'Informe seu email',
                    //         typeInput: TypInputText.EMAIL,
                    //         controller: null,
                    //         validator: true,
                    //       ),
                    //       const SizedBox(height: 20),
                    //       SimpleInput(
                    //         title: 'Telefone',
                    //         hintText: 'Informe seu telefone',
                    //         typeInput: TypInputText.EMAIL,
                    //         controller: null,
                    //         validator: true,
                    //       ),
                    //       const SizedBox(height: 20),
                    //       ButtonWidget(
                    //         label: 'Enviar mensagem',
                    //         isloading: false,
                    //         onTap: (){
                    //         }
                    //       )
                    //     ],
                    //   ),
                    // ),
                  ),
                )
              )
            ],
          ),
        ),
      )
    );
  }
}