import 'package:flutter/material.dart';
import 'package:starting_template/core/extensions/build_context_extension.dart';
import 'package:starting_template/presentation/features/counter/blocs/counter_cubit/counter_cubit.dart';
import 'package:wyatt_bloc_helper/wyatt_bloc_helper.dart';

/// {@template counter_consumer_widget}
/// CounterConsumerWidget is a stateful widget. Aware of state changes.
/// {@endtemplate}
class CounterConsumerWidget
    extends CubitConsumerScreen<CounterCubit, CounterState> {
  /// {@macro counter_consumer_widget}
  const CounterConsumerWidget({super.key});

  @override
  Widget onBuild(BuildContext context, CounterState state) => Text(
        context.l10n.youHavePushed(state.value),
        textAlign: TextAlign.center,
        style: Theme.of(context).textTheme.headline3,
      );
}
