diff --git a/packages/app/lib/branding.dart b/packages/app/lib/branding.dart index 731fd955..460403f6 100644 --- a/packages/app/lib/branding.dart +++ b/packages/app/lib/branding.dart @@ -1,6 +1,12 @@ +import 'package:flutter_svg/flutter_svg.dart'; import 'package:neon/neon.dart'; Branding getNeonBranding() => Branding( name: 'Nextcloud Neon', + logo: SvgPicture.asset( + 'assets/logo.svg', + width: 100, + height: 100, + ), legalese: 'Copyright © 2023, provokateurin\nUnder GPLv3 license', ); diff --git a/packages/app/pubspec.lock b/packages/app/pubspec.lock index 1d9dbc9d..87360732 100644 --- a/packages/app/pubspec.lock +++ b/packages/app/pubspec.lock @@ -133,10 +133,10 @@ packages: dependency: transitive description: name: csslib - sha256: b36c7f7e24c0bdf1bf9a3da461c837d1de64b9f8beb190c9011d8c72a3dfd745 + sha256: "831883fb353c8bdc1d71979e5b342c7d88acfbc643113c14ae51e2442ea0f20f" url: "https://pub.dev" source: hosted - version: "0.17.2" + version: "0.17.3" dbus: dependency: transitive description: @@ -295,13 +295,13 @@ packages: source: hosted version: "2.0.14" flutter_svg: - dependency: transitive + dependency: "direct main" description: name: flutter_svg - sha256: f991fdb1533c3caeee0cdc14b04f50f0c3916f0dbcbc05237ccbe4e3c6b93f3f + sha256: "6ff8c902c8056af9736de2689f63f81c42e2d642b9f4c79dbf8790ae48b63012" url: "https://pub.dev" source: hosted - version: "2.0.5" + version: "2.0.6" flutter_test: dependency: "direct dev" description: flutter @@ -1132,26 +1132,26 @@ packages: dependency: transitive description: name: vector_graphics - sha256: "59a230f8bf37dd8b077335d1d64d895bccef0fb14f50730e3d79e8990bf3ed2b" + sha256: b96f10cbdfcbd03a65758633a43e7d04574438f059b1043104b5d61b23d38a4f url: "https://pub.dev" source: hosted - version: "1.1.5+1" + version: "1.1.6" vector_graphics_codec: dependency: transitive description: name: vector_graphics_codec - sha256: "40781fe91c6d10a617c0289f7ec16cdb2d85a7f3654af2778c6d0adbf3bf45a3" + sha256: "57a8e6e24662a3bdfe3b3d61257db91768700c0b8f844e235877b56480f31c69" url: "https://pub.dev" source: hosted - version: "1.1.5+1" + version: "1.1.6" vector_graphics_compiler: dependency: transitive description: name: vector_graphics_compiler - sha256: "6ca1298b70edcc3486fdb14032f1a186a593f1b5f6b5e82fb10febddcb1c61bb" + sha256: "7430f5d834d0db4560d7b19863362cd892f1e52b43838553a3c5cdfc9ab28e5b" url: "https://pub.dev" source: hosted - version: "1.1.5+1" + version: "1.1.6" vector_math: dependency: transitive description: diff --git a/packages/app/pubspec.yaml b/packages/app/pubspec.yaml index eb2b082c..dc3f0509 100644 --- a/packages/app/pubspec.yaml +++ b/packages/app/pubspec.yaml @@ -10,6 +10,7 @@ dependencies: flutter: sdk: flutter flutter_native_splash: ^2.2.19 + flutter_svg: ^2.0.6 neon: git: url: https://github.com/provokateurin/nextcloud-neon diff --git a/packages/neon/neon/lib/src/pages/login.dart b/packages/neon/neon/lib/src/pages/login.dart index a7715cbf..f842a411 100644 --- a/packages/neon/neon/lib/src/pages/login.dart +++ b/packages/neon/neon/lib/src/pages/login.dart @@ -167,69 +167,71 @@ class _LoginPageState extends State { ], ), ) - : Center( - child: Scrollbar( - interactive: true, - child: SingleChildScrollView( - padding: const EdgeInsets.symmetric(vertical: 40, horizontal: 20), - primary: true, - child: Column( - children: [ - SvgPicture.asset( - 'assets/logo.svg', - width: 100, - height: 100, - ), - Text( - Provider.of(context, listen: false).name, - style: Theme.of(context).textTheme.titleLarge, - ), - const SizedBox( - height: 30, - ), - Text(AppLocalizations.of(context).loginWorksWith), - const SizedBox( - height: 20, - ), - const NextcloudLogo(), - Form( - key: _formKey, - child: TextFormField( - focusNode: _focusNode, - decoration: const InputDecoration( - hintText: 'https://...', + : Builder( + builder: (final context) { + final branding = Provider.of(context, listen: false); + return Center( + child: Scrollbar( + interactive: true, + child: SingleChildScrollView( + padding: const EdgeInsets.symmetric(vertical: 40, horizontal: 20), + primary: true, + child: Column( + children: [ + branding.logo, + Text( + branding.name, + style: Theme.of(context).textTheme.titleLarge, ), - keyboardType: TextInputType.url, - initialValue: widget.serverURL, - validator: (final input) => validateHttpUrl(context, input), - onFieldSubmitted: (final input) { - if (_formKey.currentState!.validate()) { - _loginBloc.setServerURL(input); - } else { - _focusNode.requestFocus(); - } - }, - ), - ), - NeonLinearProgressIndicator( - visible: serverConnectionStateSnapshot.data == ServerConnectionState.loading, + const SizedBox( + height: 30, + ), + Text(AppLocalizations.of(context).loginWorksWith), + const SizedBox( + height: 20, + ), + const NextcloudLogo(), + Form( + key: _formKey, + child: TextFormField( + focusNode: _focusNode, + decoration: const InputDecoration( + hintText: 'https://...', + ), + keyboardType: TextInputType.url, + initialValue: widget.serverURL, + validator: (final input) => validateHttpUrl(context, input), + onFieldSubmitted: (final input) { + if (_formKey.currentState!.validate()) { + _loginBloc.setServerURL(input); + } else { + _focusNode.requestFocus(); + } + }, + ), + ), + NeonLinearProgressIndicator( + visible: serverConnectionStateSnapshot.data == ServerConnectionState.loading, + ), + if (serverConnectionStateSnapshot.data == ServerConnectionState.unreachable) ...[ + NeonException( + AppLocalizations.of(context).errorUnableToReachServer, + onRetry: _loginBloc.refresh, + ), + ], + if (serverConnectionStateSnapshot.data == + ServerConnectionState.maintenanceMode) ...[ + NeonException( + AppLocalizations.of(context).errorServerInMaintenanceMode, + onRetry: _loginBloc.refresh, + ), + ], + ], ), - if (serverConnectionStateSnapshot.data == ServerConnectionState.unreachable) ...[ - NeonException( - AppLocalizations.of(context).errorUnableToReachServer, - onRetry: _loginBloc.refresh, - ), - ], - if (serverConnectionStateSnapshot.data == ServerConnectionState.maintenanceMode) ...[ - NeonException( - AppLocalizations.of(context).errorServerInMaintenanceMode, - onRetry: _loginBloc.refresh, - ), - ], - ], + ), ), - ), - ), + ); + }, ), ), ), diff --git a/packages/neon/neon/lib/src/pages/settings.dart b/packages/neon/neon/lib/src/pages/settings.dart index 65197ebe..6923d824 100644 --- a/packages/neon/neon/lib/src/pages/settings.dart +++ b/packages/neon/neon/lib/src/pages/settings.dart @@ -206,11 +206,7 @@ class _SettingsPageState extends State { showLicensePage( context: context, applicationName: branding.name, - applicationIcon: SvgPicture.asset( - 'assets/logo.svg', - width: 100, - height: 100, - ), + applicationIcon: branding.logo, applicationLegalese: branding.legalese, applicationVersion: Provider.of(context, listen: false).version, ); diff --git a/packages/neon/neon/lib/src/utils/branding.dart b/packages/neon/neon/lib/src/utils/branding.dart index eb42738d..9b758b17 100644 --- a/packages/neon/neon/lib/src/utils/branding.dart +++ b/packages/neon/neon/lib/src/utils/branding.dart @@ -3,10 +3,13 @@ part of '../../neon.dart'; class Branding { Branding({ required this.name, + required this.logo, this.legalese, }); final String name; + final Widget logo; + final String? legalese; }