-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from imaNNeoFighT/improvement/refactor-class-names
Improvement/refactor class names
- Loading branch information
Showing
35 changed files
with
182 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ Thank you all! | |
|
||
```kotlin | ||
dependencies: | ||
fl_chart: ^0.0.2 | ||
fl_chart: ^0.0.3 | ||
``` | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
library fl_chart; | ||
|
||
import 'package:flutter/material.dart'; | ||
|
||
import 'src/chart/bar_chart/bar_chart.dart'; | ||
import 'src/chart/base/base_chart/base_chart.dart'; | ||
import 'src/chart/base/base_chart/base_chart_painter.dart'; | ||
import 'src/chart/line_chart/line_chart.dart'; | ||
import 'src/chart/pie_chart/pie_chart.dart'; | ||
|
||
export 'src/chart/bar_chart/bar_chart.dart'; | ||
export 'src/chart/bar_chart/bar_chart_data.dart'; | ||
export 'src/chart/base/axis_chart/axis_chart_data.dart'; | ||
export 'src/chart/base/base_chart/base_chart_data.dart'; | ||
export 'src/chart/line_chart/line_chart.dart'; | ||
export 'src/chart/line_chart/line_chart_data.dart'; | ||
export 'src/chart/pie_chart/pie_chart.dart'; | ||
export 'src/chart/pie_chart/pie_chart_data.dart'; | ||
|
||
|
||
/// A base widget that holds a [BaseChart] class | ||
/// that contains [BaseChartPainter] extends from [CustomPainter] | ||
/// to paint the relative content on our [CustomPaint] class | ||
/// [BaseChart] is an abstract class and we should use a concrete class | ||
/// such as [LineChart], [BarChart], [PieChart]. | ||
class FlChart extends StatefulWidget { | ||
final BaseChart chart; | ||
|
||
FlChart({ | ||
Key key, | ||
@required this.chart, | ||
}) : super(key: key) { | ||
if (chart == null) { | ||
throw Exception('chart might not be null'); | ||
} | ||
} | ||
|
||
@override | ||
State<StatefulWidget> createState() => _FlChartState(); | ||
} | ||
|
||
class _FlChartState extends State<FlChart> { | ||
@override | ||
Widget build(BuildContext context) { | ||
return CustomPaint( | ||
painter: widget.chart.painter(), | ||
); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
import '../base/fl_axis_chart/fl_axis_chart.dart'; | ||
import '../base/fl_chart/fl_chart_data.dart'; | ||
import '../base/fl_chart/fl_chart_painter.dart'; | ||
import 'package:fl_chart/src/chart/base/axis_chart/axis_chart.dart'; | ||
import 'package:fl_chart/src/chart/base/base_chart/base_chart_data.dart'; | ||
import 'package:fl_chart/src/chart/base/base_chart/base_chart_painter.dart'; | ||
|
||
import 'bar_chart_data.dart'; | ||
import 'bar_chart_painter.dart'; | ||
|
||
class BarChart extends FlAxisChart { | ||
class BarChart extends AxisChart { | ||
final BarChartData barChartData; | ||
|
||
BarChart( | ||
this.barChartData, | ||
); | ||
|
||
@override | ||
FlChartPainter<FlChartData> painter() => BarChartPainter(barChartData); | ||
BaseChartPainter<BaseChartData> painter() => BarChartPainter(barChartData); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import 'package:fl_chart/src/chart/bar_chart/bar_chart.dart'; | ||
import 'package:fl_chart/src/chart/base/base_chart/base_chart.dart'; | ||
import 'package:fl_chart/src/chart/line_chart/line_chart.dart'; | ||
|
||
/// This class is suitable for axis base charts | ||
/// in the axis base charts we have a grid behind the charts | ||
/// the direct subclasses are [LineChart], [BarChart] | ||
abstract class AxisChart extends BaseChart {} |
6 changes: 3 additions & 3 deletions
6
...ase/fl_axis_chart/fl_axis_chart_data.dart → ...hart/base/axis_chart/axis_chart_data.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
.../fl_axis_chart/fl_axis_chart_painter.dart → ...t/base/axis_chart/axis_chart_painter.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.