diff --git a/three_fold_connect/.metadata b/three_fold_connect/.metadata index 9d32c61..b9d51b4 100644 --- a/three_fold_connect/.metadata +++ b/three_fold_connect/.metadata @@ -4,8 +4,8 @@ # This file should be version controlled and should not be manually edited. version: - revision: "b0850beeb25f6d5b10426284f506557f66181b36" - channel: "stable" + revision: "2e9cb0aa71a386a91f73f7088d115c0d96654829" + channel: "[user-branch]" project_type: app @@ -13,26 +13,26 @@ project_type: app migration: platforms: - platform: root - create_revision: b0850beeb25f6d5b10426284f506557f66181b36 - base_revision: b0850beeb25f6d5b10426284f506557f66181b36 + create_revision: 2e9cb0aa71a386a91f73f7088d115c0d96654829 + base_revision: 2e9cb0aa71a386a91f73f7088d115c0d96654829 - platform: android - create_revision: b0850beeb25f6d5b10426284f506557f66181b36 - base_revision: b0850beeb25f6d5b10426284f506557f66181b36 + create_revision: 2e9cb0aa71a386a91f73f7088d115c0d96654829 + base_revision: 2e9cb0aa71a386a91f73f7088d115c0d96654829 - platform: ios - create_revision: b0850beeb25f6d5b10426284f506557f66181b36 - base_revision: b0850beeb25f6d5b10426284f506557f66181b36 + create_revision: 2e9cb0aa71a386a91f73f7088d115c0d96654829 + base_revision: 2e9cb0aa71a386a91f73f7088d115c0d96654829 - platform: linux - create_revision: b0850beeb25f6d5b10426284f506557f66181b36 - base_revision: b0850beeb25f6d5b10426284f506557f66181b36 + create_revision: 2e9cb0aa71a386a91f73f7088d115c0d96654829 + base_revision: 2e9cb0aa71a386a91f73f7088d115c0d96654829 - platform: macos - create_revision: b0850beeb25f6d5b10426284f506557f66181b36 - base_revision: b0850beeb25f6d5b10426284f506557f66181b36 + create_revision: 2e9cb0aa71a386a91f73f7088d115c0d96654829 + base_revision: 2e9cb0aa71a386a91f73f7088d115c0d96654829 - platform: web - create_revision: b0850beeb25f6d5b10426284f506557f66181b36 - base_revision: b0850beeb25f6d5b10426284f506557f66181b36 + create_revision: 2e9cb0aa71a386a91f73f7088d115c0d96654829 + base_revision: 2e9cb0aa71a386a91f73f7088d115c0d96654829 - platform: windows - create_revision: b0850beeb25f6d5b10426284f506557f66181b36 - base_revision: b0850beeb25f6d5b10426284f506557f66181b36 + create_revision: 2e9cb0aa71a386a91f73f7088d115c0d96654829 + base_revision: 2e9cb0aa71a386a91f73f7088d115c0d96654829 # User provided section diff --git a/three_fold_connect/lib/daily_transactions/presentation/pages/daily_transactions.dart b/three_fold_connect/lib/daily_transactions/presentation/pages/daily_transactions.dart new file mode 100644 index 0000000..6fc201d --- /dev/null +++ b/three_fold_connect/lib/daily_transactions/presentation/pages/daily_transactions.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/three_fold_connect/lib/daily_transactions/presentation/widgets/filter.dart b/three_fold_connect/lib/daily_transactions/presentation/widgets/filter.dart new file mode 100644 index 0000000..3120287 --- /dev/null +++ b/three_fold_connect/lib/daily_transactions/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/three_fold_connect/lib/daily_transactions/presentation/widgets/header.dart b/three_fold_connect/lib/daily_transactions/presentation/widgets/header.dart new file mode 100644 index 0000000..7b4ea4a --- /dev/null +++ b/three_fold_connect/lib/daily_transactions/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 Transactions', + style: TextStyle( + fontSize: 20, + color: Colors.white, + fontWeight: FontWeight.bold, + ), + ), + Text( + email, + style: const TextStyle( + fontSize: 16, + color: Colors.white, + ), + ), + ], + ), + ), + ), + ], + ), + ); + } +} diff --git a/three_fold_connect/lib/daily_transactions/presentation/widgets/transaction.dart b/three_fold_connect/lib/daily_transactions/presentation/widgets/transaction.dart new file mode 100644 index 0000000..c740a2c --- /dev/null +++ b/three_fold_connect/lib/daily_transactions/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/three_fold_connect/lib/daily_transactions/presentation/widgets/vertical_divider.dart b/three_fold_connect/lib/daily_transactions/presentation/widgets/vertical_divider.dart new file mode 100644 index 0000000..f862bcd --- /dev/null +++ b/three_fold_connect/lib/daily_transactions/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/three_fold_connect/lib/main.dart b/three_fold_connect/lib/main.dart index 8e94089..970b389 100644 --- a/three_fold_connect/lib/main.dart +++ b/three_fold_connect/lib/main.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:three_fold_connect/daily_transactions/presentation/pages/daily_transactions.dart'; void main() { runApp(const MyApp()); @@ -28,10 +29,23 @@ class MyApp extends StatelessWidget { // // This works for code too, not just values: Most code changes can be // tested with just a hot reload. + appBarTheme: const AppBarTheme( + backgroundColor: Color(0xFF1AA18F), + titleTextStyle: TextStyle(color: Colors.white), + iconTheme: IconThemeData(color: Colors.white), + ), + scaffoldBackgroundColor: const Color(0xFF383434), + primaryColor: const Color(0xFF1AA18F), + iconTheme: const IconThemeData(color: Colors.white), + textTheme: const TextTheme( + headlineMedium: TextStyle( + color: Colors.white, + ), + ), colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), useMaterial3: true, ), - home: const MyHomePage(title: 'Flutter Demo Home Page'), + home: const DailyTransactionsPage(), ); } } diff --git a/three_fold_connect/lib/widgets/app_bar.dart b/three_fold_connect/lib/widgets/app_bar.dart new file mode 100644 index 0000000..d843bfe --- /dev/null +++ b/three_fold_connect/lib/widgets/app_bar.dart @@ -0,0 +1,21 @@ +import 'package:flutter/material.dart'; + +class MyAppBar extends StatelessWidget implements PreferredSizeWidget { + final String title; + + const MyAppBar({super.key, required this.title}); + + @override + Widget build(BuildContext context) { + return AppBar( + title: Text(title), + leading: IconButton( + icon: const Icon(Icons.menu), + onPressed: () {}, + ), + ); + } + + @override + Size get preferredSize => const Size.fromHeight(kToolbarHeight); +} diff --git a/three_fold_connect/pubspec.lock b/three_fold_connect/pubspec.lock index 6cb5f72..3e17e10 100644 --- a/three_fold_connect/pubspec.lock +++ b/three_fold_connect/pubspec.lock @@ -75,30 +75,6 @@ packages: description: flutter source: sdk version: "0.0.0" - leak_tracker: - dependency: transitive - description: - name: leak_tracker - sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" - url: "https://pub.dev" - source: hosted - version: "10.0.4" - leak_tracker_flutter_testing: - dependency: transitive - description: - name: leak_tracker_flutter_testing - sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" - url: "https://pub.dev" - source: hosted - version: "3.0.3" - leak_tracker_testing: - dependency: transitive - description: - name: leak_tracker_testing - sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" - url: "https://pub.dev" - source: hosted - version: "3.0.1" lints: dependency: transitive description: @@ -111,34 +87,34 @@ packages: dependency: transitive description: name: matcher - sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" url: "https://pub.dev" source: hosted - version: "0.12.16+1" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" url: "https://pub.dev" source: hosted - version: "0.8.0" + version: "0.5.0" meta: dependency: transitive description: name: meta - sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e url: "https://pub.dev" source: hosted - version: "1.12.0" + version: "1.10.0" path: dependency: transitive description: name: path - sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.8.3" sky_engine: dependency: transitive description: flutter @@ -188,10 +164,10 @@ packages: dependency: transitive description: name: test_api - sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.7.0" + version: "0.6.1" vector_math: dependency: transitive description: @@ -200,14 +176,13 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" - vm_service: + web: dependency: transitive description: - name: vm_service - sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" + name: web + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 url: "https://pub.dev" source: hosted - version: "14.2.1" + version: "0.3.0" sdks: - dart: ">=3.4.4 <4.0.0" - flutter: ">=3.18.0-18.0.pre.54" + dart: ">=3.2.3 <4.0.0" diff --git a/three_fold_connect/pubspec.yaml b/three_fold_connect/pubspec.yaml index 4ce4f63..02edcad 100644 --- a/three_fold_connect/pubspec.yaml +++ b/three_fold_connect/pubspec.yaml @@ -19,7 +19,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: '>=3.4.4 <4.0.0' + sdk: '>=3.2.3 <4.0.0' # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions