feat: style tweaks

This commit is contained in:
Rongjian Zhang 2019-09-13 15:55:58 +08:00
parent 1a9f7083ee
commit 6312da876a
6 changed files with 90 additions and 67 deletions

View File

@ -164,7 +164,7 @@ class _UserScreenState extends State<UserScreen> {
[query(), getContributions(widget.login)],
);
},
title: AppBarTitle(widget.login),
title: AppBarTitle('User'),
trailingBuilder: (data) {
var payload = data[0];
if (widget.showSettings) {
@ -230,26 +230,35 @@ class _UserScreenState extends State<UserScreen> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(children: <Widget>[
Text(
payload['name'] ?? widget.login,
style: TextStyle(
color: PrimerColors.blue500, fontSize: 16),
),
Text(
'(${widget.login})',
style: TextStyle(
color: PrimerColors.gray500, fontSize: 16),
),
]),
SizedBox(height: 4),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
Text(
payload['name'] ?? widget.login,
style: TextStyle(
color: PrimerColors.blue500,
fontSize: 18,
fontWeight: FontWeight.w600,
),
),
SizedBox(width: 8),
Text(
widget.login,
style: TextStyle(
color: PrimerColors.gray700, fontSize: 16),
),
],
),
SizedBox(height: 6),
Text(
payload['bio'] == null ||
(payload['bio'] as String).isEmpty
? 'No bio'
: payload['bio'],
style: TextStyle(
color: PrimerColors.gray500, fontSize: 15),
color: PrimerColors.gray700,
fontSize: 14,
),
),
],
),

View File

@ -73,27 +73,26 @@ class _UsersScreenState extends State<UsersScreen> {
child: Container(
padding: EdgeInsets.all(10),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Avatar(url: payload['avatarUrl'], size: 20),
Avatar(url: payload['avatarUrl'], size: 24),
SizedBox(width: 10),
DefaultTextStyle(
style: TextStyle(color: PrimerColors.gray900, fontSize: 13),
child: Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: join(SizedBox(height: 6), [
Text(
payload['name'] ?? payload['login'],
style: TextStyle(
fontSize: 16,
color: PrimerColors.blue500,
fontWeight: FontWeight.w500,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: join(SizedBox(height: 6), [
Text(
payload['name'] ?? payload['login'],
style: TextStyle(
fontSize: 16,
color: PrimerColors.blue500,
fontWeight: FontWeight.w500,
),
Text(payload['url'], style: TextStyle(fontSize: 14))
]),
),
),
Text(
payload['login'],
style: TextStyle(fontSize: 14, color: PrimerColors.gray700),
)
]),
),
)
],

View File

@ -37,7 +37,7 @@ void nextTick(Function callback, [int milliseconds = 0]) {
TextSpan createLinkSpan(BuildContext context, String text, Function handle) {
return TextSpan(
text: text,
style: TextStyle(color: PrimerColors.blue500, fontWeight: FontWeight.w500),
style: TextStyle(color: PrimerColors.blue500, fontWeight: FontWeight.w600),
recognizer: TapGestureRecognizer()
..onTap = () {
Navigator.of(context).push(

View File

@ -15,13 +15,21 @@ class EntryItem extends StatelessWidget {
return Expanded(
child: Link(
child: Container(
padding: EdgeInsets.symmetric(vertical: 12),
padding: EdgeInsets.symmetric(vertical: 14),
child: Column(
children: <Widget>[
Text(count.toString(),
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w500)),
Text(text,
style: TextStyle(fontSize: 12, color: PrimerColors.gray600))
Text(
count.toString(),
style: TextStyle(fontSize: 17, fontWeight: FontWeight.w600),
),
Text(
text,
style: TextStyle(
fontSize: 12,
color: PrimerColors.gray700,
fontWeight: FontWeight.w500,
),
)
],
),
),

View File

@ -70,7 +70,7 @@ class EventItem extends StatelessWidget {
screenBuilder: screenBuilder,
url: url,
child: Container(
padding: EdgeInsets.all(10),
padding: EdgeInsets.all(12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
@ -80,7 +80,7 @@ class EventItem extends StatelessWidget {
Avatar(
url: event.actorAvatarUrl,
login: event.actorLogin,
size: 18,
size: 20,
),
SizedBox(width: 10),
Expanded(
@ -90,7 +90,10 @@ class EventItem extends StatelessWidget {
RichText(
text: TextSpan(
style: TextStyle(
fontSize: 15, color: PrimerColors.gray900),
fontSize: 16,
color: PrimerColors.gray900,
fontWeight: FontWeight.w500,
),
children: [
createLinkSpan(
context,
@ -104,16 +107,19 @@ class EventItem extends StatelessWidget {
if (detailWidget != null)
DefaultTextStyle(
style: TextStyle(
color: PrimerColors.gray500, fontSize: 14),
color: PrimerColors.gray900, fontSize: 14),
child: detailWidget,
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Icon(iconData, color: PrimerColors.gray700, size: 13),
Icon(iconData, color: PrimerColors.gray500, size: 14),
SizedBox(width: 4),
Text(timeago.format(event.createdAt),
style: TextStyle(
fontSize: 13, color: PrimerColors.gray700))
fontSize: 13,
color: PrimerColors.gray500,
))
],
),
]),
@ -134,7 +140,7 @@ class EventItem extends StatelessWidget {
spans: [
TextSpan(
text: ' ' + event.type,
style: TextStyle(color: Colors.blueAccent),
style: TextStyle(color: PrimerColors.blue500),
)
],
iconData: Octicons.octoface,
@ -302,26 +308,27 @@ class EventItem extends StatelessWidget {
iconData: Octicons.repo_push,
detailWidget: Column(
children: commits.map((commit) {
return Row(children: <Widget>[
Text(
(commit['sha'] as String).substring(0, 7),
style: TextStyle(
color: PrimerColors.blue500,
fontSize: 13,
fontFamily: 'Menlo',
fontFamilyFallback: ['Menlo', 'Roboto Mono'],
return Row(
children: <Widget>[
Text(
(commit['sha'] as String).substring(0, 7),
style: TextStyle(
color: PrimerColors.blue500,
fontSize: 13,
fontFamily: 'Menlo',
fontFamilyFallback: ['Menlo', 'Roboto Mono'],
),
),
),
SizedBox(width: 6),
Expanded(
child: Text(
commit['message'],
style: TextStyle(color: Colors.black54, fontSize: 14),
overflow: TextOverflow.ellipsis,
maxLines: 1,
),
)
]);
SizedBox(width: 6),
Expanded(
child: Text(
commit['message'],
overflow: TextOverflow.ellipsis,
maxLines: 1,
),
)
],
);
}).toList(),
),
url: 'https://github.com/' +

View File

@ -91,7 +91,7 @@ class RepoItem extends StatelessWidget {
Text(
payload['owner']['login'] + ' / ',
style: TextStyle(
fontSize: 16,
fontSize: inRepoScreen ? 18 : 16,
color: PrimerColors.blue500,
fontWeight: FontWeight.w500,
),
@ -99,7 +99,7 @@ class RepoItem extends StatelessWidget {
Text(
payload['name'],
style: TextStyle(
fontSize: 16,
fontSize: inRepoScreen ? 18 : 16,
color: PrimerColors.blue500,
fontWeight: FontWeight.w600,
),