sync changes
This commit is contained in:
@@ -2,9 +2,11 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
import '../../core/app_colors.dart';
|
||||
import '../../di/service_locator.dart';
|
||||
import '../../domain/entities/payment_card.dart';
|
||||
import '../../domain/usecase/get_payment_cards_usecase.dart';
|
||||
import '../components/app_checkbox.dart';
|
||||
import '../components/custom_app_bar.dart'; // ✅ Уже есть
|
||||
import '../components/gradient_button.dart';
|
||||
import '../components/payment_option.dart';
|
||||
@@ -51,7 +53,6 @@ class TopUpScreen extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
_buildCardSelector(state, context),
|
||||
_buildAddCardButton(() => context.push("/home/payment-methods/add-card")),
|
||||
const SizedBox(height: 20),
|
||||
_buildAgreement(state, context),
|
||||
const Spacer(),
|
||||
@@ -159,7 +160,6 @@ class TopUpScreen extends StatelessWidget {
|
||||
subtitle: '****${state.selectedCard!.cardLastNumber}',
|
||||
isSelected: true,
|
||||
onTap: () async {
|
||||
// Открываем модалку как вложенную, не закрывая текущую
|
||||
final selectedCard = await showModalBottomSheet<PaymentCard>(
|
||||
context: context,
|
||||
isScrollControlled: true,
|
||||
@@ -236,18 +236,22 @@ class TopUpScreen extends StatelessWidget {
|
||||
|
||||
Widget _buildAgreement(TopUpState state, BuildContext context) {
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Checkbox(
|
||||
AppCheckbox(
|
||||
value: state.isAgreed,
|
||||
onChanged: (v) =>
|
||||
context.read<TopUpBloc>().add(ToggleAgreement(v ?? false)),
|
||||
side: const BorderSide(color: Colors.white54),
|
||||
),
|
||||
const Expanded(
|
||||
child: Text(
|
||||
'Я принимаю условия покупки бонусного пакета, при котором денежные средства не подлежат возврату...',
|
||||
style: TextStyle(color: Colors.white54, fontSize: 12),
|
||||
const SizedBox(width: 12),
|
||||
Flexible(
|
||||
child: Text.rich(
|
||||
TextSpan(
|
||||
text: 'Я принимаю условия покупки бонусного пакета, при котором денежные средства не подлежат возврату... ',
|
||||
style: const TextStyle(
|
||||
color: AppColors.white70,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -266,23 +270,4 @@ class TopUpScreen extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildAddCardButton(VoidCallback onPressed) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(top: 10),
|
||||
child: OutlinedButton.icon(
|
||||
onPressed: onPressed,
|
||||
icon: const Icon(Icons.add, color: Colors.white),
|
||||
label: const Text(
|
||||
'Добавить платежную карту',
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
style: OutlinedButton.styleFrom(
|
||||
side: const BorderSide(color: Colors.white54),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user