import 'package:cims_apps/application/component/button/button_view.dart';
import 'package:cims_apps/application/component/image/image_view.dart';
import 'package:cims_apps/core/utils/size_config.dart';
import 'package:flutter/material.dart';

class SuccessView extends StatelessWidget {
  final String img;
  final String textTitle;
  final Widget? subtitle;
  final void Function() nextRoute;
  const SuccessView({super.key,
    required this.img,
    required this.textTitle,
    required this.subtitle,
    required this.nextRoute
  });

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            ImageView(image: img, width: SizeConfig.width * .8,),
            Text(textTitle,
              style: TextStyle(
                fontWeight: FontWeight.w700,
                fontSize: 28,
              ),
            ),
            subtitle ?? SizedBox()
          ],
        ),
      ),
      bottomNavigationBar: Container(
        padding: EdgeInsets.all(24),
        height: 110,
        width: SizeConfig.width,
        child: ButtonView(
          name: 'Done',
          onPressed: nextRoute,
          marginVertical: 0,
          heightWrapContent: true,
          width: SizeConfig.width,
          textSize: 20,
          contentPadding: EdgeInsets.symmetric(vertical: 12),
        ),
      ),
    );
  }
}
