Files
sf-app-platform/modules/home/lib/src/presentation/wallet_management_layout.dart
aitorarana 8201bff0a7 - created snackbar, step indicator, money text, text field and progress bar components.
- created wallet balance block, wallet item and kid line chart widgets.
- restructured onboarding, signup and device signup screens into layouts and main screens.
- updated signup and kid wallet screens to 17/11 design.
2025-11-21 15:28:46 +01:00

120 lines
3.7 KiB
Dart

import 'package:design_system/design_system.dart';
import 'package:flutter/material.dart';
import 'package:sf_shared/sf_shared.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
class WalletManagementLayout extends ConsumerWidget {
final List<Widget> children;
final Widget footer;
final Kid kid;
const WalletManagementLayout({
super.key,
required this.kid,
required this.children,
required this.footer,
});
@override
Widget build(BuildContext context, WidgetRef ref) {
final theme = ref.watch(themePortProvider);
final bool locked = false;
final content = [
Container(
padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
child: Stack(
children: [
IconButton(
onPressed: () => Navigator.pop(context),
icon: Icon(
Icons.arrow_back_ios_outlined,
color: theme.getColorFor(ThemeCode.textSecondary),
),
),
Expanded(
child: Center(
child: Column(
children: [
Text(
kid.name,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 30,
color: theme.getColorFor(ThemeCode.textSecondary),
),
),
Text.rich(
TextSpan(
text: "Saldo disponible: ",
style: TextStyle(
color: theme.getColorFor(ThemeCode.textSecondary),
),
children: [
TextSpan(
text: "${kid.balance}",
style: TextStyle(
fontWeight: FontWeight.bold,
color: theme.getColorFor(ThemeCode.textSecondary),
),
),
TextSpan(
text: "",
style: TextStyle(
color: theme.getColorFor(ThemeCode.textSecondary),
),
),
],
),
),
],
),
),
),
],
),
),
...children,
];
return Scaffold(
backgroundColor: theme.getColorFor(ThemeCode.backgroundSecondary),
body: Stack(
children: [
DecoratedBox(
decoration: BoxDecoration(
borderRadius: const BorderRadius.all(Radius.circular(24)),
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: locked? theme.getDisabledCardColors() : theme.getCardColorFor(0)
),
),
child: SizedBox(width: double.infinity, height: 200),
),
Column(
children: [
Expanded(
child: ListView.separated(
itemBuilder: (BuildContext context, int index) {
return Container(
margin: EdgeInsets.symmetric(horizontal: 20),
child: content[index],
);
},
separatorBuilder: (BuildContext context, int index) {
return Divider(height: 30, color: Colors.transparent);
},
itemCount: content.length,
),
),
footer,
],
),
],
),
);
}
}