Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Update to latest Flutter SDK #14

Merged
merged 20 commits into from Aug 29, 2017
Merged

Update to latest Flutter SDK #14

merged 20 commits into from Aug 29, 2017

Conversation

rxlabz
Copy link
Contributor

@rxlabz rxlabz commented Aug 22, 2017

No description provided.

flutter_test:
sdk: flutter
flutter_flux:
path: /Users/rxlabz/dev/examples/flutter/examples/redux_styles/flutter_flux-1

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it will probably help 😊

enableAssertInitializer: true
strong-mode:
implicit-dynamic: false

Copy link
Contributor

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.


1. `cd chat_app`
2. `flutter run`
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Presumably this was unintentional?

enableSuperMixins: true
enableAssertInitializer: true
strong-mode:
implicit-dynamic: false
Copy link
Contributor

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
}
Copy link
Contributor

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

Copy link
Contributor Author

@rxlabz rxlabz Aug 24, 2017

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 ?

Copy link
Contributor

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.

Copy link
Contributor Author

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

@@ -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';
Copy link
Contributor

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:

@@ -16,6 +15,8 @@ void main() {
}

class ChatScreen extends StoreWatcher {
final TextEditingController msgController = new TextEditingController();

ChatScreen({Key key}) : super(key: key);
Copy link
Contributor

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

padding: new EdgeInsets.symmetric(horizontal: 8.0),
scrollAnchor: ViewportAnchor.end,
/*scrollAnchor: ViewportAnchor.end,*/
Copy link
Contributor

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

import 'package:flutter/widgets.dart';
import 'package:flutter_flux/src/store.dart';
import 'package:meta/meta.dart';
Copy link
Contributor

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

if (!mounted)
return;
setState(() { });
if (!mounted) return;
Copy link
Contributor

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.

Copy link
Contributor Author

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 ?

Copy link
Contributor

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.

Copy link
Contributor Author

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 ?

return;
setState(() { });
if (!mounted) return;
setState(() {});
Copy link
Contributor

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

@@ -145,8 +149,7 @@ class StoreToken {

@override
bool operator ==(dynamic other) {
if (other is! StoreToken)
return false;
if (other is! StoreToken) return false;
Copy link
Contributor

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.

@Hixie
Copy link
Contributor

Hixie commented Aug 24, 2017

Overall this is great, just some minor issues.

@rxlabz
Copy link
Contributor Author

rxlabz commented Aug 29, 2017

@Hixie Do I need to do something more, or better ?

@@ -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>{
Copy link
Contributor

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 <

@@ -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))));
}
Copy link
Contributor

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)),
  ),
);


@Hixie
Copy link
Contributor

Hixie commented Aug 29, 2017

LGTM

@Hixie
Copy link
Contributor

Hixie commented Aug 29, 2017

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.

@rxlabz
Copy link
Contributor Author

rxlabz commented Aug 29, 2017

@Hixie Thanks for the review. the two last issues are fixed now !
( so happy to make my first PR to the Flutter repo ( and to a major OSS project ) ! :) )

@Hixie
Copy link
Contributor

Hixie commented Aug 29, 2017

Hm, I just noticed the cla bot didn't trigger. Let me look into that before I land it.

@Hixie
Copy link
Contributor

Hixie commented Aug 29, 2017

Oh never mind, it did trigger, we just don't have the labels set.

@Hixie
Copy link
Contributor

Hixie commented Aug 29, 2017

Ok, all's good! I'm landing it! Thanks so much for the contribution!

@Hixie Hixie merged commit 628e178 into google:master Aug 29, 2017
@rxlabz rxlabz deleted the updateToLatestDSK branch September 3, 2017 21:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants