From 2aa835cfec8ead359bdca4cf8f840a2630267504 Mon Sep 17 00:00:00 2001 From: PLUXVR Date: Fri, 29 Nov 2024 22:03:50 +0300 Subject: [PATCH 1/3] my data page --- lib/core/widgets/my_data_textfield.dart | 47 +++++++ .../presentation/pages/my_data_page.dart | 132 ++++++++++-------- 2 files changed, 121 insertions(+), 58 deletions(-) create mode 100644 lib/core/widgets/my_data_textfield.dart diff --git a/lib/core/widgets/my_data_textfield.dart b/lib/core/widgets/my_data_textfield.dart new file mode 100644 index 0000000..269a88d --- /dev/null +++ b/lib/core/widgets/my_data_textfield.dart @@ -0,0 +1,47 @@ +import 'package:flutter/material.dart'; +import 'package:vas_app/core/theme/app_colors.dart'; +import 'package:vas_app/core/theme/app_corners.dart'; +import 'package:vas_app/core/theme/typography.dart'; + +class MyDataTextField extends StatelessWidget { + final String text; + + const MyDataTextField({ + super.key, + required this.text, + }); + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.only(bottom: 15.0), + child: Container( + width: double.infinity, + height: 60, + alignment: Alignment.centerLeft, + padding: const EdgeInsets.only(left: 15), + decoration: BoxDecoration( + color: AppColors.gray.shade30, + borderRadius: AppCorners.radius15, + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), // Цвет тени + spreadRadius: 0, // Радиус размытия + blurRadius: 1, // Радиус размытия тени + offset: const Offset( + 0, + 2, + ), // Смещение тени (горизонтальное, вертикальное) + ), + ], + ), + child: Text( + text, + style: AppTypography.font16Regular.copyWith( + fontWeight: FontWeight.w500, + ), + ), + ), + ); + } +} diff --git a/lib/feature/profile_page/presentation/pages/my_data_page.dart b/lib/feature/profile_page/presentation/pages/my_data_page.dart index c8c184e..fc6302d 100644 --- a/lib/feature/profile_page/presentation/pages/my_data_page.dart +++ b/lib/feature/profile_page/presentation/pages/my_data_page.dart @@ -3,7 +3,10 @@ import 'package:flutter_staggered_animations/flutter_staggered_animations.dart'; import 'package:flutter_svg/svg.dart'; import 'package:vas_app/core/resources/assets/resources.dart'; import 'package:vas_app/core/theme/app_colors.dart'; +import 'package:vas_app/core/theme/app_corners.dart'; +import 'package:vas_app/core/theme/button_style.dart'; import 'package:vas_app/core/theme/typography.dart'; +import 'package:vas_app/core/widgets/my_data_textfield.dart'; import 'package:vas_app/feature/app/routing/route_path.dart'; class MyDataPage extends StatelessWidget { @@ -30,72 +33,85 @@ class MyDataPage extends StatelessWidget { }, ), ), - body: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: AnimationConfiguration.toStaggeredList( - duration: const Duration(milliseconds: 1400), - childAnimationBuilder: (widget) => SlideAnimation( - verticalOffset: 50.0, - curve: Curves.easeOut, - child: FadeInAnimation( - child: widget, - ), - ), - children: [ - Center( - child: Padding( - padding: const EdgeInsets.only(top: 15.0, left: 15, right: 15), - child: SizedBox( - height: 150, - width: 150, - child: CircleAvatar( - child: SvgPicture.asset( - VectorAssets.icProfileActive, - width: 150, - height: 150, - fit: BoxFit.cover, - ), - ), + body: ListView( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: AnimationConfiguration.toStaggeredList( + duration: const Duration(milliseconds: 1400), + childAnimationBuilder: (widget) => SlideAnimation( + verticalOffset: 50.0, + curve: Curves.easeOut, + child: FadeInAnimation( + child: widget, ), ), - ), - const SizedBox(height: 30), - GestureDetector( - onTap: () {}, - child: Center( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 15.0), - child: Column( - children: [ - Text( - 'Редактировать', - style: AppTypography.font16Regular.copyWith( - fontWeight: FontWeight.w400, - color: AppColors.blue200, + children: [ + Center( + child: Padding( + padding: + const EdgeInsets.only(top: 15.0, left: 15, right: 15), + child: SizedBox( + height: 150, + width: 150, + child: CircleAvatar( + child: SvgPicture.asset( + VectorAssets.icProfileActive, + width: 150, + height: 150, + fit: BoxFit.cover, ), ), - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 60, - alignment: Alignment.centerLeft, - padding: const EdgeInsets.only(left: 15), - decoration: BoxDecoration( - color: AppColors.gray.shade30, - borderRadius: BorderRadius.circular(15), - shape: BoxShape.rectangle, - ), - child: Text('Никита'), + ), + ), + ), + const SizedBox(height: 30), + GestureDetector( + onTap: () {}, + child: Center( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 15.0), + child: Column( + children: [ + Text( + 'Редактировать', + style: AppTypography.font16Regular.copyWith( + fontWeight: FontWeight.w400, + color: AppColors.blue200, + ), + ), + const SizedBox( + height: 30, + ), + MyDataTextField(text: 'Никита'), + MyDataTextField(text: 'Алексеевич'), + MyDataTextField(text: '+7 999 999 99 99'), + MyDataTextField(text: 'nikita2024@yandex.ru'), + const SizedBox( + height: 30, + ), + Center( + child: ElevatedButton( + style: AppButtonStyle.primaryStyleOrange, + onPressed: () {}, + child: Text( + 'Сохранить изменения', + style: AppTypography.font18Regular.copyWith( + color: AppColors.white, + fontWeight: FontWeight.w700, + ), + ), + ), + ), + ], ), - ], + ), ), ), - ), + ], ), - ], - ), + ), + ], ), ); } From f12b7a2f9927f361da774f099a1e69b47a84d30d Mon Sep 17 00:00:00 2001 From: PLUXVR Date: Tue, 3 Dec 2024 20:51:19 +0300 Subject: [PATCH 2/3] my_data_page done --- assets/images/ic_russia.svg | 1 + lib/core/resources/assets/vector_assets.dart | 15 +++--- lib/core/widgets/my_data_textfield.dart | 54 +++++++++++++++++-- lib/feature/app/routing/path_files.dart | 3 +- .../{historia_page.dart => history_page.dart} | 0 .../presentation/pages/my_data_page.dart | 42 ++++++++++++--- 6 files changed, 94 insertions(+), 21 deletions(-) create mode 100644 assets/images/ic_russia.svg rename lib/feature/history_page/presentation/pages/{historia_page.dart => history_page.dart} (100%) diff --git a/assets/images/ic_russia.svg b/assets/images/ic_russia.svg new file mode 100644 index 0000000..943d57f --- /dev/null +++ b/assets/images/ic_russia.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/lib/core/resources/assets/vector_assets.dart b/lib/core/resources/assets/vector_assets.dart index 994bd2d..82f6363 100644 --- a/lib/core/resources/assets/vector_assets.dart +++ b/lib/core/resources/assets/vector_assets.dart @@ -7,12 +7,12 @@ class VectorAssets { //BottomNavBar static const String icHomeDeactive = 'assets/images/ic_home_deactive.svg'; - static const String icHistoryDeactive = 'assets/images/ic_history_deactive.svg'; - static const String icNoteBookDeactive = 'assets/images/ic_notebook_deactive.svg'; - static const String icProfileDeactive = 'assets/images/ic_profile_deactive.svg'; - - - + static const String icHistoryDeactive = + 'assets/images/ic_history_deactive.svg'; + static const String icNoteBookDeactive = + 'assets/images/ic_notebook_deactive.svg'; + static const String icProfileDeactive = + 'assets/images/ic_profile_deactive.svg'; // static const String icHomeActive = 'assets/images/ic_home_active.svg'; @@ -24,10 +24,9 @@ class VectorAssets { static const String icBell = 'assets/images/ic_bell.svg'; static const String icDoOrder = 'assets/images/ic_do_order.svg'; static const String icLogout = 'assets/images/ic_logout.svg'; + static const String icRussia = 'assets/images/ic_russia.svg'; static const String icBook = 'assets/images/ic_book.svg'; static const String icPlansh = 'assets/images/ic_plansh.svg'; static const String icHistory = 'assets/images/ic_history.svg'; - - } diff --git a/lib/core/widgets/my_data_textfield.dart b/lib/core/widgets/my_data_textfield.dart index 269a88d..fee4997 100644 --- a/lib/core/widgets/my_data_textfield.dart +++ b/lib/core/widgets/my_data_textfield.dart @@ -1,14 +1,21 @@ import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.dart'; +import 'package:vas_app/core/resources/assets/resources.dart'; import 'package:vas_app/core/theme/app_colors.dart'; import 'package:vas_app/core/theme/app_corners.dart'; import 'package:vas_app/core/theme/typography.dart'; class MyDataTextField extends StatelessWidget { final String text; + final bool isFlag; + // final TextEditingController textEditingController; const MyDataTextField({ super.key, required this.text, + required this.isFlag, + + // required this.textEditingController, }); @override @@ -35,11 +42,48 @@ class MyDataTextField extends StatelessWidget { ), ], ), - child: Text( - text, - style: AppTypography.font16Regular.copyWith( - fontWeight: FontWeight.w500, - ), + child: Row( + children: [ + isFlag + ? Container( + decoration: BoxDecoration( + borderRadius: AppCorners.radius25, + ), + child: SvgPicture.asset( + VectorAssets.icRussia, + width: 30, + height: 30, + fit: BoxFit.fill, + clipBehavior: Clip.antiAlias, + ), + ) + : const SizedBox(), + Flexible( + child: TextFormField( + // controller: textEditingController, + initialValue: text, + // readOnly: true, + decoration: InputDecoration( + hintStyle: TextStyle(color: Colors.grey.shade400), + filled: true, + fillColor: Colors.grey.shade200, + border: OutlineInputBorder( + borderSide: BorderSide.none, + borderRadius: BorderRadius.circular(12), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide.none, + borderRadius: BorderRadius.circular(12), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide.none, + borderRadius: BorderRadius.circular(12), + ), + ), + // obscureText: true, + ), + ), + ], ), ), ); diff --git a/lib/feature/app/routing/path_files.dart b/lib/feature/app/routing/path_files.dart index 2982701..82826dc 100644 --- a/lib/feature/app/routing/path_files.dart +++ b/lib/feature/app/routing/path_files.dart @@ -9,9 +9,8 @@ import 'package:vas_app/feature/auth_page/presentation/pages/auth_page.dart'; import 'package:vas_app/feature/main_page/presentation/pages/main_page.dart'; import 'package:vas_app/feature/profile_page/presentation/pages/my_data_page.dart'; - import '../../../core/theme/typography.dart'; -import '../../history_page/presentation/pages/historia_page.dart'; +import '../../history_page/presentation/pages/history_page.dart'; import '../../order_page/presentation/pages/order_page.dart'; import '../../profile_page/presentation/pages/profile_page.dart'; import 'route_path.dart'; diff --git a/lib/feature/history_page/presentation/pages/historia_page.dart b/lib/feature/history_page/presentation/pages/history_page.dart similarity index 100% rename from lib/feature/history_page/presentation/pages/historia_page.dart rename to lib/feature/history_page/presentation/pages/history_page.dart diff --git a/lib/feature/profile_page/presentation/pages/my_data_page.dart b/lib/feature/profile_page/presentation/pages/my_data_page.dart index fc6302d..d99fb16 100644 --- a/lib/feature/profile_page/presentation/pages/my_data_page.dart +++ b/lib/feature/profile_page/presentation/pages/my_data_page.dart @@ -9,9 +9,23 @@ import 'package:vas_app/core/theme/typography.dart'; import 'package:vas_app/core/widgets/my_data_textfield.dart'; import 'package:vas_app/feature/app/routing/route_path.dart'; -class MyDataPage extends StatelessWidget { - const MyDataPage({Key? key}) : super(key: key); +class MyDataPage extends StatefulWidget { + const MyDataPage({ + super.key, + }); + static String name = RoutePath.myDataPagePath; + + @override + State createState() => _MyDataPageState(); +} + +class _MyDataPageState extends State { + // final TextEditingController _nameController = TextEditingController(); + // final TextEditingController _surnameController = TextEditingController(); + // final TextEditingController _phoneController = TextEditingController(); + // final TextEditingController _emailController = TextEditingController(); + @override Widget build(BuildContext context) { return Scaffold( @@ -83,10 +97,26 @@ class MyDataPage extends StatelessWidget { const SizedBox( height: 30, ), - MyDataTextField(text: 'Никита'), - MyDataTextField(text: 'Алексеевич'), - MyDataTextField(text: '+7 999 999 99 99'), - MyDataTextField(text: 'nikita2024@yandex.ru'), + MyDataTextField( + text: 'Никита', + isFlag: false, + // textEditingController: _nameController, + ), + MyDataTextField( + text: 'Алексеевич', + isFlag: false, + // textEditingController: _surnameController, + ), + MyDataTextField( + text: '+7 999 999 99 99', + isFlag: true, + // textEditingController: _phoneController, + ), + MyDataTextField( + text: 'nikita2024@yandex.ru', + isFlag: false, + // textEditingController: _emailController, + ), const SizedBox( height: 30, ), From 002054e8b3d14d7b21df242707c7fce00cf3560f Mon Sep 17 00:00:00 2001 From: PLUXVR Date: Tue, 3 Dec 2024 20:52:45 +0300 Subject: [PATCH 3/3] fixes --- .../profile_page/presentation/pages/my_data_page.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/feature/profile_page/presentation/pages/my_data_page.dart b/lib/feature/profile_page/presentation/pages/my_data_page.dart index d99fb16..37a90b0 100644 --- a/lib/feature/profile_page/presentation/pages/my_data_page.dart +++ b/lib/feature/profile_page/presentation/pages/my_data_page.dart @@ -3,7 +3,6 @@ import 'package:flutter_staggered_animations/flutter_staggered_animations.dart'; import 'package:flutter_svg/svg.dart'; import 'package:vas_app/core/resources/assets/resources.dart'; import 'package:vas_app/core/theme/app_colors.dart'; -import 'package:vas_app/core/theme/app_corners.dart'; import 'package:vas_app/core/theme/button_style.dart'; import 'package:vas_app/core/theme/typography.dart'; import 'package:vas_app/core/widgets/my_data_textfield.dart'; @@ -21,6 +20,7 @@ class MyDataPage extends StatefulWidget { } class _MyDataPageState extends State { + // TODO Надо подумать на счет логики изменения данных // final TextEditingController _nameController = TextEditingController(); // final TextEditingController _surnameController = TextEditingController(); // final TextEditingController _phoneController = TextEditingController(); @@ -97,22 +97,22 @@ class _MyDataPageState extends State { const SizedBox( height: 30, ), - MyDataTextField( + const MyDataTextField( text: 'Никита', isFlag: false, // textEditingController: _nameController, ), - MyDataTextField( + const MyDataTextField( text: 'Алексеевич', isFlag: false, // textEditingController: _surnameController, ), - MyDataTextField( + const MyDataTextField( text: '+7 999 999 99 99', isFlag: true, // textEditingController: _phoneController, ), - MyDataTextField( + const MyDataTextField( text: 'nikita2024@yandex.ru', isFlag: false, // textEditingController: _emailController,