stack_wallet/lib/pages/ordinals/widgets/ordinal_card.dart

64 lines
1.9 KiB
Dart
Raw Normal View History

2023-07-18 16:15:05 +00:00
import 'package:flutter/material.dart';
import '../../../models/isar/ordinal.dart';
import '../ordinal_details_view.dart';
import '../../../pages_desktop_specific/ordinals/desktop_ordinal_details_view.dart';
import '../../../utilities/constants.dart';
import '../../../utilities/text_styles.dart';
import '../../../utilities/util.dart';
import '../../../widgets/rounded_white_container.dart';
2023-07-18 16:15:05 +00:00
class OrdinalCard extends StatelessWidget {
const OrdinalCard({
2024-05-27 23:56:22 +00:00
super.key,
2023-07-18 16:15:05 +00:00
required this.walletId,
required this.ordinal,
2024-05-27 23:56:22 +00:00
});
2023-07-18 16:15:05 +00:00
final String walletId;
final Ordinal ordinal;
2023-07-18 16:15:05 +00:00
@override
Widget build(BuildContext context) {
return RoundedWhiteContainer(
radiusMultiplier: 2,
onPressed: () {
Navigator.of(context).pushNamed(
2023-07-22 01:52:43 +00:00
Util.isDesktop
? DesktopOrdinalDetailsView.routeName
: OrdinalDetailsView.routeName,
arguments: (walletId: walletId, ordinal: ordinal),
2023-07-18 16:15:05 +00:00
);
},
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
AspectRatio(
aspectRatio: 1,
child: ClipRRect(
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,
),
child: Image.network(
ordinal.content, // Use the preview URL as the image source
fit: BoxFit.cover,
filterQuality:
FilterQuality.none, // Set the filter mode to nearest
2023-07-18 16:15:05 +00:00
),
),
),
const Spacer(),
Text(
'INSC. ${ordinal.inscriptionNumber}', // infer from address associated with utxoTXID
2023-07-18 16:15:05 +00:00
style: STextStyles.w500_12(context),
),
// const Spacer(),
// Text(
// "ID ${ordinal.inscriptionId}",
// style: STextStyles.w500_8(context),
// ),
2023-07-18 16:15:05 +00:00
],
),
);
}
}