Comments (7)
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?
from flutter_redux.
@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
from flutter_redux.
Thanks for the full project, I'll take a look :)
from flutter_redux.
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, global.dart
, you want to specify the full "path":
import 'package:flutter_redux_test/global.dart';
Otherwise, for some reason, Dart will think that import 'global.dart'
and import 'package:flutter_redux_test/global.dart';
are different :/
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);
from flutter_redux.
That's it! The good news is VS Code is defaulting to using package.
from flutter_redux.
Just ran into this and wasted a full evening...
from flutter_redux.
@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.
from flutter_redux.
Related Issues (20)
- How to not accept change notifications when the Router is not at the top level, and then take the initiative to obtain the changes when the Router returns to the top level HOT 1
- onDidChange called twice HOT 8
- Is this package still actively maintained?
- `onWillChange` and `onDidChange` errors are swallowed HOT 4
- Warning related to `?` operator on Linux/Dev channel. HOT 2
- Import Store data type
- Widgets binding error after upgrading flutter version to 2.13.0-0.1.pre HOT 1
- onDidChange not working as expected HOT 3
- Build warning with Flutter 3.0 HOT 5
- flutter_redux depends on flutter_redux, version solving failed HOT 3
- onWillChange and onDidChange called twice after state update HOT 2
- Passing Store as an argument to MethodChannel and Background Isolate
- Question on how to use the reducer right way HOT 2
- [Question]: Any thoughts on difference between ignoreChange and distinct?
- Socket and Flutter_redux HOT 18
- Dispatching an action that does not alter state rerenders the widget, causing an infinite loop HOT 5
- How to watch redux store change inside useEffect? HOT 5
- [Question] is it expected that the store doesn't run until frames render? HOT 1
- After push a new page, and Dispatching an action, there is an infinite loop
- Is flutter redux actively maintained HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter_redux.