add timeline edit/delete
All checks were successful
All checks were successful
This commit is contained in:
47
lib/components/pages/calculator_details.dart
Normal file
47
lib/components/pages/calculator_details.dart
Normal file
@@ -0,0 +1,47 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mileograph_flutter/components/calculator/route_summary_widget.dart';
|
||||
import 'package:mileograph_flutter/objects/objects.dart';
|
||||
|
||||
class CalculatorDetailsPage extends StatelessWidget {
|
||||
const CalculatorDetailsPage({
|
||||
super.key,
|
||||
required this.result,
|
||||
});
|
||||
|
||||
final Object? result;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final parsed = result is RouteResult ? result as RouteResult : null;
|
||||
if (parsed == null) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
TextButton.icon(
|
||||
onPressed: () => context.pop(),
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
label: const Text('Back'),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
const Text(
|
||||
'No route details available.',
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: RouteDetailsView(
|
||||
route: parsed.calculatedRoute,
|
||||
costs: parsed.costs,
|
||||
onBack: () => context.pop(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user