Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BookState #1

Closed
nassimbjf opened this issue Mar 28, 2019 · 1 comment
Closed

BookState #1

nassimbjf opened this issue Mar 28, 2019 · 1 comment

Comments

@nassimbjf
Copy link

WHY THIS FUNCTION IS UNDERLINED BY RED COLOR
@OverRide
Stream mapEventToState(currentState, event) async* {
if (event is FetchBook && !_hasReachedMax(currentState)) {
try {
if (currentState is BookUninitialized) {
final books = await _fetchBooks(0, 20);
yield BookInitialized.success(books);
}
if (currentState is BookInitialized) {
final books = await fetchBooks(currentState.books.length, 20);
yield books.isEmpty
? currentState.copyWith(hasReachedMax: true)
: BookInitialized.success(currentState.books + books);
}
} catch (
) {
yield BookInitialized.failure();
}
}
}

@lohanidamodar
Copy link
Owner

Also paste the output of your flutter doctor command! May be issue with dart version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants