Commit Graph

27 Commits

Author SHA1 Message Date
Ian Hickson
a52c7b470d Update the examples/ README and associated fixes. (#9090)
This yak shave went as follows:

Fix https://github.com/flutter/flutter/issues/8795 by adding stocks to
the examples README.

Notice the layers entry in that README isn't quite right either.
Update that.

Check the layers/README file is worth pointing at.

Update the layers/README.

Let's run some of the layer tests to see if they still work.

Oops, need to update them to gradle.

Ok let's try running them again.

Oops, sector is broken.

Add a test for sector.

Fix sector. Find you need to add an assert to a const constructor.

Notice we need to turn const asserts on for the analyzer.

Notice the analysis_options files are out of sync with each other and
with the full list of lints.

Turn on the lints that should be on.

Fix the bugs that finds.
2017-04-05 11:28:33 -07:00
Alexandre Ardhuin
578ca0a295 use color.shadeXxx instead of color[Xxx] (#8932)
* use color.shadeXxx instead of color[Xxx]

* remove calls to .shade500 on MaterialColor

* remove calls to .shade200 on MaterialAccentColor

* fix test
2017-03-21 23:14:55 +01:00
Alexandre Ardhuin
a9ba0e2f88 prefer_initializing_formals (#8797) 2017-03-15 18:30:55 +01:00
Alexandre Ardhuin
16d800b204 normalize setter format (#8708) 2017-03-10 21:52:30 +01:00
Chris Bracken
4c8c420e0b Declare locals final where not reassigned (layers) (#8572) 2017-03-03 18:04:27 -08:00
Alexandre Ardhuin
e9a775bf38 prefer const constructors (#8316) 2017-02-21 14:54:29 -08:00
Adam Barth
27970bd82d Remove package:flutter/cassowary.dart (#7350)
We didn't end up using this mechanism.
2017-01-05 13:08:43 -08:00
Ian Hickson
9e673853e5 Turn off AnimationControllers when not in use (#5902)
This requires all AnimationController objects to be given a
TickerProvider, a class that can create the Ticker.

It also provides some nice mixins for people who want to have their
State provide a TickerProvider. And a schedulerTickerProvider for those
cases where you just want to see your battery burn.

Also, we now enforce destruction order for elements.
2016-09-26 10:57:10 -07:00
Dragoș Tiselice
8ac14f8698 Replaced FlexDirection with Axis. (#5896)
Fixes #4618.
2016-09-15 15:23:37 -07:00
Ian Hickson
007d0a2f39 Cache intrinsic dimensions (#4446)
Also, make sure that the parent is notified when they change.

Fixes #2298
2016-06-07 22:07:12 -07:00
Ian Hickson
787fb3be7d Simplify intrinsic dimension APIs (#4283) 2016-05-31 14:59:48 -07:00
pq
e54196d7fc Turn on avoid_return_types_on_setters and cleanup annotated setters.
It's safe to remove the unneeded `void`s from setters since the blocking issues in the
`always_declare_return_types` lint have been fixed (https://github.com/dart-lang/linter/).  We can also safely flip the bit on  `avoid_return_types_on_setters`.
2016-05-12 11:45:30 -07:00
Adam Barth
4aa3756835 Move cassowary into package:flutter (#3591)
Cassowary doesn't have any additional dependencies and this simplifies things.

Fixes #2442
2016-04-27 17:32:06 -07:00
Ian Hickson
ecf1cce82c Provide details when reporting invalid constraints (#3281)
This also shrinks the width of the error messages a bit because now that
we use 'package:' URLs the stacks are a bit narrower.
2016-04-12 15:42:00 -07:00
Ian Hickson
47f5c6f2e0 Add even more careful checks around BoxConstraints (#3243)
I ran into a case where I was setting minHeight=∞ and then calling
layout() with that constraint, which is all kinds of bad. To try to
catch this earlier, this patch now provides a way to catch constraints
that are requiring infinite values.

We don't _always_ check this because there are valid uses for
BoxConstraints.biggest, e.g. as an additionalConstraint.
2016-04-11 11:10:11 -07:00
Adam Barth
1ba539a661 Add constants for FractionalOffsets
Adds some names for common FractionalOffset values.
2016-03-28 22:51:06 -07:00
Ian Hickson
552896afb7 Refactor cassowary so it uses imports rather than parts.
Also misc cleanup:
 - reorder members to be more consistent and fit the style guide
 - remove use of _Pair
 - made Variable.applyUpdate and Variable.owner public
 - added docs to Priority, tweaked the code a bit
 - added some docs to Result
 - removed the internal-error Result (replaced with asserts)
 - removed unused Results
 - made Result const
 - merged some files together since they had used privates a lot

I'm sorry this is completely unreviewable. I did the move from `lib/*`
to `lib/src/*` first, then did the `part`-to-`import` change, and then
found out how many of the files involved privates, which I wasn't
expecting. I can redo this as multiple commits if that would make it
easier to review.
2016-03-20 18:10:37 -07:00
Hixie
797e27edd3 Add @override annotations to flutter framework 2016-03-14 14:02:26 -07:00
Adam Barth
d5b2e2a01c [rename fixit] Flex alignments
* justifyContent -> mainAxisAlignment
* alignItems -> crossAxisAlignment
* FlexJustifyContent -> MainAxisAlignment
* FlexAlignItems -> CrossAxisAlignment

Fixes #231
2016-03-12 18:33:47 -08:00
Adam Barth
e71bd77e4f [rename fixit] EdgeDims -> EdgeInsets
Fixes #1382
2016-03-12 12:33:38 -08:00
Adam Barth
fb4dbf4584 Improve TextSpan
Now we just have one TextSpan class that handles both simple strings, trees of
children, and styling both. This approach simplifies the interface for most
clients.

This patch also removes StyledText, which was weakly typed and tricky to use
correctly. The replacement is RichText, which is strongly typed and uses
TextSpan.
2016-02-24 14:07:10 -08:00
Adam Barth
4408c820e1 Rename AutoLayoutParams to AutoLayoutRect
This object represents a rect the auto-layout system.
2016-02-15 16:29:27 -08:00
Adam Barth
c7d71d8ab1 Simplify the AutoLayout API
This patch makes it easier to use the auto layout API:

* We no longer use operator== because that requires an ugly cast by the
  API user.
* Also, "leftEdge" is now just "left" for less verbosity.
* AutoLayoutChild not implies its key from the AutoLayoutParam object.
* We now correctly layout every child of a RenderAutoLayout object even
  if the solver doesn't flush any updates to that child.
2016-02-15 15:25:21 -08:00
Adam Barth
262dd7a63b Add support for autolayout to widgets
This patch teaches the widget framework how to use Cassowary-based
autolayout. To integrate autolayout with widgets, I had to refactor how
RenderAutoLayout worked a bit. Now RenderAutoLayout follows the same
delegate pattern we use for custom paint and custom layout.
2016-02-15 03:01:40 -08:00
Adam Barth
1ab3d3a71c Add a raw hello_world that shows "Hello, world"
Previously, hello_world.dart was an interactive circle. I've moved that
to touch_input.dart. We should eventually harmonize the touch input
examples at all the layers.
2016-02-13 16:51:00 -08:00
Adam Barth
025c43de1c Adds documentation to the layering examples 2016-02-13 16:14:42 -08:00
Adam Barth
948ae15ca5 Clean up the standalone examples
Our examples have been growing organically over time. This patch cleans
them up to illustrate specific aspects of Flutter.
2016-02-13 11:00:58 -08:00