Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions three_fold_connect/.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,35 @@
# 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

# Tracks metadata for the flutter migrate command
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

Expand Down
Original file line number Diff line number Diff line change
@@ -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<DailyTransactionsPage> createState() => _DailyTransactionsPageState();
}

class _DailyTransactionsPageState extends State<DailyTransactionsPage> {
String selectedCurrency = 'TFT';
final List<String> 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(),
],
);
},
),
),
],
),
),
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import 'package:flutter/material.dart';

class FilterWidget extends StatelessWidget {
final List<String> currencies;
final String selectedCurrency;
final ValueChanged<String?> 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<String>(
dropdownColor: Theme.of(context).scaffoldBackgroundColor,
style: const TextStyle(color: Colors.white),
value: selectedCurrency,
onChanged: onCurrencyChanged,
items: currencies
.map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
}).toList(),
),
),
),
),
),
],
),
],
);
}
}
Original file line number Diff line number Diff line change
@@ -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,
),
),
],
),
),
),
],
),
);
}
}
Original file line number Diff line number Diff line change
@@ -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,
),
),
),
],
),
);
}
}
Original file line number Diff line number Diff line change
@@ -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,
),
),
),
);
}
}
16 changes: 15 additions & 1 deletion three_fold_connect/lib/main.dart
Original file line number Diff line number Diff line change
@@ -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());
Expand Down Expand Up @@ -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(),
);
}
}
Expand Down
Loading