Add display of legs and top traction, adjust colour based on device theme
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mileograph_flutter/services/authservice.dart';
|
||||
import 'package:mileograph_flutter/services/dataService.dart';
|
||||
import 'package:mileograph_flutter/components/dashboard/topTractionPanel.dart';
|
||||
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
@@ -22,36 +23,70 @@ class DashboardHeader extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
return Column(
|
||||
children: [
|
||||
Column(
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
auth.fullName ?? "Unknown",
|
||||
style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold),
|
||||
),
|
||||
Text.rich(
|
||||
TextSpan(
|
||||
children: [
|
||||
TextSpan(text: "Total Mileage: "),
|
||||
TextSpan(
|
||||
text: data.homepageStats?.totalMileage.toString() ?? "0",
|
||||
Row(
|
||||
children: [
|
||||
Card(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Text.rich(
|
||||
TextSpan(
|
||||
children: [
|
||||
TextSpan(text: "Total Mileage: "),
|
||||
TextSpan(
|
||||
text:
|
||||
data.homepageStats?.totalMileage
|
||||
.toString() ??
|
||||
"0",
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Text.rich(
|
||||
TextSpan(
|
||||
children: [
|
||||
TextSpan(text: DateTime.now().year.toString()),
|
||||
TextSpan(text: " Mileage: "),
|
||||
TextSpan(
|
||||
text: data
|
||||
.getMileageForCurrentYear()
|
||||
.toString(),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Text.rich(
|
||||
TextSpan(
|
||||
children: [
|
||||
TextSpan(text: DateTime.now().year.toString()),
|
||||
TextSpan(text: " Mileage: "),
|
||||
TextSpan(text: data.getMileageForCurrentYear().toString()),
|
||||
],
|
||||
),
|
||||
),
|
||||
Card(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(8),
|
||||
child: Column(
|
||||
children: [
|
||||
Text("Total Winners: 123"),
|
||||
Text("Average mileage: 45.6"),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Expanded(
|
||||
child: ListView(
|
||||
scrollDirection: Axis.vertical,
|
||||
children: [TopTractionPanel()],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user