import 'package:cims_apps/application/assets/path_assets.dart';
import 'package:cims_apps/application/component/button/button_view.dart';
import 'package:cims_apps/application/component/image/image_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/core/route/route.dart';
import 'package:cims_apps/core/utils/size_config.dart';
import 'package:cims_apps/features/auth/registration/view/submission_data/submit_signature/submit_signature.dart';
import 'package:cims_apps/features/auth/registration/viewmodel/submission_data_viewmodel.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

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

  @override
  Widget build(BuildContext context) {
    return MultiProvider(
        providers: [
          ChangeNotifierProvider(
            create: (context) => SubmissionDataViewModel(),
          )
        ],
        builder: (context, child) {
          return Consumer<SubmissionDataViewModel>(
              builder: (context, provider, child) {
            return SizedBox(
              height: SizeConfig.height * .8,
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  const TextCaption(title: 'Draw your digital sign'),
                  const ImageView(image: PathAssets.frameSignature),
                  const ListTileView(
                      title:
                          'Make sure the sign you draw is match with your ID Card'),
                  SizedBox(height: SizeConfig.height * .1),
                  ButtonView(
                    name: 'Next',
                    onPressed: () {
                      provider.next(context).then((value) {
                        if (value) {
                          routePush(context, page: const SubmitSignature());
                        }
                      });
                    },
                  )
                ],
              ),
            );
          });
        });
  }
}
