Added Localizations and ran small fixes
This commit is contained in:
@@ -3,25 +3,28 @@ import 'package:flutter/material.dart';
|
||||
import 'package:pweb/models/wallet.dart';
|
||||
import 'package:pweb/utils/dimensions.dart';
|
||||
|
||||
import 'package:pweb/generated/i18n/app_localizations.dart';
|
||||
|
||||
|
||||
class SaveWalletButton extends StatelessWidget {
|
||||
final Wallet wallet;
|
||||
final TextEditingController nameController;
|
||||
final TextEditingController balanceController;
|
||||
final VoidCallback onSave; // Changed to VoidCallback
|
||||
final VoidCallback onSave;
|
||||
|
||||
const SaveWalletButton({
|
||||
super.key,
|
||||
required this.wallet,
|
||||
required this.nameController,
|
||||
required this.balanceController,
|
||||
required this.onSave, // Now matches _saveWallet signature
|
||||
required this.onSave,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
final dimensions = AppDimensions();
|
||||
final loc = AppLocalizations.of(context)!;
|
||||
|
||||
return Center(
|
||||
child: SizedBox(
|
||||
@@ -29,7 +32,7 @@ class SaveWalletButton extends StatelessWidget {
|
||||
height: dimensions.buttonHeight,
|
||||
child: InkWell(
|
||||
borderRadius: BorderRadius.circular(dimensions.borderRadiusSmall),
|
||||
onTap: onSave, // Directly use onSave now
|
||||
onTap: onSave,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.primary,
|
||||
@@ -37,7 +40,7 @@ class SaveWalletButton extends StatelessWidget {
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
'Save',
|
||||
loc.save,
|
||||
style: theme.textTheme.bodyLarge?.copyWith(
|
||||
color: theme.colorScheme.onSecondary,
|
||||
fontWeight: FontWeight.w600,
|
||||
@@ -49,4 +52,4 @@ class SaveWalletButton extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,19 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'package:pweb/providers/page_selector.dart';
|
||||
import 'package:pweb/providers/wallets.dart';
|
||||
|
||||
import 'package:pweb/generated/i18n/app_localizations.dart';
|
||||
|
||||
|
||||
class SendPayoutButton extends StatelessWidget {
|
||||
const SendPayoutButton({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final loc = AppLocalizations.of(context)!;
|
||||
return ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
shadowColor: null,
|
||||
@@ -23,7 +28,7 @@ class SendPayoutButton extends StatelessWidget {
|
||||
pageSelectorProvider.startPaymentFromWallet(wallet);
|
||||
}
|
||||
},
|
||||
child: Text('Send Payout'),
|
||||
child: Text(loc.payoutNavSendPayout),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:pweb/generated/i18n/app_localizations.dart';
|
||||
|
||||
|
||||
class TopUpButton extends StatelessWidget{
|
||||
const TopUpButton({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final loc = AppLocalizations.of(context)!;
|
||||
return ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
shadowColor: null,
|
||||
@@ -13,10 +16,10 @@ class TopUpButton extends StatelessWidget{
|
||||
),
|
||||
onPressed: () {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text('Add functionality')),
|
||||
SnackBar(content: Text(loc.addFunctionality)),
|
||||
);
|
||||
},
|
||||
child: Text('Top Up Balance'),
|
||||
child: Text(loc.topUpBalance),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user