Skip to content

Commit

Permalink
feat: style tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
pd4d10 committed Sep 13, 2019
1 parent 1a9f708 commit 6312da8
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 67 deletions.
39 changes: 24 additions & 15 deletions lib/screens/user.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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,
),
),
],
),
Expand Down
35 changes: 17 additions & 18 deletions lib/screens/users.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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),
)
]),
),
)
],
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
18 changes: 13 additions & 5 deletions lib/widgets/entry_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
)
],
),
),
Expand Down
59 changes: 33 additions & 26 deletions lib/widgets/event_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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>[
Expand All @@ -80,7 +80,7 @@ class EventItem extends StatelessWidget {
Avatar(
url: event.actorAvatarUrl,
login: event.actorLogin,
size: 18,
size: 20,
),
SizedBox(width: 10),
Expanded(
Expand All @@ -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,
Expand All @@ -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,
))
],
),
]),
Expand All @@ -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,
Expand Down Expand Up @@ -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/' +
Expand Down
4 changes: 2 additions & 2 deletions lib/widgets/repo_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ class RepoItem extends StatelessWidget {
Text(
payload['owner']['login'] + ' / ',
style: TextStyle(
fontSize: 16,
fontSize: inRepoScreen ? 18 : 16,
color: PrimerColors.blue500,
fontWeight: FontWeight.w500,
),
),
Text(
payload['name'],
style: TextStyle(
fontSize: 16,
fontSize: inRepoScreen ? 18 : 16,
color: PrimerColors.blue500,
fontWeight: FontWeight.w600,
),
Expand Down

0 comments on commit 6312da8

Please sign in to comment.