Top Up Balance logic and Added fixes for routing

This commit is contained in:
Arseni
2025-12-05 20:29:43 +03:00
parent f7bf3138ac
commit bf39b1d401
27 changed files with 972 additions and 175 deletions

View File

@@ -0,0 +1,44 @@
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:pweb/pages/wallet_top_up/content.dart';
import 'package:pweb/providers/wallets.dart';
import 'package:pweb/generated/i18n/app_localizations.dart';
class WalletTopUpPage extends StatelessWidget {
final VoidCallback onBack;
const WalletTopUpPage({super.key, required this.onBack});
@override
Widget build(BuildContext context) {
final loc = AppLocalizations.of(context)!;
return Consumer<WalletsProvider>(
builder: (context, provider, child) {
if (provider.isLoading) {
return const Center(child: CircularProgressIndicator());
}
if (provider.error != null) {
return Center(
child: Text(loc.notificationError(provider.error.toString())),
);
}
final wallet = provider.selectedWallet;
if (wallet == null) {
return Center(child: Text(loc.noWalletSelected));
}
return WalletTopUpContent(
wallet: wallet,
onBack: onBack,
);
},
);
}
}