feat(profile): some fixes, add buttons

This commit is contained in:
mso7nueh
2024-09-04 17:27:46 +03:00
parent d76f535663
commit f9c10047b2
154 changed files with 1249 additions and 296 deletions

View File

@@ -32,70 +32,104 @@ class _CircumferenceChartWidgetState extends State<CircumferenceChartWidget> {
Widget build(BuildContext context) {
return Column(
children: [
Padding(
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: Row(
children: [
Text(
'${widget.chartData.last.chestCircumference}',
style: TextStyle(
color: Colors.black,
fontSize: 40,
fontWeight: FontWeight.w500,
if (widget.chartData.isNotEmpty)
Padding(
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: Row(
children: [
Text(
'${widget.chartData.last.chestCircumference}',
style: TextStyle(
color: Colors.black,
fontSize: 40,
fontWeight: FontWeight.w500,
),
),
),
widget.chartData.last.chestCircumference > widget.chartData[widget.chartData.length - 2].chestCircumference
? Icon(
Icons.arrow_drop_up,
size: 40,
color: Colors.grey,
)
: Icon(
Icons.arrow_drop_down,
size: 40,
color: Colors.grey,
if (widget.chartData.length == 1)
Container(
margin: EdgeInsets.symmetric(horizontal: 12),
width: 8,
height: 8,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black12,
),
Text(
'${widget.chartData.last.waistCircumference}',
style: TextStyle(
color: Colors.black,
fontSize: 40,
fontWeight: FontWeight.w500,
),
if (widget.chartData.length > 1)
widget.chartData.last.chestCircumference > widget.chartData[widget.chartData.length - 2].chestCircumference
? Icon(
Icons.arrow_drop_up,
size: 40,
color: Colors.grey,
)
: Icon(
Icons.arrow_drop_down,
size: 40,
color: Colors.grey,
),
Text(
'${widget.chartData.last.waistCircumference}',
style: TextStyle(
color: Colors.black,
fontSize: 40,
fontWeight: FontWeight.w500,
),
),
),
widget.chartData.last.waistCircumference > widget.chartData[widget.chartData.length - 2].waistCircumference
? Icon(
Icons.arrow_drop_up,
size: 40,
color: Colors.grey,
)
: Icon(
Icons.arrow_drop_down,
size: 40,
color: Colors.grey,
if (widget.chartData.length == 1)
Container(
margin: EdgeInsets.symmetric(horizontal: 12),
width: 8,
height: 8,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black12,
),
Text(
'${widget.chartData.last.hipCircumference}',
style: TextStyle(
color: Colors.black,
fontSize: 40,
fontWeight: FontWeight.w500,
),
if (widget.chartData.length > 1)
widget.chartData.last.waistCircumference > widget.chartData[widget.chartData.length - 2].waistCircumference
? Icon(
Icons.arrow_drop_up,
size: 40,
color: Colors.grey,
)
: Icon(
Icons.arrow_drop_down,
size: 40,
color: Colors.grey,
),
Text(
'${widget.chartData.last.hipCircumference}',
style: TextStyle(
color: Colors.black,
fontSize: 40,
fontWeight: FontWeight.w500,
),
),
),
widget.chartData.last.hipCircumference > widget.chartData[widget.chartData.length - 2].hipCircumference
? Icon(
Icons.arrow_drop_up,
size: 40,
color: Colors.grey,
)
: Icon(
Icons.arrow_drop_down,
size: 40,
color: Colors.grey,
if (widget.chartData.length == 1)
Container(
margin: EdgeInsets.symmetric(horizontal: 12),
width: 8,
height: 8,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black12,
),
],
),
if (widget.chartData.length > 1)
widget.chartData.last.hipCircumference > widget.chartData[widget.chartData.length - 2].hipCircumference
? Icon(
Icons.arrow_drop_up,
size: 40,
color: Colors.grey,
)
: Icon(
Icons.arrow_drop_down,
size: 40,
color: Colors.grey,
),
],
),
),
),
Stack(
alignment: Alignment.bottomRight,
children: [
@@ -140,12 +174,18 @@ class _CircumferenceChartWidgetState extends State<CircumferenceChartWidget> {
FloatingActionButton.small(
heroTag: 'addCircumference',
onPressed: () {
chest = widget.chartData.last.chestCircumference;
waist = widget.chartData.last.waistCircumference;
hip = widget.chartData.last.hipCircumference;
chestController = FixedExtentScrollController(initialItem: chest - 20);
waistController = FixedExtentScrollController(initialItem: waist - 20);
hipController = FixedExtentScrollController(initialItem: hip - 20);
if (widget.chartData.isNotEmpty) {
chest = widget.chartData.last.chestCircumference;
waist = widget.chartData.last.waistCircumference;
hip = widget.chartData.last.hipCircumference;
chestController = FixedExtentScrollController(initialItem: chest - 20);
waistController = FixedExtentScrollController(initialItem: waist - 20);
hipController = FixedExtentScrollController(initialItem: hip - 20);
} else {
chestController = FixedExtentScrollController();
waistController = FixedExtentScrollController();
hipController = FixedExtentScrollController();
}
showModalBottomSheet(
useRootNavigator: true,
context: context,