From bcc1b50f1070520ba7a29a82b28f5693b70dd266 Mon Sep 17 00:00:00 2001 From: Codel1417 Date: Wed, 12 Jun 2024 11:55:09 -0400 Subject: [PATCH] Move battery graph into debug info --- lib/Frontend/pages/shell.dart | 74 ++++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 31 deletions(-) diff --git a/lib/Frontend/pages/shell.dart b/lib/Frontend/pages/shell.dart index d0bb91f8..15fbff66 100644 --- a/lib/Frontend/pages/shell.dart +++ b/lib/Frontend/pages/shell.dart @@ -229,37 +229,6 @@ class _ManageGearState extends ConsumerState { ), ) ], - ValueListenableBuilder( - valueListenable: widget.device.batteryLevel, - builder: (BuildContext context, double value, Widget? child) { - return ExpansionTile( - title: Text(manageDevicesBatteryGraphTitle()), - children: [ - SizedBox( - height: 200, - child: Padding( - 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)), - ), - 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).colorScheme.primary, dotData: const FlDotData(show: false), isCurved: true, show: widget.device.batlevels.isNotEmpty)], - ), - ), - ), - ) - ], - ); - }, - ), if (widget.device.hasUpdate.value || HiveProxy.getOrDefault(settings, showDebugging, defaultValue: showDebuggingDefault)) ...[ Padding( padding: const EdgeInsets.all(16.0), @@ -383,6 +352,49 @@ class _ManageGearState extends ConsumerState { const ListTile( title: Divider(), ), + ValueListenableBuilder( + valueListenable: widget.device.batteryLevel, + builder: (BuildContext context, double value, Widget? child) { + return ExpansionTile( + title: Text(manageDevicesBatteryGraphTitle()), + children: [ + SizedBox( + height: 200, + child: Padding( + 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), + ), + leftTitles: AxisTitles( + axisNameWidget: Text('Battery'), + ), + bottomTitles: AxisTitles( + axisNameWidget: Text('Time'), + sideTitles: SideTitles(showTitles: true), + ), + ), + 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).colorScheme.primary, dotData: const FlDotData(show: false), isCurved: true, show: widget.device.batlevels.isNotEmpty)], + ), + ), + ), + ) + ], + ); + }, + ), ListTile( title: const Text("Debug"), subtitle: Column(