-
Notifications
You must be signed in to change notification settings - Fork 219
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
StoreProvider not found #35
Comments
Hey there @lockerfish, sorry about that! Could you please tell me which version of Flutter / Redux / flutter_redux you're using? I can't see anything obviously wrong with the code in the code you've pasted in. Does the example from this repository work for ya? |
@brianegan Not problem. I see the benefits of using flutter redux so THANKS!.. I basically took the example from the repo and decompose it, move widgets out to separate files, global stuff, app stuff, etc.. Here is a link to the test project... https://github.com/lockerfish/flutter_redux_test. Check out app.dart file. It breaks when trying to use a new IncrementButton widget... Hope this helps |
Thanks for the full project, I'll take a look :) |
Ah, ok -- you're running into one of the most annyoing things about Dart! For some reason, you need to be very careful when importing files in your own project. Rather than directly referencing the file,
Otherwise, for some reason, Dart will think that Diff to get it working: diff --git a/lib/app.dart b/lib/app.dart
index 8205a18..efedfb9 100644
--- a/lib/app.dart
+++ b/lib/app.dart
@@ -2,8 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_redux/flutter_redux.dart';
import 'package:flutter_redux_test/increment_button.dart';
import 'package:redux/redux.dart';
-import 'cool_widget.dart';
-import 'global.dart';
+import 'package:flutter_redux_test/cool_widget.dart';
class FlutterReduxApp extends StatelessWidget {
final Store<int> store;
diff --git a/lib/main.dart b/lib/main.dart
index b89686f..ab338dd 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:redux/redux.dart';
-import 'global.dart';
-import 'app.dart';
+import 'package:flutter_redux_test/global.dart';
+import 'package:flutter_redux_test/app.dart';
void main() {
final store = new Store<int>(counterReducer, initialState: 0);
|
That's it! The good news is VS Code is defaulting to using package. |
Just ran into this and wasted a full evening... |
@passsy Did ya get it fixed following these instructions? If so, might be good to chime in on the linked issue for the Dart lang Repo. More reports will hopefully bump up the priority. |
I am getting StoreProvider not found when I try connecting from another class. Hoping the code below helps understanding the issue.
The text was updated successfully, but these errors were encountered: