Files
eatvio_app/lib/presentation/registration/weight_screen/bloc/weight_bloc.dart

23 lines
757 B
Dart

import 'package:equatable/equatable.dart';
import 'package:flutter/material.dart';
import '/core/app_export.dart';
import 'package:eatvio_app/presentation/registration/weight_screen/models/weight_model.dart';
part 'weight_event.dart';
part 'weight_state.dart';
/// A bloc that manages the state of a Weight according to the event that is dispatched to it.
class WeightBloc extends Bloc<WeightEvent, WeightState> {
WeightBloc(WeightState initialState) : super(initialState) {
on<WeightInitialEvent>(_onInitialize);
}
_onInitialize(
WeightInitialEvent event,
Emitter<WeightState> emit,
) async {
emit(state.copyWith(
weightModelObj: state.weightModelObj?.copyWith(),
weightController: state.weightController));
}
}