Set color for the dialog buttons

This commit is contained in:
vishnukvmd 2021-08-23 15:54:56 +05:30
parent e0fd3725b7
commit 838aa5def4

View file

@ -43,8 +43,7 @@ class _PaymentWebPageState extends State<PaymentWebPage> {
void initState() { void initState() {
userService.getPaymentToken().then((token) { userService.getPaymentToken().then((token) {
initPaymentUrl = _getPaymentUrl(token); initPaymentUrl = _getPaymentUrl(token);
setState(() { setState(() {});
});
}); });
if (Platform.isAndroid && kDebugMode) { if (Platform.isAndroid && kDebugMode) {
AndroidInAppWebViewController.setWebContentsDebuggingEnabled(true); AndroidInAppWebViewController.setWebContentsDebuggingEnabled(true);
@ -107,7 +106,8 @@ class _PaymentWebPageState extends State<PaymentWebPage> {
await _dialog.hide(); await _dialog.hide();
} }
}, },
onLoadHttpError: (controller, navigationAction, code, msg) async { onLoadHttpError:
(controller, navigationAction, code, msg) async {
_logger.info("onHttpError with $code and msg = $msg"); _logger.info("onHttpError with $code and msg = $msg");
}, },
onLoadStop: (controller, navigationAction) async { onLoadStop: (controller, navigationAction) async {
@ -152,12 +152,24 @@ class _PaymentWebPageState extends State<PaymentWebPage> {
title: Text('are you sure you want to exit?'), title: Text('are you sure you want to exit?'),
actions: <Widget>[ actions: <Widget>[
TextButton( TextButton(
child: Text('yes'), child: Text('yes',
onPressed: () => Navigator.of(context).pop(true)), style: TextStyle(
color: Colors.redAccent,
)),
onPressed: () => Navigator.of(context).pop(true),
),
TextButton( TextButton(
child: Text('no'), child: Text(
onPressed: () => Navigator.of(context).pop(false)), 'no',
])); style: TextStyle(
color: Colors.white,
),
),
onPressed: () => Navigator.of(context).pop(false),
),
],
),
);
} }
bool _isPaymentActionComplete(Uri loadingUri) { bool _isPaymentActionComplete(Uri loadingUri) {