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';
Branding getNeonBranding() => Branding(
name: 'Nextcloud Neon',
logo: SvgPicture.asset(
'assets/logo.svg',
width: 100,
height: 100,
),
legalese: 'Copyright © 2023, provokateurin\nUnder GPLv3 license',
);

22
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:

1
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

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

@ -167,69 +167,71 @@ class _LoginPageState extends State<LoginPage> {
],
),
)
: 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<Branding>(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<Branding>(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,
),
],
],
),
),
),
),
);
},
),
),
),

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

@ -206,11 +206,7 @@ class _SettingsPageState extends State<SettingsPage> {
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<PackageInfo>(context, listen: false).version,
);

3
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;
}

Loading…
Cancel
Save