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

There is one more motive of failure when it cannot find the StoreConnector. #36

Closed
marcglasberg opened this issue Apr 11, 2018 · 4 comments

Comments

@marcglasberg
Copy link
Contributor

marcglasberg commented Apr 11, 2018

I got this:

I/flutter (15445): The following StoreProviderError was thrown building StoreConnector<AppState, _ViewModel>(dirty):
I/flutter (15445): Error: No StoreProvider<AppState> found. To fix, please try:
I/flutter (15445):   * Using Dart 2 (required) by using the --preview-dart-2 flag
I/flutter (15445):   * Wrapping your MaterialApp with the StoreProvider<State>, rather than an individual Route
I/flutter (15445):   * Providing full type information to your Store<State>, StoreProvider<State> and
I/flutter (15445):     StoreConnector<State, ViewModel>
I/flutter (15445): If none of these solutions work, please file a bug at:
I/flutter (15445): https://github.com/brianegan/flutter_redux/issues/new

Steps to reproduce:

  1. Create a file to hold AppState named task_list_redux.dart, inside of the sandbox package, directory abc.
  2. In another file in the same abc directory, that builds the StoreConnector, import it like this: import 'package:sandbox/abc/task_list_REDUX.dart';.

Then it fails.

To solve it, simple change the import to import 'task_list_REDUX.dart';.

@brianegan
Copy link
Owner

Great call. I've seen this a couple of times now, but forgot to put it in the error message. I'll do that post-haste!

@miketheprogrammer
Copy link

miketheprogrammer commented Apr 12, 2018

@brianegan - I am currently getting No dynamic found. To fix, please try on release version.
have you seen this before.

**Edit:
Added Information @brianegan :

I added the following prints

StoreConnect::build - AppState
S in StoreProvider::of - dynamic
type in StoreProvider::of - dynamic

The code is as follows

  @override
  Widget build(BuildContext context) {
    
    print('StoreConnect::build - ' + S.toString());
    StoreProvider.of<S>(context);
    // return new _StoreStreamListener<S, ViewModel>(
    //   store: StoreProvider.of<S>(context),
    //   builder: builder,
    //   converter: converter,
    //   distinct: distinct,
    //   onInit: onInit,
    //   onDispose: onDispose,
    //   rebuildOnChange: rebuildOnChange,
    //   ignoreChange: ignoreChange,
    //   onWillChange: onWillChange,
    // );
  }
  static Store<S> of<S>(BuildContext context) {
    final type = _typeOf<StoreProvider<S>>();
    print('S in StoreProvider::of - ' + S.toString());
    print('type in StoreProvider::of - ' + type.toString());

@brianegan
Copy link
Owner

Hrm, I haven't seen that one. I'll try to take a look soon!

@miketheprogrammer
Copy link

My issue may have been preview dart 2 related.

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

3 participants