mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
f8d086a743
Signed-off-by: validcube <pun.butrach@gmail.com>
96 lines
2.8 KiB
Dart
96 lines
2.8 KiB
Dart
import 'dart:typed_data';
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_i18n/flutter_i18n.dart';
|
|
import 'package:revanced_manager/ui/widgets/shared/custom_card.dart';
|
|
import 'package:timeago/timeago.dart';
|
|
|
|
class ApplicationItem extends StatefulWidget {
|
|
const ApplicationItem({
|
|
super.key,
|
|
required this.icon,
|
|
required this.name,
|
|
required this.patchDate,
|
|
required this.onPressed,
|
|
});
|
|
final Uint8List icon;
|
|
final String name;
|
|
final DateTime patchDate;
|
|
final Function() onPressed;
|
|
|
|
@override
|
|
State<ApplicationItem> createState() => _ApplicationItemState();
|
|
}
|
|
|
|
class _ApplicationItemState extends State<ApplicationItem> {
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
margin: const EdgeInsets.only(bottom: 16.0),
|
|
child: CustomCard(
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
Flexible(
|
|
child: Row(
|
|
children: [
|
|
SizedBox(
|
|
width: 40,
|
|
child: Image.memory(widget.icon, height: 40, width: 40),
|
|
),
|
|
const SizedBox(width: 19),
|
|
Expanded(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: <Widget>[
|
|
Text(
|
|
widget.name,
|
|
maxLines: 1,
|
|
overflow: TextOverflow.ellipsis,
|
|
style: const TextStyle(
|
|
fontSize: 16,
|
|
fontWeight: FontWeight.w500,
|
|
),
|
|
),
|
|
Text(
|
|
format(widget.patchDate),
|
|
maxLines: 1,
|
|
overflow: TextOverflow.ellipsis,
|
|
style: const TextStyle(
|
|
fontSize: 16,
|
|
fontWeight: FontWeight.w500,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
Row(
|
|
children: [
|
|
const SizedBox(width: 8),
|
|
Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
children: <Widget>[
|
|
FilledButton(
|
|
onPressed: widget.onPressed,
|
|
child: I18nText('applicationItem.infoButton'),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|