WIP Themes: Make all fonts depend on theme

This commit is contained in:
Yegor Vialov
2020-04-04 15:13:55 +00:00
parent f448a20784
commit a0a0cb4612
20 changed files with 88 additions and 105 deletions

View File

@ -13,12 +13,6 @@ class _MediaPlayerSeekBarState extends State<MediaPlayerSeekBar> {
double _currentPosition = 0;
int _savedPosition = 0;
final TextStyle _seekTextStyle = TextStyle(
fontSize: 20,
color: Colors.blue,
fontWeight: FontWeight.bold
);
@override
initState() {
super.initState();
@ -79,7 +73,13 @@ class _MediaPlayerSeekBarState extends State<MediaPlayerSeekBar> {
children: <Widget>[
Text("00:00"),
Expanded(
child: Text("${Duration(seconds: _currentPosition.toInt()).toString().split(".")[0]}",textAlign: TextAlign.center, style: _seekTextStyle),
child: Text(
"${Duration(seconds: _currentPosition.toInt()).toString().split(".")[0]}",
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.title.copyWith(
color: Colors.blue
)
),
),
Text("${Duration(seconds: entity.durationSeconds).toString().split(".")[0]}")
],

View File

@ -19,7 +19,7 @@ class MediaPlayerWidget extends StatelessWidget {
right: 0.0,
child: Container(
color: Colors.black45,
child: _buildState(entity),
child: _buildState(entity, context),
),
),
Positioned(
@ -35,12 +35,9 @@ class MediaPlayerWidget extends StatelessWidget {
);
}
Widget _buildState(MediaPlayerEntity entity) {
TextStyle style = TextStyle(
fontSize: 14.0,
color: Colors.white,
fontWeight: FontWeight.normal,
height: 1.2
Widget _buildState(MediaPlayerEntity entity, BuildContext context) {
TextStyle style = Theme.of(context).textTheme.body1.copyWith(
color: Colors.white
);
List<Widget> states = [];
states.add(Text("${entity.displayName}", style: style));