m3_lightmeter/lib/screens/settings/components/widget_label_version.dart
Vadim 14bac950cf Fixed _models_ and _screens_ folders structure
proper folders for models

unified _screen_ folder filenames
2022-12-18 14:39:02 +03:00

27 lines
813 B
Dart

import 'package:flutter/material.dart';
import 'package:lightmeter/generated/l10n.dart';
import 'package:package_info_plus/package_info_plus.dart';
class VersionLabel extends StatelessWidget {
const VersionLabel({super.key});
@override
Widget build(BuildContext context) {
return FutureBuilder<PackageInfo>(
future: PackageInfo.fromPlatform(),
builder: (context, snapshot) {
if (snapshot.data != null) {
final version = snapshot.data!.version;
final buildNumber = snapshot.data!.buildNumber;
return Center(
child: Text(
S.of(context).version(version, buildNumber),
style: Theme.of(context).textTheme.bodySmall,
),
);
}
return const SizedBox.shrink();
},
);
}
}