Created
November 28, 2024 17:29
-
-
Save vbalagovic/c74871ed1d8ce25092c8bf7ce78226e1 to your computer and use it in GitHub Desktop.
This file contains 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
// Before (Riverpod 1.0) | |
final movieServiceProvider = Provider<MovieService>((ref) => MovieService()); | |
// After (Riverpod 2.0) | |
@riverpod | |
class MovieService extends _$MovieService { | |
@override | |
Future<List<Movie>> build() async { | |
return fetchMovies(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment