Created
January 7, 2022 23:11
-
-
Save MwBakker/66cd7479e641b982282f444d0451ce5c 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
import 'package:flutter_riverpod/flutter_riverpod.dart'; | |
final indexNotifier = StateNotifierProvider<IndexNotifier>((ref) { | |
return IndexNotifier(); | |
}); | |
class IndexNotifier extends StateNotifier<int> { | |
IndexNotifier() : super(0); | |
void changeIndex(int index) { | |
state = index; | |
} | |
} | |
// ====== ERROR ====== | |
// The type 'StateNotifierProvider' is declared with 2 type parameters, | |
// but 1 type arguments were given. (Documentation) | |
// Try adjusting the number of type arguments to match the number of type parameters. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment