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,
|
||||
) {
|
||||
final colorScheme = Theme.of(context).colorScheme;
|
||||
final isCompact = MediaQuery.of(context).size.width < 720;
|
||||
final greetingName =
|
||||
stats?.user?.fullName ?? auth.fullName ?? auth.username ?? 'there';
|
||||
final totalMileage = stats?.totalMileage ?? 0;
|
||||
@@ -111,24 +110,7 @@ class _DashboardState extends State<Dashboard> {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
isCompact
|
||||
? Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_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),
|
||||
],
|
||||
),
|
||||
_heroHeading(context, greetingName, colorScheme),
|
||||
const SizedBox(height: 18),
|
||||
Wrap(
|
||||
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) {
|
||||
final filtered = data.onThisDay
|
||||
.where((leg) => leg.beginTime.year != DateTime.now().year)
|
||||
|
||||
Reference in New Issue
Block a user