-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
charts now work on iOS again. App didn't compile on iOS becaus of dar…
…t:js and dart:html imports
- Loading branch information
Showing
3 changed files
with
118 additions
and
58 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
41 changes: 41 additions & 0 deletions
41
open_earable/lib/sensor_data_tab/sensor_html_chart_stub.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:open_earable/sensor_data_tab/sensor_chart.dart'; | ||
|
||
class ChartSeries { | ||
final String id; | ||
final String label; | ||
final Function(SensorData, int?) getDomainFn; | ||
final Function(SensorData, int?) getMeasureFn; | ||
final Function(SensorData, String?) getColorFn; | ||
|
||
final List<SensorData> data; | ||
|
||
ChartSeries({ | ||
required this.id, | ||
required this.label, | ||
required this.getDomainFn, | ||
required this.getMeasureFn, | ||
required this.getColorFn, | ||
required this.data, | ||
}); | ||
} | ||
|
||
class ChartJsWidget extends StatelessWidget { | ||
final String chartType; | ||
final List<ChartSeries> seriesList; | ||
final String title; | ||
|
||
const ChartJsWidget({ | ||
super.key, | ||
required this.chartType, | ||
required this.seriesList, | ||
required this.title, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Center( | ||
child: Text("Chart.js is not supported on this platform."), | ||
); | ||
} | ||
} |