2025-11-13 15:16:00 +01:00
|
|
|
import 'package:design_system/design_system.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter_svg/svg.dart';
|
|
|
|
|
import 'package:home/src/presentation/deposit_screen.dart';
|
2025-12-03 15:28:10 +01:00
|
|
|
import 'package:home/src/presentation/extract_screen.dart';
|
|
|
|
|
import 'package:home/src/presentation/goals_screen.dart';
|
|
|
|
|
import 'package:home/src/presentation/lock_card_screen.dart';
|
2025-11-13 15:16:00 +01:00
|
|
|
import 'package:sf_shared/sf_shared.dart';
|
|
|
|
|
import 'package:home/src/presentation/limits_screen.dart';
|
|
|
|
|
import 'package:home/src/presentation/wage_screen.dart';
|
|
|
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
|
|
|
|
|
|
|
|
class KidWalletScreen extends ConsumerWidget {
|
|
|
|
|
final Kid kid;
|
|
|
|
|
|
|
|
|
|
const KidWalletScreen({super.key, required this.kid});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
|
|
|
|
final theme = ref.watch(themePortProvider);
|
2025-11-21 15:28:46 +01:00
|
|
|
final bool locked = false;
|
2025-11-13 15:16:00 +01:00
|
|
|
|
|
|
|
|
return Scaffold(
|
|
|
|
|
backgroundColor: theme.getColorFor(ThemeCode.backgroundSecondary),
|
|
|
|
|
body: Stack(
|
|
|
|
|
children: [
|
|
|
|
|
DecoratedBox(
|
|
|
|
|
decoration: BoxDecoration(
|
2025-11-21 15:28:46 +01:00
|
|
|
borderRadius: const BorderRadius.only(bottomRight: Radius.circular(24), bottomLeft: Radius.circular(24)),
|
2025-11-13 15:16:00 +01:00
|
|
|
gradient: LinearGradient(
|
|
|
|
|
begin: Alignment.topLeft,
|
|
|
|
|
end: Alignment.bottomRight,
|
2025-11-21 15:28:46 +01:00
|
|
|
colors: locked? theme.getDisabledCardColors() : theme.getCardColorFor(0)
|
|
|
|
|
)
|
2025-11-13 15:16:00 +01:00
|
|
|
),
|
2025-11-21 15:28:46 +01:00
|
|
|
child: SizedBox(width: double.infinity, height: 420)
|
2025-11-13 15:16:00 +01:00
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.symmetric(vertical: 50, horizontal: 20),
|
|
|
|
|
child: Column(
|
2025-11-21 15:28:46 +01:00
|
|
|
spacing: 24,
|
2025-11-13 15:16:00 +01:00
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
spacing: 7,
|
|
|
|
|
children: [
|
|
|
|
|
IconButton(
|
|
|
|
|
onPressed: () => Navigator.pop(context),
|
|
|
|
|
icon: Icon(
|
|
|
|
|
Icons.arrow_back_ios_new_outlined,
|
|
|
|
|
color: theme.getColorFor(ThemeCode.backgroundPrimary),
|
2025-11-21 15:28:46 +01:00
|
|
|
size: 24
|
|
|
|
|
)
|
2025-11-13 15:16:00 +01:00
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 50,
|
2025-11-21 15:28:46 +01:00
|
|
|
child: SvgPicture.asset("assets/images/ui/face.svg")
|
2025-11-13 15:16:00 +01:00
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
kid.name,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: theme.getColorFor(ThemeCode.backgroundPrimary),
|
|
|
|
|
fontWeight: FontWeight.bold,
|
2025-11-21 15:28:46 +01:00
|
|
|
fontSize: 20
|
|
|
|
|
)
|
2025-11-13 15:16:00 +01:00
|
|
|
),
|
|
|
|
|
Spacer(),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 30,
|
2025-11-21 15:28:46 +01:00
|
|
|
child: SvgPicture.asset("assets/images/ui/face.svg")
|
|
|
|
|
)
|
|
|
|
|
]
|
2025-11-13 15:16:00 +01:00
|
|
|
),
|
2025-11-21 15:28:46 +01:00
|
|
|
Column(
|
|
|
|
|
spacing: 16,
|
|
|
|
|
children: [
|
|
|
|
|
MoneyText(
|
|
|
|
|
text: "${kid.balance.toString()}€",
|
|
|
|
|
size: 60,
|
|
|
|
|
secondarySize: 24,
|
|
|
|
|
color: theme.getColorFor(ThemeCode.textSecondary)
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
"Saldo disponible",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: theme.getColorFor(ThemeCode.backgroundPrimary)
|
|
|
|
|
)
|
|
|
|
|
),
|
|
|
|
|
LinearProgressIndicator(
|
|
|
|
|
value: 0.7,
|
|
|
|
|
color: theme.getColorFor(ThemeCode.backgroundPrimary),
|
|
|
|
|
backgroundColor: theme
|
|
|
|
|
.getColorFor(ThemeCode.backgroundPrimary)
|
|
|
|
|
.withAlpha(0x4C),
|
|
|
|
|
minHeight: 10,
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(5)),
|
|
|
|
|
),
|
|
|
|
|
TextButton(
|
|
|
|
|
style: ButtonStyle(padding: WidgetStatePropertyAll(EdgeInsets.all(0))),
|
2025-12-03 15:28:10 +01:00
|
|
|
onPressed: () => Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (_) => LockCardScreen(kid: kid)
|
|
|
|
|
)
|
|
|
|
|
),
|
2025-11-13 15:16:00 +01:00
|
|
|
child: Row(
|
|
|
|
|
spacing: 10,
|
|
|
|
|
children: [
|
2025-11-21 15:28:46 +01:00
|
|
|
Icon(Icons.lock_outline, size: 24, color: theme.getColorFor(ThemeCode.textSecondary)),
|
|
|
|
|
locked ?
|
|
|
|
|
Text("Desbloquear tarjeta", style: TextStyle(fontWeight: FontWeight.w500, fontSize: 16, color: theme.getColorFor(ThemeCode.textSecondary))) :
|
|
|
|
|
Text("Bloquear tarjeta", style: TextStyle(fontWeight: FontWeight.w500, fontSize: 16, color: theme.getColorFor(ThemeCode.textSecondary)))
|
|
|
|
|
]
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
]
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
spacing: 16,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
2025-12-03 15:28:10 +01:00
|
|
|
padding: EdgeInsets.all(16),
|
2025-11-21 15:28:46 +01:00
|
|
|
margin: EdgeInsets.only(top: 30),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: theme.getColorFor(ThemeCode.backgroundPrimary),
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(20))
|
|
|
|
|
),
|
|
|
|
|
child: Expanded(
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
TextButton(
|
2025-12-03 15:28:10 +01:00
|
|
|
style: ButtonStyle(padding: WidgetStatePropertyAll(EdgeInsets.all(0))),
|
2025-11-21 15:28:46 +01:00
|
|
|
onPressed: () => Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (_) => DepositScreen(kid: kid)
|
|
|
|
|
)
|
2025-11-13 15:16:00 +01:00
|
|
|
),
|
2025-11-21 15:28:46 +01:00
|
|
|
child: Column(
|
2025-12-03 15:28:10 +01:00
|
|
|
spacing: 8,
|
2025-11-21 15:28:46 +01:00
|
|
|
children: [
|
|
|
|
|
Icon(
|
|
|
|
|
Icons.add_circle_outline,
|
|
|
|
|
color: theme.getColorFor(
|
|
|
|
|
ThemeCode.textPrimary,
|
|
|
|
|
)
|
2025-11-13 15:16:00 +01:00
|
|
|
),
|
2025-11-21 15:28:46 +01:00
|
|
|
Text(
|
|
|
|
|
"Añadir",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: theme.getColorFor(
|
|
|
|
|
ThemeCode.textPrimary
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
]
|
|
|
|
|
)
|
2025-11-13 15:16:00 +01:00
|
|
|
),
|
2025-11-21 15:28:46 +01:00
|
|
|
Spacer(),
|
|
|
|
|
TextButton(
|
2025-12-03 15:28:10 +01:00
|
|
|
style: ButtonStyle(padding: WidgetStatePropertyAll(EdgeInsets.all(0))),
|
2025-11-21 15:28:46 +01:00
|
|
|
onPressed: () => Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (_) => WageScreen(kid: kid),
|
2025-11-13 15:16:00 +01:00
|
|
|
),
|
|
|
|
|
),
|
2025-11-21 15:28:46 +01:00
|
|
|
child: Column(
|
|
|
|
|
spacing: 10,
|
|
|
|
|
children: [
|
|
|
|
|
Icon(
|
|
|
|
|
Icons.account_balance_wallet_outlined,
|
|
|
|
|
color: theme.getColorFor(
|
|
|
|
|
ThemeCode.textPrimary,
|
|
|
|
|
),
|
2025-11-13 15:16:00 +01:00
|
|
|
),
|
2025-11-21 15:28:46 +01:00
|
|
|
Text(
|
|
|
|
|
"Paga",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: theme.getColorFor(
|
|
|
|
|
ThemeCode.textPrimary,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
2025-11-13 15:16:00 +01:00
|
|
|
),
|
|
|
|
|
),
|
2025-11-21 15:28:46 +01:00
|
|
|
Spacer(),
|
|
|
|
|
TextButton(
|
2025-12-03 15:28:10 +01:00
|
|
|
style: ButtonStyle(padding: WidgetStatePropertyAll(EdgeInsets.all(0))),
|
2025-11-21 15:28:46 +01:00
|
|
|
onPressed: () => Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (_) => LimitsScreen(kid: kid),
|
2025-11-13 15:16:00 +01:00
|
|
|
),
|
|
|
|
|
),
|
2025-11-21 15:28:46 +01:00
|
|
|
child: Column(
|
|
|
|
|
spacing: 10,
|
|
|
|
|
children: [
|
|
|
|
|
Icon(
|
|
|
|
|
Icons.list_alt_outlined,
|
|
|
|
|
color: theme.getColorFor(
|
|
|
|
|
ThemeCode.textPrimary,
|
|
|
|
|
),
|
2025-11-13 15:16:00 +01:00
|
|
|
),
|
2025-11-21 15:28:46 +01:00
|
|
|
Text(
|
|
|
|
|
"Límites",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: theme.getColorFor(
|
|
|
|
|
ThemeCode.textPrimary,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
2025-11-13 15:16:00 +01:00
|
|
|
),
|
2025-11-21 15:28:46 +01:00
|
|
|
),
|
|
|
|
|
Spacer(),
|
|
|
|
|
TextButton(
|
2025-12-03 15:28:10 +01:00
|
|
|
style: ButtonStyle(padding: WidgetStatePropertyAll(EdgeInsets.all(0))),
|
|
|
|
|
onPressed: () => Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (_) => GoalsScreen(kid: kid)
|
|
|
|
|
)
|
|
|
|
|
),
|
2025-11-21 15:28:46 +01:00
|
|
|
child: Column(
|
|
|
|
|
spacing: 10,
|
|
|
|
|
children: [
|
|
|
|
|
Icon(
|
|
|
|
|
Icons.emoji_events_outlined,
|
|
|
|
|
color: theme.getColorFor(
|
|
|
|
|
ThemeCode.textPrimary,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
"Metas",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: theme.getColorFor(
|
|
|
|
|
ThemeCode.textPrimary,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
2025-11-13 15:16:00 +01:00
|
|
|
),
|
2025-11-21 15:28:46 +01:00
|
|
|
),
|
|
|
|
|
Spacer(),
|
|
|
|
|
TextButton(
|
2025-12-03 15:28:10 +01:00
|
|
|
style: ButtonStyle(padding: WidgetStatePropertyAll(EdgeInsets.all(0))),
|
|
|
|
|
onPressed: () => Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (_) => ExtractScreen(kid: kid)
|
|
|
|
|
)
|
|
|
|
|
),
|
2025-11-21 15:28:46 +01:00
|
|
|
child: Column(
|
|
|
|
|
spacing: 10,
|
|
|
|
|
children: [
|
|
|
|
|
Icon(
|
|
|
|
|
Icons.cancel_outlined,
|
|
|
|
|
color: theme.getColorFor(
|
|
|
|
|
ThemeCode.textPrimary,
|
|
|
|
|
),
|
2025-11-13 15:16:00 +01:00
|
|
|
),
|
2025-11-21 15:28:46 +01:00
|
|
|
Text(
|
|
|
|
|
"Quitar",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: theme.getColorFor(
|
|
|
|
|
ThemeCode.textPrimary,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
2025-11-13 15:16:00 +01:00
|
|
|
),
|
2025-11-21 15:28:46 +01:00
|
|
|
),
|
|
|
|
|
],
|
2025-11-13 15:16:00 +01:00
|
|
|
),
|
2025-11-21 15:28:46 +01:00
|
|
|
),
|
2025-11-13 15:16:00 +01:00
|
|
|
),
|
|
|
|
|
),
|
2025-11-21 15:28:46 +01:00
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.all(15),
|
2025-12-03 15:28:10 +01:00
|
|
|
height: 300,
|
2025-11-21 15:28:46 +01:00
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: theme.getColorFor(ThemeCode.backgroundPrimary),
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(20))
|
|
|
|
|
),
|
|
|
|
|
child: Expanded(child: Column(
|
2025-12-03 15:28:10 +01:00
|
|
|
//spacing: 24,
|
2025-11-21 15:28:46 +01:00
|
|
|
children: [
|
|
|
|
|
Text("Últimos movimientos", style: TextStyle(fontSize: 20, fontWeight: FontWeight.w500)),
|
|
|
|
|
activityList(context, theme)
|
|
|
|
|
]
|
|
|
|
|
))
|
|
|
|
|
)
|
|
|
|
|
]
|
|
|
|
|
)
|
|
|
|
|
]
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
]
|
|
|
|
|
)
|
2025-11-13 15:16:00 +01:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget activityList(BuildContext context, theme) {
|
|
|
|
|
final activity = [
|
|
|
|
|
{
|
|
|
|
|
"date": "10/05",
|
|
|
|
|
"payments": [1, 2, 3],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"date": "10/04",
|
|
|
|
|
"payments": [1, 2],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"date": "10/02",
|
|
|
|
|
"payments": [1, 2, 3, 4],
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
return Expanded(
|
|
|
|
|
child: ListView(
|
2025-12-03 15:28:10 +01:00
|
|
|
padding: EdgeInsets.symmetric(vertical: 0),
|
2025-11-21 15:28:46 +01:00
|
|
|
children: [
|
|
|
|
|
...List<Widget>.generate(activity.length, (int index) {
|
2025-12-03 15:28:10 +01:00
|
|
|
return Container(padding: EdgeInsets.only(top: 24),
|
|
|
|
|
child: Column(
|
|
|
|
|
spacing: 8,
|
2025-11-21 15:28:46 +01:00
|
|
|
children: [
|
2025-12-03 15:28:10 +01:00
|
|
|
Align(alignment: Alignment.bottomLeft, child: Text(activity[index]["date"].toString(), style: TextStyle(fontSize: 18, height: 1.5))),
|
2025-11-21 15:28:46 +01:00
|
|
|
Column(
|
|
|
|
|
spacing: 16,
|
|
|
|
|
children: List<Widget>.generate(
|
|
|
|
|
(activity[index]["payments"] as List<Object>).length,
|
|
|
|
|
(int i) {
|
|
|
|
|
return Row(
|
|
|
|
|
spacing: 12,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.all(9),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: theme.getColorFor(
|
|
|
|
|
ThemeCode.backgroundTertiary,
|
|
|
|
|
),
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(16))
|
2025-11-13 15:16:00 +01:00
|
|
|
),
|
2025-11-21 15:28:46 +01:00
|
|
|
child: Icon(
|
|
|
|
|
Icons.local_pizza_outlined,
|
|
|
|
|
color: theme.getColorFor(ThemeCode.buttonPrimary)
|
|
|
|
|
)
|
2025-11-13 15:16:00 +01:00
|
|
|
),
|
2025-11-21 15:28:46 +01:00
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
"Vips",
|
|
|
|
|
style: TextStyle(fontWeight: FontWeight.bold)
|
|
|
|
|
),
|
|
|
|
|
Text("20:15")
|
|
|
|
|
]
|
2025-11-13 15:16:00 +01:00
|
|
|
),
|
2025-11-21 15:28:46 +01:00
|
|
|
Spacer(),
|
|
|
|
|
MoneyText(
|
|
|
|
|
text: "5.1€",
|
|
|
|
|
size: 16,
|
|
|
|
|
secondarySize: 12,
|
|
|
|
|
color: theme.getColorFor(ThemeCode.textPrimary),
|
|
|
|
|
)
|
|
|
|
|
]
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
]
|
2025-12-03 15:28:10 +01:00
|
|
|
));
|
2025-11-21 15:28:46 +01:00
|
|
|
}),
|
2025-12-03 15:28:10 +01:00
|
|
|
TextButton(onPressed: () => {}, child: Align(alignment: Alignment.bottomLeft, child: Text("Ver todos"))),
|
2025-11-21 15:28:46 +01:00
|
|
|
]
|
|
|
|
|
)
|
2025-11-13 15:16:00 +01:00
|
|
|
);
|
|
|
|
|
}
|
2025-11-21 15:28:46 +01:00
|
|
|
}
|