Browse Source

Merge pull request #381 from provokateurin/cleanup/branding-logo

Move logo to branding
pull/386/head
Kate 2 years ago committed by GitHub
parent
commit
98d264bdcb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      packages/app/lib/branding.dart
  2. 22
      packages/app/pubspec.lock
  3. 1
      packages/app/pubspec.yaml
  4. 122
      packages/neon/neon/lib/src/pages/login.dart
  5. 6
      packages/neon/neon/lib/src/pages/settings.dart
  6. 3
      packages/neon/neon/lib/src/utils/branding.dart

6
packages/app/lib/branding.dart

@ -1,6 +1,12 @@
import 'package:flutter_svg/flutter_svg.dart';
import 'package:neon/neon.dart'; import 'package:neon/neon.dart';
Branding getNeonBranding() => Branding( Branding getNeonBranding() => Branding(
name: 'Nextcloud Neon', name: 'Nextcloud Neon',
logo: SvgPicture.asset(
'assets/logo.svg',
width: 100,
height: 100,
),
legalese: 'Copyright © 2023, provokateurin\nUnder GPLv3 license', legalese: 'Copyright © 2023, provokateurin\nUnder GPLv3 license',
); );

22
packages/app/pubspec.lock

@ -133,10 +133,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: csslib name: csslib
sha256: b36c7f7e24c0bdf1bf9a3da461c837d1de64b9f8beb190c9011d8c72a3dfd745 sha256: "831883fb353c8bdc1d71979e5b342c7d88acfbc643113c14ae51e2442ea0f20f"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.17.2" version: "0.17.3"
dbus: dbus:
dependency: transitive dependency: transitive
description: description:
@ -295,13 +295,13 @@ packages:
source: hosted source: hosted
version: "2.0.14" version: "2.0.14"
flutter_svg: flutter_svg:
dependency: transitive dependency: "direct main"
description: description:
name: flutter_svg name: flutter_svg
sha256: f991fdb1533c3caeee0cdc14b04f50f0c3916f0dbcbc05237ccbe4e3c6b93f3f sha256: "6ff8c902c8056af9736de2689f63f81c42e2d642b9f4c79dbf8790ae48b63012"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.0.5" version: "2.0.6"
flutter_test: flutter_test:
dependency: "direct dev" dependency: "direct dev"
description: flutter description: flutter
@ -1132,26 +1132,26 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: vector_graphics name: vector_graphics
sha256: "59a230f8bf37dd8b077335d1d64d895bccef0fb14f50730e3d79e8990bf3ed2b" sha256: b96f10cbdfcbd03a65758633a43e7d04574438f059b1043104b5d61b23d38a4f
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.1.5+1" version: "1.1.6"
vector_graphics_codec: vector_graphics_codec:
dependency: transitive dependency: transitive
description: description:
name: vector_graphics_codec name: vector_graphics_codec
sha256: "40781fe91c6d10a617c0289f7ec16cdb2d85a7f3654af2778c6d0adbf3bf45a3" sha256: "57a8e6e24662a3bdfe3b3d61257db91768700c0b8f844e235877b56480f31c69"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.1.5+1" version: "1.1.6"
vector_graphics_compiler: vector_graphics_compiler:
dependency: transitive dependency: transitive
description: description:
name: vector_graphics_compiler name: vector_graphics_compiler
sha256: "6ca1298b70edcc3486fdb14032f1a186a593f1b5f6b5e82fb10febddcb1c61bb" sha256: "7430f5d834d0db4560d7b19863362cd892f1e52b43838553a3c5cdfc9ab28e5b"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.1.5+1" version: "1.1.6"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:

1
packages/app/pubspec.yaml

@ -10,6 +10,7 @@ dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
flutter_native_splash: ^2.2.19 flutter_native_splash: ^2.2.19
flutter_svg: ^2.0.6
neon: neon:
git: git:
url: https://github.com/provokateurin/nextcloud-neon url: https://github.com/provokateurin/nextcloud-neon

122
packages/neon/neon/lib/src/pages/login.dart

@ -167,69 +167,71 @@ class _LoginPageState extends State<LoginPage> {
], ],
), ),
) )
: Center( : Builder(
child: Scrollbar( builder: (final context) {
interactive: true, final branding = Provider.of<Branding>(context, listen: false);
child: SingleChildScrollView( return Center(
padding: const EdgeInsets.symmetric(vertical: 40, horizontal: 20), child: Scrollbar(
primary: true, interactive: true,
child: Column( child: SingleChildScrollView(
children: [ padding: const EdgeInsets.symmetric(vertical: 40, horizontal: 20),
SvgPicture.asset( primary: true,
'assets/logo.svg', child: Column(
width: 100, children: [
height: 100, branding.logo,
), Text(
Text( branding.name,
Provider.of<Branding>(context, listen: false).name, style: Theme.of(context).textTheme.titleLarge,
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://...',
), ),
keyboardType: TextInputType.url, const SizedBox(
initialValue: widget.serverURL, height: 30,
validator: (final input) => validateHttpUrl(context, input), ),
onFieldSubmitted: (final input) { Text(AppLocalizations.of(context).loginWorksWith),
if (_formKey.currentState!.validate()) { const SizedBox(
_loginBloc.setServerURL(input); height: 20,
} else { ),
_focusNode.requestFocus(); const NextcloudLogo(),
} Form(
}, key: _formKey,
), child: TextFormField(
), focusNode: _focusNode,
NeonLinearProgressIndicator( decoration: const InputDecoration(
visible: serverConnectionStateSnapshot.data == ServerConnectionState.loading, 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,
),
],
],
), ),
), );
), },
), ),
), ),
), ),

6
packages/neon/neon/lib/src/pages/settings.dart

@ -206,11 +206,7 @@ class _SettingsPageState extends State<SettingsPage> {
showLicensePage( showLicensePage(
context: context, context: context,
applicationName: branding.name, applicationName: branding.name,
applicationIcon: SvgPicture.asset( applicationIcon: branding.logo,
'assets/logo.svg',
width: 100,
height: 100,
),
applicationLegalese: branding.legalese, applicationLegalese: branding.legalese,
applicationVersion: Provider.of<PackageInfo>(context, listen: false).version, applicationVersion: Provider.of<PackageInfo>(context, listen: false).version,
); );

3
packages/neon/neon/lib/src/utils/branding.dart

@ -3,10 +3,13 @@ part of '../../neon.dart';
class Branding { class Branding {
Branding({ Branding({
required this.name, required this.name,
required this.logo,
this.legalese, this.legalese,
}); });
final String name; final String name;
final Widget logo;
final String? legalese; final String? legalese;
} }

Loading…
Cancel
Save