Skip to content

Commit

Permalink
## [0.9.10]
Browse files Browse the repository at this point in the history
- start porting to null-safety in the other branch.
- fix a bug with `GText` layout.
- update dependencies in *examples/*
- removed `flutter_icons`.
  • Loading branch information
roipeker committed Mar 25, 2021
1 parent be68dfd commit 2cf0815
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 42 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [0.9.10]
- start port to null-safety.
- fix a bug with GText layout.

## [0.9.9]
- major fix for `GTween` when running lots of SceneControllers instances.
- fix stage dispose exception with keyboard/pointer.
Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,19 @@ To get some extended, boring explanations, and eventually some sample codes, che

---

[Try Graphx on Dart Pad](https://dartpad.dev/21b6670a42d32e37440192e19279e71b?)
[Try Graphx (0.0.9) on Dart Pad](https://dartpad.dev/21b6670a42d32e37440192e19279e71b?)

#### news!

- WIP Support for [null-safety](https://github.com/roipeker/graphx/tree/null-safety) in the other branch.
- Support for HotReload

#### prototyping

GraphX is all about visuals, here you have some screen captures of random prototypes I've been doing, while developing and testing graphx.

For your GraphX scene to support **Hot Reload**, you should initialize your variables and DisplayObjects inside `addedToStage`, and optionally clean them in `dispose`.

[![artificial horizon](https://media.giphy.com/media/NMG8gfpJxFiu1eALZo/giphy.gif)](https://media.giphy.com/media/NMG8gfpJxFiu1eALZo/source.mp4)
[![parallax game](https://media.giphy.com/media/RIrvhfZoDtal41Tb4e/giphy-downsized.gif)](https://media.giphy.com/media/RIrvhfZoDtal41Tb4e/source.mp4)
[![charts pie color 2](https://media.giphy.com/media/pQdeurUOAqWdZuxxUK/giphy.gif)](https://media.giphy.com/media/pQdeurUOAqWdZuxxUK/source.mp4)
Expand Down
13 changes: 7 additions & 6 deletions example/lib/demos/simple_interactions/ui/my_button.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter_icons/flutter_icons.dart';
import 'package:graphx/graphx.dart';

class MyButton extends GSprite {
Expand Down Expand Up @@ -155,11 +154,13 @@ class MyButton extends GSprite {
/// update the [icon.data] and icon's color, based on [_isOn] current state.
void _updateIcon() {
if (_isOn) {
icon.data = Feather.sun;
icon.color = Colors.yellow;
} else {
icon.data = Feather.moon;
icon.color = Colors.white;
if (_isOn) {
icon.data = Icons.wb_incandescent;
icon.color = Colors.yellow;
} else {
icon.data = Icons.wb_incandescent_outlined;
icon.color = Colors.white;
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ void main() {
// home: PizzaBoxMain(),
// home: DrawingPadBezierMain(),
// home: IsmaChartMain(),
// home: TriGridMain(),
home: TriGridMain(),
// home: NicoLoadingIndicatorMain(),
// home: FeelingSwitchMain(),
// home: MouseRepulsionMain(),
// home: Globe3dMain(),
// home: LungsAnimationMain(),
// home: PathChartStressTestMain(),
// home: ExpanderFabMenu(),
home: PageIndicatorMain(),
// home: PageIndicatorMain(),
),
);
}
4 changes: 2 additions & 2 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ description: Graphx rendering prototype examples

publish_to: "none"

version: 1.0.0+22
version: 1.0.0+23

environment:
sdk: ">=2.7.0 <3.0.0"

dependencies:
flutter:
sdk: flutter
flutter_icons: ^1.1.0
flutter_svg: 0.19.3
graphx:
path: ../

dev_dependencies:
flutter_test:
sdk: flutter
Expand Down
16 changes: 16 additions & 0 deletions example/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Here you will find an exhaustive list of experiments made with GraphX.

Some are more complicated than others, but overall is a good resource to learn the "real world" API that GraphX provides.

Be WARNED: the examples are (mostly) pretty raw, a direct copy of codes I did during the last couple of months as
quick prototypes for experiments while sketching the package.

Remember, GraphX should be considered WIP. As stated in the root README file, I mostly used it to play, prototype
and have fun creating random stuffs, and that's the spirit of it :)

Although you are free to use it in production apps (some users are, myself as well), beware that you might find
some bugs.

I truly hope you enjoy using the package, as I much as I do.

Sincerely, roipeker.
2 changes: 1 addition & 1 deletion lib/src/display/text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ class GText extends GDisplayObject {

void _layout() {
//// Web has a bug for double.infinity for text layout.
var paragraphWidth = !SystemUtils.usingSkia ? _maxTextWidthForWeb : _width;
final paragraphWidth = _width.isInfinite && !SystemUtils.usingSkia ? _maxTextWidthForWeb : _width;
_paragraph?.layout(ui.ParagraphConstraints(width: paragraphWidth));
_invalidSize = false;
}
Expand Down
4 changes: 3 additions & 1 deletion lib/src/tween/src/mixins/tweenable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ mixin GTweenable {

/// override to know which properties will change.
void setTweenProp(PropTween tweenProp) {
final lerpObj = _lerps[tweenProp.p];
final key = '${tweenProp.p}';
if( !_lerps.containsKey(key)) return ;
final lerpObj = _lerps[key];
if (lerpObj == null) return;
lerpObj.to = tweenProp.cObj;
tweenProp.c = 1.0;
Expand Down
46 changes: 23 additions & 23 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,42 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.0-nullsafety.3"
version: "2.5.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety.3"
version: "2.1.0"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.5"
version: "1.1.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety.3"
version: "1.2.0"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.3"
version: "1.1.0"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.15.0-nullsafety.5"
version: "1.15.0"
convert:
dependency: transitive
description:
Expand All @@ -56,14 +56,14 @@ packages:
name: effective_dart
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
version: "1.3.1"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety.3"
version: "1.2.0"
flutter:
dependency: "direct main"
description: flutter
Expand All @@ -80,42 +80,42 @@ packages:
name: http
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.2"
version: "0.13.1"
http_parser:
dependency: transitive
description:
name: http_parser
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.4"
version: "4.0.0"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.10-nullsafety.3"
version: "0.12.10"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.6"
version: "1.3.0"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0-nullsafety.3"
version: "1.8.0"
pedantic:
dependency: "direct dev"
description:
name: pedantic
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.2"
version: "1.11.0"
petitparser:
dependency: transitive
description:
Expand All @@ -134,56 +134,56 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0-nullsafety.4"
version: "1.8.0"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0-nullsafety.6"
version: "1.10.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety.3"
version: "2.1.0"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.3"
version: "1.1.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety.3"
version: "1.2.0"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.19-nullsafety.6"
version: "0.2.19"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.5"
version: "1.3.0"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety.5"
version: "2.1.0"
xml:
dependency: "direct main"
description:
Expand All @@ -192,4 +192,4 @@ packages:
source: hosted
version: "4.5.1"
sdks:
dart: ">=2.12.0-0.0 <3.0.0"
dart: ">=2.12.0 <3.0.0"
11 changes: 5 additions & 6 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: graphx
description: Render API on top of CustomPainter to power-up your Flutter apps to the next level.
version: 0.9.9
version: 0.9.10
homepage: https://github.com/roipeker/graphx

environment:
Expand All @@ -9,12 +9,11 @@ environment:
dependencies:
flutter:
sdk: flutter
xml: ^4.5.1
http: ^0.12.2
# flutter_svg: 0.19.0
xml: ^4.2.0
http: ^0.13.1

dev_dependencies:
pedantic: ^1.9.2
pedantic: ^1.11.0
flutter_test:
sdk: flutter
effective_dart: ^1.3.0
effective_dart: ^1.3.1

0 comments on commit 2cf0815

Please sign in to comment.