Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Chat Bloc Fixed
import 'package:equatable/equatable.dart';
import 'package:flutter_app/network/response/message_response.dart';
abstract class ChatState extends Equatable {
ChatState([List props = const []]) : super(props);
}
class ChatInitial extends ChatState {
@override
String toString() => 'ChatInitial';
}
class ChatLoading extends ChatState {
@override
String toString() => 'ProfileLoading';
}
class SendMessageFail extends ChatState {
final String error;
final MessagesResponse message;
SendMessageFail({this.error, this.message}) : super([error, message]);
@override
String toString() => 'SendMessageFail $error - message $message';
}
class SendMessageSuccess extends ChatState {
MessagesResponse message;
SendMessageSuccess({this.message}) : super([message]);
@override
String toString() {
return 'SendMessageSuccess';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.