diff --git a/lib/authentication/login/views/login_page.dart b/lib/authentication/login/views/login_page.dart index e2c77f6705..cc23cadfde 100644 --- a/lib/authentication/login/views/login_page.dart +++ b/lib/authentication/login/views/login_page.dart @@ -8,6 +8,7 @@ import 'package:ardrive/authentication/login/blocs/login_bloc.dart'; import 'package:ardrive/authentication/login/blocs/stub_web_wallet.dart' // stub implementation if (dart.library.html) 'package:ardrive/authentication/login/blocs/web_wallet.dart'; import 'package:ardrive/blocs/profile/profile_cubit.dart'; +import 'package:ardrive/components/app_version_widget.dart'; import 'package:ardrive/misc/resources.dart'; import 'package:ardrive/pages/drive_detail/components/hover_widget.dart'; import 'package:ardrive/services/arconnect/arconnect.dart'; @@ -99,10 +100,25 @@ class _LoginPageScaffoldState extends State { child: Row( children: [ Expanded( - child: _buildIllustration( - context, - // verify theme light - Resources.images.login.gridImage), + child: Stack( + children: [ + _buildIllustration( + context, + // verify theme light + Resources.images.login.gridImage, + ), + Positioned( + bottom: 16, + left: 16, + child: AppVersionWidget( + color: ArDriveTheme.of(context) + .themeData + .colors + .themeFgDefault, + ), + ), + ], + ), ), Expanded( child: FractionallySizedBox( @@ -123,7 +139,29 @@ class _LoginPageScaffoldState extends State { horizontal: 16, vertical: 8, ), - child: Center(child: _buildContent(context)), + child: Stack( + children: [ + Center( + child: Column( + children: [ + _buildContent(context), + ], + ), + ), + Positioned( + bottom: 16, + child: SizedBox( + width: MediaQuery.of(context).size.width - 32, + child: AppVersionWidget( + color: ArDriveTheme.of(context) + .themeData + .colors + .themeFgDefault, + ), + ), + ), + ], + ), ), ), ), diff --git a/lib/components/app_version_widget.dart b/lib/components/app_version_widget.dart new file mode 100644 index 0000000000..24a1611a36 --- /dev/null +++ b/lib/components/app_version_widget.dart @@ -0,0 +1,39 @@ +import 'package:ardrive/utils/app_localizations_wrapper.dart'; +import 'package:ardrive_ui/ardrive_ui.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; +import 'package:package_info_plus/package_info_plus.dart'; + +class AppVersionWidget extends StatelessWidget { + final Color color; + + const AppVersionWidget({ + Key? key, + this.color = Colors.grey, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return FutureBuilder( + future: PackageInfo.fromPlatform(), + builder: (BuildContext context, AsyncSnapshot snapshot) { + final info = snapshot.data; + if (info == null) { + return const SizedBox( + height: 32, + width: 32, + ); + } + final literalVersion = + kIsWeb ? info.version : '${info.version}+${info.buildNumber}'; + return Text( + appLocalizationsOf(context).appVersion(literalVersion), + style: ArDriveTypography.body.buttonNormalRegular( + color: color, + ), + textAlign: TextAlign.center, + ); + }, + ); + } +} diff --git a/lib/components/side_bar.dart b/lib/components/side_bar.dart index 797d8f53f6..cd4c974e87 100644 --- a/lib/components/side_bar.dart +++ b/lib/components/side_bar.dart @@ -1,6 +1,7 @@ import 'package:ardrive/blocs/drive_detail/drive_detail_cubit.dart'; import 'package:ardrive/blocs/drives/drives_cubit.dart'; import 'package:ardrive/blocs/profile/profile_cubit.dart'; +import 'package:ardrive/components/app_version_widget.dart'; import 'package:ardrive/components/new_button/new_button.dart'; import 'package:ardrive/components/theme_switcher.dart'; import 'package:ardrive/misc/resources.dart'; @@ -16,7 +17,6 @@ import 'package:ardrive_ui/ardrive_ui.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:package_info_plus/package_info_plus.dart'; import 'package:responsive_builder/responsive_builder.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -719,32 +719,3 @@ class HelpButton extends StatelessWidget { ); } } - -class AppVersionWidget extends StatelessWidget { - const AppVersionWidget({Key? key}) : super(key: key); - - @override - Widget build(BuildContext context) { - return FutureBuilder( - future: PackageInfo.fromPlatform(), - builder: (BuildContext context, AsyncSnapshot snapshot) { - final info = snapshot.data; - if (info == null) { - return const SizedBox( - height: 32, - width: 32, - ); - } - final literalVersion = - kIsWeb ? info.version : '${info.version}+${info.buildNumber}'; - return Text( - appLocalizationsOf(context).appVersion(literalVersion), - style: ArDriveTypography.body.buttonNormalRegular( - color: Colors.grey, - ), - textAlign: TextAlign.center, - ); - }, - ); - } -}