Frontend first draft
This commit is contained in:
22
frontend/pshared/lib/models/recipient/status.dart
Normal file
22
frontend/pshared/lib/models/recipient/status.dart
Normal file
@@ -0,0 +1,22 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user