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

57 lines
1.6 KiB
Dart
Raw Normal View History

2023-07-18 16:15:05 +00:00
import 'package:flutter/material.dart';
import 'package:stackwallet/models/ordinal.dart';
2023-07-18 16:15:05 +00:00
import 'package:stackwallet/pages/ordinals/ordinal_details_view.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart';
class OrdinalCard extends StatelessWidget {
const OrdinalCard({
Key? key,
2023-07-18 16:15:05 +00:00
required this.walletId,
required this.ordinal,
}) : super(key: key);
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(
OrdinalDetailsView.routeName,
arguments: (walletId: walletId, ordinal: ordinal),
2023-07-18 16:15:05 +00:00
);
},
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
2023-07-21 15:49:30 +00:00
AspectRatio(
aspectRatio: 1,
child: Container(
2023-07-18 16:15:05 +00:00
color: Colors.red,
child: Image.network(
ordinal.content, // Use the preview URL as the image source
fit: BoxFit.cover,
2023-07-21 15:49:30 +00:00
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
],
),
);
}
}