const splashWarning =
'Please use the IVI system responsibly while driving. Keep your attention on the road, and use voice commands or hands-free controls when interacting with the system. Distracted driving can lead to accidents and serious injury. Follow all traffic laws and drive safely.';
-const aglVeriosn = 'AGL 16.0.2 (pike)';
-const kernelVeriosn = 'Kernel: 5.10.41.-yocto-standard';
const maxFuelLevel = 100.0;
const maxSpeed = 240.0;
const maxRpm = 8000;
import 'package:flutter_ics_homescreen/export.dart';
class VersionInfoPage extends ConsumerWidget {
+ static String aglVersionFilePath = '/etc/os-release';
+ static String kernelVersionFilePath = '/proc/version';
+
+ static String aglVersion() {
+ try {
+ final file = File(aglVersionFilePath);
+ final data = file.readAsStringSync().split("\n");
+ if (!data[1].contains('Automotive Grade Linux')) {
+ throw 'Non-AGL distribution';
+ }
+ return "AGL: " + data[2].split('"')[1];
+ } catch (_) {
+ return '<AGL version not found>';
+ }
+ }
+
+ static String kernelVersion() {
+ try {
+ final file = File(kernelVersionFilePath);
+ final data = file.readAsStringSync().split(" ");
+ return "Kernel: " + data[2];
+ } catch (_) {
+ return '<Kernel version not found>';
+ }
+ }
+
const VersionInfoPage({super.key});
static Page<void> page() =>
child: ListTile(
contentPadding: const EdgeInsets.only(top: 50, left: 25),
leading: Text(
- aglVeriosn,
+ aglVersion(),
style: Theme.of(context).textTheme.titleMedium,
),
),
contentPadding: const EdgeInsets.only(top: 50, left: 25),
leading: Text(
- kernelVeriosn,
+ kernelVersion(),
style: Theme.of(context).textTheme.titleMedium,
),
),