remove hero buttons
All checks were successful
All checks were successful
This commit is contained in:
@@ -83,7 +83,6 @@ class _DashboardState extends State<Dashboard> {
|
|||||||
HomepageStats? stats,
|
HomepageStats? stats,
|
||||||
) {
|
) {
|
||||||
final colorScheme = Theme.of(context).colorScheme;
|
final colorScheme = Theme.of(context).colorScheme;
|
||||||
final isCompact = MediaQuery.of(context).size.width < 720;
|
|
||||||
final greetingName =
|
final greetingName =
|
||||||
stats?.user?.fullName ?? auth.fullName ?? auth.username ?? 'there';
|
stats?.user?.fullName ?? auth.fullName ?? auth.username ?? 'there';
|
||||||
final totalMileage = stats?.totalMileage ?? 0;
|
final totalMileage = stats?.totalMileage ?? 0;
|
||||||
@@ -109,26 +108,9 @@ class _DashboardState extends State<Dashboard> {
|
|||||||
),
|
),
|
||||||
padding: const EdgeInsets.all(18),
|
padding: const EdgeInsets.all(18),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
isCompact
|
|
||||||
? Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
_heroHeading(context, greetingName, colorScheme),
|
_heroHeading(context, greetingName, colorScheme),
|
||||||
const SizedBox(height: 12),
|
|
||||||
_heroActions(context, colorScheme, wrap: true),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
: Row(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: _heroHeading(context, greetingName, colorScheme),
|
|
||||||
),
|
|
||||||
_heroActions(context, colorScheme, wrap: false),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const SizedBox(height: 18),
|
const SizedBox(height: 18),
|
||||||
Wrap(
|
Wrap(
|
||||||
spacing: 12,
|
spacing: 12,
|
||||||
@@ -314,49 +296,6 @@ class _DashboardState extends State<Dashboard> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _heroActions(
|
|
||||||
BuildContext context,
|
|
||||||
ColorScheme colorScheme, {
|
|
||||||
required bool wrap,
|
|
||||||
}) {
|
|
||||||
final buttons = [
|
|
||||||
FilledButton.icon(
|
|
||||||
style: FilledButton.styleFrom(
|
|
||||||
backgroundColor: Colors.white,
|
|
||||||
foregroundColor: colorScheme.primary,
|
|
||||||
),
|
|
||||||
onPressed: () => context.go('/add'),
|
|
||||||
icon: const Icon(Icons.add_circle_outline),
|
|
||||||
label: const Text('Add entry'),
|
|
||||||
),
|
|
||||||
FilledButton.tonalIcon(
|
|
||||||
onPressed: () => context.go('/traction'),
|
|
||||||
icon: const Icon(Icons.train),
|
|
||||||
label: const Text('Traction'),
|
|
||||||
),
|
|
||||||
FilledButton.tonalIcon(
|
|
||||||
onPressed: () => context.go('/trips'),
|
|
||||||
icon: const Icon(Icons.book),
|
|
||||||
label: const Text('Trips'),
|
|
||||||
),
|
|
||||||
];
|
|
||||||
|
|
||||||
if (wrap) {
|
|
||||||
return Wrap(spacing: 8, runSpacing: 8, children: buttons);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
for (final btn in buttons)
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(left: 8.0),
|
|
||||||
child: btn,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget _buildOnThisDayCard(BuildContext context, DataService data) {
|
Widget _buildOnThisDayCard(BuildContext context, DataService data) {
|
||||||
final filtered = data.onThisDay
|
final filtered = data.onThisDay
|
||||||
.where((leg) => leg.beginTime.year != DateTime.now().year)
|
.where((leg) => leg.beginTime.year != DateTime.now().year)
|
||||||
|
|||||||
Reference in New Issue
Block a user