From 98e43889222cfdf3369ccfada89c2385fce84040 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Fri, 23 Aug 2024 12:44:18 +0300 Subject: [PATCH] fix: remove cahrts --- .../auth/auth_screen/auth_screen.dart | 188 +++++++++--------- .../my_profile_screen/my_profile_screen.dart | 80 ++++---- 2 files changed, 134 insertions(+), 134 deletions(-) diff --git a/lib/presentation/auth/auth_screen/auth_screen.dart b/lib/presentation/auth/auth_screen/auth_screen.dart index 5f11a97e..bd662937 100644 --- a/lib/presentation/auth/auth_screen/auth_screen.dart +++ b/lib/presentation/auth/auth_screen/auth_screen.dart @@ -42,107 +42,109 @@ class _AuthScreenState extends State { centerTitle: true, title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio), ), - body: Padding( - padding: EdgeInsets.all(16), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text("email".tr), - SizedBox(height: 4), - BlocSelector( - selector: (state) => state.emailController, - builder: (context, emailController) { - return CustomTextFormField( - controller: emailController, - textInputAction: TextInputAction.next, - keyboardType: TextInputType.emailAddress, - textInputType: TextInputType.emailAddress, - hintText: 'Введите email', - ); - }, - ), - SizedBox(height: 16), - Text("password".tr), - SizedBox(height: 4), - BlocSelector( - selector: (state) => state.passwordController, - builder: (context, passwordController) { - return CustomTextFormField( - obscureText: true, - controller: passwordController, - hintText: 'Введите пароль', - ); - }, - ), - SizedBox(height: 16), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text('Нет аккаунта? '), - GestureDetector( - onTap: () => GoRouter.of(context).goNamed('registrationScreen'), - child: Text( - 'Зарегистрироваться', - style: TextStyle( - color: appTheme.blueA400, - decorationColor: appTheme.blueA400, - decoration: TextDecoration.underline, + body: SafeArea( + child: Padding( + padding: EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text("email".tr), + SizedBox(height: 4), + BlocSelector( + selector: (state) => state.emailController, + builder: (context, emailController) { + return CustomTextFormField( + controller: emailController, + textInputAction: TextInputAction.next, + keyboardType: TextInputType.emailAddress, + textInputType: TextInputType.emailAddress, + hintText: 'Введите email', + ); + }, + ), + SizedBox(height: 16), + Text("password".tr), + SizedBox(height: 4), + BlocSelector( + selector: (state) => state.passwordController, + builder: (context, passwordController) { + return CustomTextFormField( + obscureText: true, + controller: passwordController, + hintText: 'Введите пароль', + ); + }, + ), + SizedBox(height: 16), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text('Нет аккаунта? '), + GestureDetector( + onTap: () => GoRouter.of(context).goNamed('registrationScreen'), + child: Text( + 'Зарегистрироваться', + style: TextStyle( + color: appTheme.blueA400, + decorationColor: appTheme.blueA400, + decoration: TextDecoration.underline, + ), ), ), - ), - ], - ), - Spacer(), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - 'Нажимая "Войти", Вы соглашаетесь с ', - style: TextStyle( - fontSize: 12, - ), - ), - GestureDetector( - onTap: () async { - await launchUrl(Uri.parse(baseUrl + '/oferta_bs.pdf')); - }, - child: Text( - 'Публичной офертой', + ], + ), + Spacer(), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + 'Нажимая "Войти", Вы соглашаетесь с ', style: TextStyle( fontSize: 12, - color: appTheme.blueA400, - decorationColor: appTheme.blueA400, - decoration: TextDecoration.underline, ), ), - ), - ], - ), - SizedBox(height: 16), - BlocBuilder( - builder: (context, state) { - return Container( - height: 48, - width: MediaQuery.of(context).size.width - 32, - child: FloatingActionButton.extended( - heroTag: 'nextButtonRegistration', - highlightElevation: 0, - elevation: 0, - focusElevation: 0, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(16), - ), - backgroundColor: appTheme.blueA400, - onPressed: onTapAuth(state, context), - label: Text( - 'Войти', - style: theme.textTheme.titleSmall, + GestureDetector( + onTap: () async { + await launchUrl(Uri.parse(baseUrl + '/oferta_bs.pdf')); + }, + child: Text( + 'Публичной офертой', + style: TextStyle( + fontSize: 12, + color: appTheme.blueA400, + decorationColor: appTheme.blueA400, + decoration: TextDecoration.underline, + ), ), ), - ); - }, - ), - ], + ], + ), + SizedBox(height: 16), + BlocBuilder( + builder: (context, state) { + return Container( + height: 48, + width: MediaQuery.of(context).size.width - 32, + child: FloatingActionButton.extended( + heroTag: 'nextButtonRegistration', + highlightElevation: 0, + elevation: 0, + focusElevation: 0, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(16), + ), + backgroundColor: appTheme.blueA400, + onPressed: onTapAuth(state, context), + label: Text( + 'Войти', + style: theme.textTheme.titleSmall, + ), + ), + ); + }, + ), + ], + ), ), ), ); diff --git a/lib/presentation/profile/my_profile_screen/my_profile_screen.dart b/lib/presentation/profile/my_profile_screen/my_profile_screen.dart index 03b9f4b2..306099e8 100644 --- a/lib/presentation/profile/my_profile_screen/my_profile_screen.dart +++ b/lib/presentation/profile/my_profile_screen/my_profile_screen.dart @@ -10,8 +10,6 @@ import 'package:flutter/services.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; import 'package:image_picker/image_picker.dart'; -import 'package:syncfusion_flutter_charts/charts.dart'; - import 'bloc/my_profile_bloc.dart'; import 'models/my_profile_model.dart'; @@ -212,11 +210,11 @@ class MyProfileScreen extends StatelessWidget { ), ), SizedBox(height: 50.v), - _buildChart( - context, - state.chartPoints?.values.map((e) => e['weight']).toList().map((i) => i.toDouble()).toList() ?? [0.0, 0.0, 0.0, 0.0], - state.chartDates, - ), + // _buildChart( + // context, + // state.chartPoints?.values.map((e) => e['weight']).toList().map((i) => i.toDouble()).toList() ?? [0.0, 0.0, 0.0, 0.0], + // state.chartDates, + // ), ], ), ); @@ -230,14 +228,14 @@ class MyProfileScreen extends StatelessWidget { ), ), SizedBox(height: 50.v), - _buildChart( - context, - _bodyMassIndex( - state.chartPoints?.values.map((e) => e['weight']).toList().map((i) => i.toDouble()).toList() ?? [0.0, 0.0, 0.0, 0.0], - state.userDetails?['height'].toInt() ?? 160, - ), - state.chartDates, - ), + // _buildChart( + // context, + // _bodyMassIndex( + // state.chartPoints?.values.map((e) => e['weight']).toList().map((i) => i.toDouble()).toList() ?? [0.0, 0.0, 0.0, 0.0], + // state.userDetails?['height'].toInt() ?? 160, + // ), + // state.chartDates, + // ), ], ); case 3: //График обхватов @@ -298,34 +296,34 @@ class MyProfileScreen extends StatelessWidget { ); } - Widget _buildChart(BuildContext context, List chartPoints, List? dates) { - // Проверяем, что у нас есть 4 элемента в обоих списках - if (chartPoints.length != 4 || (dates != null && dates.length != 4)) { - return Center(child: Text('Должно быть ровно 4 точки и 4 даты.')); - } + // Widget _buildChart(BuildContext context, List chartPoints, List? dates) { + // // Проверяем, что у нас есть 4 элемента в обоих списках + // if (chartPoints.length != 4 || (dates != null && dates.length != 4)) { + // return Center(child: Text('Должно быть ровно 4 точки и 4 даты.')); + // } - // Преобразуем данные в список точек для графика - List chartData = List.generate(4, (index) { - return ChartData(dates![index], chartPoints[index]); - }); + // // Преобразуем данные в список точек для графика + // List chartData = List.generate(4, (index) { + // return ChartData(dates![index], chartPoints[index]); + // }); - return Container( - height: 300, // Задайте нужную высоту для графика - child: SfCartesianChart( - title: ChartTitle(text: 'График значений'), - primaryXAxis: CategoryAxis(), - series: >[ - // Изменяем на CartesianSeries - LineSeries( - dataSource: chartData, - xValueMapper: (ChartData data, _) => data.date, - yValueMapper: (ChartData data, _) => data.value, - dataLabelSettings: DataLabelSettings(isVisible: true), - ), - ], - ), - ); - } + // return Container( + // height: 300, // Задайте нужную высоту для графика + // child: SfCartesianChart( + // title: ChartTitle(text: 'График значений'), + // primaryXAxis: CategoryAxis(), + // series: >[ + // // Изменяем на CartesianSeries + // LineSeries( + // dataSource: chartData, + // xValueMapper: (ChartData data, _) => data.date, + // yValueMapper: (ChartData data, _) => data.value, + // dataLabelSettings: DataLabelSettings(isVisible: true), + // ), + // ], + // ), + // ); + // } /// Section Widget _buildPlans(BuildContext context, List? plans, List? imagePaths, List? states) {