23 lines
668 B
Dart
23 lines
668 B
Dart
import 'package:flutter/widgets.dart';
|
|
|
|
import 'package:pshared/generated/i18n/ps_localizations.dart';
|
|
|
|
|
|
/// Possible payout readiness states.
|
|
enum RecipientStatus { ready, registered, notRegistered }
|
|
|
|
extension RecipientStatusExtension on RecipientStatus {
|
|
/// Human-readable, **localized** label for display in the UI.
|
|
String label(BuildContext context) {
|
|
final l10n = PSLocalizations.of(context)!;
|
|
switch (this) {
|
|
case RecipientStatus.ready:
|
|
return l10n.statusReady;
|
|
case RecipientStatus.registered:
|
|
return l10n.statusRegistered;
|
|
case RecipientStatus.notRegistered:
|
|
return l10n.statusNotRegistered;
|
|
}
|
|
}
|
|
}
|