tab navigation
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
import 'dart:collection';
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:design_system/src/theme/theme_port.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ThemeSfAdapter extends ThemePort {
|
||||
@override
|
||||
Map<ThemeCode, Color> theme = HashMap.from({
|
||||
final Map<ThemeCode, Color> _theme = {
|
||||
ThemeCode.backgroundPrimary: Color(0xFFFFFFFF),
|
||||
ThemeCode.backgroundSecondary: Color(0xFFF7F7F7),
|
||||
ThemeCode.backgroundTertiary: Color(0x4D329E95),
|
||||
@@ -15,11 +13,16 @@ class ThemeSfAdapter extends ThemePort {
|
||||
ThemeCode.textTertiary: Color(0xFFE0E0E0),
|
||||
ThemeCode.buttonPrimary: Color(0xFF329e95),
|
||||
ThemeCode.buttonSecondary: Color(0xFF4B4B4B),
|
||||
});
|
||||
};
|
||||
|
||||
@override
|
||||
List<List<Color>> cardColors = [
|
||||
<Color>[Color(0xFFFA5C9F), Color(0xFFEB2579), Color(0xFFE60866)],
|
||||
<Color>[Color(0xFF00A1C6), Color(0xFF00819E)],
|
||||
Map<ThemeCode, Color> get theme => _theme;
|
||||
|
||||
final List<List<Color>> _cardColors = [
|
||||
[Color(0xFFFA5C9F), Color(0xFFEB2579), Color(0xFFE60866)],
|
||||
[Color(0xFF00A1C6), Color(0xFF00819E)],
|
||||
];
|
||||
|
||||
@override
|
||||
List<List<Color>> get cardColors => _cardColors;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
export 'src/kid.dart';
|
||||
export 'src/line_graph.dart';
|
||||
export 'src/deposit_block.dart';
|
||||
export 'src/wallet_management_layout.dart';
|
||||
export 'src/connection_error_screen.dart';
|
||||
export 'src/server_error_screen.dart';
|
||||
export 'src/no_plan_error_screen.dart';
|
||||
export 'src/models/kid.dart';
|
||||
export 'src/widgets/line_graph.dart';
|
||||
export 'src/widgets/deposit_block.dart';
|
||||
export 'src/screens/connection_error_screen.dart';
|
||||
export 'src/screens/server_error_screen.dart';
|
||||
export 'src/screens/no_plan_error_screen.dart';
|
||||
|
||||
@@ -1,117 +0,0 @@
|
||||
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 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(30)),
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: 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,
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MainConstants {
|
||||
static const double minWebAppRatio = 9.0 / 21.0;
|
||||
static const double maxWebAppRatio = 9.0 / 18.0;
|
||||
}
|
||||
// class MainConstants {
|
||||
// static const double minWebAppRatio = 9.0 / 21.0;
|
||||
// static const double maxWebAppRatio = 9.0 / 18.0;
|
||||
// }
|
||||
|
||||
/// Utils for dynamic sizes
|
||||
class SizeUtils {
|
||||
@@ -22,7 +22,7 @@ class SizeUtils {
|
||||
// Padding of the screen where we cannot render elements without the SafeArea
|
||||
static EdgeInsets padding = const EdgeInsets.all(0);
|
||||
|
||||
static const double kWebDesiredAspectRatio = MainConstants.minWebAppRatio;
|
||||
// static const double kWebDesiredAspectRatio = MainConstants.minWebAppRatio;
|
||||
|
||||
const SizeUtils();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user