-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implemented graphs and percentages, ready for release
- Loading branch information
Showing
11 changed files
with
171 additions
and
41 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
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,5 @@ | ||
class ChartsModel { | ||
DateTime date; | ||
int value; | ||
ChartsModel(this.date, this.value); | ||
} |
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,21 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:charts_flutter/flutter.dart' as charts; | ||
|
||
class Chart extends StatelessWidget { | ||
final List<charts.Series> seriesList; | ||
final bool animate; | ||
Chart(this.seriesList, {this.animate: false}); | ||
@override | ||
Widget build(BuildContext context) { | ||
return charts.TimeSeriesChart( | ||
seriesList, | ||
animate: animate, | ||
dateTimeFactory: const charts.LocalDateTimeFactory(), | ||
primaryMeasureAxis: charts.NumericAxisSpec( | ||
tickProviderSpec: charts.BasicNumericTickProviderSpec(zeroBound: false), | ||
renderSpec: charts.NoneRenderSpec(), | ||
), | ||
domainAxis: charts.DateTimeAxisSpec(renderSpec: charts.NoneRenderSpec()), | ||
); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,16 +1,17 @@ | ||
import 'package:corona_app/src/data/corona_api.dart'; | ||
import 'package:corona_app/src/models/chart_model.dart'; | ||
import 'package:corona_app/src/models/corona_data.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
|
||
void main() { | ||
test("Testing Last 8 days data for Worldwide", () async { | ||
CoronaData data = await fetchData("Worldwide"); | ||
print(data.last8DaysCases); | ||
expect(data.last8DaysCases is List<int>, true); | ||
print(data.last8DaysCases[0].date); | ||
expect(data.last8DaysCases is List<ChartsModel>, true); | ||
}); | ||
test("Testing Last 8 days data for a Country", () async { | ||
CoronaData data = await fetchData("USA"); | ||
print(data.last8DaysCases); | ||
expect(data.last8DaysCases is List<int>, true); | ||
print(data.last8DaysCases[0].date); | ||
expect(data.last8DaysCases is List<ChartsModel>, true); | ||
}); | ||
} |