Add dark mode (#46)

Merge branch 'master' into feature/dark-mode

Add white logo in dark mode

Make button shadow dark

Format

Add dark mode

Co-authored-by: kolaente <k@knt.li>
Co-authored-by: Jonas Franz <info@jonasfranz.software>
Reviewed-on: vikunja/app#46
Reviewed-by: konrad <konrad@kola-entertainments.de>
This commit is contained in:
JonasFranz 2020-06-17 17:41:40 +00:00 committed by konrad
parent 8993999a68
commit 3ecf6cd9dd
8 changed files with 19 additions and 4 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

View File

@ -61,6 +61,7 @@ class VikunjaApp extends StatelessWidget {
return new MaterialApp(
title: 'Vikunja',
theme: buildVikunjaTheme(),
darkTheme: buildVikunjaDarkTheme(),
home: this.home,
);
}

View File

@ -34,7 +34,9 @@ class _LoginPageState extends State<LoginPage> {
Padding(
padding: EdgeInsets.symmetric(vertical: 30),
child: Image(
image: AssetImage('assets/vikunja_logo_full.png'),
image: Theme.of(context).brightness == Brightness.dark
? AssetImage('assets/vikunja_logo_full_white.png')
: AssetImage('assets/vikunja_logo_full.png'),
height: 85.0,
semanticLabel: 'Vikunja Logo',
),

View File

@ -24,7 +24,9 @@ class FancyButton extends StatelessWidget {
height: height,
decoration: BoxDecoration(boxShadow: [
BoxShadow(
color: vButtonShadow,
color: Theme.of(context).brightness == Brightness.dark
? vButtonShadowDark
: vButtonShadow,
offset: Offset(-5, 5),
blurRadius: 10,
),

View File

@ -15,6 +15,7 @@ const vGreen = Color(0xFF00CE6E);
const vButtonColor = vPrimary;
const vButtonTextColor = vWhite;
const vButtonShadowDark = Color(0xFF0b2a4a);
const vButtonShadow = Color(0xFFb2d9ff);
///////////

View File

@ -1,8 +1,16 @@
import 'package:flutter/material.dart';
import 'package:vikunja_app/theme/constants.dart';
ThemeData buildVikunjaTheme() {
var base = ThemeData.light();
ThemeData buildVikunjaTheme() => _buildVikunjaTheme(ThemeData.light());
ThemeData buildVikunjaDarkTheme() {
ThemeData base = _buildVikunjaTheme(ThemeData.dark());
return base.copyWith(
accentColor: vWhite,
);
}
ThemeData _buildVikunjaTheme(ThemeData base) {
return base.copyWith(
errorColor: vRed,
primaryColor: vPrimaryDark,

View File

@ -34,6 +34,7 @@ flutter:
- assets/graphics/hypnotize.png
- assets/vikunja_logo.png
- assets/vikunja_logo_full.png
- assets/vikunja_logo_full_white.png
fonts:
- family: Quicksand
fonts: