fApp/lib/utils/appversion.dart
Flummi 14081489cc
All checks were successful
Flutter Schmutter / build (push) Successful in 3m54s
v1.3.0+56
2025-06-16 15:05:39 +02:00

13 lines
408 B
Dart

import 'package:flutter/services.dart';
class AppVersion {
static late String version;
static Future<void> init() async {
final String yaml = await rootBundle.loadString('pubspec.yaml');
final RegExpMatch? match = RegExp(r'^version:\s*(.*)$', multiLine: true).firstMatch(yaml);
final String? v = match?.group(1)!.replaceAll('"', '').replaceAll("'", '').trim();
version = v ?? "";
}
}