WT 1.1.26+4 radar chart 1
This commit is contained in:
@@ -2,17 +2,17 @@ import 'dart:async';
|
||||
import 'dart:collection';
|
||||
import 'package:aitrainer_app/bloc/development_diagram/development_diagram_bloc.dart';
|
||||
import 'package:aitrainer_app/bloc/menu/menu_bloc.dart';
|
||||
import 'package:aitrainer_app/library/radar_chart.dart';
|
||||
import 'package:aitrainer_app/util/enums.dart';
|
||||
import 'package:aitrainer_app/widgets/app_bar.dart';
|
||||
import 'package:aitrainer_app/widgets/bottom_nav.dart';
|
||||
import 'package:aitrainer_app/widgets/dialog_premium.dart';
|
||||
import 'package:flutter/scheduler.dart';
|
||||
import 'package:aitrainer_app/model/cache.dart';
|
||||
import 'package:aitrainer_app/util/common.dart';
|
||||
import 'package:aitrainer_app/util/trans.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:aitrainer_app/bloc/body_development/body_development_bloc.dart';
|
||||
import 'package:flutter_radar_chart/flutter_radar_chart.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:modal_progress_hud_nsn/modal_progress_hud_nsn.dart';
|
||||
|
||||
@@ -23,13 +23,12 @@ class MyDevelopmentBodyPage extends StatefulWidget {
|
||||
|
||||
class _MyDevelopmentBodyPage extends State<MyDevelopmentBodyPage> with Trans, Common {
|
||||
bool isStart = false;
|
||||
// ignore: close_sinks
|
||||
late BodyDevelopmentBloc bloc;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
if (!Cache().hasPurchased || true) {
|
||||
if (!Cache().hasPurchased && Cache().userLoggedIn != null) {
|
||||
Timer(
|
||||
Duration(milliseconds: 2000),
|
||||
() => {
|
||||
@@ -49,11 +48,6 @@ class _MyDevelopmentBodyPage extends State<MyDevelopmentBodyPage> with Trans, Co
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/// We require the initializers to run after the loading screen is rendered
|
||||
SchedulerBinding.instance!.addPostFrameCallback((_) {
|
||||
BlocProvider.of<BodyDevelopmentBloc>(context).add(BodyDevelopmentLoad());
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -195,42 +189,48 @@ class _MyDevelopmentBodyPage extends State<MyDevelopmentBodyPage> with Trans, Co
|
||||
}
|
||||
|
||||
Widget getLegend(BodyDevelopmentBloc bloc) {
|
||||
if (bloc.filter == DiagramDateFilterGroup.yearly) {
|
||||
return Offstage();
|
||||
}
|
||||
return Wrap(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
width: 100,
|
||||
height: 6,
|
||||
color: Colors.green,
|
||||
),
|
||||
Text("First Month", style: GoogleFonts.inter(fontSize: 14)),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Text(t(bloc.legends[0]), style: GoogleFonts.inter(fontSize: 14)),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
width: 100,
|
||||
height: 6,
|
||||
color: Colors.blue,
|
||||
),
|
||||
Text("First Month", style: GoogleFonts.inter(fontSize: 14)),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Text(t(bloc.legends[1]), style: GoogleFonts.inter(fontSize: 14)),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
width: 100,
|
||||
height: 6,
|
||||
color: Colors.red,
|
||||
),
|
||||
Text("First Month", style: GoogleFonts.inter(fontSize: 14)),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Text(t(bloc.legends[2]), style: GoogleFonts.inter(fontSize: 14)),
|
||||
],
|
||||
)
|
||||
],
|
||||
@@ -250,7 +250,17 @@ class _MyDevelopmentBodyPage extends State<MyDevelopmentBodyPage> with Trans, Co
|
||||
}
|
||||
|
||||
Widget exerciseWidget(int customerId, BodyDevelopmentBloc bloc) {
|
||||
return RadarChart.light(ticks: bloc.radarTicks, features: bloc.radarFeatures, data: bloc.radarData);
|
||||
List<String> radarFeatures = [
|
||||
t(MuscleGroup.chest.toText()),
|
||||
t(MuscleGroup.biceps.toText()),
|
||||
t(MuscleGroup.triceps.toText()),
|
||||
t(MuscleGroup.back.toText()),
|
||||
t(MuscleGroup.shoulders.toText()),
|
||||
t(MuscleGroup.core.toText()),
|
||||
t(MuscleGroup.thigh.toText()),
|
||||
t(MuscleGroup.calf.toText())
|
||||
];
|
||||
return RadarChart.light(ticks: bloc.radarTicks, features: radarFeatures, data: bloc.radarData);
|
||||
}
|
||||
|
||||
Widget explanationWidget() {
|
||||
|
||||
@@ -189,7 +189,7 @@ class _SizeState extends State<SizesDevelopmentPage> with Trans {
|
||||
t("Red icon means you have not saved this size."),
|
||||
//overflow: TextOverflow.clip,
|
||||
style: GoogleFonts.inter(
|
||||
fontSize: 14,
|
||||
fontSize: 12,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
@@ -199,7 +199,7 @@ class _SizeState extends State<SizesDevelopmentPage> with Trans {
|
||||
t("Tap on the green icon to see your development in a diagram"),
|
||||
//overflow: TextOverflow.clip,
|
||||
style: GoogleFonts.inter(
|
||||
fontSize: 14,
|
||||
fontSize: 12,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user