git-touch-android-ios-app/lib/widgets/contributor_item.dart

67 lines
1.9 KiB
Dart
Raw Normal View History

2022-09-17 14:35:45 +02:00
import 'package:flutter/widgets.dart';
import 'package:git_touch/models/theme.dart';
import 'package:git_touch/utils/utils.dart';
import 'package:git_touch/widgets/avatar.dart';
import 'package:git_touch/widgets/link.dart';
import 'package:provider/provider.dart';
class ContributorItem extends StatelessWidget {
2022-09-06 18:28:12 +02:00
const ContributorItem({
2021-05-16 09:16:35 +02:00
required this.login,
required this.avatarUrl,
required this.commits,
required this.url,
});
2022-09-21 18:28:21 +02:00
final String? login;
final String? avatarUrl;
final int? commits;
final String url;
@override
Widget build(BuildContext context) {
final theme = Provider.of<ThemeModel>(context);
2021-05-16 09:16:35 +02:00
return LinkWidget(
url: url,
child: Container(
padding: CommonStyle.padding,
child: Row(
children: <Widget>[
Avatar(url: avatarUrl, size: AvatarSize.large),
2022-09-06 18:28:12 +02:00
const SizedBox(width: 10),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
Text(
2021-05-16 09:16:35 +02:00
login!,
style: TextStyle(
color: theme.palette.primary,
fontSize: 18,
fontWeight: FontWeight.w600,
),
),
],
),
2022-09-06 18:28:12 +02:00
const SizedBox(height: 6),
if (commits != null)
DefaultTextStyle(
style: TextStyle(
color: theme.palette.secondaryText,
fontSize: 16,
),
child: Text('Commits: $commits'),
),
],
),
)
],
),
),
);
}
}