feat: finance

This commit is contained in:
BLoC
2025-02-28 13:54:09 +03:00
parent 0ee94e96c9
commit 9251bcbff1
4 changed files with 202 additions and 2 deletions

View File

@@ -28,6 +28,7 @@ import 'package:eatvio_app/features/feed/presentation/pages/feed_screen.dart';
import 'package:eatvio_app/features/glossary/presentation/pages/glossary_screen.dart';
import 'package:eatvio_app/features/menu/presentation/pages/menu_screen.dart';
import 'package:eatvio_app/features/my_diets/presentation/my_diets_screen.dart';
import 'package:eatvio_app/features/my_finance/presentation/pages/card_settings.dart';
import 'package:eatvio_app/features/my_finance/presentation/pages/consultant_finance_screen.dart';
import 'package:eatvio_app/features/my_finance/presentation/pages/user_finance_screen.dart';
import 'package:eatvio_app/features/my_plans/presentation/my_plans_screen.dart';
@@ -160,6 +161,11 @@ class AppRouter {
name: 'userFinanceScreen',
builder: (context, state) => UserFinanceScreen(),
),
GoRoute(
path: '/card-settings-screen',
name: 'cardSettingsScreen',
builder: (context, state) => CardSettingsScreen(),
),
GoRoute(
path: '/about-plan-screen',
name: 'aboutPlanScreen',

View File

@@ -57,7 +57,7 @@ class MenuScreen extends StatelessWidget {
onTap: () => GoRouter.of(context).push(MyPlansScreen.path),
),
_divider(context),
if (profileModel.roles.contains('consultant'))
if (!profileModel.roles.contains('consultant'))
_tile(
leading: 'assets/icons/finance.svg',
title: 'Мои финансы',

View File

@@ -0,0 +1,24 @@
import 'package:flutter/material.dart';
class CardSettingsScreen extends StatelessWidget {
const CardSettingsScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color(0xFFF0F2F5),
appBar: AppBar(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(
bottom: Radius.circular(12),
),
),
title: Text('Мои карты'),
centerTitle: true,
),
body: Column(
children: [],
),
);
}
}

View File

@@ -1,10 +1,180 @@
import 'package:eatvio_app/core/theme/theme_helper.dart';
import 'package:eatvio_app/core/utils/date_time_utils.dart';
import 'package:eatvio_app/core/widgets/custom_drop_down_button.dart';
import 'package:eatvio_app/features/my_finance/entities/consultant_finance_entity.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
class UserFinanceScreen extends StatelessWidget {
const UserFinanceScreen({super.key});
@override
Widget build(BuildContext context) {
return const Placeholder();
return Scaffold(
backgroundColor: Color(0xFFF0F2F5),
appBar: AppBar(
shape: RoundedRectangleBorder(
borderRadius: BorderRadiusDirectional.vertical(
bottom: Radius.circular(12),
),
),
title: Text('История операций'),
centerTitle: true,
),
body: SingleChildScrollView(
padding: const EdgeInsets.symmetric(vertical: 8),
child: Column(
children: [
const SizedBox(height: 8),
InkWell(
onTap: () {
GoRouter.of(context).pushNamed('cardSettingsScreen');
},
borderRadius: BorderRadius.circular(20),
child: Ink(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: appTheme.blueA400,
),
width: MediaQuery.of(context).size.width - 32,
child: Center(
child: Padding(
padding: const EdgeInsets.all(16),
child: Text(
'Управление картами',
style: TextStyle(
color: Colors.white,
fontSize: 16,
fontWeight: FontWeight.w600,
),
),
),
),
),
),
const SizedBox(height: 16),
Material(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
child: Padding(
padding: const EdgeInsets.only(left: 16, right: 16, top: 16),
child: SingleChildScrollView(
physics: const NeverScrollableScrollPhysics(),
child: Column(
children: [
CustomDropDownButton(
items: [],
onChanged: (value) {},
),
const SizedBox(height: 12),
ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) => Material(
color: Color(0xFFF6F6F6),
borderRadius: BorderRadius.circular(20),
child: Padding(
padding: const EdgeInsets.all(12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
testFinanceEntity.consultationsList[index].id,
style: TextStyle(
color: Color(0xFF323F4B),
height: 1,
fontWeight: FontWeight.w500,
),
),
Text(
testFinanceEntity.consultationsList[index].date.format('dd.MM.yyy', 'RU'),
style: TextStyle(
color: Color(0xFF6D6F71),
height: 1,
fontWeight: FontWeight.w500,
),
),
],
),
const SizedBox(height: 8),
Text(
testFinanceEntity.consultationsList[index].title,
style: TextStyle(
color: appTheme.blueA400,
height: 1,
fontSize: 18,
fontWeight: FontWeight.w600,
),
),
const SizedBox(height: 8),
Text(
'Покупатель: ' + testFinanceEntity.consultationsList[index].clientName,
style: TextStyle(
color: Color(0xFF323F4B),
height: 1,
fontSize: 14,
fontWeight: FontWeight.w500,
),
),
const SizedBox(height: 8),
Text(
testFinanceEntity.consultationsList[index].planDuration.toString() + ' дней',
style: TextStyle(
color: Color(0xFF323F4B),
height: 1,
fontSize: 14,
fontWeight: FontWeight.w500,
),
),
const SizedBox(height: 8),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
testFinanceEntity.consultationsList[index].price.toString() + ' ₽',
style: TextStyle(
color: Color(0xFF323F4B),
height: 1,
fontSize: 18,
fontWeight: FontWeight.w600,
),
),
Material(
color: Color(0xFF0BB450).withAlpha(11),
borderRadius: BorderRadius.circular(8),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 4),
child: Text(
testFinanceEntity.consultationsList[index].status.name,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w400,
color: Color(0xFF0BB450),
height: 1,
),
),
),
),
],
),
],
),
),
),
separatorBuilder: (context, index) => const SizedBox(height: 12),
itemCount: testFinanceEntity.consultationsList.length,
),
],
),
),
),
),
],
),
),
);
}
}