changed imports of AppLocalization
Also added beneficiary validation while quick pay within bank
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import '../../../l10n/app_localizations.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:kmobile/api/services/auth_service.dart';
|
||||
@@ -36,9 +36,7 @@ class _TransactionPinScreen extends State<TransactionPinScreen> {
|
||||
if (!isSet && mounted) {
|
||||
Navigator.pushReplacement(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (_) => const TpinSetupPromptScreen(),
|
||||
),
|
||||
MaterialPageRoute(builder: (_) => const TpinSetupPromptScreen()),
|
||||
);
|
||||
} else if (mounted) {
|
||||
setState(() => _loading = false);
|
||||
@@ -48,7 +46,8 @@ class _TransactionPinScreen extends State<TransactionPinScreen> {
|
||||
setState(() => _loading = false);
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(AppLocalizations.of(context).tpinStatusFailed)),
|
||||
content: Text(AppLocalizations.of(context).tpinStatusFailed),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -95,8 +94,8 @@ class _TransactionPinScreen extends State<TransactionPinScreen> {
|
||||
} else {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content:
|
||||
Text(AppLocalizations.of(context).enter6DigitTpin)),
|
||||
content: Text(AppLocalizations.of(context).enter6DigitTpin),
|
||||
),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
@@ -122,11 +121,13 @@ class _TransactionPinScreen extends State<TransactionPinScreen> {
|
||||
Row(children: [_buildKey('1'), _buildKey('2'), _buildKey('3')]),
|
||||
Row(children: [_buildKey('4'), _buildKey('5'), _buildKey('6')]),
|
||||
Row(children: [_buildKey('7'), _buildKey('8'), _buildKey('9')]),
|
||||
Row(children: [
|
||||
_buildKey('done', icon: Icons.check),
|
||||
_buildKey('0'),
|
||||
_buildKey('back', icon: Icons.backspace_outlined),
|
||||
]),
|
||||
Row(
|
||||
children: [
|
||||
_buildKey('done', icon: Icons.check),
|
||||
_buildKey('0'),
|
||||
_buildKey('back', icon: Icons.backspace_outlined),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -136,19 +137,21 @@ class _TransactionPinScreen extends State<TransactionPinScreen> {
|
||||
final transfer = widget.transactionData;
|
||||
transfer.tpin = _pin.join();
|
||||
try {
|
||||
final paymentResponse =
|
||||
paymentService.processQuickPayWithinBank(transfer);
|
||||
final paymentResponse = paymentService.processQuickPayWithinBank(
|
||||
transfer,
|
||||
);
|
||||
|
||||
Navigator.of(context).pushReplacement(
|
||||
MaterialPageRoute(
|
||||
builder: (_) =>
|
||||
PaymentAnimationScreen(paymentResponse: paymentResponse)),
|
||||
builder: (_) =>
|
||||
PaymentAnimationScreen(paymentResponse: paymentResponse),
|
||||
),
|
||||
);
|
||||
} catch (e) {
|
||||
if (mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(e.toString())),
|
||||
);
|
||||
ScaffoldMessenger.of(
|
||||
context,
|
||||
).showSnackBar(SnackBar(content: Text(e.toString())));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user