Skip to content

Instantly share code, notes, and snippets.

@FlutterWiz
Created June 18, 2022 12:22
Show Gist options
  • Save FlutterWiz/4d5462e8388e68bff0946a507e53cedc to your computer and use it in GitHub Desktop.
Save FlutterWiz/4d5462e8388e68bff0946a507e53cedc to your computer and use it in GitHub Desktop.
final searchProvider = StateNotifierProvider.autoDispose<SearchNotifier, SearchState>(
(ref) {
final characterModelList = ref.watch(charactersDatasProvider).whenOrNull(data: (data) => data);
return SearchNotifier()
..mapEventsToState(
UpdateListItems(
characterModelList: characterModelList ?? [],
),
);
},
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment