WIP Themes: Dark theme fonts

This commit is contained in:
Yegor Vialov 2020-04-04 16:13:12 +00:00
parent eb4184713f
commit d94235ef6d
2 changed files with 44 additions and 19 deletions

View File

@ -249,7 +249,7 @@ class _AlarmControlPanelControlsWidgetWidgetState extends State<AlarmControlPane
child: Text(
"TRIGGER",
style: Theme.of(context).textTheme.subhead.copyWith(
color: Colors.redAccent
color: Theme.of(context).errorColor
)
),
onPressed: () => _askToTrigger(entity),

View File

@ -2,7 +2,23 @@ import 'package:flutter/material.dart';
class HAClientTheme {
static const Color defaultFontColor = Colors.black87;
static const TextTheme textTheme = TextTheme(
display1: TextStyle(fontSize: 34, fontWeight: FontWeight.normal),
display2: TextStyle(fontSize: 34, fontWeight: FontWeight.normal),
headline: TextStyle(fontSize: 24, fontWeight: FontWeight.normal),
title: TextStyle(fontSize: 20, fontWeight: FontWeight.w700),
subhead: TextStyle(fontSize: 16, fontWeight: FontWeight.normal),
body1: TextStyle(fontSize: 15, fontWeight: FontWeight.normal),
body2: TextStyle(fontSize: 15, fontWeight: FontWeight.w500),
subtitle: TextStyle(fontSize: 15, fontWeight: FontWeight.w500),
caption: TextStyle(fontSize: 12, fontWeight: FontWeight.normal),
overline: TextStyle(
fontSize: 10,
fontWeight: FontWeight.normal,
letterSpacing: 1,
),
button: TextStyle(fontSize: 14, fontWeight: FontWeight.w500),
);
static final HAClientTheme _instance = HAClientTheme
._internal();
@ -16,25 +32,34 @@ class HAClientTheme {
final ThemeData lightTheme = ThemeData.light().copyWith(
//primaryColor: Colors.blue,
textTheme: ThemeData.light().textTheme.copyWith(
display1: TextStyle(fontSize: 34, fontWeight: FontWeight.normal, color: Colors.black54),
display2: TextStyle(fontSize: 34, fontWeight: FontWeight.normal, color: Colors.redAccent),
headline: TextStyle(fontSize: 24, fontWeight: FontWeight.normal, color: defaultFontColor),
title: TextStyle(fontSize: 20, fontWeight: FontWeight.w700, color: defaultFontColor),
subhead: TextStyle(fontSize: 16, fontWeight: FontWeight.normal, color: Colors.black54),
body1: TextStyle(fontSize: 15, fontWeight: FontWeight.normal, color: defaultFontColor),
body2: TextStyle(fontSize: 15, fontWeight: FontWeight.w500, color: defaultFontColor),
subtitle: TextStyle(fontSize: 15, fontWeight: FontWeight.w500, color: Colors.black45),
caption: TextStyle(fontSize: 12, fontWeight: FontWeight.normal, color: Colors.black45),
overline: TextStyle(
fontSize: 10,
fontWeight: FontWeight.normal,
color: Colors.black26,
letterSpacing: 1,
),
button: TextStyle(fontSize: 14, fontWeight: FontWeight.w500, color: Colors.white),
display1: textTheme.display1.copyWith(color: Colors.black54),
display2: textTheme.display2.copyWith(color: Colors.redAccent),
headline: textTheme.headline.copyWith(color: Colors.black87),
title: textTheme.title.copyWith(color: Colors.black87),
subhead: textTheme.subhead.copyWith(color: Colors.black54),
body1: textTheme.body1.copyWith(color: Colors.black87),
body2: textTheme.body2.copyWith(color: Colors.black87),
subtitle: textTheme.subtitle.copyWith(color: Colors.black45),
caption: textTheme.caption.copyWith(color: Colors.black45),
overline: textTheme.overline.copyWith(color: Colors.black26),
button: textTheme.button.copyWith(color: Colors.white),
)
);
final ThemeData darkTheme = ThemeData.dark();
final ThemeData darkTheme = ThemeData.dark().copyWith(
textTheme: ThemeData.light().textTheme.copyWith(
display1: textTheme.display1.copyWith(color: Colors.white70),
display2: textTheme.display2.copyWith(color: Colors.redAccent),
headline: textTheme.headline.copyWith(color: Colors.white),
title: textTheme.title.copyWith(color: Colors.white),
subhead: textTheme.subhead.copyWith(color: Colors.white70),
body1: textTheme.body1.copyWith(color: Colors.white),
body2: textTheme.body2.copyWith(color: Colors.white),
subtitle: textTheme.subtitle.copyWith(color: Colors.white70),
caption: textTheme.caption.copyWith(color: Colors.white70),
overline: textTheme.overline.copyWith(color: Colors.white54),
button: textTheme.button.copyWith(color: Colors.white),
)
);
}