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

56 lines
1.4 KiB
Dart
Raw Permalink Normal View History

2022-09-24 20:46:37 +02:00
import 'package:antd_mobile/antd_mobile.dart';
2019-02-04 14:38:29 +01:00
import 'package:flutter/cupertino.dart';
import 'package:git_touch/utils/utils.dart';
2019-02-04 14:38:29 +01:00
class EntryItem extends StatelessWidget {
2022-09-06 18:28:12 +02:00
const EntryItem({
2021-05-16 09:16:35 +02:00
required this.text,
2020-10-05 12:26:43 +02:00
this.count,
this.url,
});
2022-09-21 18:28:21 +02:00
final int? count;
final String text;
final String? url;
2019-02-04 14:38:29 +01:00
@override
Widget build(BuildContext context) {
2022-10-04 14:18:04 +02:00
final theme = AntTheme.of(context);
2019-02-04 14:38:29 +01:00
return Expanded(
2022-10-04 14:18:04 +02:00
child: Container(
color: theme.colorBackground,
child: AntButton(
block: true,
size: AntButtonSize.large,
fill: AntButtonFill.none,
color: theme.colorPrimary,
onClick: () {
if (url != null) context.pushUrl(url!);
},
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,
2022-10-04 14:18:04 +02:00
color: theme.colorText,
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,
2022-10-04 14:18:04 +02:00
color: theme.colorTextSecondary,
2019-09-13 09:55:58 +02:00
fontWeight: FontWeight.w500,
// overflow: TextOverflow.ellipsis,
2019-09-13 09:55:58 +02:00
),
)
2019-02-04 14:38:29 +01:00
],
),
),
),
);
}
}