From 46ecf2ff4aa997db56432bdbb87d235b77f94e5b Mon Sep 17 00:00:00 2001 From: Rongjian Zhang Date: Sun, 26 Jan 2020 23:47:50 +0800 Subject: [PATCH] fix: user name color --- lib/widgets/user_name.dart | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/widgets/user_name.dart b/lib/widgets/user_name.dart index e4c2e0c..df046ee 100644 --- a/lib/widgets/user_name.dart +++ b/lib/widgets/user_name.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; +import 'package:git_touch/models/theme.dart'; import 'package:git_touch/widgets/link.dart'; - -final style = TextStyle(fontWeight: FontWeight.w600); +import 'package:provider/provider.dart'; class UserName extends StatelessWidget { final String login; @@ -10,6 +10,7 @@ class UserName extends StatelessWidget { @override Widget build(BuildContext context) { + final theme = Provider.of(context); return Link( url: '/$login', child: Container( @@ -17,7 +18,13 @@ class UserName extends StatelessWidget { decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(4)), ), - child: Text(login, style: style), + child: Text( + login, + style: TextStyle( + fontWeight: FontWeight.w600, + color: theme.paletteOf(context).primary, + ), + ), ), ); }