mirror of
https://github.com/git-touch/git-touch
synced 2024-12-17 02:38:39 +01:00
feat: issues screen style
This commit is contained in:
parent
eb9de95efc
commit
2c6a3d097c
@ -88,17 +88,13 @@ class IssuesScreen extends StatelessWidget {
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Avatar(
|
||||
login: payload['author']['login'],
|
||||
url: payload['author']['avatarUrl'],
|
||||
size: 12,
|
||||
),
|
||||
SizedBox(width: 10),
|
||||
Icon(_buildIconData(), color: Palette.green, size: 16),
|
||||
SizedBox(width: 6),
|
||||
Expanded(
|
||||
child: Container(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: join(SizedBox(height: 6), [
|
||||
children: join(SizedBox(height: 8), [
|
||||
// Text(
|
||||
// owner +
|
||||
// '/' +
|
||||
@ -109,17 +105,19 @@ class IssuesScreen extends StatelessWidget {
|
||||
// ),
|
||||
// Padding(padding: EdgeInsets.only(top: 4)),
|
||||
Text(
|
||||
payload['title'],
|
||||
payload['title'] + ' (#${payload['number']})',
|
||||
style: TextStyle(
|
||||
fontSize: 16, color: PrimerColors.gray900),
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
fontSize: 16,
|
||||
color: PrimerColors.gray900,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
if ((payload['labels']['nodes'] as List).isNotEmpty)
|
||||
Wrap(
|
||||
spacing: 2,
|
||||
runSpacing: 2,
|
||||
children:
|
||||
(payload['labels']['nodes'] as List).map((label) {
|
||||
children: (payload['labels']['nodes'] as List)
|
||||
.map((label) {
|
||||
final color = convertColor(label['color']);
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
@ -146,10 +144,18 @@ class IssuesScreen extends StatelessWidget {
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Icon(_buildIconData(),
|
||||
color: Palette.green, size: 13),
|
||||
Avatar(
|
||||
login: payload['author']['login'],
|
||||
url: payload['author']['avatarUrl'],
|
||||
size: 8,
|
||||
),
|
||||
SizedBox(width: 4),
|
||||
Text(timeago.format(
|
||||
Text(
|
||||
payload['author']['login'],
|
||||
style: TextStyle(fontWeight: FontWeight.w500),
|
||||
),
|
||||
Text(' opened ' +
|
||||
timeago.format(
|
||||
DateTime.parse(payload['updatedAt']))),
|
||||
if (payload['comments']['totalCount'] > 0) ...[
|
||||
Expanded(child: SizedBox()),
|
||||
@ -183,7 +189,8 @@ class IssuesScreen extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListScaffold(
|
||||
title: AppBarTitle('Issues of $owner/$name'),
|
||||
title: AppBarTitle(
|
||||
(isPullRequest ? 'Pull requests' : 'Issues') + ' of $owner/$name'),
|
||||
onRefresh: () => _query(context),
|
||||
onLoadMore: (cursor) => _query(cursor),
|
||||
itemBuilder: _buildItem,
|
||||
|
@ -130,10 +130,6 @@ List<T> joinAll<T>(T seperator, List<List<T>> xss) {
|
||||
return result;
|
||||
}
|
||||
|
||||
K ifNotNull<T, K>(T value, K Function(T v) builder) {
|
||||
return value == null ? null : builder(value);
|
||||
}
|
||||
|
||||
final numberFormat = NumberFormat();
|
||||
|
||||
class BorderView extends StatelessWidget {
|
||||
|
Loading…
Reference in New Issue
Block a user