GiftLivesRequestCard constructor
GiftLivesRequestCard({
- Key? key,
- required GiftLivesRequest request,
- required ValueChanged<
String> onSendLife, - String sendLabel = 'Send Life',
- String sentLabel = 'Sent',
- String expiredLabel = 'Expired',
- String? statusText,
- Duration guardWindow = const Duration(milliseconds: 600),
Implementation
GiftLivesRequestCard({
super.key,
required this.request,
required this.onSendLife,
this.sendLabel = 'Send Life',
this.sentLabel = 'Sent',
this.expiredLabel = 'Expired',
this.statusText,
this.guardWindow = const Duration(milliseconds: 600),
}) {
if (request.requestId.trim().isEmpty || request.senderName.trim().isEmpty) {
throw ArgumentError.value(
request,
'request',
'requestId and senderName must not be empty',
);
}
if (sendLabel.trim().isEmpty ||
sentLabel.trim().isEmpty ||
expiredLabel.trim().isEmpty) {
throw ArgumentError('labels must not be empty');
}
if (guardWindow.isNegative) {
throw ArgumentError.value(
guardWindow,
'guardWindow',
'must not be negative',
);
}
}