improvement: show company and location of users
This commit is contained in:
parent
35993942fe
commit
fb28038021
|
@ -51,7 +51,12 @@ class GithubUsersUser extends GithubUsersAuditEntryActor
|
||||||
@override
|
@override
|
||||||
String avatarUrl;
|
String avatarUrl;
|
||||||
|
|
||||||
String bio;
|
String company;
|
||||||
|
|
||||||
|
@override
|
||||||
|
String location;
|
||||||
|
|
||||||
|
DateTime createdAt;
|
||||||
|
|
||||||
GithubUsersFollowerConnection followers;
|
GithubUsersFollowerConnection followers;
|
||||||
|
|
||||||
|
@ -62,8 +67,17 @@ class GithubUsersUser extends GithubUsersAuditEntryActor
|
||||||
String resolveType;
|
String resolveType;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<Object> get props =>
|
List<Object> get props => [
|
||||||
[login, name, avatarUrl, bio, followers, following, resolveType];
|
login,
|
||||||
|
name,
|
||||||
|
avatarUrl,
|
||||||
|
company,
|
||||||
|
location,
|
||||||
|
createdAt,
|
||||||
|
followers,
|
||||||
|
following,
|
||||||
|
resolveType
|
||||||
|
];
|
||||||
Map<String, dynamic> toJson() => _$GithubUsersUserToJson(this);
|
Map<String, dynamic> toJson() => _$GithubUsersUserToJson(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -240,11 +254,13 @@ class GithubUsersProfileOwner with EquatableMixin {
|
||||||
|
|
||||||
String name;
|
String name;
|
||||||
|
|
||||||
|
String location;
|
||||||
|
|
||||||
@JsonKey(name: '__typename')
|
@JsonKey(name: '__typename')
|
||||||
String resolveType;
|
String resolveType;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<Object> get props => [login, name, resolveType];
|
List<Object> get props => [login, name, location, resolveType];
|
||||||
Map<String, dynamic> toJson() => _$GithubUsersProfileOwnerToJson(this);
|
Map<String, dynamic> toJson() => _$GithubUsersProfileOwnerToJson(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -307,6 +323,9 @@ class GithubUsersOrganization extends GithubUsersAuditEntryActor
|
||||||
@override
|
@override
|
||||||
String avatarUrl;
|
String avatarUrl;
|
||||||
|
|
||||||
|
@override
|
||||||
|
String location;
|
||||||
|
|
||||||
GithubUsersOrganizationMemberConnection membersWithRole;
|
GithubUsersOrganizationMemberConnection membersWithRole;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -315,7 +334,7 @@ class GithubUsersOrganization extends GithubUsersAuditEntryActor
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<Object> get props =>
|
List<Object> get props =>
|
||||||
[login, name, avatarUrl, membersWithRole, resolveType];
|
[login, name, avatarUrl, location, membersWithRole, resolveType];
|
||||||
Map<String, dynamic> toJson() => _$GithubUsersOrganizationToJson(this);
|
Map<String, dynamic> toJson() => _$GithubUsersOrganizationToJson(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -608,7 +627,19 @@ class GithubUsersQuery extends GraphQLQuery<GithubUsers, GithubUsersArguments> {
|
||||||
directives: [],
|
directives: [],
|
||||||
selectionSet: null),
|
selectionSet: null),
|
||||||
FieldNode(
|
FieldNode(
|
||||||
name: NameNode(value: 'bio'),
|
name: NameNode(value: 'company'),
|
||||||
|
alias: null,
|
||||||
|
arguments: [],
|
||||||
|
directives: [],
|
||||||
|
selectionSet: null),
|
||||||
|
FieldNode(
|
||||||
|
name: NameNode(value: 'location'),
|
||||||
|
alias: null,
|
||||||
|
arguments: [],
|
||||||
|
directives: [],
|
||||||
|
selectionSet: null),
|
||||||
|
FieldNode(
|
||||||
|
name: NameNode(value: 'createdAt'),
|
||||||
alias: null,
|
alias: null,
|
||||||
arguments: [],
|
arguments: [],
|
||||||
directives: [],
|
directives: [],
|
||||||
|
@ -679,7 +710,19 @@ class GithubUsersQuery extends GraphQLQuery<GithubUsers, GithubUsersArguments> {
|
||||||
directives: [],
|
directives: [],
|
||||||
selectionSet: null),
|
selectionSet: null),
|
||||||
FieldNode(
|
FieldNode(
|
||||||
name: NameNode(value: 'bio'),
|
name: NameNode(value: 'company'),
|
||||||
|
alias: null,
|
||||||
|
arguments: [],
|
||||||
|
directives: [],
|
||||||
|
selectionSet: null),
|
||||||
|
FieldNode(
|
||||||
|
name: NameNode(value: 'location'),
|
||||||
|
alias: null,
|
||||||
|
arguments: [],
|
||||||
|
directives: [],
|
||||||
|
selectionSet: null),
|
||||||
|
FieldNode(
|
||||||
|
name: NameNode(value: 'createdAt'),
|
||||||
alias: null,
|
alias: null,
|
||||||
arguments: [],
|
arguments: [],
|
||||||
directives: [],
|
directives: [],
|
||||||
|
@ -752,7 +795,19 @@ class GithubUsersQuery extends GraphQLQuery<GithubUsers, GithubUsersArguments> {
|
||||||
directives: [],
|
directives: [],
|
||||||
selectionSet: null),
|
selectionSet: null),
|
||||||
FieldNode(
|
FieldNode(
|
||||||
name: NameNode(value: 'bio'),
|
name: NameNode(value: 'company'),
|
||||||
|
alias: null,
|
||||||
|
arguments: [],
|
||||||
|
directives: [],
|
||||||
|
selectionSet: null),
|
||||||
|
FieldNode(
|
||||||
|
name: NameNode(value: 'location'),
|
||||||
|
alias: null,
|
||||||
|
arguments: [],
|
||||||
|
directives: [],
|
||||||
|
selectionSet: null),
|
||||||
|
FieldNode(
|
||||||
|
name: NameNode(value: 'createdAt'),
|
||||||
alias: null,
|
alias: null,
|
||||||
arguments: [],
|
arguments: [],
|
||||||
directives: [],
|
directives: [],
|
||||||
|
@ -794,6 +849,12 @@ class GithubUsersQuery extends GraphQLQuery<GithubUsers, GithubUsersArguments> {
|
||||||
arguments: [],
|
arguments: [],
|
||||||
directives: [],
|
directives: [],
|
||||||
selectionSet: null),
|
selectionSet: null),
|
||||||
|
FieldNode(
|
||||||
|
name: NameNode(value: 'location'),
|
||||||
|
alias: null,
|
||||||
|
arguments: [],
|
||||||
|
directives: [],
|
||||||
|
selectionSet: null),
|
||||||
FieldNode(
|
FieldNode(
|
||||||
name: NameNode(value: 'membersWithRole'),
|
name: NameNode(value: 'membersWithRole'),
|
||||||
alias: null,
|
alias: null,
|
||||||
|
@ -860,7 +921,19 @@ class GithubUsersQuery extends GraphQLQuery<GithubUsers, GithubUsersArguments> {
|
||||||
directives: [],
|
directives: [],
|
||||||
selectionSet: null),
|
selectionSet: null),
|
||||||
FieldNode(
|
FieldNode(
|
||||||
name: NameNode(value: 'bio'),
|
name: NameNode(value: 'company'),
|
||||||
|
alias: null,
|
||||||
|
arguments: [],
|
||||||
|
directives: [],
|
||||||
|
selectionSet: null),
|
||||||
|
FieldNode(
|
||||||
|
name: NameNode(value: 'location'),
|
||||||
|
alias: null,
|
||||||
|
arguments: [],
|
||||||
|
directives: [],
|
||||||
|
selectionSet: null),
|
||||||
|
FieldNode(
|
||||||
|
name: NameNode(value: 'createdAt'),
|
||||||
alias: null,
|
alias: null,
|
||||||
arguments: [],
|
arguments: [],
|
||||||
directives: [],
|
directives: [],
|
||||||
|
@ -947,7 +1020,19 @@ class GithubUsersQuery extends GraphQLQuery<GithubUsers, GithubUsersArguments> {
|
||||||
directives: [],
|
directives: [],
|
||||||
selectionSet: null),
|
selectionSet: null),
|
||||||
FieldNode(
|
FieldNode(
|
||||||
name: NameNode(value: 'bio'),
|
name: NameNode(value: 'company'),
|
||||||
|
alias: null,
|
||||||
|
arguments: [],
|
||||||
|
directives: [],
|
||||||
|
selectionSet: null),
|
||||||
|
FieldNode(
|
||||||
|
name: NameNode(value: 'location'),
|
||||||
|
alias: null,
|
||||||
|
arguments: [],
|
||||||
|
directives: [],
|
||||||
|
selectionSet: null),
|
||||||
|
FieldNode(
|
||||||
|
name: NameNode(value: 'createdAt'),
|
||||||
alias: null,
|
alias: null,
|
||||||
arguments: [],
|
arguments: [],
|
||||||
directives: [],
|
directives: [],
|
||||||
|
@ -1020,7 +1105,19 @@ class GithubUsersQuery extends GraphQLQuery<GithubUsers, GithubUsersArguments> {
|
||||||
directives: [],
|
directives: [],
|
||||||
selectionSet: null),
|
selectionSet: null),
|
||||||
FieldNode(
|
FieldNode(
|
||||||
name: NameNode(value: 'bio'),
|
name: NameNode(value: 'company'),
|
||||||
|
alias: null,
|
||||||
|
arguments: [],
|
||||||
|
directives: [],
|
||||||
|
selectionSet: null),
|
||||||
|
FieldNode(
|
||||||
|
name: NameNode(value: 'location'),
|
||||||
|
alias: null,
|
||||||
|
arguments: [],
|
||||||
|
directives: [],
|
||||||
|
selectionSet: null),
|
||||||
|
FieldNode(
|
||||||
|
name: NameNode(value: 'createdAt'),
|
||||||
alias: null,
|
alias: null,
|
||||||
arguments: [],
|
arguments: [],
|
||||||
directives: [],
|
directives: [],
|
||||||
|
|
|
@ -33,7 +33,11 @@ GithubUsersUser _$GithubUsersUserFromJson(Map<String, dynamic> json) {
|
||||||
..login = json['login'] as String
|
..login = json['login'] as String
|
||||||
..name = json['name'] as String
|
..name = json['name'] as String
|
||||||
..avatarUrl = json['avatarUrl'] as String
|
..avatarUrl = json['avatarUrl'] as String
|
||||||
..bio = json['bio'] as String
|
..company = json['company'] as String
|
||||||
|
..location = json['location'] as String
|
||||||
|
..createdAt = json['createdAt'] == null
|
||||||
|
? null
|
||||||
|
: DateTime.parse(json['createdAt'] as String)
|
||||||
..followers = json['followers'] == null
|
..followers = json['followers'] == null
|
||||||
? null
|
? null
|
||||||
: GithubUsersFollowerConnection.fromJson(
|
: GithubUsersFollowerConnection.fromJson(
|
||||||
|
@ -50,7 +54,9 @@ Map<String, dynamic> _$GithubUsersUserToJson(GithubUsersUser instance) =>
|
||||||
'login': instance.login,
|
'login': instance.login,
|
||||||
'name': instance.name,
|
'name': instance.name,
|
||||||
'avatarUrl': instance.avatarUrl,
|
'avatarUrl': instance.avatarUrl,
|
||||||
'bio': instance.bio,
|
'company': instance.company,
|
||||||
|
'location': instance.location,
|
||||||
|
'createdAt': instance.createdAt?.toIso8601String(),
|
||||||
'followers': instance.followers?.toJson(),
|
'followers': instance.followers?.toJson(),
|
||||||
'following': instance.following?.toJson(),
|
'following': instance.following?.toJson(),
|
||||||
'__typename': instance.resolveType,
|
'__typename': instance.resolveType,
|
||||||
|
@ -189,6 +195,7 @@ GithubUsersProfileOwner _$GithubUsersProfileOwnerFromJson(
|
||||||
return GithubUsersProfileOwner()
|
return GithubUsersProfileOwner()
|
||||||
..login = json['login'] as String
|
..login = json['login'] as String
|
||||||
..name = json['name'] as String
|
..name = json['name'] as String
|
||||||
|
..location = json['location'] as String
|
||||||
..resolveType = json['__typename'] as String;
|
..resolveType = json['__typename'] as String;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -197,6 +204,7 @@ Map<String, dynamic> _$GithubUsersProfileOwnerToJson(
|
||||||
<String, dynamic>{
|
<String, dynamic>{
|
||||||
'login': instance.login,
|
'login': instance.login,
|
||||||
'name': instance.name,
|
'name': instance.name,
|
||||||
|
'location': instance.location,
|
||||||
'__typename': instance.resolveType,
|
'__typename': instance.resolveType,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -237,6 +245,7 @@ GithubUsersOrganization _$GithubUsersOrganizationFromJson(
|
||||||
..login = json['login'] as String
|
..login = json['login'] as String
|
||||||
..name = json['name'] as String
|
..name = json['name'] as String
|
||||||
..avatarUrl = json['avatarUrl'] as String
|
..avatarUrl = json['avatarUrl'] as String
|
||||||
|
..location = json['location'] as String
|
||||||
..membersWithRole = json['membersWithRole'] == null
|
..membersWithRole = json['membersWithRole'] == null
|
||||||
? null
|
? null
|
||||||
: GithubUsersOrganizationMemberConnection.fromJson(
|
: GithubUsersOrganizationMemberConnection.fromJson(
|
||||||
|
@ -250,6 +259,7 @@ Map<String, dynamic> _$GithubUsersOrganizationToJson(
|
||||||
'login': instance.login,
|
'login': instance.login,
|
||||||
'name': instance.name,
|
'name': instance.name,
|
||||||
'avatarUrl': instance.avatarUrl,
|
'avatarUrl': instance.avatarUrl,
|
||||||
|
'location': instance.location,
|
||||||
'membersWithRole': instance.membersWithRole?.toJson(),
|
'membersWithRole': instance.membersWithRole?.toJson(),
|
||||||
'__typename': instance.resolveType,
|
'__typename': instance.resolveType,
|
||||||
};
|
};
|
||||||
|
|
|
@ -12,7 +12,9 @@ query(
|
||||||
login
|
login
|
||||||
name
|
name
|
||||||
avatarUrl
|
avatarUrl
|
||||||
bio
|
company
|
||||||
|
location
|
||||||
|
createdAt
|
||||||
followers(first: 30, after: $after) @include(if: $isFollowers) {
|
followers(first: 30, after: $after) @include(if: $isFollowers) {
|
||||||
pageInfo {
|
pageInfo {
|
||||||
hasNextPage
|
hasNextPage
|
||||||
|
@ -22,7 +24,9 @@ query(
|
||||||
login
|
login
|
||||||
name
|
name
|
||||||
avatarUrl
|
avatarUrl
|
||||||
bio
|
company
|
||||||
|
location
|
||||||
|
createdAt
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
following(first: 30, after: $after) @include(if: $isFollowing) {
|
following(first: 30, after: $after) @include(if: $isFollowing) {
|
||||||
|
@ -34,7 +38,9 @@ query(
|
||||||
login
|
login
|
||||||
name
|
name
|
||||||
avatarUrl
|
avatarUrl
|
||||||
bio
|
company
|
||||||
|
location
|
||||||
|
createdAt
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,6 +48,7 @@ query(
|
||||||
login
|
login
|
||||||
name
|
name
|
||||||
avatarUrl
|
avatarUrl
|
||||||
|
location
|
||||||
membersWithRole(first: 30, after: $after) @include(if: $isFollowing) {
|
membersWithRole(first: 30, after: $after) @include(if: $isFollowing) {
|
||||||
pageInfo {
|
pageInfo {
|
||||||
hasNextPage
|
hasNextPage
|
||||||
|
@ -51,7 +58,9 @@ query(
|
||||||
login
|
login
|
||||||
name
|
name
|
||||||
avatarUrl
|
avatarUrl
|
||||||
bio
|
company
|
||||||
|
location
|
||||||
|
createdAt
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,7 +74,9 @@ query(
|
||||||
login
|
login
|
||||||
name
|
name
|
||||||
avatarUrl
|
avatarUrl
|
||||||
bio
|
company
|
||||||
|
location
|
||||||
|
createdAt
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stargazers(first: 30, after: $after) @include(if: $isStar) {
|
stargazers(first: 30, after: $after) @include(if: $isStar) {
|
||||||
|
@ -77,7 +88,9 @@ query(
|
||||||
login
|
login
|
||||||
name
|
name
|
||||||
avatarUrl
|
avatarUrl
|
||||||
bio
|
company
|
||||||
|
location
|
||||||
|
createdAt
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ class MeScreen extends StatelessWidget {
|
||||||
login: user.login,
|
login: user.login,
|
||||||
name: user.name,
|
name: user.name,
|
||||||
avatarUrl: user.avatarUrl,
|
avatarUrl: user.avatarUrl,
|
||||||
bio: user.bio,
|
bio: Text(user.bio ?? ''),
|
||||||
inUserScreen: true,
|
inUserScreen: true,
|
||||||
),
|
),
|
||||||
CommonStyle.border,
|
CommonStyle.border,
|
||||||
|
|
|
@ -46,7 +46,6 @@ class TrendingScreen extends StatelessWidget {
|
||||||
login: item.username,
|
login: item.username,
|
||||||
name: item.name,
|
name: item.name,
|
||||||
avatarUrl: item.avatar,
|
avatarUrl: item.avatar,
|
||||||
bio: '',
|
|
||||||
);
|
);
|
||||||
default:
|
default:
|
||||||
throw '';
|
throw '';
|
||||||
|
|
|
@ -79,7 +79,7 @@ class UserScreen extends StatelessWidget {
|
||||||
login: user.login,
|
login: user.login,
|
||||||
name: user.name,
|
name: user.name,
|
||||||
avatarUrl: user.avatarUrl,
|
avatarUrl: user.avatarUrl,
|
||||||
bio: user.bio,
|
bio: Text(user.bio ?? ''),
|
||||||
inUserScreen: true,
|
inUserScreen: true,
|
||||||
),
|
),
|
||||||
CommonStyle.border,
|
CommonStyle.border,
|
||||||
|
@ -201,7 +201,7 @@ class UserScreen extends StatelessWidget {
|
||||||
login: payload.login,
|
login: payload.login,
|
||||||
name: payload.name,
|
name: payload.name,
|
||||||
avatarUrl: payload.avatarUrl,
|
avatarUrl: payload.avatarUrl,
|
||||||
bio: payload.description,
|
bio: Text(payload.description ?? ''),
|
||||||
inUserScreen: true,
|
inUserScreen: true,
|
||||||
),
|
),
|
||||||
CommonStyle.border,
|
CommonStyle.border,
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:git_touch/graphql/github_users.dart';
|
import 'package:git_touch/graphql/github_users.dart';
|
||||||
|
import 'package:git_touch/models/theme.dart';
|
||||||
import 'package:git_touch/scaffolds/list_stateful.dart';
|
import 'package:git_touch/scaffolds/list_stateful.dart';
|
||||||
|
import 'package:git_touch/utils/utils.dart';
|
||||||
import 'package:git_touch/widgets/app_bar_title.dart';
|
import 'package:git_touch/widgets/app_bar_title.dart';
|
||||||
import 'package:git_touch/widgets/user_item.dart';
|
import 'package:git_touch/widgets/user_item.dart';
|
||||||
import 'package:git_touch/models/auth.dart';
|
import 'package:git_touch/models/auth.dart';
|
||||||
|
import 'package:intl/intl.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
enum UsersScreenType {
|
enum UsersScreenType {
|
||||||
|
@ -93,6 +96,50 @@ class UsersScreen extends StatelessWidget {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static final _dateFormat = DateFormat.yMMMMd();
|
||||||
|
|
||||||
|
Widget _buildBio(BuildContext context, String company, String location,
|
||||||
|
DateTime createdAt) {
|
||||||
|
final theme = Provider.of<ThemeModel>(context);
|
||||||
|
if (company != null && company.isNotEmpty) {
|
||||||
|
return Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Icon(
|
||||||
|
Octicons.organization,
|
||||||
|
size: 15,
|
||||||
|
color: theme.palette.secondaryText,
|
||||||
|
),
|
||||||
|
SizedBox(width: 4),
|
||||||
|
Text(company),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (location != null && location.isNotEmpty) {
|
||||||
|
return Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Icon(
|
||||||
|
Octicons.location,
|
||||||
|
size: 15,
|
||||||
|
color: theme.palette.secondaryText,
|
||||||
|
),
|
||||||
|
SizedBox(width: 4),
|
||||||
|
Text(location),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Icon(
|
||||||
|
Octicons.clock,
|
||||||
|
size: 15,
|
||||||
|
color: theme.palette.secondaryText,
|
||||||
|
),
|
||||||
|
SizedBox(width: 4),
|
||||||
|
Text('Joined on ${_dateFormat.format(createdAt)}'),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ListStatefulScaffold<GithubUsersUser, String>(
|
return ListStatefulScaffold<GithubUsersUser, String>(
|
||||||
|
@ -104,7 +151,8 @@ class UsersScreen extends StatelessWidget {
|
||||||
login: payload.login,
|
login: payload.login,
|
||||||
name: payload.name,
|
name: payload.name,
|
||||||
avatarUrl: payload.avatarUrl,
|
avatarUrl: payload.avatarUrl,
|
||||||
bio: payload.bio,
|
bio: _buildBio(
|
||||||
|
context, payload.company, payload.location, payload.createdAt),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
|
@ -29,7 +29,7 @@ class TextContainsOrganization extends StatelessWidget {
|
||||||
|
|
||||||
return RichText(
|
return RichText(
|
||||||
text: TextSpan(children: spans, style: style),
|
text: TextSpan(children: spans, style: style),
|
||||||
overflow: oneLine ? TextOverflow.ellipsis : null,
|
overflow: oneLine ? TextOverflow.ellipsis : TextOverflow.clip,
|
||||||
maxLines: oneLine ? 1 : null,
|
maxLines: oneLine ? 1 : null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@ import 'package:git_touch/models/theme.dart';
|
||||||
import 'package:git_touch/utils/utils.dart';
|
import 'package:git_touch/utils/utils.dart';
|
||||||
import 'package:git_touch/widgets/avatar.dart';
|
import 'package:git_touch/widgets/avatar.dart';
|
||||||
import 'package:git_touch/widgets/link.dart';
|
import 'package:git_touch/widgets/link.dart';
|
||||||
import 'package:git_touch/widgets/text_contains_organization.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
const userGqlChunk = '''
|
const userGqlChunk = '''
|
||||||
|
@ -17,7 +16,7 @@ class UserItem extends StatelessWidget {
|
||||||
final String login;
|
final String login;
|
||||||
final String name;
|
final String name;
|
||||||
final String avatarUrl;
|
final String avatarUrl;
|
||||||
final String bio;
|
final Widget bio;
|
||||||
final bool inUserScreen;
|
final bool inUserScreen;
|
||||||
|
|
||||||
UserItem({
|
UserItem({
|
||||||
|
@ -33,7 +32,7 @@ class UserItem extends StatelessWidget {
|
||||||
}) : login = data['login'],
|
}) : login = data['login'],
|
||||||
name = data['name'],
|
name = data['name'],
|
||||||
avatarUrl = data['avatarUrl'],
|
avatarUrl = data['avatarUrl'],
|
||||||
bio = data['bio'];
|
bio = Text(data['bio']);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
@ -42,12 +41,12 @@ class UserItem extends StatelessWidget {
|
||||||
final widget = Container(
|
final widget = Container(
|
||||||
padding: CommonStyle.padding,
|
padding: CommonStyle.padding,
|
||||||
child: Row(
|
child: Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Avatar(url: avatarUrl, size: AvatarSize.large),
|
Avatar(url: avatarUrl, size: AvatarSize.large),
|
||||||
SizedBox(width: 10),
|
SizedBox(width: 10),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Row(
|
Row(
|
||||||
|
@ -69,14 +68,13 @@ class UserItem extends StatelessWidget {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(height: 6),
|
SizedBox(height: 6),
|
||||||
if (bio != null && bio.isNotEmpty)
|
if (bio != null)
|
||||||
TextContainsOrganization(
|
DefaultTextStyle(
|
||||||
bio,
|
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: theme.palette.secondaryText,
|
color: theme.palette.secondaryText,
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
),
|
),
|
||||||
oneLine: true,
|
child: bio,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in New Issue