feat:增加变化提醒功能
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import 'package:fitnote/utils/record_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:getwidget/getwidget.dart';
|
||||
|
||||
Widget buildCardTitle({
|
||||
required BuildContext context,
|
||||
@@ -45,3 +47,40 @@ BoxDecoration buildBoxDecoration(BuildContext context) {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildProgressItem({
|
||||
required String title,
|
||||
required String current,
|
||||
required String target,
|
||||
required String unit,
|
||||
required double progress,
|
||||
required Color color,
|
||||
}) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(title),
|
||||
Text(
|
||||
'$current/$target $unit',
|
||||
style: TextStyle(fontWeight: FontWeight.w500, color: color),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
GFProgressBar(
|
||||
animation: true,
|
||||
lineHeight: 20,
|
||||
percentage: progress,
|
||||
progressBarColor: color,
|
||||
child: Text(
|
||||
'${roundNum(progress * 100)}%',
|
||||
textAlign: TextAlign.end,
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user