Skip to content

Commit 2cf0815

Browse files
committed
## [0.9.10]
- start porting to null-safety in the other branch. - fix a bug with `GText` layout. - update dependencies in *examples/* - removed `flutter_icons`.
1 parent be68dfd commit 2cf0815

File tree

10 files changed

+71
-42
lines changed

10 files changed

+71
-42
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [0.9.10]
2+
- start port to null-safety.
3+
- fix a bug with GText layout.
4+
15
## [0.9.9]
26
- major fix for `GTween` when running lots of SceneControllers instances.
37
- fix stage dispose exception with keyboard/pointer.

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,19 @@ To get some extended, boring explanations, and eventually some sample codes, che
2020

2121
---
2222

23-
[Try Graphx on Dart Pad](https://dartpad.dev/21b6670a42d32e37440192e19279e71b?)
23+
[Try Graphx (0.0.9) on Dart Pad](https://dartpad.dev/21b6670a42d32e37440192e19279e71b?)
24+
25+
#### news!
26+
27+
- WIP Support for [null-safety](https://github.com/roipeker/graphx/tree/null-safety) in the other branch.
28+
- Support for HotReload
2429

2530
#### prototyping
2631

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

34+
For your GraphX scene to support **Hot Reload**, you should initialize your variables and DisplayObjects inside `addedToStage`, and optionally clean them in `dispose`.
35+
2936
[![artificial horizon](https://media.giphy.com/media/NMG8gfpJxFiu1eALZo/giphy.gif)](https://media.giphy.com/media/NMG8gfpJxFiu1eALZo/source.mp4)
3037
[![parallax game](https://media.giphy.com/media/RIrvhfZoDtal41Tb4e/giphy-downsized.gif)](https://media.giphy.com/media/RIrvhfZoDtal41Tb4e/source.mp4)
3138
[![charts pie color 2](https://media.giphy.com/media/pQdeurUOAqWdZuxxUK/giphy.gif)](https://media.giphy.com/media/pQdeurUOAqWdZuxxUK/source.mp4)

example/lib/demos/simple_interactions/ui/my_button.dart

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import 'package:flutter/material.dart';
2-
import 'package:flutter_icons/flutter_icons.dart';
32
import 'package:graphx/graphx.dart';
43

54
class MyButton extends GSprite {
@@ -155,11 +154,13 @@ class MyButton extends GSprite {
155154
/// update the [icon.data] and icon's color, based on [_isOn] current state.
156155
void _updateIcon() {
157156
if (_isOn) {
158-
icon.data = Feather.sun;
159-
icon.color = Colors.yellow;
160-
} else {
161-
icon.data = Feather.moon;
162-
icon.color = Colors.white;
157+
if (_isOn) {
158+
icon.data = Icons.wb_incandescent;
159+
icon.color = Colors.yellow;
160+
} else {
161+
icon.data = Icons.wb_incandescent_outlined;
162+
icon.color = Colors.white;
163+
}
163164
}
164165
}
165166

example/lib/main.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ void main() {
4747
// home: PizzaBoxMain(),
4848
// home: DrawingPadBezierMain(),
4949
// home: IsmaChartMain(),
50-
// home: TriGridMain(),
50+
home: TriGridMain(),
5151
// home: NicoLoadingIndicatorMain(),
5252
// home: FeelingSwitchMain(),
5353
// home: MouseRepulsionMain(),
5454
// home: Globe3dMain(),
5555
// home: LungsAnimationMain(),
5656
// home: PathChartStressTestMain(),
5757
// home: ExpanderFabMenu(),
58-
home: PageIndicatorMain(),
58+
// home: PageIndicatorMain(),
5959
),
6060
);
6161
}

example/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ description: Graphx rendering prototype examples
33

44
publish_to: "none"
55

6-
version: 1.0.0+22
6+
version: 1.0.0+23
77

88
environment:
99
sdk: ">=2.7.0 <3.0.0"
1010

1111
dependencies:
1212
flutter:
1313
sdk: flutter
14-
flutter_icons: ^1.1.0
1514
flutter_svg: 0.19.3
1615
graphx:
1716
path: ../
17+
1818
dev_dependencies:
1919
flutter_test:
2020
sdk: flutter

example/readme.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Here you will find an exhaustive list of experiments made with GraphX.
2+
3+
Some are more complicated than others, but overall is a good resource to learn the "real world" API that GraphX provides.
4+
5+
Be WARNED: the examples are (mostly) pretty raw, a direct copy of codes I did during the last couple of months as
6+
quick prototypes for experiments while sketching the package.
7+
8+
Remember, GraphX should be considered WIP. As stated in the root README file, I mostly used it to play, prototype
9+
and have fun creating random stuffs, and that's the spirit of it :)
10+
11+
Although you are free to use it in production apps (some users are, myself as well), beware that you might find
12+
some bugs.
13+
14+
I truly hope you enjoy using the package, as I much as I do.
15+
16+
Sincerely, roipeker.

lib/src/display/text.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ class GText extends GDisplayObject {
218218

219219
void _layout() {
220220
//// Web has a bug for double.infinity for text layout.
221-
var paragraphWidth = !SystemUtils.usingSkia ? _maxTextWidthForWeb : _width;
221+
final paragraphWidth = _width.isInfinite && !SystemUtils.usingSkia ? _maxTextWidthForWeb : _width;
222222
_paragraph?.layout(ui.ParagraphConstraints(width: paragraphWidth));
223223
_invalidSize = false;
224224
}

lib/src/tween/src/mixins/tweenable.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ mixin GTweenable {
3030

3131
/// override to know which properties will change.
3232
void setTweenProp(PropTween tweenProp) {
33-
final lerpObj = _lerps[tweenProp.p];
33+
final key = '${tweenProp.p}';
34+
if( !_lerps.containsKey(key)) return ;
35+
final lerpObj = _lerps[key];
3436
if (lerpObj == null) return;
3537
lerpObj.to = tweenProp.cObj;
3638
tweenProp.c = 1.0;

pubspec.lock

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,42 +7,42 @@ packages:
77
name: async
88
url: "https://pub.dartlang.org"
99
source: hosted
10-
version: "2.5.0-nullsafety.3"
10+
version: "2.5.0"
1111
boolean_selector:
1212
dependency: transitive
1313
description:
1414
name: boolean_selector
1515
url: "https://pub.dartlang.org"
1616
source: hosted
17-
version: "2.1.0-nullsafety.3"
17+
version: "2.1.0"
1818
characters:
1919
dependency: transitive
2020
description:
2121
name: characters
2222
url: "https://pub.dartlang.org"
2323
source: hosted
24-
version: "1.1.0-nullsafety.5"
24+
version: "1.1.0"
2525
charcode:
2626
dependency: transitive
2727
description:
2828
name: charcode
2929
url: "https://pub.dartlang.org"
3030
source: hosted
31-
version: "1.2.0-nullsafety.3"
31+
version: "1.2.0"
3232
clock:
3333
dependency: transitive
3434
description:
3535
name: clock
3636
url: "https://pub.dartlang.org"
3737
source: hosted
38-
version: "1.1.0-nullsafety.3"
38+
version: "1.1.0"
3939
collection:
4040
dependency: transitive
4141
description:
4242
name: collection
4343
url: "https://pub.dartlang.org"
4444
source: hosted
45-
version: "1.15.0-nullsafety.5"
45+
version: "1.15.0"
4646
convert:
4747
dependency: transitive
4848
description:
@@ -56,14 +56,14 @@ packages:
5656
name: effective_dart
5757
url: "https://pub.dartlang.org"
5858
source: hosted
59-
version: "1.3.0"
59+
version: "1.3.1"
6060
fake_async:
6161
dependency: transitive
6262
description:
6363
name: fake_async
6464
url: "https://pub.dartlang.org"
6565
source: hosted
66-
version: "1.2.0-nullsafety.3"
66+
version: "1.2.0"
6767
flutter:
6868
dependency: "direct main"
6969
description: flutter
@@ -80,42 +80,42 @@ packages:
8080
name: http
8181
url: "https://pub.dartlang.org"
8282
source: hosted
83-
version: "0.12.2"
83+
version: "0.13.1"
8484
http_parser:
8585
dependency: transitive
8686
description:
8787
name: http_parser
8888
url: "https://pub.dartlang.org"
8989
source: hosted
90-
version: "3.1.4"
90+
version: "4.0.0"
9191
matcher:
9292
dependency: transitive
9393
description:
9494
name: matcher
9595
url: "https://pub.dartlang.org"
9696
source: hosted
97-
version: "0.12.10-nullsafety.3"
97+
version: "0.12.10"
9898
meta:
9999
dependency: transitive
100100
description:
101101
name: meta
102102
url: "https://pub.dartlang.org"
103103
source: hosted
104-
version: "1.3.0-nullsafety.6"
104+
version: "1.3.0"
105105
path:
106106
dependency: transitive
107107
description:
108108
name: path
109109
url: "https://pub.dartlang.org"
110110
source: hosted
111-
version: "1.8.0-nullsafety.3"
111+
version: "1.8.0"
112112
pedantic:
113113
dependency: "direct dev"
114114
description:
115115
name: pedantic
116116
url: "https://pub.dartlang.org"
117117
source: hosted
118-
version: "1.9.2"
118+
version: "1.11.0"
119119
petitparser:
120120
dependency: transitive
121121
description:
@@ -134,56 +134,56 @@ packages:
134134
name: source_span
135135
url: "https://pub.dartlang.org"
136136
source: hosted
137-
version: "1.8.0-nullsafety.4"
137+
version: "1.8.0"
138138
stack_trace:
139139
dependency: transitive
140140
description:
141141
name: stack_trace
142142
url: "https://pub.dartlang.org"
143143
source: hosted
144-
version: "1.10.0-nullsafety.6"
144+
version: "1.10.0"
145145
stream_channel:
146146
dependency: transitive
147147
description:
148148
name: stream_channel
149149
url: "https://pub.dartlang.org"
150150
source: hosted
151-
version: "2.1.0-nullsafety.3"
151+
version: "2.1.0"
152152
string_scanner:
153153
dependency: transitive
154154
description:
155155
name: string_scanner
156156
url: "https://pub.dartlang.org"
157157
source: hosted
158-
version: "1.1.0-nullsafety.3"
158+
version: "1.1.0"
159159
term_glyph:
160160
dependency: transitive
161161
description:
162162
name: term_glyph
163163
url: "https://pub.dartlang.org"
164164
source: hosted
165-
version: "1.2.0-nullsafety.3"
165+
version: "1.2.0"
166166
test_api:
167167
dependency: transitive
168168
description:
169169
name: test_api
170170
url: "https://pub.dartlang.org"
171171
source: hosted
172-
version: "0.2.19-nullsafety.6"
172+
version: "0.2.19"
173173
typed_data:
174174
dependency: transitive
175175
description:
176176
name: typed_data
177177
url: "https://pub.dartlang.org"
178178
source: hosted
179-
version: "1.3.0-nullsafety.5"
179+
version: "1.3.0"
180180
vector_math:
181181
dependency: transitive
182182
description:
183183
name: vector_math
184184
url: "https://pub.dartlang.org"
185185
source: hosted
186-
version: "2.1.0-nullsafety.5"
186+
version: "2.1.0"
187187
xml:
188188
dependency: "direct main"
189189
description:
@@ -192,4 +192,4 @@ packages:
192192
source: hosted
193193
version: "4.5.1"
194194
sdks:
195-
dart: ">=2.12.0-0.0 <3.0.0"
195+
dart: ">=2.12.0 <3.0.0"

pubspec.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: graphx
22
description: Render API on top of CustomPainter to power-up your Flutter apps to the next level.
3-
version: 0.9.9
3+
version: 0.9.10
44
homepage: https://github.com/roipeker/graphx
55

66
environment:
@@ -9,12 +9,11 @@ environment:
99
dependencies:
1010
flutter:
1111
sdk: flutter
12-
xml: ^4.5.1
13-
http: ^0.12.2
14-
# flutter_svg: 0.19.0
12+
xml: ^4.2.0
13+
http: ^0.13.1
1514

1615
dev_dependencies:
17-
pedantic: ^1.9.2
16+
pedantic: ^1.11.0
1817
flutter_test:
1918
sdk: flutter
20-
effective_dart: ^1.3.0
19+
effective_dart: ^1.3.1

0 commit comments

Comments
 (0)