Skip to content

Commit

Permalink
Merge pull request #423 from artchiee/fix/replace-chart-lib
Browse files Browse the repository at this point in the history
Unfinished work on Charts replacement
  • Loading branch information
rolandgeider authored Aug 25, 2023
2 parents 237b4da + cf35cea commit 23d87d9
Show file tree
Hide file tree
Showing 7 changed files with 519 additions and 79 deletions.
2 changes: 1 addition & 1 deletion flatpak/scripts/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@ packages:
source: hosted
version: "1.3.1"
sdks:
dart: ">=2.18.5 <3.0.0"
dart: ">=2.18.5 <4.0.0"
18 changes: 18 additions & 0 deletions lib/widgets/core/charts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/

import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:wger/theme/theme.dart';

Expand Down Expand Up @@ -45,6 +46,9 @@ class MeasurementChartWidget extends StatelessWidget {
id: 'Measurement',
colorFn: (_, __) => wgerChartSecondaryColor,
domainFn: (MeasurementChartEntry entry, _) => entry.date,

// expression body => same as above(arrow expression)
//domainFn: (MeasurementChartEntry entry, _){ return entry.date;} ,
measureFn: (MeasurementChartEntry entry, _) => entry.value,
data: _entries,
)
Expand All @@ -58,6 +62,20 @@ class MeasurementChartWidget extends StatelessWidget {
}
}

// // #TODO : Del Later /// test state less >> del later
// class GetEntries extends StatelessWidget {
// final List<MeasurementChartEntry> _entries;
// const GetEntries(this._entries);

// @override
// Widget build(BuildContext context) {
// // return old entries above

// var entriesal = _entries.toString();
// return Text(entriesal);
// }
// }

class Indicator extends StatelessWidget {
const Indicator({
super.key,
Expand Down
Loading

0 comments on commit 23d87d9

Please sign in to comment.