mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-09 10:08:00 -06:00
Update Landing page
This commit is contained in:
@@ -4,7 +4,14 @@ class ExpansionCard extends StatelessWidget {
|
||||
final Widget title;
|
||||
final Widget content;
|
||||
|
||||
const ExpansionCard({super.key, required this.title, required this.content});
|
||||
final bool initiallyExpanded;
|
||||
|
||||
const ExpansionCard({
|
||||
super.key,
|
||||
required this.title,
|
||||
required this.content,
|
||||
this.initiallyExpanded = false,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -23,7 +30,7 @@ class ExpansionCard extends StatelessWidget {
|
||||
),
|
||||
child: ExpansionTile(
|
||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||
initiallyExpanded: true,
|
||||
initiallyExpanded: initiallyExpanded,
|
||||
title: title,
|
||||
children: [content],
|
||||
),
|
||||
|
||||
@@ -75,7 +75,7 @@ class _MimeTypesPieChartState extends State<MimeTypesPieChart> {
|
||||
),
|
||||
),
|
||||
Wrap(
|
||||
alignment: WrapAlignment.start,
|
||||
alignment: WrapAlignment.spaceAround,
|
||||
spacing: 8,
|
||||
runSpacing: 8,
|
||||
children: [
|
||||
@@ -126,25 +126,18 @@ class _MimeTypesPieChartState extends State<MimeTypesPieChart> {
|
||||
for (int i = 0; i < widget.statistics.fileTypeCounts.length; i++) {
|
||||
final type = widget.statistics.fileTypeCounts[i];
|
||||
final isTouched = i == _touchedIndex;
|
||||
final fontSize = isTouched ? 24.0 : 16.0;
|
||||
final fontSize = isTouched ? 18.0 : 16.0;
|
||||
final radius = isTouched ? 60.0 : 50.0;
|
||||
const shadows = [
|
||||
Shadow(color: Colors.black, blurRadius: 2),
|
||||
];
|
||||
final color = colorShades[i % colorShades.length];
|
||||
final textColor =
|
||||
color.computeLuminance() > 0.5 ? Colors.black : Colors.white;
|
||||
final percentage = type.count / widget.statistics.documentsTotal * 100;
|
||||
yield PieChartSectionData(
|
||||
color: colorShades[i % colorShades.length],
|
||||
value: type.count.toDouble(),
|
||||
title: ((type.count / widget.statistics.documentsTotal) * 100)
|
||||
.toStringAsFixed(1) +
|
||||
"%",
|
||||
title: percentage.toStringAsFixed(1) + "%",
|
||||
radius: radius,
|
||||
titleStyle: TextStyle(
|
||||
fontSize: fontSize,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: textColor,
|
||||
color: Colors.black,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user