2022-11-22 20:52:28 +00:00
|
|
|
import 'package:cake_wallet/generated/i18n.dart';
|
|
|
|
|
2024-09-23 14:10:40 +00:00
|
|
|
enum PinCodeRequiredDuration {
|
|
|
|
always(0),
|
|
|
|
tenMinutes(10),
|
|
|
|
halfHour(30),
|
|
|
|
fortyFiveMinutes(45),
|
|
|
|
oneHour(60);
|
2022-11-22 20:52:28 +00:00
|
|
|
|
|
|
|
const PinCodeRequiredDuration(this.value);
|
2024-09-23 14:10:40 +00:00
|
|
|
|
2022-11-22 20:52:28 +00:00
|
|
|
final int value;
|
|
|
|
|
|
|
|
static PinCodeRequiredDuration deserialize({required int raw}) =>
|
|
|
|
PinCodeRequiredDuration.values.firstWhere((e) => e.value == raw);
|
|
|
|
|
|
|
|
@override
|
2024-09-23 14:10:40 +00:00
|
|
|
String toString() {
|
2022-11-22 20:52:28 +00:00
|
|
|
String label = '';
|
|
|
|
switch (this) {
|
|
|
|
case PinCodeRequiredDuration.always:
|
|
|
|
label = S.current.always;
|
|
|
|
break;
|
2024-09-23 14:10:40 +00:00
|
|
|
case PinCodeRequiredDuration.tenMinutes:
|
2022-11-22 20:52:28 +00:00
|
|
|
label = S.current.minutes_to_pin_code('10');
|
|
|
|
break;
|
2024-09-23 14:10:40 +00:00
|
|
|
case PinCodeRequiredDuration.oneHour:
|
2022-11-22 20:52:28 +00:00
|
|
|
label = S.current.minutes_to_pin_code('60');
|
|
|
|
break;
|
2024-09-23 14:10:40 +00:00
|
|
|
case PinCodeRequiredDuration.halfHour:
|
|
|
|
label = S.current.minutes_to_pin_code('30');
|
|
|
|
break;
|
|
|
|
case PinCodeRequiredDuration.fortyFiveMinutes:
|
|
|
|
label = S.current.minutes_to_pin_code('45');
|
|
|
|
break;
|
2022-11-22 20:52:28 +00:00
|
|
|
}
|
|
|
|
return label;
|
|
|
|
}
|
2024-09-23 14:10:40 +00:00
|
|
|
}
|