98 Commits

Author SHA1 Message Date
Adam Barth
d25ff94259 Merge pull request #1832 from abarth/tap_position
Add a position to the onTap callback
2015-10-27 14:20:35 -07:00
Adam Barth
0d1e58072b Add a position to the onTap callback
Fixes #1807
2015-10-27 14:12:54 -07:00
Ian Hickson
4b56dd50a0 Track scroll position
- Change RouteArguments to pass the route's BuildContext rather than
  the Navigator. This caused the bulk of the examples/ and .../test/
  changes (those are mostly mechanical changes). It also meant I could
  simplify Navigator.of().

- Make initState() actually get called when the State's Element is in
  the tree, so you can use Foo.of() functions there. Added a test for
  this also.

- Provide a RouteWidget so that routes have a position in the Widget
  tree. The bulk of the route logic is still in a longer-lived Route
  object for now.

- Make Route.setState() only rebuild the actual route, not the whole
  navigator.

- Provided a Route.of().

- Provided a Route.writeState / Route.readState API that tries to
  identify the clients by their runtimeType, their key, and their
  ancestors keys, up to the nearest ancestor with a GlobalKey.

- Made scrollables hook into this API to track state. Added a test to
  make sure this works.

- Fix the debug output of GestureDetector and the hashCode of
  MixedViewport.

- Fixed ScrollableWidgetListState<T> to handle infinite lists.
2015-10-27 13:46:07 -07:00
Adam Barth
e448acb008 Use VoidCallback for onPressed and friends
Previous these callbacks were leaking the implementation detail that they were
triggered by taps. In a later patch, we're going to add a parameter to
GestureTapCallback that these callbacks won't have.

Related to #1807
2015-10-27 10:21:10 -07:00
Hixie
a8bd598fc4 Strong modeify the examples
This makes skyanalyzer also check the examples, and fixes everything it
found there.
2015-10-23 18:13:25 -07:00
Adam Barth
75fe9414e7 Give the CustomPaint and SizeObserver callbacks better names
The style we use for callbacks in widgets is "onFoo". These classes were using
an order naming convention and just called their callbacks "callback".
2015-10-19 17:27:40 -07:00
Adam Barth
1782be8d98 Remove old setFoo functions on Paint
We now just use Dart properties, which is more idiomatic.
2015-10-19 12:21:34 -07:00
Adam Barth
06a9623906 Rename skysprites to flutter_sprites 2015-10-13 16:34:01 -07:00
Jason Simmons
c5e01a4067 Update imports of skysprites to flutter_sprites 2015-10-13 16:07:38 -07:00
Adam Barth
4d0b7911a0 Import dart:ui as ui (instead of as sky) 2015-10-09 20:55:54 -07:00
Adam Barth
dca1370bc6 Rename package:sky to package:flutter 2015-10-09 20:44:52 -07:00
Adam Barth
72c103cefa Rename dart:sky to dart:ui 2015-10-09 19:27:13 -07:00
Adam Barth
6483ebeecc Rename App to MaterialApp
MaterialApp assumes that you're using material design.

Also move radial reaction and fix imports for stats box.
2015-10-09 10:27:22 -07:00
Adam Barth
3b06c85c6d Split material design widgets out of widgets.dart
These are now part of material.dart.
2015-10-09 10:07:06 -07:00
Adam Barth
4e8ee23a1a Remove ButtonState
Clients should just use a GestureDetector (or an InkWell) instead.
2015-10-08 10:26:34 -07:00
Viktor Lidholt
bf4342fa9a Adds default text style 2015-10-06 09:28:05 -07:00
Hixie
3467f32a1f Simplify the usage of Navigator's routes argument
(These are changes cherry-picked from in-flight branches since they are
more independent and could be helpful even without those changes.)

- Change RouteBuilder's signature to take a single argument in which the
  other fields are placed, so that we can keep iterating on those
  arguments without having to break compatibility each time. Also, this
  makes defining route builders much simpler (only one argument to
  ignore rather than a variable number).

- Expose the next performance to RouteBuilders, since sometimes the
  route itself might not be where it's used.

- Allow BuildContext to be used to walk children, just like it can for
  ancestors

- Allow BuildContext to be used to get the Widget of the current
  BuildContext

- Allow StatefulComponentElement to be referenced with a type
  specialisation so that you don't have to cast when you know what the
  type you're dealing with actually is.
2015-10-05 13:59:30 -07:00
Adam Barth
8cf43b65d2 Moves from vector_math to vector_math_64
* Moves from vector_math to vector_math_64
* Adds support for Float64List in Dart bindings
2015-10-01 14:46:13 -07:00
Adam Barth
feb70684f5 Make fn3 the default widget framework 2015-10-01 09:48:35 -07:00
Adam Barth
d7e3388b13 Remove unused imports 2015-10-01 09:30:31 -07:00
Adam Barth
9d63bb1381 Port SkySprites and clients to fn3 2015-10-01 09:26:19 -07:00
Viktor Lidholt
05f31c7259 Renames pointQuickDist in GameMath 2015-09-25 13:12:01 -07:00
Adam Barth
3dbef8ac26 SkySprites should import the public libraries
Importing the public libraries caused a name conflict with dart:sky because we
assume people will import dart:sky into a namespace, so I've also changed
skysprites to import dart:sky into a namespace.
2015-09-18 11:19:39 -07:00
Adam Barth
9cef3e61e9 Move theme into material.dart
Also, introduce Colors and Typography to hold the material colors and the
typography declarations. Previously we expected clients of these libraries to
import them into a namespace, but that doesn't play nice with re-exporting them
from material.dart.
2015-09-18 09:57:21 -07:00
Adam Barth
0cc094288e Move mojo frontend into services.dart
What's important about this code is that it's presenting services outside the
VM, not the particular technology used to present the services.
2015-09-16 19:13:50 -07:00
Adam Barth
b0719a47b6 Remove use of some deprecated functions on sky.Paint
We now expose idiomatic setters for these properties. Eventually we'll remove
the setter functions.
2015-09-13 17:24:15 -07:00
Adam Barth
ad0d74a41e Introduce painting.dart and move painting code to src/painting 2015-09-08 10:36:14 -07:00
Viktor Lidholt
ae9d4115ff Adds helpers to bosses at level 2 & 3 and above in demo game 2015-09-04 10:35:45 -07:00
Viktor Lidholt
c4a6610ad7 More precise removal of lasers when they go offscreen in demo game 2015-09-04 10:35:45 -07:00
Viktor Lidholt
7681420367 Laser speed now accounts for scrolling speed in demo game 2015-09-04 10:35:45 -07:00
Viktor Lidholt
a4d344d164 Refactors boss power bar to use new constraint in demo game 2015-09-03 15:36:26 -07:00
Viktor Lidholt
ab616f08d9 Adds coins when a boss explodes in demo game 2015-09-03 14:55:14 -07:00
Viktor Lidholt
2bb73bbf5f Refactors code in demo game to make it simpler 2015-09-03 13:40:36 -07:00
Viktor Lidholt
1a6300a20a Adds power bar and movements to boss fights in demo game 2015-09-03 12:58:24 -07:00
Viktor Lidholt
ee7023531c Initial boss fight in demo game 2015-09-02 16:49:36 -07:00
Viktor Lidholt
e8fbb4f133 Adds speed boost power up to demo game 2015-09-02 15:14:22 -07:00
Viktor Lidholt
b5ffee2b25 Improves laser upgrade in demo game 2015-09-02 14:47:54 -07:00
Adam Barth
becef0155a Merge pull request #1018 from abarth/mv_src
Move widgets and rendering inside src
2015-09-02 13:41:25 -07:00
Adam Barth
0045b65996 Move widgets and rendering inside src
Code outside of package:sky should import this code using

package:sky/rendering.dart
package:sky/widgets.dart

Moving this code into the "src" directory is a convention that signifies that
and it cleans up the generated dartdoc because the libraries in the src
directory aren't included in the generated documentation. Instead, the classes
are documented in the widgets.dart and rendering.dart libraries.
2015-09-02 13:38:00 -07:00
Viktor Lidholt
cbce3da61a Improves on demo game balance and adds levels for lasers 2015-09-02 13:34:02 -07:00
Viktor Lidholt
1cca29b3cd Adds level labels to demo game 2015-09-01 16:14:53 -07:00
Viktor Lidholt
2291bd6d4c Adds small explosions to demo game 2015-09-01 15:34:43 -07:00
Viktor Lidholt
fcd47c4dc1 Speeds up explosions in demo game 2015-09-01 15:34:43 -07:00
Viktor Lidholt
eb6a09c55c Adds power-ups to demo game 2015-08-28 16:07:00 -07:00
Viktor Lidholt
435e3a5fbd Adds new enemies and coin display to demo game 2015-08-28 16:07:00 -07:00
Viktor Lidholt
aca0dd5860 Adds counting of coins in demo game 2015-08-26 15:35:19 -07:00
Viktor Lidholt
77c8c04946 Moves GameObjectFactory and PlayerState to their own files in demo game 2015-08-26 13:14:40 -07:00
Viktor Lidholt
3b183ff416 Adds power ups to demo game, and some minor refactoring to support the addition 2015-08-26 12:41:21 -07:00
Viktor Lidholt
a7ede89e93 Splits up demo game into multiple files for better readability 2015-08-26 10:22:09 -07:00
Viktor Lidholt
33f64444ad Updates demo game to work with new constraints api 2015-08-26 10:07:59 -07:00