-
Notifications
You must be signed in to change notification settings - Fork 46
chore(llc): call stats improvements #1053
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
26d9832
improved call stats
Brazol a1c3e18
tweaks
Brazol cf3108e
Merge branch 'main' into chore/call-stats-improvements
Brazol 75df819
changelog
Brazol 898f193
trace when force migrating
Brazol 53ff7a8
reconnect traces tweaks
Brazol 4be211f
Merge branch 'main' into chore/call-stats-improvements
Brazol fe795a7
fix tests
Brazol 1e99baa
tweaks
Brazol 30f8752
battery drain display improvement
Brazol File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,118 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:fl_chart/fl_chart.dart'; | ||
import 'package:flutter_dogfooding/theme/app_palette.dart'; | ||
|
||
class StatsBatteryChart extends StatelessWidget { | ||
const StatsBatteryChart({super.key, required this.batteryLevelHistory}); | ||
|
||
final List<int> batteryLevelHistory; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Padding( | ||
padding: const EdgeInsets.all(8.0), | ||
child: LineChart( | ||
LineChartData( | ||
lineTouchData: const LineTouchData(enabled: false), | ||
gridData: FlGridData( | ||
show: true, | ||
drawVerticalLine: false, | ||
drawHorizontalLine: true, | ||
verticalInterval: 1, | ||
horizontalInterval: 20, | ||
getDrawingVerticalLine: (value) { | ||
return const FlLine( | ||
color: Color(0xff37434d), | ||
strokeWidth: 1, | ||
); | ||
}, | ||
getDrawingHorizontalLine: (value) { | ||
return const FlLine( | ||
color: Color(0xff37434d), | ||
strokeWidth: 1, | ||
); | ||
}, | ||
), | ||
titlesData: FlTitlesData( | ||
show: true, | ||
rightTitles: const AxisTitles( | ||
sideTitles: SideTitles( | ||
showTitles: true, | ||
reservedSize: 40, | ||
interval: 20, | ||
), | ||
), | ||
topTitles: const AxisTitles( | ||
sideTitles: SideTitles(showTitles: false), | ||
), | ||
bottomTitles: const AxisTitles( | ||
sideTitles: SideTitles(showTitles: false), | ||
), | ||
leftTitles: const AxisTitles( | ||
sideTitles: SideTitles(showTitles: false), | ||
), | ||
), | ||
borderData: FlBorderData( | ||
show: false, | ||
), | ||
minX: 0, | ||
maxX: 20, | ||
minY: 0, | ||
maxY: 100, | ||
lineBarsData: [ | ||
LineChartBarData( | ||
spots: batteryLevelHistory.indexed | ||
.map<FlSpot>( | ||
(m) => FlSpot(m.$1.toDouble(), m.$2.toDouble()), | ||
) | ||
.toList(), | ||
isCurved: true, | ||
gradient: LinearGradient( | ||
colors: [ | ||
ColorTween( | ||
begin: AppColorPalette.appGreen, | ||
// ignore: deprecated_member_use | ||
end: AppColorPalette.appGreen.withOpacity(0.5)) | ||
.lerp(0.2)!, | ||
ColorTween( | ||
begin: AppColorPalette.appGreen, | ||
// ignore: deprecated_member_use | ||
end: AppColorPalette.appGreen.withOpacity(0.5)) | ||
.lerp(0.2)!, | ||
], | ||
), | ||
barWidth: 3, | ||
isStrokeCapRound: true, | ||
dotData: const FlDotData( | ||
show: false, | ||
), | ||
belowBarData: BarAreaData( | ||
show: true, | ||
gradient: LinearGradient( | ||
colors: [ | ||
ColorTween( | ||
begin: AppColorPalette.appGreen, | ||
end: | ||
// ignore: deprecated_member_use | ||
AppColorPalette.appGreen.withOpacity(0.5)) | ||
.lerp(0.2)! | ||
// ignore: deprecated_member_use | ||
.withOpacity(0.1), | ||
ColorTween( | ||
begin: AppColorPalette.appGreen, | ||
end: | ||
// ignore: deprecated_member_use | ||
AppColorPalette.appGreen.withOpacity(0.5)) | ||
.lerp(0.2)! | ||
// ignore: deprecated_member_use | ||
.withOpacity(0.1), | ||
], | ||
), | ||
), | ||
), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.