this repo has no description
at main 21 lines 615 B view raw
1import 'package:flutter/material.dart'; 2import 'package:package_info_plus/package_info_plus.dart'; 3 4class AppVersionText extends StatelessWidget { 5 const AppVersionText({super.key}); 6 7 @override 8 Widget build(BuildContext context) { 9 return FutureBuilder( 10 future: PackageInfo.fromPlatform(), 11 builder: (context, snapshot) { 12 if (!snapshot.hasData) return const SizedBox.shrink(); 13 final info = snapshot.data!; 14 return Text( 15 'v${info.version} (${info.buildNumber})', 16 style: const TextStyle(fontSize: 12, color: Colors.grey), 17 ); 18 }, 19 ); 20 } 21}