import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:krow/core/presentation/styles/kw_text_styles.dart';
import 'package:krow/core/presentation/styles/theme.dart';
import 'package:krow/features/create_event/domain/bloc/create_event_bloc.dart';

class TotalCostRowWidget extends StatelessWidget {
   TotalCostRowWidget({super.key});

  @override
  Widget build(BuildContext context) {
    return BlocBuilder<CreateEventBloc, CreateEventState>(
      builder: (context, state) {
        return Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            Text(
              'Approximate Total Costs',
              style: AppTextStyles.bodyMediumReg
                  .copyWith(color: AppColors.blackGray),
            ),
            ValueListenableBuilder(
              valueListenable: state.entity.totalCost,
              builder: (context, value, child) {
                return Text(
                '\$${value.toStringAsFixed(2)}',
                style: AppTextStyles.bodyMediumMed,
              );
              },
            )
          ],
        );
      },
    );
  }
}
