28 lines
1.0 KiB
Dart
28 lines
1.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'scooter_info_item.dart';
|
|
|
|
class ScooterInfoSection extends StatelessWidget {
|
|
final double distance;
|
|
final String location;
|
|
const ScooterInfoSection({super.key, required this.distance, required this.location});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Column(
|
|
children: [
|
|
ScooterInfoItem(icon: 'assets/icons/bolt.png', text: '47 км или 4 часа 17 минут'),
|
|
ScooterInfoItem(icon: 'assets/icons/speed.png', text: 'max = 25 км/ч'),
|
|
ScooterInfoItem(icon: 'assets/icons/location.png', text: location),
|
|
Row(
|
|
children: [
|
|
ScooterInfoItem(icon: 'assets/icons/person.png', text: distance.toInt() >= 1000
|
|
? '${((distance.toInt()) / 1000).toStringAsFixed(1)} km'
|
|
: '${distance.toInt()} m',),
|
|
SizedBox(width: 16),
|
|
ScooterInfoItem(icon: 'assets/icons/time.png', text: '1 минута'),
|
|
],
|
|
),
|
|
],
|
|
);
|
|
}
|
|
} |