Conversation
example/pubspec.yaml
Outdated
flutter_test: | ||
sdk: flutter | ||
flutter_flux: | ||
path: /Users/rxlabz/dev/examples/flutter/examples/redux_styles/flutter_flux-1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should remove this absolute path, yes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it will probably help 😊
analysis_options.yaml
Outdated
enableAssertInitializer: true | ||
strong-mode: | ||
implicit-dynamic: false | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we shouldn't need this file, flutter analyze
should automatically get the options from the flutter repo.
example/README.md
Outdated
|
||
1. `cd chat_app` | ||
2. `flutter run` | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Presumably this was unintentional?
example/analysis_options.yaml
Outdated
enableSuperMixins: true | ||
enableAssertInitializer: true | ||
strong-mode: | ||
implicit-dynamic: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment as above
|
||
task clean(type: Delete) { | ||
delete rootProject.buildDir | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please don't check in the .jar files or the gradlew and gradlew.bat files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I'm not sure to understand, isn't it the default generated build.gradle ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I put the comment nearest the files in the diff. It wasn't a comment on build.gradle. Github won't let me comment on the actual binary files.
The patch includes the gradle wrapper jar file and the shell scripts. It should not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I removed the gradle dir and gradlew files
example/lib/main.dart
Outdated
@@ -4,8 +4,7 @@ | |||
|
|||
import 'package:flutter/material.dart'; | |||
import 'package:flutter_flux/flutter_flux.dart'; | |||
|
|||
import 'stores.dart'; | |||
import 'package:flutter_flux_example/stores.dart'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this shouldn't be imported using package:
example/lib/main.dart
Outdated
@@ -16,6 +15,8 @@ void main() { | |||
} | |||
|
|||
class ChatScreen extends StoreWatcher { | |||
final TextEditingController msgController = new TextEditingController(); | |||
|
|||
ChatScreen({Key key}) : super(key: key); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: constructor first
see our style guide for more details on flutter style
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
example/lib/main.dart
Outdated
padding: new EdgeInsets.symmetric(horizontal: 8.0), | ||
scrollAnchor: ViewportAnchor.end, | ||
/*scrollAnchor: ViewportAnchor.end,*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't commit commented out code
lib/src/store_watcher.dart
Outdated
import 'package:flutter/widgets.dart'; | ||
import 'package:flutter_flux/src/store.dart'; | ||
import 'package:meta/meta.dart'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import flutter/foundation.dart instead
lib/src/store_watcher.dart
Outdated
if (!mounted) | ||
return; | ||
setState(() { }); | ||
if (!mounted) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this and the other change below seem to be extraneous and violate the flutter style guide.
there's various other things that could be done in this file to improve its adherence to the style guide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this 2 changes are only caused by dartfmt. How can I try to improve it , any advice ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't use dartfmt. It doesn't implement Flutter's style guide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know that, I restored the original formatting.
So there is no automated way to format to Flutter's style guide ?
lib/src/store_watcher.dart
Outdated
return; | ||
setState(() { }); | ||
if (!mounted) return; | ||
setState(() {}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a comment inside the closure saying what state changed
lib/src/store_watcher.dart
Outdated
@@ -145,8 +149,7 @@ class StoreToken { | |||
|
|||
@override | |||
bool operator ==(dynamic other) { | |||
if (other is! StoreToken) | |||
return false; | |||
if (other is! StoreToken) return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should really compare runtimeTypes not use is
here.
Overall this is great, just some minor issues. |
@Hixie Do I need to do something more, or better ? |
lib/src/store_watcher.dart
Outdated
@@ -85,7 +79,7 @@ class StoreWatcherState extends State<StoreWatcher> with StoreWatcherMixin { | |||
/// Listens to changes in a number of different stores. | |||
/// | |||
/// Used by [StoreWatcher] to track which stores the widget is listening to. | |||
abstract class StoreWatcherMixin implements State<dynamic> { // ignore: TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, https://github.com/dart-lang/sdk/issues/25232 | |||
abstract class StoreWatcherMixin <T extends StatefulWidget> implements State<T>{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove space before the <
lib/src/action.dart
Outdated
@@ -58,7 +58,7 @@ class Action<T> implements Function { | |||
// a [Stream]-based action implementation. At smaller sample sizes this | |||
// implementation slows down in comparison, yielding average times of 0.1 ms | |||
// for stream-based actions vs. 0.14 ms for this action implementation. | |||
return Future.wait(_listeners | |||
return Future.wait<dynamic>(_listeners | |||
.map((OnData l) => new Future<dynamic>.microtask(() => l(payload)))); | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: flutter style would be:
return Future.wait<dynamic>(
_listeners.map(
(OnData listener) => new Future<dynamic>.microtask(() => listener(payload)),
),
);

Let me know once you've fixed the two trivial issues I just pointed out and I can land it for you! Thanks so much for your contribution! And sorry about the delay in responding. |
to follow the Flutter style guide
@Hixie Thanks for the review. the two last issues are fixed now ! |
Hm, I just noticed the cla bot didn't trigger. Let me look into that before I land it. |
Oh never mind, it did trigger, we just don't have the labels set. |
Ok, all's good! I'm landing it! Thanks so much for the contribution! |
No description provided.