import 'package:cims_apps/application/component/select_form/select_form_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/features/auth/registration/viewmodel/submission_data_viewmodel.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

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

  @override
  Widget build(BuildContext context) {
    List<ItemSelectForm> listForm = [
      ItemSelectForm('key1', 'text'),
      ItemSelectForm('key2', 'text'),
      ItemSelectForm('key3', 'text'),
      ItemSelectForm('key4', 'text'),
      ItemSelectForm('key5', 'text'),
    ];
    return ChangeNotifierProvider(
        create: (context) => SubmissionDataViewModel(),
        builder: (context, child) {
          return Consumer<SubmissionDataViewModel>(
              builder: (context, provider, child) {
            return SingleChildScrollView(
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                // mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  const TextCaption(title: 'Your personal details'),
                  SelectFormView(
                    name: 'Occupation',
                    hintText: 'Select occupation ',
                    bottomSheetTitle: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        const Text('Occupation'),
                        IconButton(
                            onPressed: () => Navigator.pop(context),
                            icon: const Icon(
                              Icons.clear,
                              size: 20,
                              color: ColorPalette.greyBase,
                            )),
                      ],
                    ),
                    listItem: listForm,
                    onSelect: (value) {},
                  ),
                ],
              ),
            );
          });
        });
  }
}
