fix styles on the add card page, move the parser to a separate file, change the styles of the page of one news item, add a parser for the subscription page, add the input field for the qr code
This commit is contained in:
@@ -58,27 +58,10 @@ class _PromoCodeScreenContentState extends State<_PromoCodeScreenContent> {
|
||||
BlocListener<PromoCodeBloc, PromoCodeState>(
|
||||
listener: (context, state) {
|
||||
if (state.status == PromoCodeStatus.success) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
'Промокод активирован! Баланс: ${state.newBalance?.toStringAsFixed(2)} BYN',
|
||||
),
|
||||
backgroundColor: Colors.green,
|
||||
),
|
||||
);
|
||||
// Очищаем поле визуально
|
||||
promoController.clear();
|
||||
// Ждем чуть меньше, чтобы пользователь увидел успех
|
||||
Future.delayed(const Duration(milliseconds: 1200), () {
|
||||
Future.delayed(const Duration(milliseconds: 800), () {
|
||||
if (mounted) Navigator.pop(context);
|
||||
});
|
||||
} else if (state.status == PromoCodeStatus.failure) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(state.errorMessage ?? 'Ошибка активации'),
|
||||
backgroundColor: Colors.red,
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
child: BlocBuilder<PromoCodeBloc, PromoCodeState>(
|
||||
|
||||
Reference in New Issue
Block a user