Skip to content

Commit

Permalink
Merge pull request #319 from krispypen/patch-1
Browse files Browse the repository at this point in the history
Shadows default off
  • Loading branch information
imaNNeo committed Apr 23, 2020
2 parents ada2f15 + b88a3f0 commit 376697b
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions lib/src/chart/bar_chart/bar_chart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class _BarChartState extends AnimatedWidgetBaseState<BarChart> {

@override
Widget build(BuildContext context) {
final BarChartData showingData = _getDate();
final BarChartData showingData = _getData();
final BarTouchData touchData = showingData.barTouchData;

return GestureDetector(
Expand Down Expand Up @@ -177,7 +177,7 @@ class _BarChartState extends AnimatedWidgetBaseState<BarChart> {
return null;
}

BarChartData _getDate() {
BarChartData _getData() {
final barTouchData = widget.data.barTouchData;
if (barTouchData.enabled && barTouchData.handleBuiltInTouches) {
return widget.data.copyWith(
Expand Down
2 changes: 1 addition & 1 deletion lib/src/chart/bar_chart/bar_chart_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ class BarTouchedSpot extends TouchedSpot with EquatableMixin {
/// When touch happens, a [BarTouchedSpot] returns as a output,
/// it tells you where the touch happened.
/// [touchedBarGroup], and [touchedBarGroupIndex] tells you in which group touch happened,
/// [touchedRodData], and [touchedRodDataIndex] telss you in which rod touch happened.
/// [touchedRodData], and [touchedRodDataIndex] tells you in which rod touch happened.
/// You can also have the touched x and y in the chart as a [FlSpot] using [spot] value,
/// and you can have the local touch coordinates on the screen as a [Offset] using [offset] value.
BarTouchedSpot(
Expand Down
6 changes: 3 additions & 3 deletions lib/src/chart/line_chart/line_chart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class _LineChartState extends AnimatedWidgetBaseState<LineChart> {

@override
Widget build(BuildContext context) {
final LineChartData showingData = _getDate();
final LineChartData showingData = _getData();
final LineTouchData touchData = showingData.lineTouchData;

return GestureDetector(
Expand Down Expand Up @@ -173,7 +173,7 @@ class _LineChartState extends AnimatedWidgetBaseState<LineChart> {
return null;
}

LineChartData _getDate() {
LineChartData _getData() {
final lineTouchData = widget.data.lineTouchData;
if (lineTouchData.enabled && lineTouchData.handleBuiltInTouches) {
return widget.data.copyWith(
Expand Down Expand Up @@ -218,7 +218,7 @@ class _LineChartState extends AnimatedWidgetBaseState<LineChart> {
void forEachTween(visitor) {
_lineChartDataTween = visitor(
_lineChartDataTween,
_getDate(),
_getData(),
(dynamic value) => LineChartDataTween(begin: value),
);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/chart/line_chart/line_chart_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ class LineChartBarData with EquatableMixin {
dotData = dotData ?? FlDotData(),
showingIndicators = showingIndicators ?? const [],
dashArray = dashArray,
shadow = shadow ?? const Shadow(),
shadow = shadow ?? const Shadow(color: Colors.transparent),
isStepLineChart = isStepLineChart ?? false,
lineChartStepData = lineChartStepData ?? LineChartStepData();

Expand Down
2 changes: 1 addition & 1 deletion lib/src/chart/line_chart/line_chart_painter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ class LineChartPainter extends AxisChartPainter<LineChartData>
}

// paint each sublist that was built above
// bar is passed in seperately from barData
// bar is passed in separately from barData
// because barData is the whole line
// and bar is a piece of that line
for (List<FlSpot> bar in barList) {
Expand Down
4 changes: 2 additions & 2 deletions lib/src/chart/pie_chart/pie_chart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class _PieChartState extends AnimatedWidgetBaseState<PieChart> {

@override
Widget build(BuildContext context) {
final PieChartData showingData = _getDate();
final PieChartData showingData = _getData();
final PieTouchData touchData = showingData.pieTouchData;

return GestureDetector(
Expand Down Expand Up @@ -155,7 +155,7 @@ class _PieChartState extends AnimatedWidgetBaseState<PieChart> {

/// if builtIn touches are enabled, we should recreate our [pieChartData]
/// to handle built in touches
PieChartData _getDate() {
PieChartData _getData() {
return widget.data;
}

Expand Down
6 changes: 3 additions & 3 deletions lib/src/chart/scatter_chart/scatter_chart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class _ScatterChartState extends AnimatedWidgetBaseState<ScatterChart> {

@override
Widget build(BuildContext context) {
final ScatterChartData showingData = _getDate();
final ScatterChartData showingData = _getData();
final ScatterTouchData touchData = showingData.scatterTouchData;

return GestureDetector(
Expand Down Expand Up @@ -169,7 +169,7 @@ class _ScatterChartState extends AnimatedWidgetBaseState<ScatterChart> {
return null;
}

ScatterChartData _getDate() {
ScatterChartData _getData() {
final scatterTouchData = widget.data.scatterTouchData;
if (scatterTouchData.enabled && scatterTouchData.handleBuiltInTouches) {
return widget.data.copyWith(
Expand Down Expand Up @@ -202,7 +202,7 @@ class _ScatterChartState extends AnimatedWidgetBaseState<ScatterChart> {
void forEachTween(visitor) {
_scatterChartDataTween = visitor(
_scatterChartDataTween,
_getDate(),
_getData(),
(dynamic value) => ScatterChartDataTween(begin: value),
);
}
Expand Down
2 changes: 1 addition & 1 deletion repo_files/documentations/handle_touches.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


#### The Touch Flow
When user touches on the chart, touch will handle by the painter to determine which elements of the chart is touched and it makes an object that contains touch informations (for example a [LineTouchResponse](line_chart.md#LineTouchResponse), you can listen to the `touchCallback` provided in each ChartTouchData classes like [LineTouchData](line_chart.md#linetouchdata-read-about-touch-handling).
When user touches on the chart, touch will handle by the painter to determine which elements of the chart is touched and it makes an object that contains touch information (for example a [LineTouchResponse](line_chart.md#LineTouchResponse), you can listen to the `touchCallback` provided in each ChartTouchData classes like [LineTouchData](line_chart.md#linetouchdata-read-about-touch-handling).

If you set `handleBuiltInTouches` true, it will handle touch by showing a tooltip or an indicator on the touched spot (in the line and bar chart), you can also handle your own touch handling along with the built in touches.

Expand Down
2 changes: 1 addition & 1 deletion repo_files/documentations/scatter_chart.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ ScatterChart(


### ScatterTouchResponse
###### you can listen to touch behaviors callback and retrieve this object when any touch action happend.
###### you can listen to touch behaviors callback and retrieve this object when any touch action happened.
|PropName|Description|default value|
|:-------|:----------|:------------|
|touchedSpot|touched [ScatterSpot](#ScatterSpot)|null|
Expand Down
2 changes: 1 addition & 1 deletion test/utils/utils_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void main() {
expect(getDefaultSize(const Size(1000, 1000)).width, closeTo(700, tolerance));
});

test('translate roatted position', () {
test('translate rotated position', () {
expect(translateRotatedPosition(100, 90), 25);
expect(translateRotatedPosition(100, 0), 0);
});
Expand Down

0 comments on commit 376697b

Please sign in to comment.