formatted the whole codebase

This commit is contained in:
asif
2025-08-18 03:20:05 +05:30
parent e2a809d363
commit e6ea764785
58 changed files with 470 additions and 373 deletions

View File

@@ -87,7 +87,7 @@ class _AccountInfoScreen extends State<AccountInfoScreen> {
);
}).toList(),
),
InfoRow(
title: AppLocalizations.of(context).customerNumber,
value: selectedUser.cifNumber ?? 'N/A',

View File

@@ -294,10 +294,10 @@ class _AccountStatementScreen extends State<AccountStatementScreen> {
Navigator.push(
context,
MaterialPageRoute(
builder: (_) =>
TransactionDetailsScreen(transaction: tx),
),
);
builder: (_) => TransactionDetailsScreen(
transaction: tx),
),
);
},
);
},

View File

@@ -3,7 +3,7 @@ import 'package:kmobile/l10n/app_localizations.dart';
import 'package:material_symbols_icons/symbols.dart';
class TransactionDetailsScreen extends StatelessWidget {
final dynamic transaction;
final dynamic transaction;
const TransactionDetailsScreen({super.key, required this.transaction});
@@ -11,41 +11,42 @@ class TransactionDetailsScreen extends StatelessWidget {
Widget build(BuildContext context) {
final bool isCredit = transaction.type?.toUpperCase() == 'CR';
// Future<void> _shareScreenshot() async {
// try {
// RenderRepaintBoundary boundary =
// _shareKey.currentContext!.findRenderObject() as RenderRepaintBoundary;
// ui.Image image = await boundary.toImage(pixelRatio: 3.0);
// ByteData? byteData = await image.toByteData(format: ui.ImageByteFormat.png);
// Uint8List pngBytes = byteData!.buffer.asUint8List();
// Future<void> _shareScreenshot() async {
// try {
// RenderRepaintBoundary boundary =
// _shareKey.currentContext!.findRenderObject() as RenderRepaintBoundary;
// ui.Image image = await boundary.toImage(pixelRatio: 3.0);
// ByteData? byteData = await image.toByteData(format: ui.ImageByteFormat.png);
// Uint8List pngBytes = byteData!.buffer.asUint8List();
// final tempDir = await getTemporaryDirectory();
// final file = await File('${tempDir.path}/payment_result.png').create();
// await file.writeAsBytes(pngBytes);
// final tempDir = await getTemporaryDirectory();
// final file = await File('${tempDir.path}/payment_result.png').create();
// await file.writeAsBytes(pngBytes);
// await Share.shareXFiles(
// [XFile(file.path)],
// text: AppLocalizations.of(context).paymentResult,
// );
// } catch (e) {
// if (!mounted) return;
// ScaffoldMessenger.of(context).showSnackBar(
// SnackBar(
// content: Text(
// '${AppLocalizations.of(context).failedToShareScreenshot}: $e',
// ),
// ),
// );
// }
// }
// await Share.shareXFiles(
// [XFile(file.path)],
// text: AppLocalizations.of(context).paymentResult,
// );
// } catch (e) {
// if (!mounted) return;
// ScaffoldMessenger.of(context).showSnackBar(
// SnackBar(
// content: Text(
// '${AppLocalizations.of(context).failedToShareScreenshot}: $e',
// ),
// ),
// );
// }
// }
return Scaffold(
appBar: AppBar(title: Text(AppLocalizations.of(context).transactionDetails)),
appBar:
AppBar(title: Text(AppLocalizations.of(context).transactionDetails)),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
children: [
// Absolute center for amount + icon + date + details
// Absolute center for amount + icon + date + details
Expanded(
flex: 3,
child: Center(
@@ -94,39 +95,45 @@ class TransactionDetailsScreen extends StatelessWidget {
child: ListView(
children: [
// ignore: unnecessary_cast
_buildDetailRow(AppLocalizations.of(context).transactionType as String, transaction.type ?? ""),
_buildDetailRow(AppLocalizations.of(context).transferType, transaction.name.split("/").first ?? ""),
if(transaction.name.length> 12) ... [
_buildDetailRow(AppLocalizations.of(context).utrNo, transaction.name.split("= ")[1].split(" ")[0] ?? ""),
_buildDetailRow(AppLocalizations.of(context).beneficiaryAccountNo, transaction.name.split("A/C ").last ?? "")
_buildDetailRow(
AppLocalizations.of(context).transactionType as String,
transaction.type ?? ""),
_buildDetailRow(AppLocalizations.of(context).transferType,
transaction.name.split("/").first ?? ""),
if (transaction.name.length > 12) ...[
_buildDetailRow(AppLocalizations.of(context).utrNo,
transaction.name.split("= ")[1].split(" ")[0] ?? ""),
_buildDetailRow(
AppLocalizations.of(context).beneficiaryAccountNo,
transaction.name.split("A/C ").last ?? "")
]
],
),
),
// ElevatedButton.icon(
// onPressed: _shareScreenshot,
// icon: Icon(
// Icons.share_rounded,
// color: Theme.of(context).primaryColor,
// ),
// label: Text(
// AppLocalizations.of(context).share,
// style: TextStyle(color: Theme.of(context).primaryColor),
// ),
// style: ElevatedButton.styleFrom(
// backgroundColor: Theme.of(context).scaffoldBackgroundColor,
// padding: const EdgeInsets.symmetric(horizontal: 32, vertical: 12),
// shape: RoundedRectangleBorder(
// side: BorderSide(color: Theme.of(context).primaryColor, width: 1),
// borderRadius: BorderRadius.circular(30),
// ),
// textStyle: const TextStyle(
// fontSize: 18,
// fontWeight: FontWeight.w600,
// color: Colors.black,
// ),
// ),
// ),
// ElevatedButton.icon(
// onPressed: _shareScreenshot,
// icon: Icon(
// Icons.share_rounded,
// color: Theme.of(context).primaryColor,
// ),
// label: Text(
// AppLocalizations.of(context).share,
// style: TextStyle(color: Theme.of(context).primaryColor),
// ),
// style: ElevatedButton.styleFrom(
// backgroundColor: Theme.of(context).scaffoldBackgroundColor,
// padding: const EdgeInsets.symmetric(horizontal: 32, vertical: 12),
// shape: RoundedRectangleBorder(
// side: BorderSide(color: Theme.of(context).primaryColor, width: 1),
// borderRadius: BorderRadius.circular(30),
// ),
// textStyle: const TextStyle(
// fontSize: 18,
// fontWeight: FontWeight.w600,
// color: Colors.black,
// ),
// ),
// ),
],
),
),
@@ -159,4 +166,3 @@ class TransactionDetailsScreen extends StatelessWidget {
);
}
}