Created
June 15, 2020 19:07
-
-
Save ookami-kb/140afc52aca9758a7d543460252792c1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CreateThreadBloc extends BlocBase { | |
/// Title of the conversation | |
Stream<String> get title => _title.transform(emptyValidationTransformer); | |
final BehaviorSubject<String> _title = BehaviorSubject.seeded(''); | |
/// Creates new message thread or updates existing one. | |
Future<Either<Exception, MessageThread>> submit() async { | |
Either<Exception, MessageThread> result; | |
if (initialThread == null) { | |
result = await _createThread(); | |
} else { | |
result = await _updateThread(); | |
} | |
return result; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment