import 'package:cims_apps/application/component/button/back_button_view.dart';
import 'package:cims_apps/application/component/button/button_view.dart';
import 'package:cims_apps/application/component/list_tile/list_tile_view.dart';
import 'package:cims_apps/application/component/text_caption/text_caption.dart';
import 'package:cims_apps/application/theme/color_palette.dart';
import 'package:cims_apps/core/route/route.dart';
import 'package:cims_apps/core/utils/size_config.dart';
import 'package:cims_apps/features/auth/registration/view/submission_data/submission_parent.dart';
import 'package:flutter/material.dart';

class ConfirmBankAccount extends StatelessWidget {
  const ConfirmBankAccount({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    List listData = [
      {'title': 'Bank Name', 'subtitle': 'Bank Mandiri'},
      {'title': 'Account Number', 'subtitle': '123002212084'},
      {'title': 'Account Owner Name', 'subtitle': 'Muhamad Rosyidin'},
      {'title': 'Name on ID card', 'subtitle': 'Muhamad Rosyidin'},
    ];
    return Scaffold(
      appBar: AppBar(
        toolbarHeight: 70,
        backgroundColor: Colors.white,
        surfaceTintColor: Colors.white,
        automaticallyImplyLeading: false,
        title: Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            const BackButtonView(),
            const Text('Registration'),
            SizedBox(
              width: SizeConfig.width * 0.1,
            )
          ],
        ),
        shape: const RoundedRectangleBorder(
            side: BorderSide(color: ColorPalette.slate200)),
      ),
      body: SingleChildScrollView(
        padding: const EdgeInsets.all(16.0),
        child: SizedBox(
          height: SizeConfig.height * .85,
          child: Column(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              const TextCaption(title: 'Bank account confirmation'),
              SizedBox(
                height: SizeConfig.height * .6,
                child: Column(
                  mainAxisAlignment: MainAxisAlignment.start,
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    ...listData.map((e) {
                      return Padding(
                        padding: const EdgeInsets.only(bottom: 16.0),
                        child: Column(
                          mainAxisAlignment: MainAxisAlignment.start,
                          crossAxisAlignment: CrossAxisAlignment.start,
                          children: [
                            Text(
                              e['title'],
                              style: const TextStyle(
                                  color: ColorPalette.slate400, fontSize: 16),
                            ),
                            Text(
                              e['subtitle'],
                              style: const TextStyle(
                                  fontSize: 16,
                                  color: ColorPalette.slate800,
                                  fontWeight: FontWeight.w600),
                            ),
                          ],
                        ),
                      );
                    }).toList(),
                    const ListTileView(
                      title:
                          'Make sure your data is correct as it will affect the disbursement process',
                    ),
                  ],
                ),
              ),
              Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  ButtonView(
                    name: 'Recheck',
                    isOutlined: true,
                    width: SizeConfig.width * .42,
                    onPressed: () {
                      Navigator.pop(context);
                    },
                  ),
                  ButtonView(
                    name: 'Confirm',
                    width: SizeConfig.width * .42,
                    onPressed: () {
                      routePush(context, page: const SubmissionParent());
                    },
                  ),
                ],
              )
            ],
          ),
        ),
      ),
    );
  }
}
