Skip to content

Commit

Permalink
Merge pull request #381 from provokateurin/cleanup/branding-logo
Browse files Browse the repository at this point in the history
Move logo to branding
  • Loading branch information
provokateurin authored Jun 13, 2023
2 parents c7a386a + d88a906 commit 98d264b
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 76 deletions.
6 changes: 6 additions & 0 deletions packages/app/lib/branding.dart
Original file line number Diff line number Diff line change
@@ -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 changes: 11 additions & 11 deletions packages/app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions packages/app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
122 changes: 62 additions & 60 deletions packages/neon/neon/lib/src/pages/login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
],
],
),
),
),
),
);
},
),
),
),
Expand Down
6 changes: 1 addition & 5 deletions packages/neon/neon/lib/src/pages/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
);
Expand Down
3 changes: 3 additions & 0 deletions packages/neon/neon/lib/src/utils/branding.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 98d264b

Please sign in to comment.