1
0
mirror of https://github.com/git-touch/git-touch synced 2025-02-02 08:56:54 +01:00

52 lines
1.2 KiB
Dart
Raw Normal View History

2019-02-04 21:38:29 +08:00
import 'package:flutter/cupertino.dart';
2019-11-05 21:22:41 +08:00
import 'package:git_touch/models/theme.dart';
import 'package:git_touch/utils/utils.dart';
2019-11-05 21:22:41 +08:00
import 'package:provider/provider.dart';
2019-02-04 21:38:29 +08:00
import 'link.dart';
class EntryItem extends StatelessWidget {
2021-05-16 15:16:35 +08:00
final int? count;
2019-02-04 21:38:29 +08:00
final String text;
2021-05-16 15:16:35 +08:00
final String? url;
2019-02-04 21:38:29 +08:00
EntryItem({
2021-05-16 15:16:35 +08:00
required this.text,
2020-10-05 18:26:43 +08:00
this.count,
this.url,
});
2019-02-04 21:38:29 +08:00
@override
Widget build(BuildContext context) {
2019-11-05 21:22:41 +08:00
final theme = Provider.of<ThemeModel>(context);
2019-02-04 21:38:29 +08:00
return Expanded(
2021-05-16 15:16:35 +08:00
child: LinkWidget(
2019-12-13 13:40:05 +08:00
url: url,
2019-02-04 21:38:29 +08:00
child: Container(
2019-09-13 15:55:58 +08:00
padding: EdgeInsets.symmetric(vertical: 14),
2019-02-04 21:38:29 +08:00
child: Column(
children: <Widget>[
2019-09-13 15:55:58 +08:00
Text(
2020-10-05 18:26:43 +08:00
count == null ? '?' : numberFormat.format(count),
2019-11-05 21:22:41 +08:00
style: TextStyle(
fontSize: 17,
fontWeight: FontWeight.w600,
2020-01-27 15:11:51 +08:00
color: theme.palette.text,
2019-11-05 21:22:41 +08:00
),
2019-09-13 15:55:58 +08:00
),
Text(
text,
style: TextStyle(
2019-12-21 16:16:17 +08:00
fontSize: 14,
2020-01-27 15:11:51 +08:00
color: theme.palette.secondaryText,
2019-09-13 15:55:58 +08:00
fontWeight: FontWeight.w500,
),
)
2019-02-04 21:38:29 +08:00
],
),
),
),
);
}
}