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-07 12:17:29 +01:00
|
|
|
final WidgetBuilder screenBuilder;
|
2019-02-10 07:26:51 +01:00
|
|
|
final String url;
|
2019-02-04 14:38:29 +01:00
|
|
|
|
2019-02-10 07:26:51 +01:00
|
|
|
EntryItem({this.count, this.text, this.screenBuilder, 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(
|
|
|
|
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(
|
2019-09-13 17:34:19 +02:00
|
|
|
numberFormat.format(count),
|
2019-11-05 14:22:41 +01:00
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 17,
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
color: theme.palette.text,
|
|
|
|
),
|
2019-09-13 09:55:58 +02:00
|
|
|
),
|
|
|
|
Text(
|
|
|
|
text,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 12,
|
2019-11-05 14:22:41 +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
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
2019-02-07 12:17:29 +01:00
|
|
|
screenBuilder: screenBuilder,
|
2019-02-10 07:26:51 +01:00
|
|
|
url: url,
|
2019-02-04 14:38:29 +01:00
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|