From 3b0ea460017a9d2b613b6dd4dab9b8474a0f1c67 Mon Sep 17 00:00:00 2001 From: Basem1166 Date: Wed, 21 Aug 2024 16:29:59 +0300 Subject: [PATCH 1/4] feat: daily_transacations page --- .../presentation/pages/daily_transaction.dart | 71 ++++++++++++++ .../presentation/widgets/filter.dart | 63 ++++++++++++ .../presentation/widgets/header.dart | 43 +++++++++ .../presentation/widgets/transaction.dart | 95 +++++++++++++++++++ .../widgets/vertical_divider.dart | 22 +++++ threefold_connect/lib/main.dart | 6 +- .../Flutter/GeneratedPluginRegistrant.swift | 2 + 7 files changed, 300 insertions(+), 2 deletions(-) create mode 100644 threefold_connect/lib/daily_transacations/presentation/pages/daily_transaction.dart create mode 100644 threefold_connect/lib/daily_transacations/presentation/widgets/filter.dart create mode 100644 threefold_connect/lib/daily_transacations/presentation/widgets/header.dart create mode 100644 threefold_connect/lib/daily_transacations/presentation/widgets/transaction.dart create mode 100644 threefold_connect/lib/daily_transacations/presentation/widgets/vertical_divider.dart diff --git a/threefold_connect/lib/daily_transacations/presentation/pages/daily_transaction.dart b/threefold_connect/lib/daily_transacations/presentation/pages/daily_transaction.dart new file mode 100644 index 0000000..6fc201d --- /dev/null +++ b/threefold_connect/lib/daily_transacations/presentation/pages/daily_transaction.dart @@ -0,0 +1,71 @@ +import 'package:flutter/material.dart'; + +import '../widgets/filter.dart'; +import '../widgets/transaction.dart'; +import '../widgets/vertical_divider.dart'; +import '/widgets/app_bar.dart'; + +import '../widgets/header.dart'; + +class DailyTransactionsPage extends StatefulWidget { + const DailyTransactionsPage({super.key}); + + @override + State createState() => _DailyTransactionsPageState(); +} + +class _DailyTransactionsPageState extends State { + String selectedCurrency = 'TFT'; + final List currencies = ['TFT', 'All']; + + void _onCurrencyChanged(String? newCurrency) { + if (newCurrency != null) { + setState(() { + selectedCurrency = newCurrency; + }); + } + } + + @override + Widget build(BuildContext context) { + return SafeArea( + child: Scaffold( + appBar: const MyAppBar(title: 'Wallet'), + body: Column( + children: [ + const WalletInfoHeader(email: 'Daily@username'), + const SizedBox(height: 16), + FilterWidget( + currencies: currencies, + selectedCurrency: selectedCurrency, + onCurrencyChanged: _onCurrencyChanged, + ), + const SizedBox(height: 16), + Expanded( + child: ListView.builder( + itemCount: 10, + itemBuilder: (context, index) { + return Column( + children: [ + TransactionWidget( + isIncoming: index % 2 == 0, + status: "Completed", + transactionId: + 'VerlyLongTransacationIDkfuiuaiuagigiuagiuwaghwag $index', + tftAmount: 100.0 + index, + date: '2022-01-0${index + 1}', + ), + index != 9 + ? const CustomVerticalDivider() + : const SizedBox(), + ], + ); + }, + ), + ), + ], + ), + ), + ); + } +} diff --git a/threefold_connect/lib/daily_transacations/presentation/widgets/filter.dart b/threefold_connect/lib/daily_transacations/presentation/widgets/filter.dart new file mode 100644 index 0000000..3120287 --- /dev/null +++ b/threefold_connect/lib/daily_transacations/presentation/widgets/filter.dart @@ -0,0 +1,63 @@ +import 'package:flutter/material.dart'; + +class FilterWidget extends StatelessWidget { + final List currencies; + final String selectedCurrency; + final ValueChanged onCurrencyChanged; + + const FilterWidget({ + super.key, + required this.currencies, + required this.selectedCurrency, + required this.onCurrencyChanged, + }); + + @override + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Padding( + padding: EdgeInsets.symmetric(horizontal: 16), + child: Text( + 'Filter by Currency', + style: TextStyle(fontSize: 16, color: Colors.white), + ), + ), + const SizedBox(height: 8), + Row( + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Container( + decoration: BoxDecoration( + color: Theme.of(context).scaffoldBackgroundColor, + border: Border.all(color: Theme.of(context).primaryColor), + borderRadius: BorderRadius.circular(8), + ), + padding: const EdgeInsets.symmetric(horizontal: 16), + child: DropdownButtonHideUnderline( + child: DropdownButton( + dropdownColor: Theme.of(context).scaffoldBackgroundColor, + style: const TextStyle(color: Colors.white), + value: selectedCurrency, + onChanged: onCurrencyChanged, + items: currencies + .map>((String value) { + return DropdownMenuItem( + value: value, + child: Text(value), + ); + }).toList(), + ), + ), + ), + ), + ), + ], + ), + ], + ); + } +} diff --git a/threefold_connect/lib/daily_transacations/presentation/widgets/header.dart b/threefold_connect/lib/daily_transacations/presentation/widgets/header.dart new file mode 100644 index 0000000..3477a20 --- /dev/null +++ b/threefold_connect/lib/daily_transacations/presentation/widgets/header.dart @@ -0,0 +1,43 @@ +import 'package:flutter/material.dart'; + +class WalletInfoHeader extends StatelessWidget { + final String email; + + const WalletInfoHeader({super.key, required this.email}); + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(16), + child: Row( + children: [ + const Icon(Icons.wallet), + Expanded( + child: Align( + alignment: Alignment.center, + child: Column( + children: [ + const Text( + 'Daily', + style: TextStyle( + fontSize: 20, + color: Colors.white, + fontWeight: FontWeight.bold, + ), + ), + Text( + email, + style: const TextStyle( + fontSize: 16, + color: Colors.white, + ), + ), + ], + ), + ), + ), + ], + ), + ); + } +} diff --git a/threefold_connect/lib/daily_transacations/presentation/widgets/transaction.dart b/threefold_connect/lib/daily_transacations/presentation/widgets/transaction.dart new file mode 100644 index 0000000..c740a2c --- /dev/null +++ b/threefold_connect/lib/daily_transacations/presentation/widgets/transaction.dart @@ -0,0 +1,95 @@ +import 'package:flutter/material.dart'; + +class TransactionWidget extends StatelessWidget { + final bool isIncoming; + final String transactionId; + final double tftAmount; + final String date; + final String status; + + const TransactionWidget({ + super.key, + required this.isIncoming, + required this.transactionId, + required this.tftAmount, + required this.date, + required this.status, + }); + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(16), + child: Row( + children: [ + CircleAvatar( + backgroundColor: + isIncoming ? Theme.of(context).primaryColor : Colors.red, + child: Icon( + isIncoming ? Icons.arrow_downward : Icons.arrow_outward, + color: Colors.white, + ), + ), + const SizedBox(width: 8), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + transactionId, + overflow: TextOverflow.ellipsis, + style: const TextStyle( + fontSize: 16, + color: Colors.white, + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'TFT $tftAmount', + style: TextStyle( + fontSize: 14, + color: isIncoming + ? Theme.of(context).primaryColor + : Colors.red, + ), + ), + Text( + date, + style: const TextStyle( + fontSize: 14, + color: Colors.white, + ), + ), + ], + ), + ], + ), + ), + const SizedBox(width: 8), + Container( + padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6), + decoration: BoxDecoration( + color: status == 'Completed' + ? Theme.of(context).primaryColor + : Colors.red, + border: Border.all( + color: status == 'Completed' ? Colors.green : Colors.red, + ), + borderRadius: BorderRadius.circular(20), + ), + child: Text( + status, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + color: status == 'Completed' ? Colors.white : Colors.red, + ), + ), + ), + ], + ), + ); + } +} diff --git a/threefold_connect/lib/daily_transacations/presentation/widgets/vertical_divider.dart b/threefold_connect/lib/daily_transacations/presentation/widgets/vertical_divider.dart new file mode 100644 index 0000000..f862bcd --- /dev/null +++ b/threefold_connect/lib/daily_transacations/presentation/widgets/vertical_divider.dart @@ -0,0 +1,22 @@ +import 'package:flutter/material.dart'; + +class CustomVerticalDivider extends StatelessWidget { + const CustomVerticalDivider({super.key}); + + @override + Widget build(BuildContext context) { + return const Align( + alignment: Alignment.topLeft, + child: Padding( + padding: EdgeInsets.only(left: 35), + child: SizedBox( + height: 40, + child: VerticalDivider( + color: Colors.grey, + width: 2, + ), + ), + ), + ); + } +} diff --git a/threefold_connect/lib/main.dart b/threefold_connect/lib/main.dart index e06c0c4..03ad6cb 100644 --- a/threefold_connect/lib/main.dart +++ b/threefold_connect/lib/main.dart @@ -1,5 +1,7 @@ import 'package:flutter/material.dart'; +import 'package:threefold_connect/daily_transacations/presentation/pages/daily_transaction.dart'; import 'package:threefold_connect/theme/theme.dart'; + void main() { runApp(const MyApp()); } @@ -12,8 +14,8 @@ class MyApp extends StatelessWidget { Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', - theme: threefoldTheme, - home: const MyHomePage(title: 'Flutter Demo Home Page'), + theme: threefoldTheme, + home: const DailyTransactionsPage(), ); } } diff --git a/threefold_connect/macos/Flutter/GeneratedPluginRegistrant.swift b/threefold_connect/macos/Flutter/GeneratedPluginRegistrant.swift index cccf817..e777c67 100644 --- a/threefold_connect/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/threefold_connect/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,6 +5,8 @@ import FlutterMacOS import Foundation +import path_provider_foundation func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) } From 8b145e4bdd0c58c6ce7d759495e121f5805a82a7 Mon Sep 17 00:00:00 2001 From: Basem1166 Date: Wed, 21 Aug 2024 18:09:42 +0300 Subject: [PATCH 2/4] feat: footer --- .../presentation/pages/daily_transaction.dart | 2 + .../presentation/widgets/footer.dart | 45 +++++++++++++++++++ .../presentation/widgets/transaction.dart | 9 ++-- threefold_connect/lib/theme/theme.dart | 1 + 4 files changed, 52 insertions(+), 5 deletions(-) create mode 100644 threefold_connect/lib/daily_transacations/presentation/widgets/footer.dart diff --git a/threefold_connect/lib/daily_transacations/presentation/pages/daily_transaction.dart b/threefold_connect/lib/daily_transacations/presentation/pages/daily_transaction.dart index 6fc201d..d89bcee 100644 --- a/threefold_connect/lib/daily_transacations/presentation/pages/daily_transaction.dart +++ b/threefold_connect/lib/daily_transacations/presentation/pages/daily_transaction.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import '../widgets/filter.dart'; +import '../widgets/footer.dart'; import '../widgets/transaction.dart'; import '../widgets/vertical_divider.dart'; import '/widgets/app_bar.dart'; @@ -63,6 +64,7 @@ class _DailyTransactionsPageState extends State { }, ), ), + const Footer(), ], ), ), diff --git a/threefold_connect/lib/daily_transacations/presentation/widgets/footer.dart b/threefold_connect/lib/daily_transacations/presentation/widgets/footer.dart new file mode 100644 index 0000000..f208275 --- /dev/null +++ b/threefold_connect/lib/daily_transacations/presentation/widgets/footer.dart @@ -0,0 +1,45 @@ +import 'package:flutter/material.dart'; +import 'package:threefold_connect/theme/theme.dart'; + +class Footer extends StatelessWidget { + const Footer({super.key}); + + @override + Widget build(BuildContext context) { + return BottomAppBar( + color: Theme.of(context).scaffoldBackgroundColor, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + _buildFooterButton(Icons.money, () { + // Handle button press + }), + _buildFooterButton(Icons.compare_arrows_sharp, () { + // Handle button press + }), + _buildFooterButton(Icons.info_outline, () { + // Handle button press + }), + ], + ), + ); + } + + Widget _buildFooterButton(IconData icon, VoidCallback onPressed) { + return Expanded( + child: Container( + margin: const EdgeInsets.all(8.0), + child: ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: const Color(0xFF504c4c), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(0), + ), + ), + onPressed: onPressed, + child: Icon(icon), + ), + ), + ); + } +} diff --git a/threefold_connect/lib/daily_transacations/presentation/widgets/transaction.dart b/threefold_connect/lib/daily_transacations/presentation/widgets/transaction.dart index c740a2c..e307e63 100644 --- a/threefold_connect/lib/daily_transacations/presentation/widgets/transaction.dart +++ b/threefold_connect/lib/daily_transacations/presentation/widgets/transaction.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:threefold_connect/theme/theme.dart'; class TransactionWidget extends StatelessWidget { final bool isIncoming; @@ -24,9 +25,9 @@ class TransactionWidget extends StatelessWidget { children: [ CircleAvatar( backgroundColor: - isIncoming ? Theme.of(context).primaryColor : Colors.red, + isIncoming ? Theme.of(context).primaryColor : brightRed, child: Icon( - isIncoming ? Icons.arrow_downward : Icons.arrow_outward, + isIncoming ? Icons.arrow_downward : Icons.arrow_upward, color: Colors.white, ), ), @@ -50,9 +51,7 @@ class TransactionWidget extends StatelessWidget { 'TFT $tftAmount', style: TextStyle( fontSize: 14, - color: isIncoming - ? Theme.of(context).primaryColor - : Colors.red, + color: isIncoming ? Colors.green : Colors.red, ), ), Text( diff --git a/threefold_connect/lib/theme/theme.dart b/threefold_connect/lib/theme/theme.dart index f92309c..1c488d0 100644 --- a/threefold_connect/lib/theme/theme.dart +++ b/threefold_connect/lib/theme/theme.dart @@ -9,6 +9,7 @@ const backgroundColor = Color(0xFF383434); const white = Color(0xFFFFFFFF); const darkred = Color(0xFFA11A1A); const grey = Color(0xFF818181); +const brightRed = Color.fromARGB(255, 255, 0, 0); // Fonts var poppins = GoogleFonts.poppins().fontFamily; From 300701b5e24301e1d99d45a313829180844d3139 Mon Sep 17 00:00:00 2001 From: Basem1166 Date: Thu, 22 Aug 2024 10:32:37 +0300 Subject: [PATCH 3/4] feat: add arrow inwar.dart --- .../presentation/widgets/arrow_inward.dart | 19 +++++++++++++++++++ .../presentation/widgets/transaction.dart | 11 +++++++---- 2 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 threefold_connect/lib/daily_transacations/presentation/widgets/arrow_inward.dart diff --git a/threefold_connect/lib/daily_transacations/presentation/widgets/arrow_inward.dart b/threefold_connect/lib/daily_transacations/presentation/widgets/arrow_inward.dart new file mode 100644 index 0000000..c50d7c1 --- /dev/null +++ b/threefold_connect/lib/daily_transacations/presentation/widgets/arrow_inward.dart @@ -0,0 +1,19 @@ +import 'package:flutter/material.dart'; +import 'dart:math' as math; + +class ArrowInward extends StatelessWidget { + const ArrowInward({ + Key? key, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Transform.rotate( + angle: 180 * math.pi / 180, + child: const Icon( + Icons.arrow_outward, + color: Colors.white, + ), + ); + } +} diff --git a/threefold_connect/lib/daily_transacations/presentation/widgets/transaction.dart b/threefold_connect/lib/daily_transacations/presentation/widgets/transaction.dart index e307e63..44263c9 100644 --- a/threefold_connect/lib/daily_transacations/presentation/widgets/transaction.dart +++ b/threefold_connect/lib/daily_transacations/presentation/widgets/transaction.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:threefold_connect/daily_transacations/presentation/widgets/arrow_inward.dart'; import 'package:threefold_connect/theme/theme.dart'; class TransactionWidget extends StatelessWidget { @@ -26,10 +27,12 @@ class TransactionWidget extends StatelessWidget { CircleAvatar( backgroundColor: isIncoming ? Theme.of(context).primaryColor : brightRed, - child: Icon( - isIncoming ? Icons.arrow_downward : Icons.arrow_upward, - color: Colors.white, - ), + child: isIncoming + ? const ArrowInward() + : const Icon( + Icons.arrow_outward, + color: Colors.white, + ), ), const SizedBox(width: 8), Expanded( From 357a6792c0002b077997f87f38f00d83ddb59615 Mon Sep 17 00:00:00 2001 From: Basem1166 Date: Sat, 24 Aug 2024 17:40:21 +0300 Subject: [PATCH 4/4] feat: transaction details page --- .../presentation/pages/daily_transaction.dart | 1 + .../pages/transaction_details.dart | 61 ++++++++ .../presentation/widgets/footer.dart | 2 +- .../presentation/widgets/transaction.dart | 148 ++++++++++-------- .../widgets/transaction_details.dart | 106 +++++++++++++ threefold_connect/lib/theme/theme.dart | 5 + 6 files changed, 259 insertions(+), 64 deletions(-) create mode 100644 threefold_connect/lib/daily_transacations/presentation/pages/transaction_details.dart create mode 100644 threefold_connect/lib/daily_transacations/presentation/widgets/transaction_details.dart diff --git a/threefold_connect/lib/daily_transacations/presentation/pages/daily_transaction.dart b/threefold_connect/lib/daily_transacations/presentation/pages/daily_transaction.dart index d89bcee..d53281a 100644 --- a/threefold_connect/lib/daily_transacations/presentation/pages/daily_transaction.dart +++ b/threefold_connect/lib/daily_transacations/presentation/pages/daily_transaction.dart @@ -35,6 +35,7 @@ class _DailyTransactionsPageState extends State { body: Column( children: [ const WalletInfoHeader(email: 'Daily@username'), + const Divider(), const SizedBox(height: 16), FilterWidget( currencies: currencies, diff --git a/threefold_connect/lib/daily_transacations/presentation/pages/transaction_details.dart b/threefold_connect/lib/daily_transacations/presentation/pages/transaction_details.dart new file mode 100644 index 0000000..dfd82c9 --- /dev/null +++ b/threefold_connect/lib/daily_transacations/presentation/pages/transaction_details.dart @@ -0,0 +1,61 @@ +import 'package:flutter/material.dart'; +import 'package:threefold_connect/daily_transacations/presentation/widgets/footer.dart'; +import 'package:threefold_connect/daily_transacations/presentation/widgets/header.dart'; +import 'package:threefold_connect/daily_transacations/presentation/widgets/transaction_details.dart'; +import 'package:threefold_connect/main.dart'; +import 'package:threefold_connect/widgets/app_bar.dart'; + +class TransactionDetailsPage extends StatelessWidget { + final String transactionId; + final String status; + final String asset; + final String sender; + final String receiver; + final String paymentType; + final String transactionHash; + final String? memo; + final String amount; + final String date; + + const TransactionDetailsPage({ + super.key, + required this.transactionId, + required this.status, + required this.asset, + required this.sender, + required this.receiver, + required this.paymentType, + required this.transactionHash, + required this.amount, + required this.date, + this.memo, + }); + + @override + Widget build(BuildContext context) { + return const Scaffold( + appBar: MyAppBar(title: 'Wallet'), + body: Column( + children: [ + WalletInfoHeader(email: 'Daily@username'), + Divider(), + Expanded( + child: SingleChildScrollView( + child: TransactionDetails( + transactionId: 'aufhiufa', + status: 'idk', + asset: 'TFT', + sender: 'akuakugagak', + receiver: 'wjbfafbafb', + paymentType: 'IDK', + transactionHash: 'iufwiufwiufwif', + amount: 'hmmmmm', + date: 'idk'), + ), + ), + Footer(), + ], + ), + ); + } +} diff --git a/threefold_connect/lib/daily_transacations/presentation/widgets/footer.dart b/threefold_connect/lib/daily_transacations/presentation/widgets/footer.dart index f208275..d2c9dae 100644 --- a/threefold_connect/lib/daily_transacations/presentation/widgets/footer.dart +++ b/threefold_connect/lib/daily_transacations/presentation/widgets/footer.dart @@ -31,7 +31,7 @@ class Footer extends StatelessWidget { margin: const EdgeInsets.all(8.0), child: ElevatedButton( style: ElevatedButton.styleFrom( - backgroundColor: const Color(0xFF504c4c), + backgroundColor: darkgrey, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(0), ), diff --git a/threefold_connect/lib/daily_transacations/presentation/widgets/transaction.dart b/threefold_connect/lib/daily_transacations/presentation/widgets/transaction.dart index 44263c9..5bf8838 100644 --- a/threefold_connect/lib/daily_transacations/presentation/widgets/transaction.dart +++ b/threefold_connect/lib/daily_transacations/presentation/widgets/transaction.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:threefold_connect/daily_transacations/presentation/pages/transaction_details.dart'; import 'package:threefold_connect/daily_transacations/presentation/widgets/arrow_inward.dart'; import 'package:threefold_connect/theme/theme.dart'; @@ -20,77 +21,98 @@ class TransactionWidget extends StatelessWidget { @override Widget build(BuildContext context) { - return Container( - padding: const EdgeInsets.all(16), - child: Row( - children: [ - CircleAvatar( - backgroundColor: - isIncoming ? Theme.of(context).primaryColor : brightRed, - child: isIncoming - ? const ArrowInward() - : const Icon( - Icons.arrow_outward, - color: Colors.white, - ), + return GestureDetector( + onTap: () { + ; + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const TransactionDetailsPage( + transactionId: "uafaiuhfiaifh", + status: "aufhua", + asset: "TFT", + sender: "akuagugk", + receiver: "jagyaf", + paymentType: "idk", + transactionHash: "ajfiufuhia", + amount: "weeee", + date: "fjywfua", + memo: "idk"), ), - const SizedBox(width: 8), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - transactionId, - overflow: TextOverflow.ellipsis, - style: const TextStyle( - fontSize: 16, - color: Colors.white, + ); + }, + child: Container( + padding: const EdgeInsets.all(16), + child: Row( + children: [ + CircleAvatar( + backgroundColor: + isIncoming ? Theme.of(context).primaryColor : brightRed, + child: isIncoming + ? const ArrowInward() + : const Icon( + Icons.arrow_outward, + color: Colors.white, + ), + ), + const SizedBox(width: 8), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + transactionId, + overflow: TextOverflow.ellipsis, + style: const TextStyle( + fontSize: 16, + color: Colors.white, + ), ), - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - 'TFT $tftAmount', - style: TextStyle( - fontSize: 14, - color: isIncoming ? Colors.green : Colors.red, + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'TFT $tftAmount', + style: TextStyle( + fontSize: 14, + color: isIncoming ? Colors.green : Colors.red, + ), ), - ), - Text( - date, - style: const TextStyle( - fontSize: 14, - color: Colors.white, + Text( + date, + style: const TextStyle( + fontSize: 14, + color: Colors.white, + ), ), - ), - ], - ), - ], - ), - ), - const SizedBox(width: 8), - Container( - padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6), - decoration: BoxDecoration( - color: status == 'Completed' - ? Theme.of(context).primaryColor - : Colors.red, - border: Border.all( - color: status == 'Completed' ? Colors.green : Colors.red, + ], + ), + ], ), - borderRadius: BorderRadius.circular(20), ), - child: Text( - status, - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.bold, - color: status == 'Completed' ? Colors.white : Colors.red, + const SizedBox(width: 8), + Container( + padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6), + decoration: BoxDecoration( + color: status == 'Completed' + ? Theme.of(context).primaryColor + : Colors.red, + border: Border.all( + color: status == 'Completed' ? Colors.green : Colors.red, + ), + borderRadius: BorderRadius.circular(20), + ), + child: Text( + status, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + color: status == 'Completed' ? Colors.white : Colors.red, + ), ), ), - ), - ], + ], + ), ), ); } diff --git a/threefold_connect/lib/daily_transacations/presentation/widgets/transaction_details.dart b/threefold_connect/lib/daily_transacations/presentation/widgets/transaction_details.dart new file mode 100644 index 0000000..76117d2 --- /dev/null +++ b/threefold_connect/lib/daily_transacations/presentation/widgets/transaction_details.dart @@ -0,0 +1,106 @@ +import 'package:flutter/material.dart'; +import 'package:threefold_connect/theme/theme.dart'; + +class TransactionDetails extends StatelessWidget { + final String transactionId; + final String status; + final String asset; + final String sender; + final String receiver; + final String paymentType; + final String transactionHash; + final String? memo; + final String amount; + final String date; + + const TransactionDetails({ + super.key, + required this.transactionId, + required this.status, + required this.asset, + required this.sender, + required this.receiver, + required this.paymentType, + required this.transactionHash, + required this.amount, + required this.date, + this.memo, + }); + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + IconButton( + onPressed: () { + Navigator.pop(context); + }, + icon: const Icon(Icons.arrow_back)), + const Text( + 'Transaction Details', + style: TextStyle( + fontSize: 20, + color: Colors.white, + fontWeight: FontWeight.bold, + ), + ), + ], + ), + const SizedBox(height: 16.0), + _buildDetailRow('Sender', sender), + const Divider(), + _buildDetailRow('Receiver', receiver), + const Divider(), + _buildDetailRow('Payment Type', paymentType), + const Divider(), + _buildDetailRow('Amount', amount), + const Divider(), + _buildDetailRow('Asset', asset), + const Divider(), + _buildDetailRow('date', date), + const Divider(), + _buildDetailRow('Transaction Hash', transactionHash), + const Divider(), + _buildDetailRow('memo', memo ?? '...'), + ], + ), + ); + } + + Widget _buildDetailRow(String label, String value) { + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + label, + style: const TextStyle( + fontWeight: FontWeight.bold, + color: Colors.white, + ), + ), + const SizedBox(height: 4.0), + Text( + value, + style: const TextStyle( + color: primaryColor, + ), + ), + ], + ), + ), + ], + ), + ); + } +} diff --git a/threefold_connect/lib/theme/theme.dart b/threefold_connect/lib/theme/theme.dart index 1c488d0..29fb2df 100644 --- a/threefold_connect/lib/theme/theme.dart +++ b/threefold_connect/lib/theme/theme.dart @@ -10,6 +10,7 @@ const white = Color(0xFFFFFFFF); const darkred = Color(0xFFA11A1A); const grey = Color(0xFF818181); const brightRed = Color.fromARGB(255, 255, 0, 0); +const darkgrey = Color(0xFF504c4c); // Fonts var poppins = GoogleFonts.poppins().fontFamily; @@ -17,6 +18,10 @@ var inter = GoogleFonts.inter().fontFamily; var interBold = GoogleFonts.inter(fontWeight: FontWeight.bold).fontFamily; ThemeData threefoldTheme = ThemeData( + dividerTheme: const DividerThemeData( + color: primaryColor, + thickness: 0.5, + ), appBarTheme: const AppBarTheme( backgroundColor: primaryColor, titleTextStyle: TextStyle(