mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-20 06:08:34 +02:00
CWA-207 | applied new design to pin code page; added pin alert dialog; added barrier dismissible property to base alert page
This commit is contained in:
@@ -7,12 +7,17 @@ import 'package:cake_wallet/src/screens/pin_code/pin_code.dart';
|
||||
import 'package:cake_wallet/src/screens/base_page.dart';
|
||||
import 'package:cake_wallet/src/stores/settings/settings_store.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
import 'package:cake_wallet/src/screens/setup_pin_code/widgets/pin_alert_dialog.dart';
|
||||
|
||||
class SetupPinCodePage extends BasePage {
|
||||
SetupPinCodePage({this.onPinCodeSetup});
|
||||
|
||||
final Function(BuildContext, String) onPinCodeSetup;
|
||||
|
||||
@override
|
||||
Color get backgroundColor => PaletteDark.historyPanel;
|
||||
|
||||
@override
|
||||
String get title => S.current.setup_pin;
|
||||
|
||||
@@ -58,37 +63,28 @@ class _SetupPinCodeFormState<WidgetType extends SetupPinCodeForm>
|
||||
|
||||
showDialog<void>(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
content: Text(S.of(context).setup_successful),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
child: Text(S.of(context).ok),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
widget.onPinCodeSetup(context, pin);
|
||||
reset();
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
return PinAlertDialog(
|
||||
pinTitleText: S.current.setup_pin,
|
||||
pinContentText: S.of(context).setup_successful,
|
||||
pinActionButtonText: S.of(context).ok,
|
||||
pinBarrierDismissible: false,
|
||||
pinAction: () {
|
||||
Navigator.of(context).pop();
|
||||
widget.onPinCodeSetup(context, pin);
|
||||
reset();
|
||||
});
|
||||
});
|
||||
} else {
|
||||
showDialog<void>(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
content: Text(S.of(context).pin_is_incorrect),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
child: Text(S.of(context).ok),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
return PinAlertDialog(
|
||||
pinTitleText: S.current.setup_pin,
|
||||
pinContentText: S.of(context).pin_is_incorrect,
|
||||
pinActionButtonText: S.of(context).ok,
|
||||
pinBarrierDismissible: true,
|
||||
pinAction: () => Navigator.of(context).pop());
|
||||
});
|
||||
|
||||
reset();
|
||||
|
||||
Reference in New Issue
Block a user