You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
104 lines
3.4 KiB
104 lines
3.4 KiB
import 'package:flutter/material.dart';
|
|
import 'package:provider/provider.dart';
|
|
import 'package:smartfit_app_mobile/common_widget/container/list/volumes_list.dart';
|
|
import 'package:smartfit_app_mobile/common_widget/other/entete_home_view.dart';
|
|
import 'package:smartfit_app_mobile/common/colo_extension.dart';
|
|
import 'package:smartfit_app_mobile/modele/user.dart';
|
|
import 'package:smartfit_app_mobile/modele/utile/home_view/data_home_view.dart';
|
|
|
|
class VolumesView extends StatefulWidget {
|
|
const VolumesView({super.key});
|
|
|
|
@override
|
|
State<VolumesView> createState() => _VolumesViews();
|
|
}
|
|
|
|
class _VolumesViews extends State<VolumesView> {
|
|
late DataHomeView data;
|
|
TextEditingController bpmController = TextEditingController();
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
var media = MediaQuery.of(context).size;
|
|
User user = context.watch<User>();
|
|
|
|
Map<String, dynamic> volume7Days =
|
|
user.getVolumeWhithDuration(const Duration(days: 7));
|
|
Map<String, dynamic> volume1Months =
|
|
user.getVolumeWhithDuration(const Duration(days: 30));
|
|
Map<String, dynamic> volume1Year =
|
|
user.getVolumeWhithDuration(const Duration(days: 366));
|
|
Map<String, dynamic> volumeAllTime = user.getVolumeAllTime();
|
|
|
|
return Scaffold(
|
|
backgroundColor: TColor.white,
|
|
body: SingleChildScrollView(
|
|
child: SafeArea(
|
|
child: Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: 15),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
SizedBox(
|
|
height: media.width * 0.03,
|
|
),
|
|
const EnteteHomeView(),
|
|
SizedBox(
|
|
height: media.width * 0.05,
|
|
),
|
|
Text(
|
|
"Derniere semaine",
|
|
style: TextStyle(
|
|
color: TColor.black,
|
|
fontSize: 16,
|
|
fontWeight: FontWeight.w700),
|
|
),
|
|
SizedBox(
|
|
height: media.width * 0.03,
|
|
),
|
|
VolumesList(volume: volume7Days),
|
|
SizedBox(
|
|
height: media.width * 0.03,
|
|
),
|
|
Text(
|
|
"Dernier Mois",
|
|
style: TextStyle(
|
|
color: TColor.black,
|
|
fontSize: 16,
|
|
fontWeight: FontWeight.w700),
|
|
),
|
|
VolumesList(volume: volume1Months),
|
|
SizedBox(
|
|
height: media.width * 0.03,
|
|
),
|
|
Text(
|
|
"Dernière année",
|
|
style: TextStyle(
|
|
color: TColor.black,
|
|
fontSize: 16,
|
|
fontWeight: FontWeight.w700),
|
|
),
|
|
VolumesList(volume: volume1Year),
|
|
SizedBox(
|
|
height: media.width * 0.03,
|
|
),
|
|
Text(
|
|
"Total",
|
|
style: TextStyle(
|
|
color: TColor.black,
|
|
fontSize: 16,
|
|
fontWeight: FontWeight.w700),
|
|
),
|
|
VolumesList(volume: volumeAllTime),
|
|
SizedBox(
|
|
height: media.width * 0.03,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|