From 9fce19dab2614cf939c47c13e825bf84573dc808 Mon Sep 17 00:00:00 2001 From: Welton Moura Date: Sun, 27 Sep 2026 17:30:42 -0300 Subject: [PATCH] feat: versao do app e aviso de alpha na pagina sobre Mostra a versao (via getVersion/package_info_plus) ao lado de um badge alpha e um aviso de que o app ainda esta em desenvolvimento. --- lib/utils/platform_infos.dart | 52 ++++++++++++++++++++++++++++++----- 1 file changed, 45 insertions(+), 7 deletions(-) diff --git a/lib/utils/platform_infos.dart b/lib/utils/platform_infos.dart index 2d75512..2bdee8f 100644 --- a/lib/utils/platform_infos.dart +++ b/lib/utils/platform_infos.dart @@ -72,13 +72,12 @@ abstract class PlatformInfos { final l10n = L10n.of(context); final theme = Theme.of(context); final size = MediaQuery.sizeOf(context); + final version = await getVersion(); + if (!context.mounted) return; await m.showDialog( context: context, builder: (context) => m.Dialog( - insetPadding: const EdgeInsets.symmetric( - horizontal: 24, - vertical: 40, - ), + insetPadding: const EdgeInsets.symmetric(horizontal: 24, vertical: 40), child: ConstrainedBox( constraints: BoxConstraints( maxWidth: 720, @@ -110,13 +109,52 @@ abstract class PlatformInfos { fontWeight: FontWeight.bold, ), ), + const SizedBox(height: 12), + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + l10n.versionWithNumber(version), + style: theme.textTheme.bodyMedium?.copyWith( + color: theme.colorScheme.onSurfaceVariant, + ), + ), + const SizedBox(width: 8), + Container( + padding: const EdgeInsets.symmetric( + horizontal: 8, + vertical: 2, + ), + decoration: BoxDecoration( + color: theme.colorScheme.tertiaryContainer, + borderRadius: BorderRadius.circular(8), + ), + child: Text( + 'alpha', + style: theme.textTheme.labelMedium?.copyWith( + color: theme.colorScheme.onTertiaryContainer, + fontWeight: FontWeight.bold, + ), + ), + ), + ], + ), + const SizedBox(height: 8), + Text( + 'Esta versão ainda está em fase alpha: o ' + 'aplicativo está em desenvolvimento e ainda pode ' + 'apresentar erros.', + textAlign: TextAlign.center, + style: theme.textTheme.bodySmall?.copyWith( + color: theme.colorScheme.onSurfaceVariant, + ), + ), const SizedBox(height: 24), Linkify( text: aboutDescription, textAlign: TextAlign.center, - style: TextStyle( - color: theme.colorScheme.onSurface, - ), + style: TextStyle(color: theme.colorScheme.onSurface), options: const LinkifyOptions(humanize: false), linkStyle: TextStyle( color: theme.colorScheme.primary,