mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-30 06:48:49 +01:00
* New price API * Fix test app package id * Fix workflow * change environment variable to use pr number [skip ci] * Fix un-needed padding * Fix raw value for usdtSol * Remove duplicate fetching for balance and transactions at start [skip ci] * Fix address validation of spl tokens * Add Service Status * Update lib/src/widgets/service_status_tile.dart Co-authored-by: Konstantin Ullrich <konstantinullrich12@gmail.com> * Update lib/src/widgets/services_updates_widget.dart Co-authored-by: Konstantin Ullrich <konstantinullrich12@gmail.com> * Update monero version * update sodium script * Change automatic priority fee rate --------- Co-authored-by: Konstantin Ullrich <konstantinullrich12@gmail.com>
72 lines
2.0 KiB
Dart
72 lines
2.0 KiB
Dart
import 'package:auto_size_text/auto_size_text.dart';
|
|
import 'package:cake_wallet/entities/service_status.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:intl/intl.dart';
|
|
|
|
class ServiceStatusTile extends StatelessWidget {
|
|
final ServiceStatus status;
|
|
|
|
const ServiceStatusTile(this.status, {super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return ListTile(
|
|
contentPadding: const EdgeInsets.all(8),
|
|
title: Padding(
|
|
padding: const EdgeInsets.symmetric(vertical: 8),
|
|
child: Row(
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
children: [
|
|
Expanded(
|
|
child: AutoSizeText(
|
|
"${status.title}${status.status != null ? " - ${status.status}" : ""}",
|
|
style: TextStyle(
|
|
fontSize: 16,
|
|
fontFamily: 'Lato',
|
|
fontWeight: FontWeight.w800,
|
|
height: 1,
|
|
),
|
|
maxLines: 1,
|
|
textAlign: TextAlign.start,
|
|
),
|
|
),
|
|
Text(
|
|
_getTimeString(status.date),
|
|
style: TextStyle(fontSize: 12),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
leading: RotatedBox(
|
|
child: Icon(
|
|
Icons.info,
|
|
color: status.status == "resolved" ? Colors.green : Colors.red,
|
|
),
|
|
quarterTurns: 2,
|
|
),
|
|
subtitle: Row(
|
|
children: [
|
|
Expanded(child: Text(status.description)),
|
|
if (status.image != null)
|
|
SizedBox(
|
|
height: 50,
|
|
width: 50,
|
|
child: Image.network(status.image!),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
|
|
String _getTimeString(DateTime date) {
|
|
int difference = DateTime.now().difference(date).inHours;
|
|
if (difference == 0) {
|
|
return "few minutes ago";
|
|
}
|
|
if (difference < 24) {
|
|
return DateFormat('h:mm a').format(date);
|
|
}
|
|
return DateFormat('d-MM-yyyy').format(date);
|
|
}
|
|
}
|