refactor(profile) Fixed an issue with charts display with a single building point

This commit is contained in:
2024-02-07 10:59:50 +03:00
parent b2125b0c6c
commit 77d560cfce
3 changed files with 10 additions and 4 deletions

View File

@@ -10,7 +10,7 @@
<application
android:label="eatvio_app"
android:label="Eatvio"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"

View File

@@ -33,7 +33,7 @@ class MyApp extends StatelessWidget {
builder: (context, state) {
return MaterialApp(
theme: theme,
title: 'eatvio_app',
title: 'Eatvio',
navigatorKey: NavigatorService.navigatorKey,
debugShowCheckedModeBanner: false,
localizationsDelegates: [

View File

@@ -99,10 +99,16 @@ class MyProfileBloc extends Bloc<MyProfileEvent, MyProfileState> {
..addAll(data["requestedPlan"])
..addAll(data["initedPlan"]);
/*print(data["chartPoints"]);
/*print(data["chartPoints"].length);
print(data["chartPoints"].runtimeType);
print(data["circumferences"]);
print(data["circumferences"].length);
print(data["circumferences"].runtimeType);*/
if (data["chartPoints"].length == 1) {
data["chartPoints"] = [];
}
if (data["circumferences"].length == 1) {
data["circumferences"] = [];
}
var circumferences = data["circumferences"].isEmpty
? data["circumferences"].asMap().map((index, value) {
return MapEntry(index.toString(), value);