fix: remove cahrts

This commit is contained in:
mso7nueh
2024-08-23 12:44:18 +03:00
parent df587a70dd
commit 98e4388922
2 changed files with 134 additions and 134 deletions

View File

@@ -42,107 +42,109 @@ class _AuthScreenState extends State<AuthScreen> {
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<AuthBloc, AuthState, TextEditingController?>(
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<AuthBloc, AuthState, TextEditingController?>(
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<AuthBloc, AuthState, TextEditingController?>(
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<AuthBloc, AuthState, TextEditingController?>(
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<AuthBloc, AuthState>(
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<AuthBloc, AuthState>(
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,
),
),
);
},
),
],
),
),
),
);

View File

@@ -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<int>((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<int>((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<int>((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<int>((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<double> chartPoints, List<String>? dates) {
// Проверяем, что у нас есть 4 элемента в обоих списках
if (chartPoints.length != 4 || (dates != null && dates.length != 4)) {
return Center(child: Text('Должно быть ровно 4 точки и 4 даты.'));
}
// Widget _buildChart(BuildContext context, List<double> chartPoints, List<String>? dates) {
// // Проверяем, что у нас есть 4 элемента в обоих списках
// if (chartPoints.length != 4 || (dates != null && dates.length != 4)) {
// return Center(child: Text('Должно быть ровно 4 точки и 4 даты.'));
// }
// Преобразуем данные в список точек для графика
List<ChartData> chartData = List.generate(4, (index) {
return ChartData(dates![index], chartPoints[index]);
});
// // Преобразуем данные в список точек для графика
// List<ChartData> chartData = List.generate(4, (index) {
// return ChartData(dates![index], chartPoints[index]);
// });
return Container(
height: 300, // Задайте нужную высоту для графика
child: SfCartesianChart(
title: ChartTitle(text: 'График значений'),
primaryXAxis: CategoryAxis(),
series: <CartesianSeries<ChartData, String>>[
// Изменяем на CartesianSeries
LineSeries<ChartData, String>(
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<ChartData, String>>[
// // Изменяем на CartesianSeries
// LineSeries<ChartData, String>(
// dataSource: chartData,
// xValueMapper: (ChartData data, _) => data.date,
// yValueMapper: (ChartData data, _) => data.value,
// dataLabelSettings: DataLabelSettings(isVisible: true),
// ),
// ],
// ),
// );
// }
/// Section Widget
_buildPlans(BuildContext context, List<dynamic>? plans, List<dynamic>? imagePaths, List<dynamic>? states) {