Skip to content

Instantly share code, notes, and snippets.

@guilhermecarvalhocarneiro
Created August 8, 2021 21:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guilhermecarvalhocarneiro/12ca63d6e663799793455b1e74a58c14 to your computer and use it in GitHub Desktop.
Save guilhermecarvalhocarneiro/12ca63d6e663799793455b1e74a58c14 to your computer and use it in GitHub Desktop.
State com nullsafety
part of 'cubit.dart';
abstract class PacienteState extends Equatable {
const PacienteState();
}
class PacienteInitial extends PacienteState {
@override
List<Object> get props => [];
}
class PacienteProcessState extends PacienteState {
@override
List<Object> get props => [];
}
class PacienteSuccessState extends PacienteState {
final String successMessage;
final PacienteModel pacienteModel;
final List<PacienteModel> pacienteList;
PacienteSuccessState({
required this.successMessage,
required this.pacienteModel,
required this.pacienteList,
});
@override
List<Object> get props => [];
}
class PacienteErrorState extends PacienteState {
final String error;
PacienteErrorState(this.error);
@override
List<Object> get props => [error];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment