Skip to content

Commit

Permalink
solve error on battery graph when no data
Browse files Browse the repository at this point in the history
  • Loading branch information
Codel1417 committed Feb 26, 2024
1 parent 065843a commit 1bc1682
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions lib/Frontend/pages/Shell.dart
Original file line number Diff line number Diff line change
Expand Up @@ -340,21 +340,17 @@ class _ManageGearState extends ConsumerState<ManageGear> {
padding: const EdgeInsets.only(right: 16, top: 8, bottom: 8, left: 8),
child: LineChart(
LineChartData(
titlesData: const FlTitlesData(rightTitles: AxisTitles(sideTitles: SideTitles(showTitles: false)), topTitles: AxisTitles(sideTitles: SideTitles(showTitles: false))),
titlesData: const FlTitlesData(
rightTitles: AxisTitles(sideTitles: SideTitles(showTitles: false)),
topTitles: AxisTitles(sideTitles: SideTitles(showTitles: false)),
),
lineTouchData: const LineTouchData(enabled: false),
borderData: FlBorderData(show: false),
minY: 0,
maxY: 100,
minX: 0,
maxX: widget.device.stopWatch.elapsed.inSeconds.toDouble(),
lineBarsData: [
LineChartBarData(
spots: widget.device.batlevels,
color: Theme.of(context).primaryColor,
dotData: const FlDotData(show: false),
isCurved: true,
)
],
lineBarsData: [LineChartBarData(spots: widget.device.batlevels, color: Theme.of(context).primaryColor, dotData: const FlDotData(show: false), isCurved: true, show: widget.device.batlevels.isNotEmpty)],
),
),
),
Expand Down

0 comments on commit 1bc1682

Please sign in to comment.