// ignore_for_file: always_use_package_imports

import 'package:flutter/material.dart';
import 'package:wyatt_bloc_helper/wyatt_bloc_helper.dart';

import '../blocs/{{#snakeCase}}{{feature_name}}{{/snakeCase}}_cubit/{{#snakeCase}}{{feature_name}}{{/snakeCase}}_cubit.dart';
import '../stateless/{{#snakeCase}}{{feature_name}}{{/snakeCase}}_widget.dart';
import '{{#snakeCase}}{{feature_name}}{{/snakeCase}}_parent.dart';

/// {@template {{#snakeCase}}{{feature_name}}{{/snakeCase}}_screen}
/// {{#pascalCase}}{{feature_name}}{{/pascalCase}}Screen is the merge of Provider and Consumer.
/// {@endtemplate}
class {{#pascalCase}}{{feature_name}}{{/pascalCase}}Screen
    extends CubitScreen<{{#pascalCase}}{{feature_name}}{{/pascalCase}}Cubit, {{#pascalCase}}{{feature_name}}{{/pascalCase}}State> {
  /// {@macro {{#snakeCase}}{{feature_name}}{{/snakeCase}}_screen}
  const {{#pascalCase}}{{feature_name}}{{/pascalCase}}Screen({super.key});

  @override
  {{#pascalCase}}{{feature_name}}{{/pascalCase}}Cubit create(BuildContext context) => {{#pascalCase}}{{feature_name}}{{/pascalCase}}Cubit();

  @override
  {{#pascalCase}}{{feature_name}}{{/pascalCase}}Cubit init(BuildContext context, {{#pascalCase}}{{feature_name}}{{/pascalCase}}Cubit bloc) =>
      bloc..yourCustomFunction();

  @override
  Widget parent(BuildContext context, Widget child) =>
      {{#pascalCase}}{{feature_name}}{{/pascalCase}}Parent(child: child);

  // Rebuild on every bloc changes
  @override
  Widget onBuild(BuildContext context, {{#pascalCase}}{{feature_name}}{{/pascalCase}}State state) =>
      const {{#pascalCase}}{{feature_name}}{{/pascalCase}}Widget();
}
