From c489bf38950fe63a09e677529c721f635f2de4df Mon Sep 17 00:00:00 2001 From: asif Date: Thu, 4 Sep 2025 00:33:33 +0530 Subject: [PATCH] added SafeArea and changed buttton color in Add Beneficiary Page --- .../screens/add_beneficiary_screen.dart | 109 ++---------------- .../screens/beneficiary_details_screen.dart | 108 ++++++++--------- 2 files changed, 65 insertions(+), 152 deletions(-) diff --git a/lib/features/beneficiaries/screens/add_beneficiary_screen.dart b/lib/features/beneficiaries/screens/add_beneficiary_screen.dart index 4fde100..4e47921 100644 --- a/lib/features/beneficiaries/screens/add_beneficiary_screen.dart +++ b/lib/features/beneficiaries/screens/add_beneficiary_screen.dart @@ -220,8 +220,6 @@ class _AddBeneficiaryScreen extends State { appBar: AppBar( title: Text( AppLocalizations.of(context).addBeneficiary, - style: - const TextStyle(color: Colors.black, fontWeight: FontWeight.w500), ), centerTitle: false, ), @@ -246,18 +244,6 @@ class _AddBeneficiaryScreen extends State { // prefixIcon: Icon(Icons.person), border: const OutlineInputBorder(), isDense: true, - filled: true, - fillColor: - Theme.of(context).scaffoldBackgroundColor, - enabledBorder: const OutlineInputBorder( - borderSide: BorderSide(color: Colors.black), - ), - focusedBorder: const OutlineInputBorder( - borderSide: BorderSide( - color: Colors.black, - width: 2, - ), - ), ), obscureText: true, keyboardType: TextInputType.number, @@ -288,18 +274,6 @@ class _AddBeneficiaryScreen extends State { // prefixIcon: Icon(Icons.person), border: const OutlineInputBorder(), isDense: true, - filled: true, - fillColor: - Theme.of(context).scaffoldBackgroundColor, - enabledBorder: const OutlineInputBorder( - borderSide: BorderSide(color: Colors.black), - ), - focusedBorder: const OutlineInputBorder( - borderSide: BorderSide( - color: Colors.black, - width: 2, - ), - ), ), keyboardType: TextInputType.number, textInputAction: TextInputAction.next, @@ -318,7 +292,6 @@ class _AddBeneficiaryScreen extends State { }, ), const SizedBox(height: 24), - // 🔹 IFSC Code Field TextFormField( controller: ifscController, maxLength: 11, @@ -329,18 +302,6 @@ class _AddBeneficiaryScreen extends State { labelText: AppLocalizations.of(context).ifscCode, border: const OutlineInputBorder(), isDense: true, - filled: true, - fillColor: - Theme.of(context).scaffoldBackgroundColor, - enabledBorder: const OutlineInputBorder( - borderSide: BorderSide(color: Colors.black), - ), - focusedBorder: const OutlineInputBorder( - borderSide: BorderSide( - color: Colors.black, - width: 2, - ), - ), ), textCapitalization: TextCapitalization.characters, textInputAction: TextInputAction.next, @@ -378,18 +339,6 @@ class _AddBeneficiaryScreen extends State { labelText: AppLocalizations.of(context).bankName, border: const OutlineInputBorder(), isDense: true, - filled: true, - fillColor: Theme.of(context) - .dialogBackgroundColor, // disabled color - enabledBorder: const OutlineInputBorder( - borderSide: BorderSide(color: Colors.black), - ), - focusedBorder: const OutlineInputBorder( - borderSide: BorderSide( - color: Colors.black, - width: 2, - ), - ), ), ), const SizedBox(height: 24), @@ -401,17 +350,6 @@ class _AddBeneficiaryScreen extends State { labelText: AppLocalizations.of(context).branchName, border: const OutlineInputBorder(), isDense: true, - filled: true, - fillColor: Theme.of(context).dialogBackgroundColor, - enabledBorder: const OutlineInputBorder( - borderSide: BorderSide(color: Colors.black), - ), - focusedBorder: const OutlineInputBorder( - borderSide: BorderSide( - color: Colors.black, - width: 2, - ), - ), ), ), const SizedBox(height: 24), @@ -456,15 +394,6 @@ class _AddBeneficiaryScreen extends State { AppLocalizations.of(context).beneficiaryName, border: const OutlineInputBorder(), isDense: true, - filled: true, - fillColor: Theme.of(context).dialogBackgroundColor, - enabledBorder: const OutlineInputBorder( - borderSide: BorderSide(color: Colors.black), - ), - focusedBorder: const OutlineInputBorder( - borderSide: - BorderSide(color: Colors.black, width: 2), - ), ), textInputAction: TextInputAction.next, validator: (value) => value == null || value.isEmpty @@ -479,18 +408,6 @@ class _AddBeneficiaryScreen extends State { labelText: AppLocalizations.of(context).accountType, border: const OutlineInputBorder(), isDense: true, - filled: true, - fillColor: - Theme.of(context).scaffoldBackgroundColor, - enabledBorder: const OutlineInputBorder( - borderSide: BorderSide(color: Colors.black), - ), - focusedBorder: const OutlineInputBorder( - borderSide: BorderSide( - color: Colors.black, - width: 2, - ), - ), ), items: [ 'Savings', @@ -519,18 +436,6 @@ class _AddBeneficiaryScreen extends State { prefixIcon: const Icon(Icons.phone), border: const OutlineInputBorder(), isDense: true, - filled: true, - fillColor: - Theme.of(context).scaffoldBackgroundColor, - enabledBorder: const OutlineInputBorder( - borderSide: BorderSide(color: Colors.black), - ), - focusedBorder: const OutlineInputBorder( - borderSide: BorderSide( - color: Colors.black, - width: 2, - ), - ), ), textInputAction: TextInputAction.done, validator: (value) => @@ -545,16 +450,22 @@ class _AddBeneficiaryScreen extends State { ), ), Padding( - padding: const EdgeInsets.all(16.0), + padding: const EdgeInsets.symmetric(vertical: 10), child: SizedBox( width: 250, child: ElevatedButton( onPressed: validateAndAddBeneficiary, style: ElevatedButton.styleFrom( - shape: const StadiumBorder(), - padding: const EdgeInsets.symmetric(vertical: 16), + shape: const StadiumBorder(), + padding: const EdgeInsets.symmetric(vertical: 16), + backgroundColor: + Theme.of(context).colorScheme.primaryContainer, + foregroundColor: + Theme.of(context).colorScheme.onPrimaryContainer), + child: Text( + AppLocalizations.of(context).validateAndAdd, + style: const TextStyle(fontSize: 16), ), - child: Text(AppLocalizations.of(context).validateAndAdd), ), ), ), diff --git a/lib/features/beneficiaries/screens/beneficiary_details_screen.dart b/lib/features/beneficiaries/screens/beneficiary_details_screen.dart index afa9d7d..289b06a 100644 --- a/lib/features/beneficiaries/screens/beneficiary_details_screen.dart +++ b/lib/features/beneficiaries/screens/beneficiary_details_screen.dart @@ -81,59 +81,61 @@ class BeneficiaryDetailsScreen extends StatelessWidget { appBar: AppBar( title: Text(AppLocalizations.of(context).beneficiarydetails), ), - body: Padding( - padding: const EdgeInsets.all(16.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - CircleAvatar( - radius: 24, - backgroundColor: Colors.transparent, - child: getBankLogo(beneficiary.bankName, context), - ), - const SizedBox(width: 16), - Text( - beneficiary.name, - style: const TextStyle( - fontSize: 20, fontWeight: FontWeight.bold), - ), - ], - ), - const SizedBox(height: 24), - _buildDetailRow('${AppLocalizations.of(context).bankName} ', - beneficiary.bankName ?? 'N/A'), - _buildDetailRow('${AppLocalizations.of(context).accountNumber} ', - beneficiary.accountNo), - _buildDetailRow('${AppLocalizations.of(context).accountType} ', - beneficiary.accountType), - _buildDetailRow('${AppLocalizations.of(context).ifscCode} ', - beneficiary.ifscCode), - _buildDetailRow('${AppLocalizations.of(context).branchName} ', - beneficiary.branchName ?? 'N/A'), - const Spacer(), - Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - // ElevatedButton.icon( - // onPressed: () { - // // Set Transaction Limit for this beneficiary - // }, - // icon: const Icon(Icons.currency_rupee), - // label: const Text('Set Limit'), - // ), - ElevatedButton.icon( - onPressed: () { - // Delete beneficiary option - _showDeleteConfirmationDialog(context); - }, - icon: const Icon(Icons.delete), - label: Text(AppLocalizations.of(context).delete), - ), - ], - ), - ], + body: SafeArea( + child: Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + CircleAvatar( + radius: 24, + backgroundColor: Colors.transparent, + child: getBankLogo(beneficiary.bankName, context), + ), + const SizedBox(width: 16), + Text( + beneficiary.name, + style: const TextStyle( + fontSize: 20, fontWeight: FontWeight.bold), + ), + ], + ), + const SizedBox(height: 24), + _buildDetailRow('${AppLocalizations.of(context).bankName} ', + beneficiary.bankName ?? 'N/A'), + _buildDetailRow('${AppLocalizations.of(context).accountNumber} ', + beneficiary.accountNo), + _buildDetailRow('${AppLocalizations.of(context).accountType} ', + beneficiary.accountType), + _buildDetailRow('${AppLocalizations.of(context).ifscCode} ', + beneficiary.ifscCode), + _buildDetailRow('${AppLocalizations.of(context).branchName} ', + beneficiary.branchName ?? 'N/A'), + const Spacer(), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + // ElevatedButton.icon( + // onPressed: () { + // // Set Transaction Limit for this beneficiary + // }, + // icon: const Icon(Icons.currency_rupee), + // label: const Text('Set Limit'), + // ), + ElevatedButton.icon( + onPressed: () { + // Delete beneficiary option + _showDeleteConfirmationDialog(context); + }, + icon: const Icon(Icons.delete), + label: Text(AppLocalizations.of(context).delete), + ), + ], + ), + ], + ), ), ), );