Commit Graph

168 Commits

Author SHA1 Message Date
Viktor Lidholt
e1e773af4f Fixes crash in Flutter Sprites label (#3942) 2016-05-16 13:40:14 -07:00
Ian Hickson
3252701753 Make it possible to run tests live on a device (#3936)
This makes it possible to substitute 'flutter run' for 'flutter test'
and actually watch a test run on a device.

For any test that depends on flutter_test:

1. Remove any import of 'package:test/test.dart'.

2. Replace `testWidgets('...', (WidgetTester tester) {`
      with `testWidgets('...', (WidgetTester tester) async {`

3. Add an "await" in front of calls to any of the following:
    * tap()
    * tapAt()
    * fling()
    * flingFrom()
    * scroll()
    * scrollAt()
    * pump()
    * pumpWidget()

4. Replace any calls to `tester.flushMicrotasks()` with calls to
   `await tester.idle()`.

There's a guarding API that you can use, if you have particularly
complicated tests, to get better error messages. Search for
TestAsyncUtils.
2016-05-16 12:53:13 -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
ee903af03f Move TextAlign out of TextStyle (#3789)
TextAlign applies to a whole paragraph instead of applying to an individual
text span. This patch moves the property out of TextStyle and into a separate
property on Text and RichText.
2016-05-06 17:33:27 -07:00
Viktor Lidholt
153e1bb918 Fixes to particle system API (#3762) 2016-05-05 17:31:16 -07:00
pq
bcede8dffb Literals get type annotations.
As per the recent fix to the `always_specify_types` lint (https://github.com/dart-lang/linter/issues/199), literal maps and lists are now expected to be explicitly typed.

Running that lint on the repo identifies quite a few spots to update.  This focuses on `flutter_driver` and `flutter_sprites` (somewhat arbitrarily) but the changes are fairly representative.

Note there are a number of places where I made a quick judgement on how specific to make the types.  Feedback on those is welcome.  (Especially as we move forward with more.)
2016-05-04 09:18:31 -07:00
Viktor Lidholt
76b04cddde Refactor sprite physics, part 1 (#3711) 2016-05-03 17:16:36 -07:00
Viktor Lidholt
ed40dd3577 Initial set of tests for flutter sprites (#3643)
* Initial set of tests for flutter sprites
2016-04-29 14:46:09 -07:00
Adam Barth
e41120bc68 Improve the TextPainter API (#3621)
Instead of using properties, TextPainter now receives min and max width as
parameters to layout. Also, this patch integrates the intrinsic sizing logic
into the main layout function, which satisfies all the existing uses cases.
2016-04-28 20:44:52 -07:00
Adam Barth
9d900ea75a Improve dartdoc for extent callbacks (#3514)
Fixes #3510
2016-04-23 09:45:43 -07:00
Ian Hickson
e968d91ca4 Rename binding abstract classes (#3482)
The old names were getting silly and started stepping on valuable namespace.

The new names are consistent and clear.
2016-04-21 17:18:46 -07:00
Viktor Lidholt
b314a7d9fa Adds NineSliceSprite and optimizes gallery front page (#3485)
* Adds NineSliceSprite and optimizes gallery front page
2016-04-21 17:16:16 -07:00
Adam Barth
65b36f131d Remove pub package version skew (#3212)
We need to pin the version of package:analyzer we use to avoid version skew
within our project.
2016-04-08 10:08:13 -07:00
Adam Barth
6fd6859793 LazyBlock docs and physics
This patch adds dartdoc to LazyBlock. Also, this patch fixes the scrolling
physics of LazyBlock. Previously, we updated a running simulation only when the
change in scroll behavior changed the current scroll offset. Now we update
running simulations every time the behavior changes because the simulation
might depend on quantities other than the current scroll offset.
2016-04-06 12:36:54 -07:00
Viktor Lidholt
a1212dbc54 Initial version of Fancy line drawer demo 2016-03-30 16:56:46 -07:00
Viktor Lidholt
d563f50822 First pass at new Flutter gallery front page 2016-03-25 14:11:01 -07:00
Kris Giesing
bb5a82a726 Allow independent rendering pipelines
Fixes #2723
2016-03-24 14:59:21 -07:00
Ian Hickson
561a94ccfe Miscellaneous dartdoc markdown fixes 2016-03-17 22:27:58 -07:00
Hixie
797e27edd3 Add @override annotations to flutter framework 2016-03-14 14:02:26 -07:00
Adam Barth
726eff4953 [rename fixit] *OneChild* -> *SingleChild*
Fixes #1482
2016-03-12 12:33:39 -08:00
Hixie
6795efacab Enable always_specify_types lint
And fix the zillion issues that uncovered.
2016-03-12 00:37:31 -08:00
Ian Hickson
43b0104114 Revert "Merge pull request #2639 from Hixie/always_specify_types"
This reverts commit f41b3411da, reversing
changes made to e33d8d9621.

This was a bad check-in due to my mangling uploading a new version of the branch from a different machine.

This reverts https://github.com/flutter/flutter/pull/2639 and will be replaced by https://github.com/flutter/flutter/pull/2640
2016-03-12 00:34:37 -08:00
Hixie
d162d98c79 Enable always_specify_types lint
And fix the zillion issues that uncovered.
2016-03-11 18:27:32 -08:00
Adam Barth
0277b075e0 Provide the BuildContext to createRenderObject and updateRenderObject
We'll need this for RTL support because the RTL state will live in the widget
tree. Also, remove the `oldWidget` argument to updateRenderObject because there
aren't any clients for it.
2016-03-11 08:59:37 -08:00
Ian Hickson
1b9cd52081 Enable ALL THE LINTS
Well, all the easy ones, anyway.

For some reason `// ignore:` isn't working for me so I've disabled
lints that need that. Also disabled those that require a ton of work
(which I'm doing, but not in this PR, to keep it reviewable).

This adds:
- avoid_init_to_null
- library_names
- package_api_docs
- package_names
- package_prefixed_library_names
- prefer_is_not_empty
- sort_constructors_first
- sort_unnamed_constructors_first
- unnecessary_getters_setters
2016-03-10 23:15:31 -08:00
Hixie
c7339de6bc Enable always_declare_return_types lint
And fix a zillion omissions this uncovered.
2016-03-09 17:57:39 -08:00
Adam Barth
ac1cba59ca updateRenderObject() methods should use the .. pattern
Fixes #1381
2016-03-01 13:03:29 -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
Viktor Lidholt
ecfc303270 Correctly calculates gravity in particle systems 2016-02-17 10:14:44 -08:00
Ian Hickson
a94999ba50 Clean up imports and exports.
Each layer is supposed to reexport the parts of the previous layer
that are part of its API.

- In painting.dart, export from dart:ui all the Canvas-related APIs
  that make sense to be used at higher levels, e.g. PaintingStyle.

- Delete painting/shadows.dart. It was dead code.

- In rendering/object.dart, export all of painting.dart.

- In widgets/basic.dart, export all of painting.dart and
  animation.dart. Some classes in animation/ are renamed to make this
  less disruptive and confusing to the namespace.

- Split out Stocks back into an import model rather than a part model,
  so that it's easier to manage its dependencies on a per-file basis.

- Move Ticker to scheduler library.

- Remove as many redundant imports as possible now.

- Some minor nit picking cleanup in various files.
2016-02-11 00:06:23 -08:00
Viktor Lidholt
b727f34fc2 Fixes issue with replacing the root node 2016-02-08 09:56:56 -08:00
Ian Hickson
e739d7431e Merge pull request #1043 from devoncarew/flutter_sprites_test
Flutter sprites test
2016-02-04 12:55:46 -08:00
Jason Simmons
6f6584b6da Update flutter_sprites now that ImageResource.first returns an ImageInfo 2016-02-02 17:07:26 -08:00
Viktor Lidholt
592250885f Adds opacity property to particle systems 2016-01-29 14:52:31 -08:00
Devon Carew
9aa39192a9 add a test for flutter_sprites 2016-01-14 09:13:44 -08:00
Devon Carew
f6518a6254 remove the flutter_sprites/lib/src/sound_manager.dart library 2016-01-14 09:07:25 -08:00
Ian Hickson
8f894f3757 Merge pull request #1140 from Hixie/concat
Transition callers from 'concat' to 'transform'
2016-01-11 20:05:07 -08:00
Alex Fandrianto
ddb060d685 Add reference to "mojo:media_service" in sound.dart
Related: https://github.com/domokit/mojo/issues/614

Flutter can play sounds using this package. However, when Mojo Shell is running Flutter, it lacks the necessary media service.

This patch creates a hook to the mojo binary `media_service.mojo`. If Mojo Shell is built with this media service, then it will be able to play sounds when running Flutter.
2016-01-11 18:13:50 -08:00
Ian Hickson
17ef9488ff Transition callers from 'concat' to 'transform'
See: https://github.com/flutter/flutter/issues/1080
2016-01-08 08:58:31 -08:00
Seth Ladd
ef4ea9b776 generate docs for sprites 2016-01-07 15:55:41 -08:00
Jason Simmons
1d16ebff05 Merge pull request #959 from jason-simmons/sound_track_pause
Pause and resume of all tracks in SoundTrackPlayer
2015-12-16 13:17:06 -08:00
Jason Simmons
8c45c949a9 Pause and resume of all tracks in SoundTrackPlayer 2015-12-16 13:11:23 -08:00
Jason Simmons
680540f9f4 Apply looping and volume in the SoundTrackPlayer 2015-12-16 13:05:44 -08:00
Jason Simmons
db10a6ee29 Update SoundEffectPlayer to use the SoundPool API 2015-12-14 12:37:17 -08:00
Jason Simmons
80e2422f6a Use Scheduler.instance in flutter_sprites 2015-12-14 10:27:55 -08:00
Ian Hickson
5996d381a7 Check for cycles in our various tree structures. 2015-12-10 19:30:46 -08:00
Jason Simmons
0c9333cc10 Change flutter_sprites to use the current PointerEvent.position API 2015-12-08 10:46:44 -08:00
Viktor Lidholt
1e683b2f61 Merge pull request #704 from vlidholt/master
Fixes issue with physics debug drawing in sprites
2015-12-07 10:22:25 -08:00
Ian Hickson
2965dcb61f Cleanup for the Pointer changes. 2015-12-05 00:31:27 -08:00
Adam Barth
abf0359569 Remove PaintingCanvas
We can just use Canvas now.  The two are the same thing.
2015-12-04 20:26:08 -08:00