diff --git a/lib/data/models/payment_cubit.dart b/lib/data/models/payment_cubit.dart index 4c0a2f4e3f3fd49b77e55f84054cc17d17799bf9..ce26027938df1e80c88901a08c5761f60b0ac270 100644 --- a/lib/data/models/payment_cubit.dart +++ b/lib/data/models/payment_cubit.dart @@ -45,7 +45,7 @@ class PaymentCubit extends HydratedCubit<PaymentState> { } void sent() { - emit(PaymentState.emptyPayment); + emit(PaymentState.emptyPayment.copyWith(status: PaymentStatus.isSent)); } void notSent() { diff --git a/lib/ui/widgets/first_screen/g1_textfield.dart b/lib/ui/widgets/first_screen/g1_textfield.dart index 05c0afc25228d0bcaebb1f5d1506beb28b0f83da..946d15a66ab0aeda2ebdd195eca51728dcb47272 100644 --- a/lib/ui/widgets/first_screen/g1_textfield.dart +++ b/lib/ui/widgets/first_screen/g1_textfield.dart @@ -70,6 +70,12 @@ class _G1PayAmountFieldState extends State<G1PayAmountField> { _controller.selection = TextSelection.fromPosition( TextPosition(offset: _controller.text.length)); } + } else { + if (state.status == PaymentStatus.isSent) { + _controller.text = ''; + // This set status to not sent + context.read<PaymentCubit>().selectAmount(null); + } } final bool expertMode = context.read<AppCubit>().isExpertMode;