Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
f5481181
Commit
f5481181
authored
Oct 01, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Port playfair to fn3
parent
76ed7ae2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
10 deletions
+20
-10
playfair.dart
packages/playfair/lib/playfair.dart
+1
-1
base.dart
packages/playfair/lib/src/base.dart
+19
-9
No files found.
packages/playfair/lib/playfair.dart
View file @
f5481181
...
...
@@ -9,6 +9,6 @@ import 'dart:math' as math;
import
'package:sky/material.dart'
;
import
'package:sky/rendering.dart'
;
import
'package:sky/widgets.dart'
;
import
'package:sky/widgets
_next
.dart'
;
part
'src/base.dart'
;
packages/playfair/lib/src/base.dart
View file @
f5481181
...
...
@@ -38,17 +38,26 @@ const double kIndicatorStrokeWidth = 2.0;
const
Color
kIndicatorColor
=
const
Color
(
0xFFFF4081
);
const
double
kIndicatorMargin
=
2.0
;
class
Chart
extends
LeafRenderObjectWrapper
{
class
Chart
extends
StatelessComponent
{
Chart
({
Key
key
,
this
.
data
})
:
super
(
key:
key
);
final
ChartData
data
;
RenderChart
createNode
()
=>
new
RenderChart
(
data:
data
);
RenderChart
get
renderObject
=>
super
.
renderObject
;
Widget
build
(
BuildContext
context
)
{
return
new
_ChartWrapper
(
textTheme:
Theme
.
of
(
context
).
text
,
data:
data
);
}
}
class
_ChartWrapper
extends
LeafRenderObjectWidget
{
_ChartWrapper
({
Key
key
,
this
.
textTheme
,
this
.
data
})
:
super
(
key:
key
);
final
TextTheme
textTheme
;
final
ChartData
data
;
RenderChart
createRenderObject
()
=>
new
RenderChart
(
textTheme:
textTheme
,
data:
data
);
void
syncRenderObject
(
Widget
old
)
{
super
.
syncRenderObject
(
old
);
renderObject
.
textTheme
=
Theme
.
of
(
this
).
text
;
void
updateRenderObject
(
RenderChart
renderObject
,
_ChartWrapper
oldWidget
)
{
renderObject
.
textTheme
=
textTheme
;
renderObject
.
data
=
data
;
}
}
...
...
@@ -56,9 +65,10 @@ class Chart extends LeafRenderObjectWrapper {
class
RenderChart
extends
RenderConstrainedBox
{
RenderChart
({
TextTheme
textTheme
,
ChartData
data
})
:
_painter
=
new
ChartPainter
(
data
),
super
(
child:
null
,
additionalConstraints:
BoxConstraints
.
expand
);
})
:
_painter
=
new
ChartPainter
(
textTheme:
textTheme
,
data:
data
),
super
(
child:
null
,
additionalConstraints:
const
BoxConstraints
.
expand
()
);
final
ChartPainter
_painter
;
...
...
@@ -104,7 +114,7 @@ class Indicator {
}
class
ChartPainter
{
ChartPainter
(
this
.
_data
)
;
ChartPainter
(
{
TextTheme
textTheme
,
ChartData
data
})
:
_data
=
data
,
_textTheme
=
textTheme
;
ChartData
_data
;
ChartData
get
data
=>
_data
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment