mirror of
https://github.com/pd4d10/git-touch.git
synced 2026-04-28 02:19:08 -05:00
feat: style tweaks
This commit is contained in:
@@ -8,10 +8,9 @@ import 'link.dart';
|
||||
|
||||
class RepoItem extends StatelessWidget {
|
||||
final Map<String, dynamic> payload;
|
||||
final bool showOwner;
|
||||
final bool isLink;
|
||||
final bool inRepoScreen;
|
||||
|
||||
RepoItem(this.payload, {this.showOwner = true, this.isLink = true});
|
||||
RepoItem(this.payload, {this.inRepoScreen = false});
|
||||
|
||||
IconData _buildIconData() {
|
||||
if (payload['isPrivate']) {
|
||||
@@ -23,6 +22,57 @@ class RepoItem extends StatelessWidget {
|
||||
return Octicons.repo;
|
||||
}
|
||||
|
||||
Widget _buildStatus() {
|
||||
return DefaultTextStyle(
|
||||
style: TextStyle(
|
||||
color: PrimerColors.gray800,
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Row(children: <Widget>[
|
||||
Container(
|
||||
width: 10,
|
||||
height: 10,
|
||||
decoration: BoxDecoration(
|
||||
color: convertColor(payload['primaryLanguage'] == null
|
||||
? null
|
||||
: payload['primaryLanguage']['color']),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 4),
|
||||
Text(payload['primaryLanguage'] == null
|
||||
? 'Unknown'
|
||||
: payload['primaryLanguage']['name']),
|
||||
]),
|
||||
),
|
||||
Expanded(
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Icon(Octicons.star, size: 14, color: PrimerColors.gray600),
|
||||
Text(payload['stargazers']['totalCount'].toString()),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Icon(Octicons.repo_forked,
|
||||
size: 14, color: PrimerColors.gray600),
|
||||
Text(payload['forks']['totalCount'].toString())
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var widget = Padding(
|
||||
@@ -36,14 +86,25 @@ class RepoItem extends StatelessWidget {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: join(SizedBox(height: 8), <Widget>[
|
||||
Text(
|
||||
(showOwner ? (payload['owner']['login'] + ' / ') : '') +
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Text(
|
||||
payload['owner']['login'] + ' / ',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: PrimerColors.blue500,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
payload['name'],
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 16,
|
||||
color: PrimerColors.blue500,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: PrimerColors.blue500,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
payload['description'] == null ||
|
||||
(payload['description'] as String).isEmpty
|
||||
@@ -51,62 +112,9 @@ class RepoItem extends StatelessWidget {
|
||||
: Text(
|
||||
payload['description'],
|
||||
style: TextStyle(
|
||||
color: PrimerColors.gray600, fontSize: 14),
|
||||
color: PrimerColors.gray700, fontSize: 14),
|
||||
),
|
||||
DefaultTextStyle(
|
||||
style: TextStyle(
|
||||
color: PrimerColors.gray600,
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
width: 100,
|
||||
child: Row(children: <Widget>[
|
||||
Container(
|
||||
width: 10,
|
||||
height: 10,
|
||||
decoration: BoxDecoration(
|
||||
color: convertColor(
|
||||
payload['primaryLanguage'] == null
|
||||
? null
|
||||
: payload['primaryLanguage']['color']),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 4),
|
||||
Text(payload['primaryLanguage'] == null
|
||||
? 'Unknown'
|
||||
: payload['primaryLanguage']['name']),
|
||||
]),
|
||||
),
|
||||
SizedBox(
|
||||
width: 100,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Icon(Octicons.star,
|
||||
size: 14, color: PrimerColors.gray600),
|
||||
Text(
|
||||
payload['stargazers']['totalCount'].toString()),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 100,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Icon(Octicons.repo_forked,
|
||||
size: 14, color: PrimerColors.gray600),
|
||||
Text(payload['forks']['totalCount'].toString())
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
...(inRepoScreen ? [] : [_buildStatus()])
|
||||
]),
|
||||
),
|
||||
),
|
||||
@@ -115,7 +123,7 @@ class RepoItem extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
|
||||
if (isLink) {
|
||||
if (inRepoScreen) {
|
||||
// TODO: text style
|
||||
return Link(
|
||||
screenBuilder: (_) =>
|
||||
|
||||
Reference in New Issue
Block a user