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