Files
sf-app-platform/lib/payments/view/screens/profile_screen.dart
2025-11-10 12:03:32 +01:00

115 lines
3.6 KiB
Dart

import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:sf_app_platform/payments/view/screens/core/activity_list.dart';
import 'package:sf_app_platform/payments/view/screens/core/deposit_block.dart';
import 'package:sf_app_platform/payments/view/screens/settings_screen.dart';
import '../../domain/ports/theme_port.dart';
import 'core/line_graph.dart';
class ProfileScreen extends StatelessWidget{
const ProfileScreen({super.key});
@override
Widget build(BuildContext context) {
ThemePort theme = context.read<ThemePort>();
final activity = [
{"type": "goal"},
{"type": "wage", "amount": 5},
{"type": "lock"},
{"type": "lock"}
];
final name = "Juan";
final total = 95.03;
final available = 44.09;
final content = [
Row(
children: [
Text(name, style: TextStyle(
color: theme.getColorFor(ThemeCode.text_secondary),
fontWeight: FontWeight.bold,
fontSize: 30)
),
Spacer(),
TextButton(
onPressed: ()=>Navigator.push(context, MaterialPageRoute(builder: (_)=>SettingsScreen())),
child: Text("Ajustes de la cuenta", style: TextStyle(
color: theme.getColorFor(ThemeCode.text_secondary))
)
)
],
),
Container(
padding: EdgeInsets.all(20),
decoration: BoxDecoration(color: theme.getColorFor(ThemeCode.background_primary), borderRadius: BorderRadius.all(Radius.circular(20))),
child: Column(
spacing: 5,
children: [
Row(
children: [
Text("Wallet", style: TextStyle(fontWeight: FontWeight.bold),),
Spacer(),
Text("$total")
]
),
Stack(
children: [
LinearProgressIndicator(
value: available/total,
minHeight: 70,
borderRadius: BorderRadius.all(Radius.circular(16)),
),
FractionallySizedBox(
widthFactor: available/total,
child: Container(
padding: EdgeInsets.symmetric(vertical: 20),
child: Center(
child: Text(
"$available",
style: TextStyle(color: theme.getColorFor(ThemeCode.text_secondary), fontSize: 20)
)
)
)
),
],
),
Center(child: Text("Disponible"))
],
),
),
SizedBox(
height: 200,
child: LineGraph()
),
DepositBlock(max: 150-total),
Row(),
ActivityList(activity: activity, edit: false)
];
return Scaffold(
backgroundColor: theme.getColorFor(ThemeCode.background_secondary),
body: Stack(children: [
DecoratedBox(
decoration: BoxDecoration(
borderRadius: const BorderRadius.all(Radius.circular(30)),
color: Color(0xFF4B4B4B)
),
child: SizedBox(width: double.infinity, height: 200),
),
Column(children: [Expanded (child: Container(
margin: EdgeInsets.fromLTRB(20, 20, 20, 0),
child: ListView.separated(
itemBuilder: (BuildContext context, int index) {return content[index];},
separatorBuilder: (BuildContext context, int index) {
return Divider(color: Colors.transparent, height: 20);
},
itemCount: content.length
)
))]),
])
);
}
}